Loading services/java/com/android/server/wm/AppWindowAnimator.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -58,9 +58,9 @@ public class AppWindowAnimator { } } public void setAnimation(Animation anim, int width, int height) { public void setAnimation(Animation anim, int width, int height) { if (WindowManagerService.localLOGV) Slog.v( if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting animation in " + mAppToken TAG, "Setting animation in " + mAppToken + ": " + anim + ": " + anim + " wxh=" + width + "x" + height + " wxh=" + width + "x" + height); + " isVisible=" + mAppToken.isVisible()); animation = anim; animation = anim; animating = false; animating = false; if (!anim.isInitialized()) { if (!anim.isInitialized()) { Loading @@ -82,16 +82,17 @@ public class AppWindowAnimator { } } // Start out animation gone if window is gone, or visible if window is visible. // Start out animation gone if window is gone, or visible if window is visible. transformation.clear(); transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); transformation.setAlpha(mAppToken.isVisible() ? 1 : 0); hasTransformation = true; hasTransformation = true; } } public void setDummyAnimation() { public void setDummyAnimation() { if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken); if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken + " isVisible=" + mAppToken.isVisible()); animation = sDummyAnimation; animation = sDummyAnimation; hasTransformation = true; hasTransformation = true; transformation.clear(); transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); transformation.setAlpha(mAppToken.isVisible() ? 1 : 0); } } public void clearAnimation() { public void clearAnimation() { Loading services/java/com/android/server/wm/AppWindowToken.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -223,6 +223,22 @@ class AppWindowToken extends WindowToken { return null; return null; } } boolean isVisible() { final int N = allAppWindows.size(); // TODO: Consider using allDrawn instead of a single window. for (int i=0; i<N; i++) { WindowState win = allAppWindows.get(i); if (!win.mAppFreezing && (win.mViewVisibility == View.VISIBLE || (win.mWinAnimator.isAnimating() && !service.mAppTransition.isTransitionSet())) && !win.mDestroying && win.isDrawnLw()) { return true; } } return false; } @Override @Override void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { super.dump(pw, prefix); super.dump(pw, prefix); Loading services/java/com/android/server/wm/WindowManagerService.java +9 −15 Original line number Original line Diff line number Diff line Loading @@ -4476,8 +4476,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, "Start moving token " + wtoken + " initially at " "Start moving token " + wtoken + " initially at " + oldIndex); + oldIndex); if (oldIndex > index && mAppTransition.isTransitionSet() if (oldIndex > index && mAppTransition.isTransitionSet()) { && !mAppTransition.isRunning()) { // animation towards back has not started, copy old list for duration of animation. // animation towards back has not started, copy old list for duration of animation. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading @@ -4491,7 +4490,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); if (DEBUG_REORDER) dumpAppTokensLocked(); if (DEBUG_REORDER) dumpAppTokensLocked(); if (!mAppTransition.isTransitionSet() && !mAppTransition.isRunning()) { if (!mAppTransition.isTransitionSet()) { // Not animating, bring animating app list in line with mAppTokens. // Not animating, bring animating app list in line with mAppTokens. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading Loading @@ -4612,12 +4611,10 @@ public class WindowManagerService extends IWindowManager.Stub } } } } if (!mAppTransition.isRunning()) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, mAppTokens.size()); moveAppWindowsLocked(tokens, mAppTokens.size()); } } } Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } Loading @@ -4631,7 +4628,7 @@ public class WindowManagerService extends IWindowManager.Stub final long origId = Binder.clearCallingIdentity(); final long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { synchronized(mWindowMap) { final int N = tokens.size(); final int N = tokens.size(); if (N > 0 && !mAppTransition.isRunning()) { if (N > 0) { // animating towards back, hang onto old list for duration of animation. // animating towards back, hang onto old list for duration of animation. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading @@ -4651,12 +4648,10 @@ public class WindowManagerService extends IWindowManager.Stub } } } } if (!mAppTransition.isRunning()) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, 0); moveAppWindowsLocked(tokens, 0); } } } Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } Loading Loading @@ -7949,7 +7944,6 @@ public class WindowManagerService extends IWindowManager.Stub final AppWindowAnimator appAnimator = wtoken.mAppAnimator; final AppWindowAnimator appAnimator = wtoken.mAppAnimator; if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken); if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken); appAnimator.clearThumbnail(); appAnimator.clearThumbnail(); wtoken.reportedVisible = false; wtoken.inPendingTransaction = false; wtoken.inPendingTransaction = false; appAnimator.animation = null; appAnimator.animation = null; setTokenVisibilityLocked(wtoken, animLp, true, transit, false); setTokenVisibilityLocked(wtoken, animLp, true, transit, false); Loading services/java/com/android/server/wm/WindowStateAnimator.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1223,7 +1223,7 @@ class WindowStateAnimator { if (mIsWallpaper && !mWin.mWallpaperVisible) { if (mIsWallpaper && !mWin.mWallpaperVisible) { // Wallpaper is no longer visible and there is no wp target => hide it. // Wallpaper is no longer visible and there is no wp target => hide it. hide(); hide(); } else if (w.mAttachedHidden || !w.isReadyForDisplay()) { } else if (w.mAttachedHidden || !w.isOnScreen()) { hide(); hide(); mAnimator.hideWallpapersLocked(w); mAnimator.hideWallpapersLocked(w); Loading Loading
services/java/com/android/server/wm/AppWindowAnimator.java +7 −6 Original line number Original line Diff line number Diff line Loading @@ -58,9 +58,9 @@ public class AppWindowAnimator { } } public void setAnimation(Animation anim, int width, int height) { public void setAnimation(Animation anim, int width, int height) { if (WindowManagerService.localLOGV) Slog.v( if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting animation in " + mAppToken TAG, "Setting animation in " + mAppToken + ": " + anim + ": " + anim + " wxh=" + width + "x" + height + " wxh=" + width + "x" + height); + " isVisible=" + mAppToken.isVisible()); animation = anim; animation = anim; animating = false; animating = false; if (!anim.isInitialized()) { if (!anim.isInitialized()) { Loading @@ -82,16 +82,17 @@ public class AppWindowAnimator { } } // Start out animation gone if window is gone, or visible if window is visible. // Start out animation gone if window is gone, or visible if window is visible. transformation.clear(); transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); transformation.setAlpha(mAppToken.isVisible() ? 1 : 0); hasTransformation = true; hasTransformation = true; } } public void setDummyAnimation() { public void setDummyAnimation() { if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken); if (WindowManagerService.localLOGV) Slog.v(TAG, "Setting dummy animation in " + mAppToken + " isVisible=" + mAppToken.isVisible()); animation = sDummyAnimation; animation = sDummyAnimation; hasTransformation = true; hasTransformation = true; transformation.clear(); transformation.clear(); transformation.setAlpha(mAppToken.reportedVisible ? 1 : 0); transformation.setAlpha(mAppToken.isVisible() ? 1 : 0); } } public void clearAnimation() { public void clearAnimation() { Loading
services/java/com/android/server/wm/AppWindowToken.java +16 −0 Original line number Original line Diff line number Diff line Loading @@ -223,6 +223,22 @@ class AppWindowToken extends WindowToken { return null; return null; } } boolean isVisible() { final int N = allAppWindows.size(); // TODO: Consider using allDrawn instead of a single window. for (int i=0; i<N; i++) { WindowState win = allAppWindows.get(i); if (!win.mAppFreezing && (win.mViewVisibility == View.VISIBLE || (win.mWinAnimator.isAnimating() && !service.mAppTransition.isTransitionSet())) && !win.mDestroying && win.isDrawnLw()) { return true; } } return false; } @Override @Override void dump(PrintWriter pw, String prefix) { void dump(PrintWriter pw, String prefix) { super.dump(pw, prefix); super.dump(pw, prefix); Loading
services/java/com/android/server/wm/WindowManagerService.java +9 −15 Original line number Original line Diff line number Diff line Loading @@ -4476,8 +4476,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, "Start moving token " + wtoken + " initially at " "Start moving token " + wtoken + " initially at " + oldIndex); + oldIndex); if (oldIndex > index && mAppTransition.isTransitionSet() if (oldIndex > index && mAppTransition.isTransitionSet()) { && !mAppTransition.isRunning()) { // animation towards back has not started, copy old list for duration of animation. // animation towards back has not started, copy old list for duration of animation. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading @@ -4491,7 +4490,7 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); if (DEBUG_REORDER) dumpAppTokensLocked(); if (DEBUG_REORDER) dumpAppTokensLocked(); if (!mAppTransition.isTransitionSet() && !mAppTransition.isRunning()) { if (!mAppTransition.isTransitionSet()) { // Not animating, bring animating app list in line with mAppTokens. // Not animating, bring animating app list in line with mAppTokens. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading Loading @@ -4612,12 +4611,10 @@ public class WindowManagerService extends IWindowManager.Stub } } } } if (!mAppTransition.isRunning()) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, mAppTokens.size()); moveAppWindowsLocked(tokens, mAppTokens.size()); } } } Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } Loading @@ -4631,7 +4628,7 @@ public class WindowManagerService extends IWindowManager.Stub final long origId = Binder.clearCallingIdentity(); final long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { synchronized(mWindowMap) { final int N = tokens.size(); final int N = tokens.size(); if (N > 0 && !mAppTransition.isRunning()) { if (N > 0) { // animating towards back, hang onto old list for duration of animation. // animating towards back, hang onto old list for duration of animation. mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); Loading @@ -4651,12 +4648,10 @@ public class WindowManagerService extends IWindowManager.Stub } } } } if (!mAppTransition.isRunning()) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, 0); moveAppWindowsLocked(tokens, 0); } } } Binder.restoreCallingIdentity(origId); Binder.restoreCallingIdentity(origId); } } Loading Loading @@ -7949,7 +7944,6 @@ public class WindowManagerService extends IWindowManager.Stub final AppWindowAnimator appAnimator = wtoken.mAppAnimator; final AppWindowAnimator appAnimator = wtoken.mAppAnimator; if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken); if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken); appAnimator.clearThumbnail(); appAnimator.clearThumbnail(); wtoken.reportedVisible = false; wtoken.inPendingTransaction = false; wtoken.inPendingTransaction = false; appAnimator.animation = null; appAnimator.animation = null; setTokenVisibilityLocked(wtoken, animLp, true, transit, false); setTokenVisibilityLocked(wtoken, animLp, true, transit, false); Loading
services/java/com/android/server/wm/WindowStateAnimator.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1223,7 +1223,7 @@ class WindowStateAnimator { if (mIsWallpaper && !mWin.mWallpaperVisible) { if (mIsWallpaper && !mWin.mWallpaperVisible) { // Wallpaper is no longer visible and there is no wp target => hide it. // Wallpaper is no longer visible and there is no wp target => hide it. hide(); hide(); } else if (w.mAttachedHidden || !w.isReadyForDisplay()) { } else if (w.mAttachedHidden || !w.isOnScreen()) { hide(); hide(); mAnimator.hideWallpapersLocked(w); mAnimator.hideWallpapersLocked(w); Loading