summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@google.com>2011-03-02 15:19:54 -0500
committerDaniel Sandler <dsandler@google.com>2011-03-02 15:19:54 -0500
commit5920f153e763b62bbc2ddb35f624a1241180575e (patch)
tree4ef103da8c1f422414f3ee3a97ce6ddc53da68df /packages
parent0ffc2306ddbfe30291c89286287f9fc75658c409 (diff)
downloadframeworks_base-5920f153e763b62bbc2ddb35f624a1241180575e.zip
frameworks_base-5920f153e763b62bbc2ddb35f624a1241180575e.tar.gz
frameworks_base-5920f153e763b62bbc2ddb35f624a1241180575e.tar.bz2
Invert sense (and text) of rotation lock switch.
It now reads "Auto-rotate screen" to be more consistent with the Settings app. Bug: 3427583 Change-Id: I58d90a6b875cfa99b03995aea4c7ebfc7751e9cf
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml2
-rw-r--r--packages/SystemUI/res/values/strings.xml2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java24
3 files changed, 14 insertions, 14 deletions
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
index fbb3c78..677988d 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
@@ -79,7 +79,7 @@
<TextView
android:id="@+id/rotate_label"
style="@style/StatusBarPanelSettingsContents"
- android:text="@string/status_bar_settings_rotation_lock"
+ android:text="@string/status_bar_settings_auto_rotation"
/>
<Switch
android:id="@+id/rotate_checkbox"
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 0923570..ebd48e7 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -81,7 +81,7 @@
<string name="status_bar_settings_airplane">Airplane mode</string>
<!-- Label in system panel saying the device will use the orientation sensor to rotate [CHAR LIMIT=30] -->
- <string name="status_bar_settings_rotation_lock">Lock screen orientation</string>
+ <string name="status_bar_settings_auto_rotation">Auto-rotate screen</string>
<!-- Abbreviation / label for mute brightness mode button. Should be all caps. [CHAR LIMIT=6] -->
<string name="status_bar_settings_mute_label">MUTE</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java
index b0a6d7a..5ac5ad0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java
@@ -35,39 +35,39 @@ public class AutoRotateController implements CompoundButton.OnCheckedChangeListe
private Context mContext;
private CompoundButton mCheckBox;
- private boolean mLockRotation;
+ private boolean mAutoRotation;
public AutoRotateController(Context context, CompoundButton checkbox) {
mContext = context;
- mLockRotation = getLockRotation();
+ mAutoRotation = getAutoRotation();
mCheckBox = checkbox;
- checkbox.setChecked(mLockRotation);
+ checkbox.setChecked(mAutoRotation);
checkbox.setOnCheckedChangeListener(this);
}
public void onCheckedChanged(CompoundButton view, boolean checked) {
- if (checked != mLockRotation) {
- setLockRotation(checked);
+ if (checked != mAutoRotation) {
+ setAutoRotation(checked);
}
}
- private boolean getLockRotation() {
+ private boolean getAutoRotation() {
ContentResolver cr = mContext.getContentResolver();
- return 0 == Settings.System.getInt(cr, Settings.System.ACCELEROMETER_ROTATION, 0);
+ return 0 != Settings.System.getInt(cr, Settings.System.ACCELEROMETER_ROTATION, 0);
}
- private void setLockRotation(final boolean locked) {
- mLockRotation = locked;
+ private void setAutoRotation(final boolean autorotate) {
+ mAutoRotation = autorotate;
AsyncTask.execute(new Runnable() {
public void run() {
try {
IWindowManager wm = IWindowManager.Stub.asInterface(
ServiceManager.getService(Context.WINDOW_SERVICE));
ContentResolver cr = mContext.getContentResolver();
- if (locked) {
- wm.freezeRotation();
- } else {
+ if (autorotate) {
wm.thawRotation();
+ } else {
+ wm.freezeRotation();
}
} catch (RemoteException exc) {
}