summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-03-23 11:43:18 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-26 22:18:34 -0700
commitd74e72e59795d39836a893afb60447acce9e9886 (patch)
tree486b705cedb559d53027efe1db1db9a9968a0baf /java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java
parentb9b64d3935bb05169afb23375ebe38fb846e78c8 (diff)
Removed NUI shortcut.
We're not going to have a shortcut for NUI anymore. There are individual flags related to NUI that are controlled in CallLogConfig. Other related changes to help accomplish this: -Changed how the call log framework/config/migrator interact; the migrator is now only called on config changes and enabling/disabling of the framework now lives in CallLogFramework. -Move CallLogConfig an interface, and moved it to its own package and added component and module. This is to simplify tests which just need to check the config status (like PhoneLookupHistoryRecorderTest). -The "Main" package is also on longer needed since it existed to control the shortcut. Bug: 74821995 Test: existing PiperOrigin-RevId: 190251418 Change-Id: I73c8e83aee80295131443a8ffaa7dea716ea89b6
Diffstat (limited to 'java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java')
-rw-r--r--java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java18
1 files changed, 1 insertions, 17 deletions
diff --git a/java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java b/java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java
index a12a98f0e..71bfb753c 100644
--- a/java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java
+++ b/java/com/android/dialer/calllog/AnnotatedCallLogMigrator.java
@@ -16,12 +16,9 @@
package com.android.dialer.calllog;
-import android.content.Context;
import android.content.SharedPreferences;
import com.android.dialer.common.LogUtil;
import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor;
-import com.android.dialer.configprovider.ConfigProviderBindings;
-import com.android.dialer.inject.ApplicationContext;
import com.android.dialer.storage.Unencrypted;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
@@ -37,18 +34,15 @@ public final class AnnotatedCallLogMigrator {
private static final String PREF_MIGRATED = "annotatedCallLogMigratorMigrated";
- private final Context appContext;
private final SharedPreferences sharedPreferences;
private final RefreshAnnotatedCallLogWorker refreshAnnotatedCallLogWorker;
private final ListeningExecutorService backgroundExecutor;
@Inject
AnnotatedCallLogMigrator(
- @ApplicationContext Context appContext,
@Unencrypted SharedPreferences sharedPreferences,
@BackgroundExecutor ListeningExecutorService backgroundExecutor,
RefreshAnnotatedCallLogWorker refreshAnnotatedCallLogWorker) {
- this.appContext = appContext;
this.sharedPreferences = sharedPreferences;
this.backgroundExecutor = backgroundExecutor;
this.refreshAnnotatedCallLogWorker = refreshAnnotatedCallLogWorker;
@@ -78,17 +72,7 @@ public final class AnnotatedCallLogMigrator {
}
private ListenableFuture<Boolean> shouldMigrate() {
- return backgroundExecutor.submit(
- () -> {
- if (!(ConfigProviderBindings.get(appContext)
- .getBoolean("is_nui_shortcut_enabled", false))) {
- return false;
- }
- if (sharedPreferences.getBoolean(PREF_MIGRATED, false)) {
- return false;
- }
- return true;
- });
+ return backgroundExecutor.submit(() -> !sharedPreferences.getBoolean(PREF_MIGRATED, false));
}
/**