diff options
author | Nancy Chen <nancychen@google.com> | 2016-01-14 18:35:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-01-14 18:35:19 +0000 |
commit | 662aed1de350c38751a962528651535a35a22789 (patch) | |
tree | d6478e553604cbd844704d03d80708c0951bd23b | |
parent | d4947e51b0b3336ff9da03275ff48a7632fe0268 (diff) | |
parent | 6551bd4def7c907760c172841f24a2493247cece (diff) |
Merge "Revert "Use telephony voicemail notification settings for vvm."" into ub-contactsdialer-b-dev
-rw-r--r-- | src/com/android/dialer/calllog/DefaultVoicemailNotifier.java | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java index 13ec0292a..2b894a12d 100644 --- a/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java +++ b/src/com/android/dialer/calllog/DefaultVoicemailNotifier.java @@ -24,7 +24,6 @@ import com.google.common.collect.Maps; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; -import android.content.ComponentName; import android.content.ContentResolver; import android.content.ContentUris; import android.content.Context; @@ -34,9 +33,7 @@ import android.database.Cursor; import android.net.Uri; import android.provider.CallLog.Calls; import android.provider.ContactsContract.PhoneLookup; -import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberUtils; -import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -197,24 +194,13 @@ public class DefaultVoicemailNotifier { // TODO: Use the photo of contact if all calls are from the same person. final int icon = android.R.drawable.stat_notify_voicemail; - Uri ringtoneUri = null; - boolean shouldVibrate = callToNotify != null; - if (callToNotify != null) { - PhoneAccountHandle accountHandle = new PhoneAccountHandle( - ComponentName.unflattenFromString(callToNotify.accountComponentName), - callToNotify.accountId); - ringtoneUri = getTelephonyManager().getVoicemailRingtoneUri(accountHandle); - shouldVibrate = getTelephonyManager().isVoicemailVibrationEnabled(accountHandle); - } - Notification.Builder notificationBuilder = new Notification.Builder(mContext) .setSmallIcon(icon) .setContentTitle(title) .setContentText(callers) .setStyle(new Notification.BigTextStyle().bigText(transcription)) - .setSound(ringtoneUri) .setColor(resources.getColor(R.color.dialer_theme_color)) - .setDefaults(shouldVibrate ? Notification.DEFAULT_VIBRATE : 0) + .setDefaults(callToNotify != null ? Notification.DEFAULT_ALL : 0) .setDeleteIntent(createMarkNewVoicemailsAsOldIntent()) .setAutoCancel(true); @@ -238,10 +224,6 @@ public class DefaultVoicemailNotifier { mNotificationManager.notify(NOTIFICATION_TAG, NOTIFICATION_ID, notificationBuilder.build()); } - private TelephonyManager getTelephonyManager() { - return (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); - } - /** Creates a pending intent that marks all new voicemails as old. */ private PendingIntent createMarkNewVoicemailsAsOldIntent() { Intent intent = new Intent(mContext, CallLogNotificationsService.class); |