summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/wm/WindowState.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-06-07 14:09:47 -0700
committerDianne Hackborn <hackbod@google.com>2011-06-08 18:45:43 -0700
commit5fd2169eabd77e6bfafaf456e58051a3bafb2bca (patch)
tree77048c3540c64cad77e5c140b6477a321190c586 /services/java/com/android/server/wm/WindowState.java
parent4381f6421ca408d1dc66430ddfb107c5011bfe25 (diff)
downloadframeworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.zip
frameworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.tar.gz
frameworks_base-5fd2169eabd77e6bfafaf456e58051a3bafb2bca.tar.bz2
Work on issue #4518815: Compatibility mode introduces compatibility regression...
...for Market App iRunner There were a lot of serious issues with how we updated (or often didn't update) the display and resource state when switching compatibility mode in conjunction with restarting and updating application components. This addresses everything I could find. Unfortunately it does *not* fix this particular app. I am starting to think this is just an issue in the app. This change does fix a number of other problems I could repro, such as switching the compatibility mode of an IME. Also a few changes here and there to get rid of $#*&^!! debug logs. Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
Diffstat (limited to 'services/java/com/android/server/wm/WindowState.java')
-rw-r--r--services/java/com/android/server/wm/WindowState.java41
1 files changed, 23 insertions, 18 deletions
diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java
index 144341b..587685e 100644
--- a/services/java/com/android/server/wm/WindowState.java
+++ b/services/java/com/android/server/wm/WindowState.java
@@ -54,6 +54,10 @@ import java.util.ArrayList;
* A window in the window manager.
*/
final class WindowState implements WindowManagerPolicy.WindowState {
+ static final boolean DEBUG_VISIBILITY = WindowManagerService.DEBUG_VISIBILITY;
+ static final boolean SHOW_TRANSACTIONS = WindowManagerService.SHOW_TRANSACTIONS;
+ static final boolean SHOW_SURFACE_ALLOC = WindowManagerService.SHOW_SURFACE_ALLOC;
+
final WindowManagerService mService;
final Session mSession;
final IWindow mClient;
@@ -71,7 +75,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
final boolean mIsImWindow;
final boolean mIsWallpaper;
final boolean mIsFloatingLayer;
- final boolean mEnforceSizeCompat;
+ boolean mEnforceSizeCompat;
int mViewVisibility;
boolean mPolicyVisibility = true;
boolean mPolicyVisibilityAfterAnim = true;
@@ -600,7 +604,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
if ((mAttrs.flags&WindowManager.LayoutParams.FLAG_SECURE) != 0) {
flags |= Surface.SECURE;
}
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(
+ if (DEBUG_VISIBILITY) Slog.v(
WindowManagerService.TAG, "Creating surface in session "
+ mSession.mSurfaceSession + " window " + this
+ " w=" + mCompatFrame.width()
@@ -639,7 +643,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mSession.mSurfaceSession, mSession.mPid,
mAttrs.getTitle().toString(),
0, w, h, format, flags);
- if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, " CREATE SURFACE "
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) Slog.i(WindowManagerService.TAG,
+ " CREATE SURFACE "
+ mSurface + " IN SESSION "
+ mSession.mSurfaceSession
+ ": pid=" + mSession.mPid + " format="
@@ -659,7 +664,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
WindowManagerService.TAG, "Got surface: " + mSurface
+ ", set left=" + mFrame.left + " top=" + mFrame.top
+ ", animLayer=" + mAnimLayer);
- if (WindowManagerService.SHOW_TRANSACTIONS) {
+ if (SHOW_TRANSACTIONS) {
Slog.i(WindowManagerService.TAG, ">>> OPEN TRANSACTION createSurfaceLocked");
WindowManagerService.logSurface(this, "CREATE pos=(" + mFrame.left
+ "," + mFrame.top + ") (" +
@@ -677,7 +682,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mSurfaceShown = false;
mSurface.hide();
if ((mAttrs.flags&WindowManager.LayoutParams.FLAG_DITHER) != 0) {
- if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(this, "DITHER", null);
+ if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(this, "DITHER", null);
mSurface.setFlags(Surface.SURFACE_DITHER,
Surface.SURFACE_DITHER);
}
@@ -688,7 +693,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mLastHidden = true;
} finally {
Surface.closeTransaction();
- if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION createSurfaceLocked");
+ if (SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, "<<< CLOSE TRANSACTION createSurfaceLocked");
}
if (WindowManagerService.localLOGV) Slog.v(
WindowManagerService.TAG, "Created surface " + this);
@@ -725,7 +730,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
try {
- if (WindowManagerService.DEBUG_VISIBILITY) {
+ if (DEBUG_VISIBILITY) {
RuntimeException e = null;
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
e = new RuntimeException();
@@ -734,13 +739,13 @@ final class WindowState implements WindowManagerPolicy.WindowState {
Slog.w(WindowManagerService.TAG, "Window " + this + " destroying surface "
+ mSurface + ", session " + mSession, e);
}
- if (WindowManagerService.SHOW_TRANSACTIONS) {
+ if (SHOW_TRANSACTIONS || SHOW_SURFACE_ALLOC) {
RuntimeException e = null;
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
e = new RuntimeException();
e.fillInStackTrace();
}
- if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(this, "DESTROY", e);
+ WindowManagerService.logSurface(this, "DESTROY", e);
}
mSurface.destroy();
} catch (RuntimeException e) {
@@ -756,7 +761,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
boolean finishDrawingLocked() {
if (mDrawPending) {
- if (WindowManagerService.SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v(
+ if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) Slog.v(
WindowManagerService.TAG, "finishDrawingLocked: " + mSurface);
mCommitDrawPending = true;
mDrawPending = false;
@@ -783,7 +788,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// This must be called while inside a transaction.
boolean performShowLocked() {
- if (WindowManagerService.DEBUG_VISIBILITY) {
+ if (DEBUG_VISIBILITY) {
RuntimeException e = null;
if (!WindowManagerService.HIDE_STACK_CRAWLS) {
e = new RuntimeException();
@@ -794,9 +799,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
+ " starting=" + (mAttrs.type == TYPE_APPLICATION_STARTING), e);
}
if (mReadyToShow && isReadyForDisplay()) {
- if (WindowManagerService.SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) WindowManagerService.logSurface(this,
+ if (SHOW_TRANSACTIONS || WindowManagerService.DEBUG_ORIENTATION) WindowManagerService.logSurface(this,
"SHOW (performShowLocked)", null);
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Showing " + this
+ if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Showing " + this
+ " during animation: policyVis=" + mPolicyVisibility
+ " attHidden=" + mAttachedHidden
+ " tok.hiddenRequested="
@@ -958,7 +963,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mHasTransformation = false;
mHasLocalTransformation = false;
if (mPolicyVisibility != mPolicyVisibilityAfterAnim) {
- if (WindowManagerService.DEBUG_VISIBILITY) {
+ if (DEBUG_VISIBILITY) {
Slog.v(WindowManagerService.TAG, "Policy visibility changing after anim in " + this + ": "
+ mPolicyVisibilityAfterAnim);
}
@@ -1020,7 +1025,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
if (mSurface != null) {
mService.mDestroySurface.add(this);
mDestroying = true;
- if (WindowManagerService.SHOW_TRANSACTIONS) WindowManagerService.logSurface(this, "HIDE (finishExit)", null);
+ if (SHOW_TRANSACTIONS) WindowManagerService.logSurface(this, "HIDE (finishExit)", null);
mSurfaceShown = false;
try {
mSurface.hide();
@@ -1414,9 +1419,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
if (mPolicyVisibility && mPolicyVisibilityAfterAnim) {
return false;
}
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility true: " + this);
+ if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility true: " + this);
if (doAnimation) {
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
+ if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "doAnimation: mPolicyVisibility="
+ mPolicyVisibility + " mAnimation=" + mAnimation);
if (mService.mDisplayFrozen || !mService.mPolicy.isScreenOn()) {
doAnimation = false;
@@ -1462,7 +1467,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
if (doAnimation) {
mPolicyVisibilityAfterAnim = false;
} else {
- if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility false: " + this);
+ if (DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "Policy visibility false: " + this);
mPolicyVisibilityAfterAnim = false;
mPolicyVisibility = false;
// Window is no longer visible -- make sure if we were waiting