diff options
author | Craig Mautner <cmautner@google.com> | 2012-11-27 16:23:15 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-27 16:23:15 -0800 |
commit | ae336a08ddc402372e3ba16dfaf50cfb837cf74d (patch) | |
tree | 78e65487f0806f6a9f42c34fe2b35d6cdc7d9ebb | |
parent | 0af622c1970973756aed5345f7f6fb30b8e49aa3 (diff) | |
parent | 067a7ac494c8a248840b9a7a46f22a0efff9e52f (diff) | |
download | frameworks_base-ae336a08ddc402372e3ba16dfaf50cfb837cf74d.zip frameworks_base-ae336a08ddc402372e3ba16dfaf50cfb837cf74d.tar.gz frameworks_base-ae336a08ddc402372e3ba16dfaf50cfb837cf74d.tar.bz2 |
am 067a7ac4: am 9e98927e: Merge "Retain configuration change info and sync access." into jb-mr1.1-dev
* commit '067a7ac494c8a248840b9a7a46f22a0efff9e52f':
Retain configuration change info and sync access.
3 files changed, 28 insertions, 8 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 51edb44..c3fc19c 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -2848,7 +2848,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (win.isConfigChanged()) { if (DEBUG_CONFIGURATION) Slog.i(TAG, "Window " + win - + " visible with new config: " + win.mConfiguration); + + " visible with new config: " + mCurConfiguration); outConfig.setTo(mCurConfiguration); } } @@ -3808,22 +3808,23 @@ public class WindowManagerService extends IWindowManager.Stub final WindowList windows = getDefaultWindowListLocked(); int pos = windows.size() - 1; while (pos >= 0) { - WindowState wtoken = windows.get(pos); + WindowState win = windows.get(pos); pos--; - if (wtoken.mAppToken != null) { + if (win.mAppToken != null) { // We hit an application window. so the orientation will be determined by the // app window. No point in continuing further. return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } - if (!wtoken.isVisibleLw() || !wtoken.mPolicyVisibilityAfterAnim) { + if (!win.isVisibleLw() || !win.mPolicyVisibilityAfterAnim) { continue; } - int req = wtoken.mAttrs.screenOrientation; + int req = win.mAttrs.screenOrientation; if((req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) || (req == ActivityInfo.SCREEN_ORIENTATION_BEHIND)){ continue; } + if (DEBUG_ORIENTATION) Slog.v(TAG, win + " forcing orientation to " + req); return (mLastWindowForcedOrientation=req); } return (mLastWindowForcedOrientation=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); @@ -9407,7 +9408,7 @@ public class WindowManagerService extends IWindowManager.Stub + " / " + mCurConfiguration + " / 0x" + Integer.toHexString(diff)); } - win.mConfiguration = mCurConfiguration; + win.setConfiguration(mCurConfiguration); if (DEBUG_ORIENTATION && winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i( TAG, "Resizing " + win + " WITH DRAW PENDING"); diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index 35bebbe..3dce939 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -21,6 +21,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW; import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; +import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import com.android.server.input.InputWindowHandle; @@ -112,6 +113,9 @@ final class WindowState implements WindowManagerPolicy.WindowState { int mLayoutSeq = -1; Configuration mConfiguration = null; + // Sticky answer to isConfigChanged(), remains true until new Configuration is assigned. + // Used only on {@link #TYPE_KEYGUARD}. + private boolean mConfigHasChanged; /** * Actual frame shown on-screen (may be modified by animation). These @@ -627,6 +631,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { : WindowManagerService.DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS; } + @Override public boolean hasAppShownWindows() { return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed); } @@ -857,9 +862,17 @@ final class WindowState implements WindowManagerPolicy.WindowState { } boolean isConfigChanged() { - return mConfiguration != mService.mCurConfiguration + boolean configChanged = mConfiguration != mService.mCurConfiguration && (mConfiguration == null || (mConfiguration.diff(mService.mCurConfiguration) != 0)); + + if (mAttrs.type == TYPE_KEYGUARD) { + // Retain configuration changed status until resetConfiguration called. + mConfigHasChanged |= configChanged; + configChanged = mConfigHasChanged; + } + + return configChanged; } boolean isConfigDiff(int mask) { @@ -886,6 +899,11 @@ final class WindowState implements WindowManagerPolicy.WindowState { } } + void setConfiguration(final Configuration newConfig) { + mConfiguration = newConfig; + mConfigHasChanged = false; + } + void setInputChannel(InputChannel inputChannel) { if (mInputChannel != null) { throw new IllegalStateException("Window already has an input channel."); @@ -907,6 +925,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { } private class DeathRecipient implements IBinder.DeathRecipient { + @Override public void binderDied() { try { synchronized(mService.mWindowMap) { diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java index 7b30c89..e33b7b7 100644 --- a/services/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/java/com/android/server/wm/WindowStateAnimator.java @@ -803,7 +803,7 @@ class WindowStateAnimator { mSurfaceShown = false; mSurface = null; - mWin.mHasSurface =false; + mWin.mHasSurface = false; mDrawState = NO_SURFACE; } } |