diff options
author | wangqi <wangqi@google.com> | 2017-08-15 14:11:35 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 03:44:57 +0000 |
commit | f1fa776384ceab6682ad86348e3d08e3ca2b983b (patch) | |
tree | 49d841ba665b7c7941f8552e39db97bc388d5c9b /java/com | |
parent | 47e19fb8f2e58ca5dba0da77a4ca2c0ebe848d90 (diff) |
Fix crash when making emergency call on direct boot mode.
This is a regression caused by cl/164019619.
Bug: 64533766,64413593
Test: manual
PiperOrigin-RevId: 165356773
Change-Id: I598fd8fa3f77bd1a963858f11f06f953b97e76b0
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/android/dialer/strictmode/DialerStrictMode.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/java/com/android/dialer/strictmode/DialerStrictMode.java b/java/com/android/dialer/strictmode/DialerStrictMode.java index 5ce2ad669..ae72c3c0d 100644 --- a/java/com/android/dialer/strictmode/DialerStrictMode.java +++ b/java/com/android/dialer/strictmode/DialerStrictMode.java @@ -23,6 +23,7 @@ import android.os.StrictMode; import android.os.StrictMode.ThreadPolicy; import android.os.StrictMode.VmPolicy; import android.preference.PreferenceManager; +import android.support.v4.os.UserManagerCompat; import com.android.dialer.buildtype.BuildType; import com.android.dialer.util.DialerUtils; @@ -44,18 +45,20 @@ public final class DialerStrictMode { private static void warmupSharedPrefs(Application application) { if (isStrictModeAllowed()) { // From credential-encrypted (CE) storage, i.e.: - // /data/data/com.google.android.dialer/shared_prefs + // /data/data/com.android.dialer/shared_prefs - // com.google.android.dialer_preferences.xml - PreferenceManager.getDefaultSharedPreferences(application); + if (UserManagerCompat.isUserUnlocked(application)) { + // <package_name>_preferences.xml + PreferenceManager.getDefaultSharedPreferences(application); - // com.google.android.dialer.xml - application.getSharedPreferences(application.getPackageName(), Context.MODE_PRIVATE); + // <package_name>.xml + application.getSharedPreferences(application.getPackageName(), Context.MODE_PRIVATE); + } // From device-encrypted (DE) storage, i.e.: // /data/user_de/0/com.android.dialer/shared_prefs/ - // com.google.android.dialer_preferences.xml + // <package_name>_preferences.xml DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(application); } } |