From 73107131025b0bbfa20a6a8be782456494e1043d Mon Sep 17 00:00:00 2001 From: twyen Date: Tue, 5 Dec 2017 16:24:23 -0800 Subject: 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 --- java/com/android/voicemail/impl/ActivationTask.java | 5 +++-- java/com/android/voicemail/impl/PreOMigrationHandler.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'java/com') 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) { -- cgit v1.2.3