From a111187a5b4dc5d287e29ced7d65e8d20edca140 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 23 Nov 2010 20:55:11 -0800 Subject: Change rotation freeze to all be implemented in window manager. Lots of work for no visible change in behavior, but now we can do some fancier stuff... Also allow rotation in all 4 directions. Change-Id: I7e5e9537c5e359f69b83c10f65cc1ce95f371461 --- policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'policy') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 5c8d88b..f892e9e 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -241,6 +241,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mUserRotationMode = WindowManagerPolicy.USER_ROTATION_FREE; int mUserRotation = Surface.ROTATION_0; + boolean mAllowAllRotations; boolean mCarDockEnablesAccelerometer; boolean mDeskDockEnablesAccelerometer; int mLidKeyboardAccessibility; @@ -657,6 +658,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { com.android.internal.R.integer.config_carDockRotation); mDeskDockRotation = readRotation( com.android.internal.R.integer.config_deskDockRotation); + mAllowAllRotations = mContext.getResources().getBoolean( + com.android.internal.R.bool.config_allowAllRotations); mCarDockEnablesAccelerometer = mContext.getResources().getBoolean( com.android.internal.R.bool.config_carDockEnablesAccelerometer); mDeskDockEnablesAccelerometer = mContext.getResources().getBoolean( @@ -2344,7 +2347,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { return getCurrentPortraitRotation(lastRotation); } - mOrientationListener.setAllow180Rotation( + mOrientationListener.setAllow180Rotation(mAllowAllRotations || orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR); // case for nosensor meaning ignore sensor and consider only lid -- cgit v1.1