@@ -3974,7 +3974,6 @@ boolean setTokenVisibilityLocked(AppWindowToken wtoken, WindowManager.LayoutPara
39743974
39753975 wtoken .willBeHidden = false ;
39763976 if (wtoken .hidden == visible ) {
3977- final int N = wtoken .allAppWindows .size ();
39783977 boolean changed = false ;
39793978 if (DEBUG_APP_TRANSITIONS ) Slog .v (
39803979 TAG , "Changing app " + wtoken + " hidden=" + wtoken .hidden
@@ -3986,23 +3985,19 @@ boolean setTokenVisibilityLocked(AppWindowToken wtoken, WindowManager.LayoutPara
39863985 if (wtoken .mAppAnimator .animation == sDummyAnimation ) {
39873986 wtoken .mAppAnimator .animation = null ;
39883987 }
3989- applyAnimationLocked (wtoken , lp , transit , visible );
3990- changed = true ;
3991- if (wtoken .mAppAnimator .animation != null ) {
3988+ if (applyAnimationLocked (wtoken , lp , transit , visible )) {
39923989 delayed = runningAppAnimation = true ;
39933990 }
3991+ changed = true ;
39943992 }
39953993
3994+ final int N = wtoken .allAppWindows .size ();
39963995 for (int i =0 ; i <N ; i ++) {
39973996 WindowState win = wtoken .allAppWindows .get (i );
39983997 if (win == wtoken .startingWindow ) {
39993998 continue ;
40003999 }
40014000
4002- if (win .mWinAnimator .isAnimating ()) {
4003- delayed = true ;
4004- }
4005-
40064001 //Slog.i(TAG, "Window " + win + ": vis=" + win.isVisible());
40074002 //win.dump(" ");
40084003 if (visible ) {
@@ -4055,6 +4050,12 @@ boolean setTokenVisibilityLocked(AppWindowToken wtoken, WindowManager.LayoutPara
40554050 delayed = true ;
40564051 }
40574052
4053+ for (int i = wtoken .allAppWindows .size () - 1 ; i >= 0 && !delayed ; i --) {
4054+ if (wtoken .allAppWindows .get (i ).mWinAnimator .isWindowAnimating ()) {
4055+ delayed = true ;
4056+ }
4057+ }
4058+
40584059 return delayed ;
40594060 }
40604061
@@ -7262,6 +7263,7 @@ final void rebuildAppWindowListLocked() {
72627263 pw .flush ();
72637264 Slog .w (TAG , "This window was lost: " + ws );
72647265 Slog .w (TAG , sw .toString ());
7266+ ws .mWinAnimator .destroySurfaceLocked ();
72657267 }
72667268 }
72677269 Slog .w (TAG , "Current app token list:" );
@@ -9333,7 +9335,7 @@ void dumpWindowsLocked(FileDescriptor fd, PrintWriter pw, boolean dumpAll,
93339335 pw .print (" mWaitingForConfig=" ); pw .println (mWaitingForConfig );
93349336 pw .print (" mRotation=" ); pw .print (mRotation );
93359337 pw .print (" mAltOrientation=" ); pw .println (mAltOrientation );
9336- pw .print (" mLastWindowForcedOrientation" ); pw .print (mLastWindowForcedOrientation );
9338+ pw .print (" mLastWindowForcedOrientation= " ); pw .print (mLastWindowForcedOrientation );
93379339 pw .print (" mForcedAppOrientation=" ); pw .println (mForcedAppOrientation );
93389340 pw .print (" mDeferredRotationPauseCount=" ); pw .println (mDeferredRotationPauseCount );
93399341 if (mAnimator .mScreenRotationAnimation != null ) {
@@ -9535,4 +9537,9 @@ void debugLayoutRepeats(final String msg, int pendingLayoutChanges) {
95359537 void bulkSetParameters (final int bulkUpdateParams ) {
95369538 mH .sendMessage (mH .obtainMessage (H .BULK_UPDATE_PARAMETERS , bulkUpdateParams , 0 ));
95379539 }
9540+
9541+ static String getCaller () {
9542+ StackTraceElement caller = Thread .currentThread ().getStackTrace ()[4 ];
9543+ return caller .getClassName () + "." + caller .getMethodName () + ":" + caller .getLineNumber ();
9544+ }
95389545}
0 commit comments