diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-06-07 17:18:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-06-07 17:18:16 -0700 |
commit | aefc94f19acc29ae9b6abc32dcdbb2ff453984cb (patch) | |
tree | de3da56c1f781b6e713f553d1535637c64f6112d /services | |
parent | f18e311ee5d35db0cae96f0b216a88e5b42604dc (diff) | |
parent | 4bd505883df3d8ca7583d854f1c71302c615519d (diff) | |
download | frameworks_base-aefc94f19acc29ae9b6abc32dcdbb2ff453984cb.zip frameworks_base-aefc94f19acc29ae9b6abc32dcdbb2ff453984cb.tar.gz frameworks_base-aefc94f19acc29ae9b6abc32dcdbb2ff453984cb.tar.bz2 |
am 4bd50588: am fc3fa5dc: am 1b405592: Merge "Fix issue #4539687: At least one compatibility-mode app (Androminion)..." into honeycomb-mr2
* commit '4bd505883df3d8ca7583d854f1c71302c615519d':
Fix issue #4539687: At least one compatibility-mode app (Androminion)...
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 1 | ||||
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 43 |
2 files changed, 30 insertions, 14 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index c2a8a1d..da9f1d6 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -92,7 +92,6 @@ import android.os.FileObserver; import android.os.FileUtils; import android.os.Handler; import android.os.IBinder; -import android.os.IInterface; import android.os.IPermissionController; import android.os.Looper; import android.os.Message; diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index d95d4c5..819c16e 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -153,6 +153,7 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_WINDOW_MOVEMENT = false; static final boolean DEBUG_TOKEN_MOVEMENT = false; static final boolean DEBUG_ORIENTATION = false; + static final boolean DEBUG_APP_ORIENTATION = false; static final boolean DEBUG_CONFIGURATION = false; static final boolean DEBUG_APP_TRANSITIONS = false; static final boolean DEBUG_STARTING_WINDOW = false; @@ -427,6 +428,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean mWindowsFreezingScreen = false; long mFreezeGcPending = 0; int mAppsFreezingScreen = 0; + int mLastWindowForcedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; int mLayoutSeq = 0; @@ -3187,6 +3189,15 @@ public class WindowManagerService extends IWindowManager.Stub } public int getOrientationFromWindowsLocked() { + if (mDisplayFrozen || mOpeningApps.size() > 0 || mClosingApps.size() > 0) { + // If the display is frozen, some activities may be in the middle + // of restarting, and thus have removed their old window. If the + // window has the flag to hide the lock screen, then the lock screen + // can re-appear and inflict its own orientation on us. Keep the + // orientation stable until this all settles down. + return mLastWindowForcedOrientation; + } + int pos = mWindows.size() - 1; while (pos >= 0) { WindowState wtoken = mWindows.get(pos); @@ -3194,7 +3205,7 @@ public class WindowManagerService extends IWindowManager.Stub if (wtoken.mAppToken != null) { // We hit an application window. so the orientation will be determined by the // app window. No point in continuing further. - return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; + return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } if (!wtoken.isVisibleLw() || !wtoken.mPolicyVisibilityAfterAnim) { continue; @@ -3204,10 +3215,10 @@ public class WindowManagerService extends IWindowManager.Stub (req == ActivityInfo.SCREEN_ORIENTATION_BEHIND)){ continue; } else { - return req; + return (mLastWindowForcedOrientation=req); } } - return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; + return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } public int getOrientationFromAppTokensLocked() { @@ -3220,16 +3231,23 @@ public class WindowManagerService extends IWindowManager.Stub while (pos >= 0) { AppWindowToken wtoken = mAppTokens.get(pos); pos--; + + if (DEBUG_APP_ORIENTATION) Slog.v(TAG, "Checking app orientation: " + wtoken); + // if we're about to tear down this window and not seek for // the behind activity, don't use it for orientation if (!findingBehind && (!wtoken.hidden && wtoken.hiddenRequested)) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken + + " -- going to hide"); continue; } if (!haveGroup) { // We ignore any hidden applications on the top. if (wtoken.hiddenRequested || wtoken.willBeHidden) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Skipping " + wtoken + + " -- hidden on top"); continue; } haveGroup = true; @@ -3243,6 +3261,8 @@ public class WindowManagerService extends IWindowManager.Stub // user's orientation. if (lastOrientation != ActivityInfo.SCREEN_ORIENTATION_BEHIND && lastFullscreen) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken + + " -- end of group, return " + lastOrientation); return lastOrientation; } } @@ -3253,16 +3273,21 @@ public class WindowManagerService extends IWindowManager.Stub lastFullscreen = wtoken.appFullscreen; if (lastFullscreen && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken + + " -- full screen, return " + or); return or; } // If this application has requested an explicit orientation, // then use it. if (or != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED && or != ActivityInfo.SCREEN_ORIENTATION_BEHIND) { + if (DEBUG_ORIENTATION) Slog.v(TAG, "Done at " + wtoken + + " -- explicitly set, return " + or); return or; } findingBehind |= (or == ActivityInfo.SCREEN_ORIENTATION_BEHIND); } + if (DEBUG_ORIENTATION) Slog.v(TAG, "No app is requesting an orientation"); return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; } @@ -3335,15 +3360,6 @@ public class WindowManagerService extends IWindowManager.Stub * android.os.IBinder) */ boolean updateOrientationFromAppTokensLocked(boolean inTransaction) { - if (mDisplayFrozen || mOpeningApps.size() > 0 || mClosingApps.size() > 0) { - // If the display is frozen, some activities may be in the middle - // of restarting, and thus have removed their old window. If the - // window has the flag to hide the lock screen, then the lock screen - // can re-appear and inflict its own orientation on us. Keep the - // orientation stable until this all settles down. - return false; - } - boolean changed = false; long ident = Binder.clearCallingIdentity(); try { @@ -8939,9 +8955,10 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(" mAppsFreezingScreen="); pw.print(mAppsFreezingScreen); pw.print(" mWaitingForConfig="); pw.println(mWaitingForConfig); pw.print(" mRotation="); pw.print(mRotation); - pw.print(" mForcedAppOrientation="); pw.print(mForcedAppOrientation); pw.print(" mRequestedRotation="); pw.print(mRequestedRotation); pw.print(" mAltOrientation="); pw.println(mAltOrientation); + pw.print(" mLastWindowForcedOrientation"); pw.print(mLastWindowForcedOrientation); + pw.print(" mForcedAppOrientation="); pw.println(mForcedAppOrientation); pw.print(" mDeferredRotation="); pw.print(mDeferredRotation); pw.print(", mDeferredRotationAnimFlags="); pw.println(mDeferredRotationAnimFlags); pw.print(" mAnimationPending="); pw.print(mAnimationPending); |