Change method of tracking moving AppWindowTokens.

Stop trying to keep track of the AppTokens that have been moved
to the top and bottom and then try and match the WindowStates when
transitions are goodToGo. Instead rebuild the WindowState order based
on the AppToken order when we are goodToGo.

When moving AppWindowTokens lower in mAppTokens create a new ArrayList
of AppWindowTokens to keep track of the apps in Z order while
animating.

Fixes bug 6481078.

Change-Id: I29b33a507b45752f15feb10a9f4b47a3f5eb9f0e
This commit is contained in:
Craig Mautner
2012-05-15 23:01:47 -07:00
parent ae14715284
commit ef25d7a019
5 changed files with 146 additions and 105 deletions

View File

@@ -134,10 +134,11 @@ public class WindowAnimator {
}
private void updateWindowsAppsAndRotationAnimationsLocked() {
final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
int i;
final int NAT = mService.mAppTokens.size();
final int NAT = appTokens.size();
for (i=0; i<NAT; i++) {
final AppWindowAnimator appAnimator = mService.mAppTokens.get(i).mAppAnimator;
final AppWindowAnimator appAnimator = appTokens.get(i).mAppAnimator;
final boolean wasAnimating = appAnimator.animation != null
&& appAnimator.animation != AppWindowAnimator.sDummyAnimation;
if (appAnimator.stepAnimationLocked(mCurrentTime, mInnerDw, mInnerDh)) {
@@ -391,9 +392,10 @@ public class WindowAnimator {
private void testTokenMayBeDrawnLocked() {
// See if any windows have been drawn, so they (and others
// associated with them) can now be shown.
final int NT = mService.mAppTokens.size();
final ArrayList<AppWindowToken> appTokens = mService.mAnimatingAppTokens;
final int NT = appTokens.size();
for (int i=0; i<NT; i++) {
AppWindowToken wtoken = mService.mAppTokens.get(i);
AppWindowToken wtoken = appTokens.get(i);
if (wtoken.mAppAnimator.freezingScreen) {
int numInteresting = wtoken.numInterestingWindows;
if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) {

View File

@@ -351,12 +351,19 @@ public class WindowManagerService extends IWindowManager.Stub
final ArrayList<WindowToken> mExitingTokens = new ArrayList<WindowToken>();
/**
* Z-ordered (bottom-most first) list of all application tokens, for
* controlling the ordering of windows in different applications. This
* contains AppWindowToken objects.
* List controlling the ordering of windows in different applications which must
* be kept in sync with ActivityManager.
*/
final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>();
/**
* AppWindowTokens in the Z order they were in at the start of an animation. Between
* animations this list is maintained in the exact order of mAppTokens. If tokens
* are added to mAppTokens during an animation an attempt is made to insert them at the same
* logical location in this list. Note that this list is always in sync with mWindows.
*/
ArrayList<AppWindowToken> mAnimatingAppTokens = new ArrayList<AppWindowToken>();
/**
* Application tokens that are in the process of exiting, but still
* on screen for animations.
@@ -529,8 +536,6 @@ public class WindowManagerService extends IWindowManager.Stub
boolean mSkipAppTransitionAnimation = false;
final ArrayList<AppWindowToken> mOpeningApps = new ArrayList<AppWindowToken>();
final ArrayList<AppWindowToken> mClosingApps = new ArrayList<AppWindowToken>();
final ArrayList<AppWindowToken> mToTopApps = new ArrayList<AppWindowToken>();
final ArrayList<AppWindowToken> mToBottomApps = new ArrayList<AppWindowToken>();
Display mDisplay;
@@ -1008,10 +1013,10 @@ public class WindowManagerService extends IWindowManager.Stub
+ client.asBinder() + " (token=" + token + ")");
// Figure out where the window should go, based on the
// order of applications.
final int NA = mAppTokens.size();
final int NA = mAnimatingAppTokens.size();
WindowState pos = null;
for (i=NA-1; i>=0; i--) {
AppWindowToken t = mAppTokens.get(i);
AppWindowToken t = mAnimatingAppTokens.get(i);
if (t == token) {
i--;
break;
@@ -1044,7 +1049,7 @@ public class WindowManagerService extends IWindowManager.Stub
// Continue looking down until we find the first
// token that has windows.
while (i >= 0) {
AppWindowToken t = mAppTokens.get(i);
AppWindowToken t = mAnimatingAppTokens.get(i);
final int NW = t.windows.size();
if (NW > 0) {
pos = t.windows.get(NW-1);
@@ -1165,6 +1170,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
/** TODO(cmautner): Is this the same as {@link WindowState#canReceiveKeys()} */
static boolean canBeImeTarget(WindowState w) {
final int fl = w.mAttrs.flags
& (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM);
@@ -1869,7 +1875,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
wallpaper.mWinAnimator.mAnimLayer = wallpaper.mLayer + mWallpaperAnimLayerAdjustment;
if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "Wallpaper win "
if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "adjustWallpaper win "
+ wallpaper + " anim layer: " + wallpaper.mWinAnimator.mAnimLayer);
// First, if this window is at the current index, then all
@@ -1923,7 +1929,7 @@ public class WindowManagerService extends IWindowManager.Stub
curWallpaperIndex--;
WindowState wallpaper = token.windows.get(curWallpaperIndex);
wallpaper.mWinAnimator.mAnimLayer = wallpaper.mLayer + adj;
if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "Wallpaper win "
if (DEBUG_LAYERS || DEBUG_WALLPAPER) Slog.v(TAG, "setWallpaper win "
+ wallpaper + " anim layer: " + wallpaper.mWinAnimator.mAnimLayer);
}
}
@@ -3498,6 +3504,25 @@ public class WindowManagerService extends IWindowManager.Stub
Binder.restoreCallingIdentity(origId);
}
/**
* Find the location to insert a new AppWindowToken into the window-ordered app token list.
* Note that mAppTokens.size() == mAnimatingAppTokens.size() + 1.
* @param addPos The location the token was inserted into in mAppTokens.
* @param wtoken The token to insert.
*/
private void addAppTokenToAnimating(final int addPos, final AppWindowToken wtoken) {
if (addPos == 0 || addPos == mAnimatingAppTokens.size()) {
// It was inserted into the beginning or end of mAppTokens. Honor that.
mAnimatingAppTokens.add(addPos, wtoken);
return;
}
// Find the item immediately above the mAppTokens insertion point and put the token
// immediately below that one in mAnimatingAppTokens.
final AppWindowToken aboveAnchor = mAppTokens.get(addPos + 1);
mAnimatingAppTokens.add(mAnimatingAppTokens.indexOf(aboveAnchor), wtoken);
}
@Override
public void addAppToken(int addPos, IApplicationToken token,
int groupId, int requestedOrientation, boolean fullscreen) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
@@ -3532,6 +3557,7 @@ public class WindowManagerService extends IWindowManager.Stub
wtoken.requestedOrientation = requestedOrientation;
if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + wtoken);
mAppTokens.add(addPos, wtoken);
addAppTokenToAnimating(addPos, wtoken);
mTokenMap.put(token.asBinder(), wtoken);
// Application tokens start out hidden.
@@ -3849,7 +3875,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_APP_TRANSITIONS) Slog.v(
TAG, "Prepare app transition: transit=" + transit
+ " mNextAppTransition=" + mNextAppTransition
+ "\nCallers=" + Debug.getCallers(3));
+ " Callers=" + Debug.getCallers(3));
if (okToDisplay()) {
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
|| mNextAppTransition == WindowManagerPolicy.TRANSIT_NONE) {
@@ -4481,6 +4507,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"removeAppToken: " + wtoken);
mAppTokens.remove(wtoken);
mAnimatingAppTokens.remove(wtoken);
wtoken.removed = true;
if (wtoken.startingData != null) {
startingToken = wtoken;
@@ -4512,11 +4539,13 @@ public class WindowManagerService extends IWindowManager.Stub
private boolean tmpRemoveAppWindowsLocked(WindowToken token) {
final int NW = token.windows.size();
if (NW > 0) {
mWindowsChanged = true;
}
for (int i=0; i<NW; i++) {
WindowState win = token.windows.get(i);
if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Tmp removing app window " + win);
mWindows.remove(win);
mWindowsChanged = true;
int j = win.mChildWindows.size();
while (j > 0) {
j--;
@@ -4535,6 +4564,12 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
void dumpAnimatingAppTokensLocked() {
for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
Slog.v(TAG, " #" + i + ": " + mAnimatingAppTokens.get(i).token);
}
}
void dumpWindowsLocked() {
for (int i=mWindows.size()-1; i>=0; i--) {
Slog.v(TAG, " #" + i + ": " + mWindows.get(i));
@@ -4544,7 +4579,7 @@ public class WindowManagerService extends IWindowManager.Stub
private int findWindowOffsetLocked(int tokenPos) {
final int NW = mWindows.size();
if (tokenPos >= mAppTokens.size()) {
if (tokenPos >= mAnimatingAppTokens.size()) {
int i = NW;
while (i > 0) {
i--;
@@ -4558,7 +4593,7 @@ public class WindowManagerService extends IWindowManager.Stub
while (tokenPos > 0) {
// Find the first app token below the new position that has
// a window displayed.
final AppWindowToken wtoken = mAppTokens.get(tokenPos-1);
final AppWindowToken wtoken = mAnimatingAppTokens.get(tokenPos-1);
if (DEBUG_REORDER) Slog.v(TAG, "Looking for lower windows @ "
+ tokenPos + " -- " + wtoken.token);
if (wtoken.sendingToBottom) {
@@ -4646,9 +4681,16 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:");
if (DEBUG_REORDER) dumpAppTokensLocked();
final AppWindowToken wtoken = findAppWindowToken(token);
final int oldIndex = mAppTokens.indexOf(wtoken);
if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG,
"Start moving token " + wtoken + " initially at "
+ mAppTokens.indexOf(wtoken));
+ oldIndex);
if (oldIndex > index && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET
&& !mAppTransitionRunning) {
// animation towards back has not started, copy old list for duration of animation.
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
}
if (wtoken == null || !mAppTokens.remove(wtoken)) {
Slog.w(TAG, "Attempting to reorder token that doesn't exist: "
+ token + " (" + wtoken + ")");
@@ -4658,24 +4700,30 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":");
else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index);
if (DEBUG_REORDER) dumpAppTokensLocked();
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET && !mAppTransitionRunning) {
// Not animating, bring animating app list in line with mAppTokens.
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
final long origId = Binder.clearCallingIdentity();
if (DEBUG_REORDER) Slog.v(TAG, "Removing windows in " + token + ":");
if (DEBUG_REORDER) dumpWindowsLocked();
if (tmpRemoveAppWindowsLocked(wtoken)) {
if (DEBUG_REORDER) Slog.v(TAG, "Adding windows back in:");
// Bring window ordering, window focus and input window in line with new app token
final long origId = Binder.clearCallingIdentity();
if (DEBUG_REORDER) Slog.v(TAG, "Removing windows in " + token + ":");
if (DEBUG_REORDER) dumpWindowsLocked();
reAddAppWindowsLocked(findWindowOffsetLocked(index), wtoken);
if (DEBUG_REORDER) Slog.v(TAG, "Final window list:");
if (DEBUG_REORDER) dumpWindowsLocked();
updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
false /*updateInputWindows*/);
mLayoutNeeded = true;
mInputMonitor.setUpdateInputWindowsNeededLw();
performLayoutAndPlaceSurfacesLocked();
mInputMonitor.updateInputWindowsLw(false /*force*/);
if (tmpRemoveAppWindowsLocked(wtoken)) {
if (DEBUG_REORDER) Slog.v(TAG, "Adding windows back in:");
if (DEBUG_REORDER) dumpWindowsLocked();
reAddAppWindowsLocked(findWindowOffsetLocked(index), wtoken);
if (DEBUG_REORDER) Slog.v(TAG, "Final window list:");
if (DEBUG_REORDER) dumpWindowsLocked();
updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
false /*updateInputWindows*/);
mLayoutNeeded = true;
mInputMonitor.setUpdateInputWindowsNeededLw();
performLayoutAndPlaceSurfacesLocked();
mInputMonitor.updateInputWindowsLw(false /*force*/);
}
Binder.restoreCallingIdentity(origId);
}
Binder.restoreCallingIdentity(origId);
}
}
@@ -4716,7 +4764,9 @@ public class WindowManagerService extends IWindowManager.Stub
assignLayersLocked();
}
mLayoutNeeded = true;
performLayoutAndPlaceSurfacesLocked();
if (!mInLayout) {
performLayoutAndPlaceSurfacesLocked();
}
mInputMonitor.updateInputWindowsLw(false /*force*/);
}
}
@@ -4772,22 +4822,22 @@ public class WindowManagerService extends IWindowManager.Stub
"Adding next to top: " + wt);
mAppTokens.add(wt);
if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
mToTopApps.remove(wt);
mToBottomApps.remove(wt);
mToTopApps.add(wt);
wt.sendingToBottom = false;
wt.sendingToTop = true;
}
}
}
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET) {
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
&& !mAppTransitionRunning) {
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
moveAppWindowsLocked(tokens, mAppTokens.size());
}
}
Binder.restoreCallingIdentity(origId);
}
@Override
public void moveAppTokensToBottom(List<IBinder> tokens) {
if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS,
"moveAppTokensToBottom()")) {
@@ -4796,8 +4846,14 @@ public class WindowManagerService extends IWindowManager.Stub
final long origId = Binder.clearCallingIdentity();
synchronized(mWindowMap) {
removeAppTokensLocked(tokens);
final int N = tokens.size();
if (N > 0 && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET
&& !mAppTransitionRunning) {
// animating towards back, hang onto old list for duration of animation.
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
}
removeAppTokensLocked(tokens);
int pos = 0;
for (int i=0; i<N; i++) {
AppWindowToken wt = findAppWindowToken(tokens.get(i));
@@ -4806,17 +4862,16 @@ public class WindowManagerService extends IWindowManager.Stub
"Adding next to bottom: " + wt + " at " + pos);
mAppTokens.add(pos, wt);
if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
mToTopApps.remove(wt);
mToBottomApps.remove(wt);
mToBottomApps.add(i, wt);
wt.sendingToTop = false;
wt.sendingToBottom = true;
}
pos++;
}
}
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET) {
if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET
&& !mAppTransitionRunning) {
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
moveAppWindowsLocked(tokens, 0);
}
}
@@ -6996,6 +7051,8 @@ public class WindowManagerService extends IWindowManager.Stub
"*** APP TRANSITION TIMEOUT");
mAppTransitionReady = true;
mAppTransitionTimeout = true;
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
performLayoutAndPlaceSurfacesLocked();
}
}
@@ -7509,9 +7566,9 @@ public class WindowManagerService extends IWindowManager.Stub
}
// And add in the still active app tokens in Z order.
NT = mAppTokens.size();
NT = mAnimatingAppTokens.size();
for (int j=0; j<NT; j++) {
i = reAddAppWindowsLocked(i, mAppTokens.get(j));
i = reAddAppWindowsLocked(i, mAnimatingAppTokens.get(j));
}
i -= lastWallpaper;
@@ -7531,7 +7588,7 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
Slog.w(TAG, "Current app token list:");
dumpAppTokensLocked();
dumpAnimatingAppTokensLocked();
Slog.w(TAG, "Final window list:");
dumpWindowsLocked();
}
@@ -7600,7 +7657,8 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG) {
throw new RuntimeException("Recursive call!");
}
Slog.w(TAG, "performLayoutAndPlaceSurfacesLocked called while in layout");
Slog.w(TAG, "performLayoutAndPlaceSurfacesLocked called while in layout. Callers="
+ Debug.getCallers(3));
return;
}
@@ -7889,22 +7947,7 @@ public class WindowManagerService extends IWindowManager.Stub
mH.removeMessages(H.APP_TRANSITION_TIMEOUT);
// If there are applications waiting to come to the
// top of the stack, now is the time to move their windows.
// (Note that we don't do apps going to the bottom
// here -- we want to keep their windows in the old
// Z-order until the animation completes.)
if (mToTopApps.size() > 0) {
NN = mAppTokens.size();
for (i=0; i<NN; i++) {
AppWindowToken wtoken = mAppTokens.get(i);
if (wtoken.sendingToTop) {
wtoken.sendingToTop = false;
moveAppWindowsLocked(wtoken, NN, false);
}
}
mToTopApps.clear();
}
rebuildAppWindowListLocked();
// if wallpaper is animating in or out set oldWallpaper to null else to wallpaper
WindowState oldWallpaper =
@@ -8131,13 +8174,14 @@ public class WindowManagerService extends IWindowManager.Stub
int changes = 0;
mAppTransitionRunning = false;
// Clear information about apps that were moving.
mToBottomApps.clear();
// Restore window app tokens to the ActivityManager views
mAnimatingAppTokens.clear();
mAnimatingAppTokens.addAll(mAppTokens);
rebuildAppWindowListLocked();
changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT;
mInnerFields.mAdjResult |= ADJUST_WALLPAPER_LAYERS_CHANGED;
moveInputMethodWindowsIfNeededLocked(false);
moveInputMethodWindowsIfNeededLocked(true);
mInnerFields.mWallpaperMayChange = true;
// Since the window list has been rebuilt, focus might
// have to be recomputed since the actual order of windows
@@ -8218,7 +8262,7 @@ public class WindowManagerService extends IWindowManager.Stub
// to go through the process of getting informed
// by the application when it has finished drawing.
if (w.mOrientationChanging) {
if (DEBUG_ANIM || DEBUG_ORIENTATION) Slog.v(TAG,
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || DEBUG_ORIENTATION) Slog.v(TAG,
"Orientation start waiting for draw mDrawState=DRAW_PENDING in "
+ w + ", surface " + winAnimator.mSurface);
winAnimator.mDrawState = WindowStateAnimator.DRAW_PENDING;
@@ -8659,25 +8703,11 @@ public class WindowManagerService extends IWindowManager.Stub
if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG,
"performLayout: App token exiting now removed" + token);
mAppTokens.remove(token);
mAnimatingAppTokens.remove(token);
mExitingAppTokens.remove(i);
}
}
if (!mAnimator.mAnimating && mAppTransitionRunning) {
// We have finished the animation of an app transition. To do
// this, we have delayed a lot of operations like showing and
// hiding apps, moving apps in Z-order, etc. The app token list
// reflects the correct Z-order, but the window list may now
// be out of sync with it. So here we will just rebuild the
// entire app window list. Fun!
mAppTransitionRunning = false;
mLayoutNeeded = true;
rebuildAppWindowListLocked();
assignLayersLocked();
// Clear information about apps that were moving.
mToBottomApps.clear();
}
if (!mAnimator.mAnimating && mRelayoutWhileAnimating.size() > 0) {
for (int j=mRelayoutWhileAnimating.size()-1; j>=0; j--) {
try {
@@ -9006,7 +9036,7 @@ public class WindowManagerService extends IWindowManager.Stub
AppWindowToken thisApp = win.mAppToken;
// If this window's application has been removed, just skip it.
if (thisApp != null && thisApp.removed) {
if (thisApp != null && (thisApp.removed || thisApp.sendingToBottom)) {
continue;
}
@@ -9409,6 +9439,21 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
}
if (mAppTransitionRunning && mAnimatingAppTokens.size() > 0) {
pw.println();
pw.println(" Application tokens during animation:");
for (int i=mAnimatingAppTokens.size()-1; i>=0; i--) {
WindowToken token = mAnimatingAppTokens.get(i);
pw.print(" App moving to bottom #"); pw.print(i);
pw.print(' '); pw.print(token);
if (dumpAll) {
pw.println(':');
token.dump(pw, " ");
} else {
pw.println();
}
}
}
pw.println();
if (mOpeningApps.size() > 0) {
pw.print(" mOpeningApps="); pw.println(mOpeningApps);
@@ -9416,12 +9461,6 @@ public class WindowManagerService extends IWindowManager.Stub
if (mClosingApps.size() > 0) {
pw.print(" mClosingApps="); pw.println(mClosingApps);
}
if (mToTopApps.size() > 0) {
pw.print(" mToTopApps="); pw.println(mToTopApps);
}
if (mToBottomApps.size() > 0) {
pw.print(" mToBottomApps="); pw.println(mToBottomApps);
}
}
void dumpSessionsLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll) {

View File

@@ -842,7 +842,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
}
}
/** Returns true if this window desires key events. */
/** Returns true if this window desires key events.
* TODO(cmautner): Is this the same as {@link WindowManagerService#canBeImeTarget}
*/
public final boolean canReceiveKeys() {
return isVisibleOrAdding()
&& (mViewVisibility == View.VISIBLE)

View File

@@ -405,8 +405,8 @@ class WindowStateAnimator {
boolean finishDrawingLocked() {
if (mDrawState == DRAW_PENDING) {
if (DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION) Slog.v(
TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
Slog.v(TAG, "finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING " + this + " in "
+ mSurface);
mDrawState = COMMIT_DRAW_PENDING;
return true;
@@ -419,7 +419,7 @@ class WindowStateAnimator {
if (mDrawState != COMMIT_DRAW_PENDING) {
return false;
}
if (DEBUG_ANIM)
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM)
Slog.i(TAG, "commitFinishDrawingLocked: mDrawState=READY_TO_SHOW " + mSurface);
mDrawState = READY_TO_SHOW;
final boolean starting = mWin.mAttrs.type == TYPE_APPLICATION_STARTING;
@@ -506,7 +506,9 @@ class WindowStateAnimator {
@Override
public void setWindowCrop(Rect crop) {
super.setWindowCrop(crop);
mWindowCrop.set(crop);
if (crop != null) {
mWindowCrop.set(crop);
}
Slog.v(SURFACE_TAG, "setWindowCrop: " + this + ". Called by "
+ Debug.getCallers(3));
}
@@ -1247,7 +1249,8 @@ class WindowStateAnimator {
// Force the show in the next prepareSurfaceLocked() call.
mLastAlpha = -1;
if (DEBUG_ANIM) Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN");
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM)
Slog.v(TAG, "performShowLocked: mDrawState=HAS_DRAWN in " + this);
mDrawState = HAS_DRAWN;
mService.scheduleAnimationLocked();

View File

@@ -71,10 +71,6 @@ class WindowToken {
// windows will be put to the bottom of the list.
boolean sendingToBottom;
// Set to true when this token is in a pending transaction where its
// windows will be put to the top of the list.
boolean sendingToTop;
WindowToken(WindowManagerService _service, IBinder _token, int type, boolean _explicit) {
service = _service;
token = _token;
@@ -88,11 +84,10 @@ class WindowToken {
pw.print(prefix); pw.print("windowType="); pw.print(windowType);
pw.print(" hidden="); pw.print(hidden);
pw.print(" hasVisible="); pw.println(hasVisible);
if (waitingToShow || waitingToHide || sendingToBottom || sendingToTop) {
if (waitingToShow || waitingToHide || sendingToBottom) {
pw.print(prefix); pw.print("waitingToShow="); pw.print(waitingToShow);
pw.print(" waitingToHide="); pw.print(waitingToHide);
pw.print(" sendingToBottom="); pw.print(sendingToBottom);
pw.print(" sendingToTop="); pw.println(sendingToTop);
}
}