@@ -1638,7 +1638,7 @@ int adjustWallpaperWindowsLocked() {
16381638 // it is of no interest to us.
16391639 if (w .mAppToken .hidden && w .mAppToken .mAppAnimator .animation == null ) {
16401640 if (DEBUG_WALLPAPER ) Slog .v (TAG ,
1641- "Skipping not hidden or animating token: " + w );
1641+ "Skipping hidden and not animating token: " + w );
16421642 continue ;
16431643 }
16441644 }
@@ -3865,6 +3865,7 @@ public void prepareAppTransition(int transit, boolean alwaysKeepCurrent) {
38653865 if (DEBUG_APP_TRANSITIONS ) Slog .v (
38663866 TAG , "Prepare app transition: transit=" + transit
38673867 + " mNextAppTransition=" + mNextAppTransition
3868+ + " alwaysKeepCurrent=" + alwaysKeepCurrent
38683869 + " Callers=" + Debug .getCallers (3 ));
38693870 if (okToDisplay ()) {
38703871 if (mNextAppTransition == WindowManagerPolicy .TRANSIT_UNSET
@@ -3934,6 +3935,15 @@ public void overridePendingAppTransitionThumb(Bitmap srcThumb, int startX,
39343935 }
39353936 }
39363937
3938+ private void cancelWindowAnimations (final AppWindowToken wtoken ) {
3939+ for (int i = wtoken .windows .size () - 1 ; i >= 0 ; i --) {
3940+ final WindowStateAnimator winAnimator = wtoken .windows .get (i ).mWinAnimator ;
3941+ if (winAnimator .isAnimating ()) {
3942+ winAnimator .clearAnimation ();
3943+ }
3944+ }
3945+ }
3946+
39373947 public void executeAppTransition () {
39383948 if (!checkCallingPermission (android .Manifest .permission .MANAGE_APP_TOKENS ,
39393949 "executeAppTransition()" )) {
@@ -3949,6 +3959,12 @@ public void executeAppTransition() {
39493959 }
39503960 if (mNextAppTransition != WindowManagerPolicy .TRANSIT_UNSET ) {
39513961 mAppTransitionReady = true ;
3962+ for (int i = mOpeningApps .size () - 1 ; i >= 0 ; i --) {
3963+ cancelWindowAnimations (mOpeningApps .get (i ));
3964+ }
3965+ for (int i = mClosingApps .size () - 1 ; i >= 0 ; i --) {
3966+ cancelWindowAnimations (mClosingApps .get (i ));
3967+ }
39523968 final long origId = Binder .clearCallingIdentity ();
39533969 performLayoutAndPlaceSurfacesLocked ();
39543970 Binder .restoreCallingIdentity (origId );
@@ -4296,6 +4312,7 @@ public void setAppVisibility(IBinder token, boolean visible) {
42964312
42974313 if (DEBUG_APP_TRANSITIONS ) Slog .v (
42984314 TAG , "Setting dummy animation on: " + wtoken );
4315+ cancelWindowAnimations (wtoken );
42994316 wtoken .mAppAnimator .setDummyAnimation ();
43004317 mOpeningApps .remove (wtoken );
43014318 mClosingApps .remove (wtoken );
@@ -5319,7 +5336,8 @@ private void showStrictModeViolation(int arg) {
53195336 // the background..)
53205337 if (on ) {
53215338 boolean isVisible = false ;
5322- for (WindowState ws : mWindows ) {
5339+ for (int i = mWindows .size () - 1 ; i >= 0 ; i --) {
5340+ final WindowState ws = mWindows .get (i );
53235341 if (ws .mSession .mPid == pid && ws .isVisibleLw ()) {
53245342 isVisible = true ;
53255343 break ;
@@ -6437,7 +6455,10 @@ boolean computeScreenConfigurationLocked(Configuration config) {
64376455
64386456 int keyboardPresence = 0 ;
64396457 int navigationPresence = 0 ;
6440- for (InputDevice device : mInputManager .getInputDevices ()) {
6458+ final InputDevice [] devices = mInputManager .getInputDevices ();
6459+ final int len = devices .length ;
6460+ for (int i = 0 ; i < len ; i ++) {
6461+ InputDevice device = devices [i ];
64416462 if (!device .isVirtual ()) {
64426463 final int sources = device .getSources ();
64436464 final int presenceFlag = device .isExternal () ?
@@ -7946,7 +7967,7 @@ public int handleAppTransitionReadyLocked() {
79467967 for (i =0 ; i <NN && goodToGo ; i ++) {
79477968 AppWindowToken wtoken = mOpeningApps .get (i );
79487969 if (DEBUG_APP_TRANSITIONS ) Slog .v (TAG ,
7949- "Check opening app" + wtoken + ": allDrawn="
7970+ "Check opening app= " + wtoken + ": allDrawn="
79507971 + wtoken .allDrawn + " startingDisplayed="
79517972 + wtoken .startingDisplayed + " startingMoved="
79527973 + wtoken .startingMoved );
@@ -8056,7 +8077,7 @@ public int handleAppTransitionReadyLocked() {
80568077 }
80578078 if (DEBUG_APP_TRANSITIONS ) Slog .v (TAG ,
80588079 "New transit: " + transit );
8059- } else if (oldWallpaper != null ) {
8080+ } else if (( oldWallpaper != null ) && ( oldWallpaper != mWallpaperTarget ) ) {
80608081 // We are transitioning from an activity with
80618082 // a wallpaper to one without.
80628083 transit = WindowManagerPolicy .TRANSIT_WALLPAPER_CLOSE ;
0 commit comments