summaryrefslogtreecommitdiffstats
path: root/java/com/android/incallui/answer/impl
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-05-15 14:05:33 -0700
committerEric Erfanian <erfanian@google.com>2017-05-15 14:48:12 -0700
commitc857f90590e7d7fcffa89511982eb33afd34805f (patch)
tree9910fb95c6fdb10b06ee8be02a3374d2882005b9 /java/com/android/incallui/answer/impl
parent738bb09adee2b56c99063a0264f8f76de393143b (diff)
downloadandroid_packages_apps_Dialer-c857f90590e7d7fcffa89511982eb33afd34805f.tar.gz
android_packages_apps_Dialer-c857f90590e7d7fcffa89511982eb33afd34805f.tar.bz2
android_packages_apps_Dialer-c857f90590e7d7fcffa89511982eb33afd34805f.zip
Update Dialer to v10 RC32
This release was created following the instructions at: go/dialer-aosp-release Subsequent dialer releases will follow as O bugs are fixed, until we reach our final RC. Version: 10 Candidate: RC32 Branch: dialer-android_release_branch/153304843.1 dialer-android_20170416.00/dialer-android_20170416.00_RC32 This release contains the following bug fixes since RC17: Bug: 33176679 33272455 3646510 36773894 37297649 37413780 37513689 37640315 37680595 37698062 37873639 37901752 37919295 37953423 38062852 38069600 38137349 38173549 38180252 38191514 Test: make, on device Change-Id: I4e4bb630082758e418ff24892b7db3142c6eb09a
Diffstat (limited to 'java/com/android/incallui/answer/impl')
-rw-r--r--java/com/android/incallui/answer/impl/hint/AnswerHintFactory.java15
-rw-r--r--java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java5
2 files changed, 7 insertions, 13 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());
- }
}
diff --git a/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java b/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java
index 485a9ae37..21154cade 100644
--- a/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java
+++ b/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java
@@ -21,10 +21,10 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION_CODES;
-import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.android.dialer.common.Assert;
+import com.android.dialer.util.DialerUtils;
/** Decrypt the event payload to be shown if in a specific time range and the key is received. */
@TargetApi(VERSION_CODES.M)
@@ -35,7 +35,8 @@ public final class PawImageLoaderImpl implements PawImageLoader {
public Drawable loadPayload(@NonNull Context context) {
Assert.isNotNull(context);
- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences preferences =
+ DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context);
if (!preferences.getBoolean(PawSecretCodeListener.PAW_ENABLED_WITH_SECRET_CODE_KEY, false)) {
return null;
}