summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2014-09-04 22:54:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-04 22:54:02 +0000
commit913ee5e915bbfd799f412dcad903dc773680aea4 (patch)
tree1ce264b57d2c92a3601d5472ecd1b6bc97b73443 /src
parent04164b5adbb3f9baee5623fbe023b7062b86fe0d (diff)
parent5ea0dcd39ff1f29d09d7bb146d7eb20f24b32201 (diff)
downloadpackages_apps_InCallUI-913ee5e915bbfd799f412dcad903dc773680aea4.tar.gz
packages_apps_InCallUI-913ee5e915bbfd799f412dcad903dc773680aea4.tar.bz2
packages_apps_InCallUI-913ee5e915bbfd799f412dcad903dc773680aea4.zip
Merge "Check for voicemail number earlier so it can be set at caller." into lmp-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/incallui/CallerInfoAsyncQuery.java17
-rw-r--r--src/com/android/incallui/CallerInfoUtils.java12
2 files changed, 19 insertions, 10 deletions
diff --git a/src/com/android/incallui/CallerInfoAsyncQuery.java b/src/com/android/incallui/CallerInfoAsyncQuery.java
index fd95458c..652788d8 100644
--- a/src/com/android/incallui/CallerInfoAsyncQuery.java
+++ b/src/com/android/incallui/CallerInfoAsyncQuery.java
@@ -318,7 +318,7 @@ public class CallerInfoAsyncQuery {
}
/**
- * Factory method to start the query based on a number.
+ * Factory method to start the query based on a CallerInfo object.
*
* Note: if the number contains an "@" character we treat it
* as a SIP address, and look it up directly in the Data table
@@ -328,18 +328,18 @@ public class CallerInfoAsyncQuery {
* PhoneUtils.startGetCallerInfo() decide which one to call based on
* the phone type of the incoming connection.
*/
- public static CallerInfoAsyncQuery startQuery(int token, Context context, String number,
+ public static CallerInfoAsyncQuery startQuery(int token, Context context, CallerInfo info,
OnQueryCompleteListener listener, Object cookie) {
Log.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####");
- Log.d(LOG_TAG, "- number: " + number);
+ Log.d(LOG_TAG, "- number: " + info.phoneNumber);
Log.d(LOG_TAG, "- cookie: " + cookie);
// Construct the URI object and query params, and start the query.
final Uri contactRef = PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI.buildUpon()
- .appendPath(number)
+ .appendPath(info.phoneNumber)
.appendQueryParameter(PhoneLookup.QUERY_PARAMETER_SIP_ADDRESS,
- String.valueOf(PhoneNumberHelper.isUriNumber(number)))
+ String.valueOf(PhoneNumberHelper.isUriNumber(info.phoneNumber)))
.build();
if (DBG) {
@@ -353,12 +353,13 @@ public class CallerInfoAsyncQuery {
CookieWrapper cw = new CookieWrapper();
cw.listener = listener;
cw.cookie = cookie;
- cw.number = number;
+ cw.number = info.phoneNumber;
// check to see if these are recognized numbers, and use shortcuts if we can.
- if (PhoneNumberHelper.isLocalEmergencyNumber(number, context)) {
+ if (PhoneNumberHelper.isLocalEmergencyNumber(info.phoneNumber, context)) {
cw.event = EVENT_EMERGENCY_NUMBER;
- } else if (PhoneNumberUtils.isVoiceMailNumber(number)) {
+ } else if (info.isVoiceMailNumber()
+ || PhoneNumberUtils.isVoiceMailNumber(info.phoneNumber)) {
cw.event = EVENT_VOICEMAIL_NUMBER;
} else {
cw.event = EVENT_NEW_QUERY;
diff --git a/src/com/android/incallui/CallerInfoUtils.java b/src/com/android/incallui/CallerInfoUtils.java
index 9745c18e..08afcaf3 100644
--- a/src/com/android/incallui/CallerInfoUtils.java
+++ b/src/com/android/incallui/CallerInfoUtils.java
@@ -8,6 +8,7 @@ import android.telecomm.PropertyPresentation;
import android.text.TextUtils;
import android.util.Log;
+import com.android.contacts.common.CallUtil;
import com.android.contacts.common.model.Contact;
import com.android.contacts.common.model.ContactLoader;
@@ -37,14 +38,13 @@ public class CallerInfoUtils {
public static CallerInfo getCallerInfoForCall(Context context, Call call,
CallerInfoAsyncQuery.OnQueryCompleteListener listener) {
CallerInfo info = buildCallerInfo(context, call);
- String number = info.phoneNumber;
// TODO: Have phoneapp send a Uri when it knows the contact that triggered this call.
if (info.numberPresentation == PropertyPresentation.ALLOWED) {
// Start the query with the number provided from the call.
Log.d(TAG, "==> Actually starting CallerInfoAsyncQuery.startQuery()...");
- CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context, number, listener, call);
+ CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context, info, listener, call);
}
return info;
}
@@ -70,6 +70,14 @@ public class CallerInfoUtils {
number = modifyForSpecialCnapCases(context, info, number, info.numberPresentation);
info.phoneNumber = number;
}
+
+ // Because the InCallUI is immediately launched before the call is connected, occasionally
+ // a voicemail call will be passed to InCallUI as a "voicemail:" URI without a number.
+ // This call should still be handled as a voicemail call.
+ if (CallUtil.SCHEME_VOICEMAIL.equals(call.getHandle().getScheme())) {
+ info.markAsVoiceMail(context);
+ }
+
return info;
}