summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {
}