summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/voicemail/impl/ActivationTask.java6
-rw-r--r--java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java5
-rw-r--r--java/com/android/voicemail/impl/protocol/VisualVoicemailProtocol.java7
-rw-r--r--java/com/android/voicemail/impl/protocol/Vvm3Protocol.java11
4 files changed, 21 insertions, 8 deletions
diff --git a/java/com/android/voicemail/impl/ActivationTask.java b/java/com/android/voicemail/impl/ActivationTask.java
index 3cdbee484..d8ec4e252 100644
--- a/java/com/android/voicemail/impl/ActivationTask.java
+++ b/java/com/android/voicemail/impl/ActivationTask.java
@@ -196,7 +196,8 @@ public class ActivationTask extends BaseTask {
VisualVoicemailProtocol protocol = helper.getProtocol();
Bundle data;
- if (messageData != null) {
+ boolean isCarrierInitiated = messageData != null;
+ if (isCarrierInitiated) {
// The content of STATUS SMS is provided to launch this task, no need to request it
// again.
data = messageData;
@@ -237,7 +238,8 @@ public class ActivationTask extends BaseTask {
} else {
if (helper.supportsProvisioning()) {
VvmLog.i(TAG, "Subscriber not ready, start provisioning");
- helper.startProvisioning(this, phoneAccountHandle, status, message, data);
+ helper.startProvisioning(
+ this, phoneAccountHandle, status, message, data, isCarrierInitiated);
} else if (message.getProvisioningStatus().equals(OmtpConstants.SUBSCRIBER_NEW)) {
VvmLog.i(TAG, "Subscriber new but provisioning is not supported");
diff --git a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
index f8a9e4bcf..8896bc740 100644
--- a/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
+++ b/java/com/android/voicemail/impl/OmtpVvmCarrierConfigHelper.java
@@ -399,9 +399,10 @@ public class OmtpVvmCarrierConfigHelper {
PhoneAccountHandle phone,
VoicemailStatus.Editor status,
StatusMessage message,
- Bundle data) {
+ Bundle data,
+ boolean isCarrierInitiated) {
Assert.checkArgument(isValid());
- protocol.startProvisioning(task, phone, this, status, message, data);
+ protocol.startProvisioning(task, phone, this, status, message, data, isCarrierInitiated);
}
public void requestStatus(@Nullable PendingIntent sentIntent) {
diff --git a/java/com/android/voicemail/impl/protocol/VisualVoicemailProtocol.java b/java/com/android/voicemail/impl/protocol/VisualVoicemailProtocol.java
index 6cf82f1b8..a2e94ed77 100644
--- a/java/com/android/voicemail/impl/protocol/VisualVoicemailProtocol.java
+++ b/java/com/android/voicemail/impl/protocol/VisualVoicemailProtocol.java
@@ -57,7 +57,8 @@ public abstract class VisualVoicemailProtocol {
OmtpVvmCarrierConfigHelper config,
VoicemailStatus.Editor editor,
StatusMessage message,
- Bundle data) {
+ Bundle data,
+ boolean isCarrierInitiated) {
// Do nothing
}
@@ -78,8 +79,8 @@ public abstract class VisualVoicemailProtocol {
* Translate an OMTP IMAP command to the protocol specific one. For example, changing the TUI
* password on OMTP is XCHANGE_TUI_PWD, but on CVVM and VVM3 it is CHANGE_TUI_PWD.
*
- * @param command A String command in {@link OmtpConstants}, the exact
- * instance should be used instead of its' value.
+ * @param command A String command in {@link OmtpConstants}, the exact instance should be used
+ * instead of its' value.
* @returns Translated command, or {@code null} if not available in this protocol
*/
public String getCommand(String command) {
diff --git a/java/com/android/voicemail/impl/protocol/Vvm3Protocol.java b/java/com/android/voicemail/impl/protocol/Vvm3Protocol.java
index 782386db1..5e7b592fa 100644
--- a/java/com/android/voicemail/impl/protocol/Vvm3Protocol.java
+++ b/java/com/android/voicemail/impl/protocol/Vvm3Protocol.java
@@ -115,8 +115,17 @@ public class Vvm3Protocol extends VisualVoicemailProtocol {
OmtpVvmCarrierConfigHelper config,
VoicemailStatus.Editor status,
StatusMessage message,
- Bundle data) {
+ Bundle data,
+ boolean isCarrierInitiated) {
VvmLog.i(TAG, "start vvm3 provisioning");
+
+ if (isCarrierInitiated) {
+ // Carrier can send the "Status UNKNOWN, Can subscribe" status when upgrading to premium VVM.
+ // Ignore so we won't downgrade it back to basic.
+ VvmLog.w(TAG, "carrier initiated, ignoring");
+ return;
+ }
+
LoggerUtils.logImpressionOnMainThread(
config.getContext(), DialerImpression.Type.VVM_PROVISIONING_STARTED);
if (OmtpConstants.SUBSCRIBER_UNKNOWN.equals(message.getProvisioningStatus())) {