summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <>2009-03-27 16:16:03 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-27 16:16:03 -0700
commit321ae681cad03d00ad1efc6f06f74268e00172a9 (patch)
tree83553a788514830976a28765e0fc55eef5fe1f5e
parentcb93c5a1a39bb4feaa776393f0d4afb5bf6aae26 (diff)
downloadframeworks_base-321ae681cad03d00ad1efc6f06f74268e00172a9.zip
frameworks_base-321ae681cad03d00ad1efc6f06f74268e00172a9.tar.gz
frameworks_base-321ae681cad03d00ad1efc6f06f74268e00172a9.tar.bz2
AI 143173: am: CL 142879 Fix issue #1732012 (Only show screen rotation animation when triggered by sensor) -- set the new surface flag as appropriate.
Original author: hackbod Merged from: //branches/cupcake/... Automated import of CL 143173
-rw-r--r--services/java/com/android/server/WindowManagerService.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 48cbf99..2e16157 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -319,6 +319,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
int mRotation = 0;
int mRequestedRotation = 0;
int mForcedAppOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+ int mLastRotationFlags;
ArrayList<IRotationWatcher> mRotationWatchers
= new ArrayList<IRotationWatcher>();
@@ -2166,7 +2167,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
if (changed) {
changed = setRotationUncheckedLocked(
- WindowManagerPolicy.USE_LAST_ROTATION, 1);
+ WindowManagerPolicy.USE_LAST_ROTATION,
+ mLastRotationFlags & (~Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE));
if (changed) {
if (freezeThisOneIfNeeded != null) {
AppWindowToken wtoken = findAppWindowToken(
@@ -3258,7 +3260,8 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
mPolicy.enableScreenAfterBoot();
// 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) {
@@ -3308,6 +3311,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
rotation = mRequestedRotation;
} else {
mRequestedRotation = rotation;
+ mLastRotationFlags = animFlags;
}
if (DEBUG_ORIENTATION) Log.v(TAG, "Overwriting rotation value from " + rotation);
rotation = mPolicy.rotationForOrientationLw(mForcedAppOrientation,
@@ -3330,7 +3334,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo
Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags);
mQueue.setOrientation(rotation);
if (mDisplayEnabled) {
- Surface.setOrientation(0, rotation);
+ Surface.setOrientation(0, rotation, animFlags);
}
for (int i=mWindows.size()-1; i>=0; i--) {
WindowState w = (WindowState)mWindows.get(i);