diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-05-15 23:21:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-05-15 23:21:06 +0000 |
commit | 0c9dbf507b53a12bdf577ff3e55c1686a2e089de (patch) | |
tree | 3849f2add85d7abe11151436b3f03f99783157a8 /java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java | |
parent | e724c7b6376be660abf2113f97c7cbfc34515da8 (diff) | |
parent | c857f90590e7d7fcffa89511982eb33afd34805f (diff) |
Merge "Update Dialer to v10 RC32" into oc-dev
Diffstat (limited to 'java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java')
-rw-r--r-- | java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java b/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java index eaf5b74e5..77b45ec71 100644 --- a/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java +++ b/java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java @@ -20,13 +20,13 @@ import android.content.Context; import android.content.SharedPreferences; import android.graphics.drawable.Drawable; import android.os.Build; -import android.preference.PreferenceManager; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import com.android.dialer.common.Assert; import com.android.dialer.common.ConfigProvider; import com.android.dialer.common.ConfigProviderBindings; import com.android.dialer.common.LogUtil; +import com.android.dialer.util.DialerUtils; import com.android.incallui.util.AccessibilityUtil; /** @@ -62,7 +62,7 @@ public class AnswerHintFactory { if (shouldShowAnswerHint( context, ConfigProviderBindings.get(context), - getDeviceProtectedPreferences(context), + DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context), Build.PRODUCT)) { return new DotAnswerHint(context, puckUpDuration, puckUpDelay); } @@ -77,7 +77,8 @@ public class AnswerHintFactory { } public static void increaseAnsweredCount(Context context) { - SharedPreferences sharedPreferences = getDeviceProtectedPreferences(context); + SharedPreferences sharedPreferences = + DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context); int answeredCount = sharedPreferences.getInt(ANSWERED_COUNT_PREFERENCE_KEY, 0); sharedPreferences.edit().putInt(ANSWERED_COUNT_PREFERENCE_KEY, answeredCount + 1).apply(); } @@ -119,12 +120,4 @@ public class AnswerHintFactory { .getString(CONFIG_ANSWER_HINT_WHITELISTED_DEVICES_KEY, DEFAULT_WHITELISTED_DEVICES_CSV) .contains("/" + device + "/"); } - - private static SharedPreferences getDeviceProtectedPreferences(Context context) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { - return PreferenceManager.getDefaultSharedPreferences(context); - } - return PreferenceManager.getDefaultSharedPreferences( - context.createDeviceProtectedStorageContext()); - } } |