diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-12 23:02:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-12 23:02:32 +0000 |
commit | 5f57e30484848b7b0b8d3fbdfe8b32338aa641a5 (patch) | |
tree | 5a37619a955212672a57d86ef50587b3545805ac /java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java | |
parent | 2633778c274746a35e4a54266a3319c53fd1cded (diff) | |
parent | 392f8cd64936a626cc035ac9bb0302094d8dd957 (diff) |
Merge changes I14a2c0b6,Ic67566c2,Id0ef9164,Iec48f030,Ibe1f9de6, ...
* changes:
Handle invalid PhoneAccountHandle component name in MissedCallNotifier
Use TelephonyManagerCompat for IS_REFRESH
Updated animation to enter and exit search ui.
Optimization for incoming call latency.
Fix for voice screen showing for a short time when making a video call
Fix incallui to use latest ux mocks for assisted dialing.
Remove voicemail count changed check for legacy notifications
Diffstat (limited to 'java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java')
-rw-r--r-- | java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java index 74ddff245..0a6f2c156 100644 --- a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java +++ b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java @@ -32,6 +32,7 @@ import com.android.dialer.app.calllog.LegacyVoicemailNotifier; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.PerAccountSharedPreferences; +import com.android.dialer.compat.telephony.TelephonyManagerCompat; import com.android.dialer.util.DialerUtils; import com.android.voicemail.VoicemailClient; import com.android.voicemail.VoicemailComponent; @@ -44,16 +45,8 @@ import com.android.voicemail.VoicemailComponent; @TargetApi(VERSION_CODES.O) public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver { - private static final String LEGACY_VOICEMAIL_COUNT = "legacy_voicemail_count"; @VisibleForTesting static final String LEGACY_VOICEMAIL_DISMISSED = "legacy_voicemail_dismissed"; - /** - * 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. This is Hidden in - * O and public in O MR1. - */ - @VisibleForTesting static final String EXTRA_IS_REFRESH = "is_refresh"; - @Override public void onReceive(Context context, Intent intent) { @@ -79,7 +72,8 @@ 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); - boolean isRefresh = intent.getBooleanExtra(EXTRA_IS_REFRESH, false); + + boolean isRefresh = intent.getBooleanExtra(TelephonyManagerCompat.EXTRA_IS_REFRESH, false); LogUtil.i("LegacyVoicemailNotificationReceiver.onReceive", "isRefresh: " + isRefresh); PerAccountSharedPreferences preferences = getSharedPreferences(context, phoneAccountHandle); if (isRefresh) { @@ -93,13 +87,6 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver { setDismissed(context, phoneAccountHandle, false); } - if (!hasVoicemailCountChanged(preferences, count)) { - LogUtil.i( - "LegacyVoicemailNotificationReceiver.onReceive", - "voicemail count hasn't changed, ignoring"); - return; - } - if (count == -1) { // Carrier might not send voicemail count. Missing extra means there are unknown numbers of // voicemails (One or more). Treat it as 1 so the generic version will be shown. ("Voicemail" @@ -149,21 +136,6 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver { .apply(); } - private static boolean hasVoicemailCountChanged( - PerAccountSharedPreferences preferences, int newCount) { - if (newCount == -1) { - // Carrier does not report voicemail count - return true; - } - - // Carriers may send multiple notifications for the same voicemail. - if (newCount != 0 && newCount == preferences.getInt(LEGACY_VOICEMAIL_COUNT, -1)) { - return false; - } - preferences.edit().putInt(LEGACY_VOICEMAIL_COUNT, newCount).apply(); - return true; - } - @VisibleForTesting static PerAccountSharedPreferences getSharedPreferences( Context context, PhoneAccountHandle phoneAccountHandle) { |