diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-27 17:21:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-27 17:21:27 +0000 |
commit | 4499718cc171a6c79e03fc53e139efaf4d8ba6f8 (patch) | |
tree | c830e73232470fc7498ffe3853c0428274e2194f /java/com/android/incallui/answer/impl | |
parent | f60c5384f34660ae03ae3c15183980dfb8219ba9 (diff) | |
parent | 5d8ed9309625302dee3407b320a52f2b7f30227f (diff) |
Merge changes I6e17c1cc,If00f7e91,Ia89d5d85
* changes:
Fix HOLD option not displayed in voice calls in CDMA + GSM.
Use string concatenation for CREATE_TABLE_SQL instead of StringBuilder()
Move the functionality of DialerUtils#getDefaultSharedPreferenceForDeviceProtectedStorageContext(Context) to StorageComponent.
Diffstat (limited to 'java/com/android/incallui/answer/impl')
3 files changed, 8 insertions, 10 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); diff --git a/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java b/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java index 05358d831..31b17112b 100644 --- a/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java +++ b/java/com/android/incallui/answer/impl/hint/PawImageLoaderImpl.java @@ -25,7 +25,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; -import com.android.dialer.util.DialerUtils; +import com.android.dialer.storage.StorageComponent; import com.android.incallui.answer.impl.hint.PawSecretCodeListener.PawType; /** Decrypt the event payload to be shown if in a specific time range and the key is received. */ @@ -37,8 +37,7 @@ public final class PawImageLoaderImpl implements PawImageLoader { public Drawable loadPayload(@NonNull Context context) { Assert.isNotNull(context); - SharedPreferences preferences = - DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context); + SharedPreferences preferences = StorageComponent.get(context).unencryptedSharedPrefs(); if (!preferences.getBoolean(PawSecretCodeListener.PAW_ENABLED_WITH_SECRET_CODE_KEY, false)) { return null; } diff --git a/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java b/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java index 871d80c23..f6444e5b4 100644 --- a/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java +++ b/java/com/android/incallui/answer/impl/hint/PawSecretCodeListener.java @@ -28,7 +28,7 @@ import com.android.dialer.common.LogUtil; import com.android.dialer.configprovider.ConfigProviderBindings; import com.android.dialer.logging.DialerImpression.Type; import com.android.dialer.logging.Logger; -import com.android.dialer.util.DialerUtils; +import com.android.dialer.storage.StorageComponent; import java.util.Random; /** @@ -69,8 +69,7 @@ public class PawSecretCodeListener extends BroadcastReceiver { if (!TextUtils.equals(secretCode, host)) { return; } - SharedPreferences preferences = - DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context); + SharedPreferences preferences = StorageComponent.get(context).unencryptedSharedPrefs(); boolean wasEnabled = preferences.getBoolean(PAW_ENABLED_WITH_SECRET_CODE_KEY, false); if (wasEnabled) { preferences.edit().putBoolean(PAW_ENABLED_WITH_SECRET_CODE_KEY, false).apply(); |