summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Mautner <cmautner@google.com>2014-02-06 10:31:41 -0800
committerCraig Mautner <cmautner@google.com>2014-02-06 10:31:41 -0800
commitd1c2c5421181b988f09fd12d9633e2a7c2a8ab60 (patch)
treee5a1eb702b42a65d77bd57b59d0c64574f8abd88
parentb341a24b2adbb67cdc34ade0a19570ee37f0cb82 (diff)
downloadframeworks_base-d1c2c5421181b988f09fd12d9633e2a7c2a8ab60.zip
frameworks_base-d1c2c5421181b988f09fd12d9633e2a7c2a8ab60.tar.gz
frameworks_base-d1c2c5421181b988f09fd12d9633e2a7c2a8ab60.tar.bz2
Test for Configuration differences before changing.
Changing Configuration first and then testing for changes yields a result indicating no change. Fixes bug 12904769. Change-Id: If7e39e843f15b1143d9877497d595511afabd020
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java16
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java22
2 files changed, 18 insertions, 20 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index d7f3fa0..b76ec4b 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -9300,22 +9300,6 @@ public class WindowManagerService extends IWindowManager.Stub
// Don't remove this window until rotation has completed.
continue;
}
- final WindowStateAnimator winAnimator = win.mWinAnimator;
- if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG,
- "Reporting new frame to " + win + ": " + win.mCompatFrame);
- int diff = 0;
- boolean configChanged = win.isConfigChanged();
- if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION)
- && configChanged) {
- Slog.i(TAG, "Sending new config to window " + win + ": "
- + winAnimator.mSurfaceW + "x" + winAnimator.mSurfaceH
- + " / " + mCurConfiguration + " / 0x"
- + Integer.toHexString(diff));
- }
- win.setConfiguration(mCurConfiguration);
- if (DEBUG_ORIENTATION &&
- winAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING) Slog.i(
- TAG, "Resizing " + win + " WITH DRAW PENDING");
win.reportResized();
mResizingWindows.remove(i);
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 2f778b1..a8e45c4 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -16,8 +16,11 @@
package com.android.server.wm;
-import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY;
+import static com.android.server.wm.WindowManagerService.DEBUG_CONFIGURATION;
import static com.android.server.wm.WindowManagerService.DEBUG_LAYOUT;
+import static com.android.server.wm.WindowManagerService.DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerService.DEBUG_RESIZE;
+import static com.android.server.wm.WindowManagerService.DEBUG_VISIBILITY;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;
@@ -1310,13 +1313,24 @@ final class WindowState implements WindowManagerPolicy.WindowState {
void reportResized() {
try {
+ if (DEBUG_RESIZE || DEBUG_ORIENTATION) Slog.v(TAG, "Reporting new frame to " + this
+ + ": " + mCompatFrame);
+ boolean configChanged = isConfigChanged();
+ if ((DEBUG_RESIZE || DEBUG_ORIENTATION || DEBUG_CONFIGURATION) && configChanged) {
+ Slog.i(TAG, "Sending new config to window " + this + ": "
+ + mWinAnimator.mSurfaceW + "x" + mWinAnimator.mSurfaceH
+ + " / " + mService.mCurConfiguration);
+ }
+ setConfiguration(mService.mCurConfiguration);
+ if (DEBUG_ORIENTATION && mWinAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING)
+ Slog.i(TAG, "Resizing " + this + " WITH DRAW PENDING");
+
final Rect frame = mFrame;
final Rect overscanInsets = mLastOverscanInsets;
final Rect contentInsets = mLastContentInsets;
final Rect visibleInsets = mLastVisibleInsets;
- final boolean reportDraw
- = mWinAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING;
- final Configuration newConfig = isConfigChanged() ? mConfiguration : null;
+ final boolean reportDraw = mWinAnimator.mDrawState == WindowStateAnimator.DRAW_PENDING;
+ final Configuration newConfig = configChanged ? mConfiguration : null;
if (mClient instanceof IWindow.Stub) {
// To prevent deadlock simulate one-way call if win.mClient is a local object.
mService.mH.post(new Runnable() {