Merge "Kepping the rotation setting UI always enabled and accessible" into ub-launcher3-edmonton
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 65225b7..4fbd806 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -183,8 +183,6 @@
<string name="allow_rotation_title">Allow Home screen rotation</string>
<!-- Text explaining when the home screen will get rotated. [CHAR LIMIT=100] -->
<string name="allow_rotation_desc">When phone is rotated</string>
- <!-- Text explaining that rotation is disabled in Display settings. 'Display' refers to the Display section in system settings [CHAR LIMIT=100] -->
- <string name="allow_rotation_blocked_desc">Current Display setting doesn\'t permit rotation</string>
<!-- Title for Notification dots setting. Tapping this will link to the system Notifications settings screen where the user can turn off notification dots globally. [CHAR LIMIT=50] -->
<string name="icon_badging_title">Notification dots</string>
<!-- Text to indicate that the system icon badging setting is on [CHAR LIMIT=100] -->
diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml
index dde2c5c..3bba73a 100644
--- a/res/xml/launcher_preferences.xml
+++ b/res/xml/launcher_preferences.xml
@@ -39,6 +39,7 @@
<SwitchPreference
android:key="pref_allowRotation"
android:title="@string/allow_rotation_title"
+ android:summary="@string/allow_rotation_desc"
android:defaultValue="@bool/allow_rotation"
android:persistent="true" />
diff --git a/src/com/android/launcher3/SettingsActivity.java b/src/com/android/launcher3/SettingsActivity.java
index 738a864..7bd6557 100644
--- a/src/com/android/launcher3/SettingsActivity.java
+++ b/src/com/android/launcher3/SettingsActivity.java
@@ -87,7 +87,6 @@
public static class LauncherSettingsFragment extends PreferenceFragment {
private IconBadgingObserver mIconBadgingObserver;
- private RotationLockObserver mRotationLockObserver;
private String mPreferenceKey;
private boolean mPreferenceHighlighted = false;
@@ -134,12 +133,6 @@
// Launcher supports rotation by default. No need to show this setting.
getPreferenceScreen().removePreference(rotationPref);
} else {
- mRotationLockObserver = new RotationLockObserver(rotationPref, resolver);
-
- // Register a content observer to listen for system setting changes while
- // this UI is active.
- mRotationLockObserver.register(Settings.System.ACCELEROMETER_ROTATION);
-
// Initialize the UI once
rotationPref.setDefaultValue(getAllowRotationDefaultValue());
}
@@ -201,10 +194,6 @@
mIconBadgingObserver.unregister();
mIconBadgingObserver = null;
}
- if (mRotationLockObserver != null) {
- mRotationLockObserver.unregister();
- mRotationLockObserver = null;
- }
super.onDestroy();
}
@@ -228,23 +217,6 @@
}
}
- private static class RotationLockObserver extends SettingsObserver.System {
-
- private final Preference mRotationPref;
-
- public RotationLockObserver(Preference rotationPref, ContentResolver resolver) {
- super(resolver);
- mRotationPref = rotationPref;
- }
-
- @Override
- public void onSettingChanged(boolean enabled) {
- mRotationPref.setEnabled(enabled);
- mRotationPref.setSummary(enabled
- ? R.string.allow_rotation_desc : R.string.allow_rotation_blocked_desc);
- }
- }
-
/**
* Content observer which listens for system badging setting changes,
* and updates the launcher badging setting subtext accordingly.