summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java')
-rw-r--r--java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
index 9d07ec561..ffbae71f2 100644
--- a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
+++ b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
@@ -43,6 +43,15 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver {
private static final String LEGACY_VOICEMAIL_COUNT = "legacy_voicemail_count";
+ /**
+ * Hidden extra for {@link TelephonyManager#ACTION_SHOW_VOICEMAIL_NOTIFICATION} for whether the
+ * notification is just a refresh or for a new voicemail. The phone should not play a ringtone or
+ * vibrate during a refresh if the notification is already showing.
+ *
+ * <p>TODO(b/62202833): make public
+ */
+ private static final String EXTRA_IS_REFRESH = "is_refresh";
+
@Override
public void onReceive(Context context, Intent intent) {
LogUtil.i(
@@ -51,7 +60,6 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver {
PhoneAccountHandle phoneAccountHandle =
Assert.isNotNull(intent.getParcelableExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE));
-
int count = intent.getIntExtra(TelephonyManager.EXTRA_NOTIFICATION_COUNT, -1);
if (!hasVoicemailCountChanged(context, phoneAccountHandle, count)) {
@@ -97,7 +105,8 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver {
count,
voicemailNumber,
callVoicemailIntent,
- voicemailSettingIntent);
+ voicemailSettingIntent,
+ intent.getBooleanExtra(EXTRA_IS_REFRESH, false));
}
private static boolean hasVoicemailCountChanged(