summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2017-08-18 11:04:37 -0700
committerEric Erfanian <erfanian@google.com>2017-08-30 15:46:06 +0000
commiteed5afa45b9da6c1532feb95bd8ffdb5ae48d219 (patch)
tree77ce2cd15635abd9f9aaf0ed52593b9be61e60db /java
parentd06fca4ec629533abc2e135d16b8b2865abe8e6c (diff)
Allow legacy mode voicemail notification to show in FBE
Legacy mode is when the carrier notifies the device of incoming voicemails with visual voicemail SMS, but the device shows a legacy voicemail notification and will not access the voicemail server. This is used by certain carriers to pretend VVM is deactivated, or under FBE because the server access credentials is encrypted. Previously the VVM activation state is made available in FBE, so all legacy voicemail notifications will be blocked, including legacy mode. In this CL, legacy mode will send an additional flag so it will not be blocked by the VVM activated state. Bug: 64768579 Test: LegacyVoicemailNotificationReceiverTest PiperOrigin-RevId: 165726692 Change-Id: I9a6dbb0ba3ad07bd31c6daf3d9beac0797e22cb4
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java8
-rw-r--r--java/com/android/voicemail/VoicemailClient.java6
-rw-r--r--java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java1
3 files changed, 12 insertions, 3 deletions
diff --git a/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java b/java/com/android/dialer/app/voicemail/LegacyVoicemailNotificationReceiver.java
index a81d8665a..d681df205 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.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.PerAccountSharedPreferences;
import com.android.dialer.util.DialerUtils;
+import com.android.voicemail.VoicemailClient;
import com.android.voicemail.VoicemailComponent;
/**
@@ -105,9 +106,10 @@ public class LegacyVoicemailNotificationReceiver extends BroadcastReceiver {
return;
}
- if (VoicemailComponent.get(context)
- .getVoicemailClient()
- .isActivated(context, phoneAccountHandle)) {
+ if (!intent.getBooleanExtra(VoicemailClient.EXTRA_IS_LEGACY_MODE, false)
+ && VoicemailComponent.get(context)
+ .getVoicemailClient()
+ .isActivated(context, phoneAccountHandle)) {
LogUtil.i(
"LegacyVoicemailNotificationReceiver.onReceive",
"visual voicemail is activated, ignoring notification");
diff --git a/java/com/android/voicemail/VoicemailClient.java b/java/com/android/voicemail/VoicemailClient.java
index 21846a480..d52a67a8e 100644
--- a/java/com/android/voicemail/VoicemailClient.java
+++ b/java/com/android/voicemail/VoicemailClient.java
@@ -55,6 +55,12 @@ public interface VoicemailClient {
"com.android.voicemail.VoicemailClient.ACTION_SHOW_LEGACY_VOICEMAIL";
/**
+ * Boolean extra send with {@link #ACTION_SHOW_LEGACY_VOICEMAIL}, indicating that the notification
+ * is sent by legacy mode and should not be suppressed even when VVM is activated
+ */
+ String EXTRA_IS_LEGACY_MODE = "is_legacy_mode";
+
+ /**
* Secret code to launch the voicemail config activity intended for OEMs and Carriers. {@code
* *#*#VVMCONFIG#*#*}
*/
diff --git a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java
index 5decf6376..e902825c0 100644
--- a/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java
+++ b/java/com/android/voicemail/impl/sms/LegacyModeSmsHandler.java
@@ -79,6 +79,7 @@ public class LegacyModeSmsHandler {
VvmLog.i(TAG, "sending voicemail notification");
Intent intent = new Intent(VoicemailClient.ACTION_SHOW_LEGACY_VOICEMAIL);
intent.setPackage(context.getPackageName());
+ intent.putExtra(VoicemailClient.EXTRA_IS_LEGACY_MODE, true);
intent.putExtra(TelephonyManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle);
// Setting voicemail message count to non-zero will show the telephony voicemail
// notification, and zero will clear it.