summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
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/SystemUI/src
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/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java24
1 files changed, 12 insertions, 12 deletions
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) {
}