diff options
author | zachh <zachh@google.com> | 2017-11-07 05:12:51 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-07 05:12:51 +0000 |
commit | 2835d4c4c30c645b87887861b54bfb4a22ff524a (patch) | |
tree | 642c7b180b33d1371c1f474be03fbb8de2110f6d /java/com/android/voicemail/impl/sync/VvmAccountManager.java | |
parent | b519cd522d472b5d7980cc015aa37c101be99386 (diff) | |
parent | 7547d3e963dab2b1ef467ad27c3f0d25e150b50c (diff) |
Merge "Move voicemail settings to dialer UI"
Diffstat (limited to 'java/com/android/voicemail/impl/sync/VvmAccountManager.java')
-rw-r--r-- | java/com/android/voicemail/impl/sync/VvmAccountManager.java | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/java/com/android/voicemail/impl/sync/VvmAccountManager.java b/java/com/android/voicemail/impl/sync/VvmAccountManager.java index f458b2a6d..e7f2eef2e 100644 --- a/java/com/android/voicemail/impl/sync/VvmAccountManager.java +++ b/java/com/android/voicemail/impl/sync/VvmAccountManager.java @@ -29,6 +29,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.PerAccountSharedPreferences; import com.android.dialer.common.concurrent.ThreadUtil; import com.android.dialer.storage.StorageComponent; +import com.android.voicemail.VoicemailClient.ActivationStateListener; import com.android.voicemail.impl.OmtpConstants; import com.android.voicemail.impl.VisualVoicemailPreferences; import com.android.voicemail.impl.VoicemailStatus; @@ -50,15 +51,9 @@ import java.util.Set; public class VvmAccountManager { public static final String TAG = "VvmAccountManager"; - /** Listener for activation state changes. Will be called on the main thread. */ - public interface Listener { - @MainThread - void onActivationStateChanged(PhoneAccountHandle phoneAccountHandle, boolean isActivated); - } - @VisibleForTesting static final String IS_ACCOUNT_ACTIVATED = "is_account_activated"; - private static Set<Listener> listeners = new ArraySet<>(); + private static final Set<ActivationStateListener> listeners = new ArraySet<>(); public static void addAccount( Context context, PhoneAccountHandle phoneAccountHandle, StatusMessage statusMessage) { @@ -69,7 +64,7 @@ public class VvmAccountManager { ThreadUtil.postOnUiThread( () -> { - for (Listener listener : listeners) { + for (ActivationStateListener listener : listeners) { listener.onActivationStateChanged(phoneAccountHandle, true); } }); @@ -86,7 +81,7 @@ public class VvmAccountManager { .apply(); ThreadUtil.postOnUiThread( () -> { - for (Listener listener : listeners) { + for (ActivationStateListener listener : listeners) { listener.onActivationStateChanged(phoneAccount, false); } }); @@ -113,13 +108,13 @@ public class VvmAccountManager { } @MainThread - public static void addListener(Listener listener) { + public static void addListener(ActivationStateListener listener) { Assert.isMainThread(); listeners.add(listener); } @MainThread - public static void removeListener(Listener listener) { + public static void removeListener(ActivationStateListener listener) { Assert.isMainThread(); listeners.remove(listener); } |