summaryrefslogtreecommitdiffstats
path: root/src/com/android/server/telecom/MissedCallNotifier.java
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2014-10-21 23:31:13 -0700
committerYorke Lee <yorkelee@google.com>2014-10-22 10:11:31 -0700
commit0c345e9bd4415983725d4469e4711fe6b3af4670 (patch)
treeb655bc93c5555ab9138a8cc98b0fa307c7652d09 /src/com/android/server/telecom/MissedCallNotifier.java
parentefba60b21218cc41251b04c71fa0ec5edc44d798 (diff)
downloadandroid_packages_services_Telecomm-0c345e9bd4415983725d4469e4711fe6b3af4670.tar.gz
android_packages_services_Telecomm-0c345e9bd4415983725d4469e4711fe6b3af4670.tar.bz2
android_packages_services_Telecomm-0c345e9bd4415983725d4469e4711fe6b3af4670.zip
Create handle with correct scheme in MissedCallNotifier
Bug: 18074511 Change-Id: If724708d3ac16ca524f03257e66b0e650a6030dd
Diffstat (limited to 'src/com/android/server/telecom/MissedCallNotifier.java')
-rw-r--r--src/com/android/server/telecom/MissedCallNotifier.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/server/telecom/MissedCallNotifier.java b/src/com/android/server/telecom/MissedCallNotifier.java
index 76d0ae84..2c1ffb85 100644
--- a/src/com/android/server/telecom/MissedCallNotifier.java
+++ b/src/com/android/server/telecom/MissedCallNotifier.java
@@ -34,6 +34,8 @@ import android.provider.CallLog;
import android.provider.CallLog.Calls;
import android.telecom.CallState;
import android.telecom.DisconnectCause;
+import android.telecom.PhoneAccount;
+import android.telephony.PhoneNumberUtils;
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
@@ -278,13 +280,19 @@ class MissedCallNotifier extends CallsManagerListenerBase {
try {
while (cursor.moveToNext()) {
// Get data about the missed call from the cursor
- Uri handle = Uri.parse(cursor.getString(
- cursor.getColumnIndexOrThrow(Calls.NUMBER)));
- int presentation = cursor.getInt(cursor.getColumnIndexOrThrow(
+ final String handleString = cursor.getString(
+ cursor.getColumnIndexOrThrow(Calls.NUMBER));
+ final int presentation = cursor.getInt(cursor.getColumnIndexOrThrow(
Calls.NUMBER_PRESENTATION));
- if (presentation != Calls.PRESENTATION_ALLOWED) {
+ final Uri handle;
+ if (presentation != Calls.PRESENTATION_ALLOWED
+ || TextUtils.isEmpty(handleString)) {
handle = null;
+ } else {
+ handle = Uri.fromParts(PhoneNumberUtils.isUriNumber(handleString) ?
+ PhoneAccount.SCHEME_SIP : PhoneAccount.SCHEME_TEL,
+ handleString, null);
}
// Convert the data to a call object