Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +15 −6 Original line number Diff line number Diff line Loading @@ -2463,6 +2463,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { public int rotationForOrientationLw(int orientation, int lastRotation, boolean displayEnabled) { if (false) { Slog.v(TAG, "rotationForOrientationLw(orient=" + orientation + ", last=" + lastRotation + "); user=" + mUserRotation + " " + ((mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED) ? "USER_ROTATION_LOCKED" : "") ); } if (mPortraitRotation < 0) { // Initialize the rotation angles for each orientation once. Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) Loading Loading @@ -2581,15 +2590,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // User rotation: to be used when all else fails in assigning an orientation to the device public void setUserRotationMode(int mode, int rot) { ContentResolver res = mContext.getContentResolver(); mUserRotationMode = mode; // mUserRotationMode and mUserRotation will be assigned by the content observer if (mode == WindowManagerPolicy.USER_ROTATION_LOCKED) { mUserRotation = rot; Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, 0); Settings.System.putInt(res, Settings.System.USER_ROTATION, rot); Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, 0); } else { Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, Loading services/java/com/android/server/wm/WindowManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -4822,21 +4822,25 @@ public class WindowManagerService extends IWindowManager.Stub public void freezeRotation() { if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION, "setRotation()")) { "freezeRotation()")) { throw new SecurityException("Requires SET_ORIENTATION permission"); } if (DEBUG_ORIENTATION) Slog.v(TAG, "freezeRotation: mRotation=" + mRotation); mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_LOCKED, mRotation); setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); } public void thawRotation() { if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION, "setRotation()")) { "thawRotation()")) { throw new SecurityException("Requires SET_ORIENTATION permission"); } mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_FREE, 0); if (DEBUG_ORIENTATION) Slog.v(TAG, "thawRotation: mRotation=" + mRotation); mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_FREE, 777); // rot not used setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); } Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +15 −6 Original line number Diff line number Diff line Loading @@ -2463,6 +2463,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { public int rotationForOrientationLw(int orientation, int lastRotation, boolean displayEnabled) { if (false) { Slog.v(TAG, "rotationForOrientationLw(orient=" + orientation + ", last=" + lastRotation + "); user=" + mUserRotation + " " + ((mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED) ? "USER_ROTATION_LOCKED" : "") ); } if (mPortraitRotation < 0) { // Initialize the rotation angles for each orientation once. Display d = ((WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE)) Loading Loading @@ -2581,15 +2590,15 @@ public class PhoneWindowManager implements WindowManagerPolicy { // User rotation: to be used when all else fails in assigning an orientation to the device public void setUserRotationMode(int mode, int rot) { ContentResolver res = mContext.getContentResolver(); mUserRotationMode = mode; // mUserRotationMode and mUserRotation will be assigned by the content observer if (mode == WindowManagerPolicy.USER_ROTATION_LOCKED) { mUserRotation = rot; Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, 0); Settings.System.putInt(res, Settings.System.USER_ROTATION, rot); Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, 0); } else { Settings.System.putInt(res, Settings.System.ACCELEROMETER_ROTATION, Loading
services/java/com/android/server/wm/WindowManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -4822,21 +4822,25 @@ public class WindowManagerService extends IWindowManager.Stub public void freezeRotation() { if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION, "setRotation()")) { "freezeRotation()")) { throw new SecurityException("Requires SET_ORIENTATION permission"); } if (DEBUG_ORIENTATION) Slog.v(TAG, "freezeRotation: mRotation=" + mRotation); mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_LOCKED, mRotation); setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); } public void thawRotation() { if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION, "setRotation()")) { "thawRotation()")) { throw new SecurityException("Requires SET_ORIENTATION permission"); } mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_FREE, 0); if (DEBUG_ORIENTATION) Slog.v(TAG, "thawRotation: mRotation=" + mRotation); mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_FREE, 777); // rot not used setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); } Loading