diff options
Diffstat (limited to 'src/com/android/dialer/calllog/MissedCallNotifier.java')
-rw-r--r-- | src/com/android/dialer/calllog/MissedCallNotifier.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/dialer/calllog/MissedCallNotifier.java b/src/com/android/dialer/calllog/MissedCallNotifier.java index 732f65665..47f9ea770 100644 --- a/src/com/android/dialer/calllog/MissedCallNotifier.java +++ b/src/com/android/dialer/calllog/MissedCallNotifier.java @@ -96,6 +96,7 @@ public class MissedCallNotifier { boolean useCallLog = newCalls != null && newCalls.size() == count; NewCall newestCall = useCallLog ? newCalls.get(0) : null; long timeMs = useCallLog ? newestCall.dateMs : System.currentTimeMillis(); + String missedNumber = useCallLog ? newestCall.number : number; Notification.Builder builder = new Notification.Builder(mContext); // Display the first line of the notification: @@ -104,7 +105,7 @@ public class MissedCallNotifier { if (count == 1) { //TODO: look up caller ID that is not in contacts. ContactInfo contactInfo = CallLogNotificationsHelper.getInstance(mContext) - .getContactInfo(useCallLog ? newestCall.number : number, + .getContactInfo(missedNumber, useCallLog ? newestCall.numberPresentation : Calls.PRESENTATION_ALLOWED, useCallLog ? newestCall.countryIso : null); @@ -157,17 +158,17 @@ public class MissedCallNotifier { // Add additional actions when there is only 1 missed call and the user isn't locked if (UserManagerCompat.isUserUnlocked(mContext) && count == 1) { - if (!TextUtils.isEmpty(number) + if (!TextUtils.isEmpty(missedNumber) && !TextUtils.equals( - number, mContext.getString(R.string.handle_restricted))) { + missedNumber, mContext.getString(R.string.handle_restricted))) { builder.addAction(R.drawable.ic_phone_24dp, mContext.getString(R.string.notification_missedCall_call_back), - createCallBackPendingIntent(number)); + createCallBackPendingIntent(missedNumber)); - if (!PhoneNumberHelper.isUriNumber(number)) { + if (!PhoneNumberHelper.isUriNumber(missedNumber)) { builder.addAction(R.drawable.ic_message_24dp, mContext.getString(R.string.notification_missedCall_message), - createSendSmsFromNotificationPendingIntent(number)); + createSendSmsFromNotificationPendingIntent(missedNumber)); } } } |