Loading services/java/com/android/server/WindowManagerService.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -319,6 +319,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo int mRotation = 0; int mRotation = 0; int mRequestedRotation = 0; int mRequestedRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mLastRotationFlags; ArrayList<IRotationWatcher> mRotationWatchers ArrayList<IRotationWatcher> mRotationWatchers = new ArrayList<IRotationWatcher>(); = new ArrayList<IRotationWatcher>(); Loading Loading @@ -2166,7 +2167,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo if (changed) { if (changed) { changed = setRotationUncheckedLocked( changed = setRotationUncheckedLocked( WindowManagerPolicy.USE_LAST_ROTATION, 1); WindowManagerPolicy.USE_LAST_ROTATION, mLastRotationFlags & (~Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE)); if (changed) { if (changed) { if (freezeThisOneIfNeeded != null) { if (freezeThisOneIfNeeded != null) { AppWindowToken wtoken = findAppWindowToken( AppWindowToken wtoken = findAppWindowToken( Loading Loading @@ -3258,7 +3260,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo mPolicy.enableScreenAfterBoot(); mPolicy.enableScreenAfterBoot(); // Make sure the last requested orientation has been applied. // Make sure the last requested orientation has been applied. setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE); } } public void setInTouchMode(boolean mode) { public void setInTouchMode(boolean mode) { Loading Loading @@ -3308,6 +3311,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo rotation = mRequestedRotation; rotation = mRequestedRotation; } else { } else { mRequestedRotation = rotation; mRequestedRotation = rotation; mLastRotationFlags = animFlags; } } if (DEBUG_ORIENTATION) Log.v(TAG, "Overwriting rotation value from " + rotation); if (DEBUG_ORIENTATION) Log.v(TAG, "Overwriting rotation value from " + rotation); rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation, rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation, Loading @@ -3330,7 +3334,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mQueue.setOrientation(rotation); mQueue.setOrientation(rotation); if (mDisplayEnabled) { if (mDisplayEnabled) { Surface.setOrientation(0, rotation); Surface.setOrientation(0, rotation, animFlags); } } for (int i=mWindows.size()-1; i>=0; i--) { for (int i=mWindows.size()-1; i>=0; i--) { WindowState w = (WindowState)mWindows.get(i); WindowState w = (WindowState)mWindows.get(i); Loading Loading
services/java/com/android/server/WindowManagerService.java +7 −3 Original line number Original line Diff line number Diff line Loading @@ -319,6 +319,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo int mRotation = 0; int mRotation = 0; int mRequestedRotation = 0; int mRequestedRotation = 0; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mLastRotationFlags; ArrayList<IRotationWatcher> mRotationWatchers ArrayList<IRotationWatcher> mRotationWatchers = new ArrayList<IRotationWatcher>(); = new ArrayList<IRotationWatcher>(); Loading Loading @@ -2166,7 +2167,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo if (changed) { if (changed) { changed = setRotationUncheckedLocked( changed = setRotationUncheckedLocked( WindowManagerPolicy.USE_LAST_ROTATION, 1); WindowManagerPolicy.USE_LAST_ROTATION, mLastRotationFlags & (~Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE)); if (changed) { if (changed) { if (freezeThisOneIfNeeded != null) { if (freezeThisOneIfNeeded != null) { AppWindowToken wtoken = findAppWindowToken( AppWindowToken wtoken = findAppWindowToken( Loading Loading @@ -3258,7 +3260,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo mPolicy.enableScreenAfterBoot(); mPolicy.enableScreenAfterBoot(); // Make sure the last requested orientation has been applied. // Make sure the last requested orientation has been applied. setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE); } } public void setInTouchMode(boolean mode) { public void setInTouchMode(boolean mode) { Loading Loading @@ -3308,6 +3311,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo rotation = mRequestedRotation; rotation = mRequestedRotation; } else { } else { mRequestedRotation = rotation; mRequestedRotation = rotation; mLastRotationFlags = animFlags; } } if (DEBUG_ORIENTATION) Log.v(TAG, "Overwriting rotation value from " + rotation); if (DEBUG_ORIENTATION) Log.v(TAG, "Overwriting rotation value from " + rotation); rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation, rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation, Loading @@ -3330,7 +3334,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mQueue.setOrientation(rotation); mQueue.setOrientation(rotation); if (mDisplayEnabled) { if (mDisplayEnabled) { Surface.setOrientation(0, rotation); Surface.setOrientation(0, rotation, animFlags); } } for (int i=mWindows.size()-1; i>=0; i--) { for (int i=mWindows.size()-1; i>=0; i--) { WindowState w = (WindowState)mWindows.get(i); WindowState w = (WindowState)mWindows.get(i); Loading