diff options
author | Rahul Chaturvedi <rkc@google.com> | 2015-06-15 14:09:42 -0400 |
---|---|---|
committer | Rahul Chaturvedi <rkc@google.com> | 2015-06-15 14:09:42 -0400 |
commit | e863fed1400d00fab11a61c5b4b989d86ca55386 (patch) | |
tree | 34c034bc8f8c15abcfbf3e20e359dde20dfab158 | |
parent | 931a2ce85aec5011298cf7f305f5823c13c0f578 (diff) | |
download | android_packages_apps_Trebuchet-e863fed1400d00fab11a61c5b4b989d86ca55386.tar.gz android_packages_apps_Trebuchet-e863fed1400d00fab11a61c5b4b989d86ca55386.tar.bz2 android_packages_apps_Trebuchet-e863fed1400d00fab11a61c5b4b989d86ca55386.zip |
Read rotation setting correctly from the wallpaper picker.
If reading the rotation setting without the multi-process flag, the
WallpaperPickerActivity usually picks up a cached value. Specifying the
multi-process flag during the read fixes this and the wallpaper picker
always has the correct rotation setting.
Change-Id: Ic3639f8cd694674e92c8940b753c6bc30486076d
-rw-r--r-- | WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java index 94159416a..d9bfc30eb 100644 --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java @@ -1147,6 +1147,6 @@ public class WallpaperPickerActivity extends WallpaperCropActivity { return true; // Check if the user has specifically enabled rotation via preferences. - return Utilities.isAllowRotationPrefEnabled(getApplicationContext()); + return Utilities.isAllowRotationPrefEnabled(getApplicationContext(), true); } } diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d52191bf1..191fdf457 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -515,7 +515,7 @@ public class Launcher extends Activity // In case we are on a device with locked rotation, we should look at preferences to check // if the user has specifically allowed rotation. if (!mRotationEnabled) { - mRotationEnabled = Utilities.isAllowRotationPrefEnabled(getApplicationContext()); + mRotationEnabled = Utilities.isAllowRotationPrefEnabled(getApplicationContext(), false); } // On large interfaces, or on devices that a user has specifically enabled screen rotation, diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 0f52cba2b..2d8a1b1cf 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -97,9 +97,10 @@ public final class Utilities { return Log.isLoggable(propertyName, Log.VERBOSE); } - public static boolean isAllowRotationPrefEnabled(Context context) { + public static boolean isAllowRotationPrefEnabled(Context context, boolean multiProcess) { SharedPreferences sharedPrefs = context.getSharedPreferences( - LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE); + LauncherAppState.getSharedPreferencesKey(), Context.MODE_PRIVATE | (multiProcess ? + Context.MODE_MULTI_PROCESS : 0)); boolean allowRotationPref = sharedPrefs.getBoolean(ALLOW_ROTATION_PREFERENCE_KEY, false); return sForceEnableRotation || allowRotationPref; } |