diff options
author | Dianne Hackborn <> | 2009-03-27 16:04:08 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 16:04:08 -0700 |
commit | 1e880dba106b14619c3eaf94c5dc2d1a943645bc (patch) | |
tree | ec31675d5556ce237bad813bc505ae88cbec9e58 /services | |
parent | c2d54f46ac13e029e6d53f7471cd9c90fe6bbfe9 (diff) | |
download | frameworks_base-1e880dba106b14619c3eaf94c5dc2d1a943645bc.zip frameworks_base-1e880dba106b14619c3eaf94c5dc2d1a943645bc.tar.gz frameworks_base-1e880dba106b14619c3eaf94c5dc2d1a943645bc.tar.bz2 |
AI 143169: am: CL 142870 Fix issue #1724917 (Applications (browser, maps, gmail) fail to retain their landscape state after coming out of sleep mode). We now rely on the listeners last known orientation, and make sure to clear it when enabling/disabling.
Also do most of the work for issue #1732012 (Only show screen rotation animation when triggered by sensor). This just needs to be hooked up to the surface flinger API when that appears.
Original author: hackbod
Merged from: //branches/cupcake/...
Automated import of CL 143169
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/WindowManagerService.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 19ab21d..48cbf99 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -2166,7 +2166,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo if (changed) { changed = setRotationUncheckedLocked( - WindowManagerPolicy.USE_LAST_ROTATION); + WindowManagerPolicy.USE_LAST_ROTATION, 1); if (changed) { if (freezeThisOneIfNeeded != null) { AppWindowToken wtoken = findAppWindowToken( @@ -3258,7 +3258,7 @@ 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); + setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0); } public void setInTouchMode(boolean mode) { @@ -3268,23 +3268,24 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo } public void setRotation(int rotation, - boolean alwaysSendConfiguration) { + boolean alwaysSendConfiguration, int animFlags) { if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION, - "setOrientation()")) { + "setRotation()")) { return; } - setRotationUnchecked(rotation, alwaysSendConfiguration); + setRotationUnchecked(rotation, alwaysSendConfiguration, animFlags); } - public void setRotationUnchecked(int rotation, boolean alwaysSendConfiguration) { + public void setRotationUnchecked(int rotation, + boolean alwaysSendConfiguration, int animFlags) { if(DEBUG_ORIENTATION) Log.v(TAG, "alwaysSendConfiguration set to "+alwaysSendConfiguration); long origId = Binder.clearCallingIdentity(); boolean changed; synchronized(mWindowMap) { - changed = setRotationUncheckedLocked(rotation); + changed = setRotationUncheckedLocked(rotation, animFlags); } if (changed) { @@ -3301,7 +3302,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo Binder.restoreCallingIdentity(origId); } - public boolean setRotationUncheckedLocked(int rotation) { + public boolean setRotationUncheckedLocked(int rotation, int animFlags) { boolean changed; if (rotation == WindowManagerPolicy.USE_LAST_ROTATION) { rotation = mRequestedRotation; @@ -3326,6 +3327,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo mH.sendMessageDelayed(mH.obtainMessage(H.WINDOW_FREEZE_TIMEOUT), 2000); startFreezingDisplayLocked(); + Log.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mQueue.setOrientation(rotation); if (mDisplayEnabled) { Surface.setOrientation(0, rotation); @@ -6976,7 +6978,6 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo public static final int REMOVE_STARTING = 6; public static final int FINISHED_STARTING = 7; public static final int REPORT_APPLICATION_TOKEN_WINDOWS = 8; - public static final int UPDATE_ORIENTATION = 10; public static final int WINDOW_FREEZE_TIMEOUT = 11; public static final int HOLD_SCREEN_CHANGED = 12; public static final int APP_TRANSITION_TIMEOUT = 13; @@ -7204,11 +7205,6 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdo } } break; - case UPDATE_ORIENTATION: { - setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false); - break; - } - case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Log.w(TAG, "Window freeze timeout expired."); |