summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-10-26 17:04:30 -0700
committerEric Erfanian <erfanian@google.com>2017-10-27 08:45:56 -0700
commit168d09c3ad4fdc93ab018f68b7f583be7acd2851 (patch)
treece7846c1d1911e2067aeaf42b2e3f247273a43f7 /java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java
parentf60c5384f34660ae03ae3c15183980dfb8219ba9 (diff)
Move the functionality of DialerUtils#getDefaultSharedPreferenceForDeviceProtectedStorageContext(Context) to StorageComponent.
Bug: 30224215 Test: none PiperOrigin-RevId: 173612463 Change-Id: Ia89d5d85c31ea2114b196393ae43b803023fc9bf
Diffstat (limited to 'java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java')
-rw-r--r--java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java b/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java
index 94cf893f0..2ed434660 100644
--- a/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java
+++ b/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java
@@ -25,7 +25,7 @@ import android.support.annotation.VisibleForTesting;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.configprovider.ConfigProviderBindings;
-import com.android.dialer.util.DialerUtils;
+import com.android.dialer.storage.StorageComponent;
import com.android.incallui.util.AccessibilityUtil;
/**
@@ -72,8 +72,7 @@ public class AnswerHintFactory {
}
public static void increaseAnsweredCount(Context context) {
- SharedPreferences sharedPreferences =
- DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context);
+ SharedPreferences sharedPreferences = StorageComponent.get(context).unencryptedSharedPrefs();
int answeredCount = sharedPreferences.getInt(ANSWERED_COUNT_PREFERENCE_KEY, 0);
sharedPreferences.edit().putInt(ANSWERED_COUNT_PREFERENCE_KEY, answeredCount + 1).apply();
}
@@ -92,7 +91,8 @@ public class AnswerHintFactory {
// If the user has gone through the process a few times we can assume they have learnt the
// method.
int answeredCount =
- DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context)
+ StorageComponent.get(context)
+ .unencryptedSharedPrefs()
.getInt(ANSWERED_COUNT_PREFERENCE_KEY, 0);
long threshold =
ConfigProviderBindings.get(context).getLong(CONFIG_ANSWER_HINT_ANSWERED_THRESHOLD_KEY, 3);