summaryrefslogtreecommitdiff
path: root/java/com/android/voicemail/impl
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2017-12-05 16:24:23 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-07 11:06:39 -0800
commit73107131025b0bbfa20a6a8be782456494e1043d (patch)
tree4df97aba20fb0109473a34ea3699a9ea6bf88d5a /java/com/android/voicemail/impl
parent6357ef788c564a0a3f92fc5761d7e0ecbf62c181 (diff)
Allow VVM activation to be rerun if carrier sent STATUS SMS
Carrier might send STATUS SMS actively if the account configuration has changed. Previously it will be discarded if the account is already activated. In this CL activation will be rerun if the messageData already exist since it is initiated by an STATUS SMS. Bug: 69857261 Test: ActivationTaskTest PiperOrigin-RevId: 178028542 Change-Id: I6d103569c2be4eeadc3a7877d160fff03ad8b40e
Diffstat (limited to 'java/com/android/voicemail/impl')
-rw-r--r--java/com/android/voicemail/impl/ActivationTask.java5
-rw-r--r--java/com/android/voicemail/impl/PreOMigrationHandler.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/java/com/android/voicemail/impl/ActivationTask.java b/java/com/android/voicemail/impl/ActivationTask.java
index 29c91e01e..83f2fd836 100644
--- a/java/com/android/voicemail/impl/ActivationTask.java
+++ b/java/com/android/voicemail/impl/ActivationTask.java
@@ -61,7 +61,7 @@ public class ActivationTask extends BaseTask {
private static final int RETRY_TIMES = 4;
private static final int RETRY_INTERVAL_MILLIS = 5_000;
- private static final String EXTRA_MESSAGE_DATA_BUNDLE = "extra_message_data_bundle";
+ @VisibleForTesting static final String EXTRA_MESSAGE_DATA_BUNDLE = "extra_message_data_bundle";
private final RetryPolicy mRetryPolicy;
@@ -168,7 +168,8 @@ public class ActivationTask extends BaseTask {
}
VvmLog.i(TAG, "VVM content provider configured - " + helper.getVvmType());
- if (VvmAccountManager.isAccountActivated(getContext(), phoneAccountHandle)) {
+ if (mMessageData == null
+ && VvmAccountManager.isAccountActivated(getContext(), phoneAccountHandle)) {
VvmLog.i(TAG, "Account is already activated");
// The activated state might come from restored data, the filter still needs to be set up.
helper.activateSmsFilter();
diff --git a/java/com/android/voicemail/impl/PreOMigrationHandler.java b/java/com/android/voicemail/impl/PreOMigrationHandler.java
index 3ec5e0826..2c454715c 100644
--- a/java/com/android/voicemail/impl/PreOMigrationHandler.java
+++ b/java/com/android/voicemail/impl/PreOMigrationHandler.java
@@ -18,6 +18,7 @@ package com.android.voicemail.impl;
import android.content.Context;
import android.os.Bundle;
+import android.support.annotation.VisibleForTesting;
import android.support.annotation.WorkerThread;
import android.telecom.PhoneAccountHandle;
import android.telephony.TelephonyManager;
@@ -49,7 +50,7 @@ public final class PreOMigrationHandler {
private static final String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING =
"android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
- private static final String PRE_O_MIGRATION_FINISHED = "pre_o_migration_finished";
+ @VisibleForTesting static final String PRE_O_MIGRATION_FINISHED = "pre_o_migration_finished";
@WorkerThread
public static void migrate(Context context, PhoneAccountHandle phoneAccountHandle) {