Skip to content

Commit ab886f5

Browse files
dsandlerCraig Mautner
authored andcommitted
Don't do closing animation on an opening app.
Check to make sure that the closing wallpaper animation isn't used on an opening app token. This can happen when a previous animation hasn't completed when the next animation is starting. Fixes bug 6557751. Change-Id: Ib8bd4dd7de1e361f6fc0cab11d0997e70f9ddd0b
1 parent 51df04b commit ab886f5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,13 +3258,15 @@ private boolean applyAnimationLocked(AppWindowToken wtoken,
32583258
if (mNextAppTransitionType == ActivityOptions.ANIM_CUSTOM) {
32593259
a = loadAnimation(mNextAppTransitionPackage, enter ?
32603260
mNextAppTransitionEnter : mNextAppTransitionExit);
3261-
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
3261+
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
3262+
"applyAnimation: wtoken=" + wtoken
32623263
+ " anim=" + a + " nextAppTransition=ANIM_CUSTOM"
32633264
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
32643265
} else if (mNextAppTransitionType == ActivityOptions.ANIM_SCALE_UP) {
32653266
a = createScaleUpAnimationLocked(transit, enter);
32663267
initialized = true;
3267-
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
3268+
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
3269+
"applyAnimation: wtoken=" + wtoken
32683270
+ " anim=" + a + " nextAppTransition=ANIM_SCALE_UP"
32693271
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
32703272
} else if (mNextAppTransitionType == ActivityOptions.ANIM_THUMBNAIL ||
@@ -3273,7 +3275,7 @@ private boolean applyAnimationLocked(AppWindowToken wtoken,
32733275
a = createThumbnailAnimationLocked(transit, enter, false, delayed);
32743276
initialized = true;
32753277

3276-
if (DEBUG_ANIM) {
3278+
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
32773279
String animName = delayed ? "ANIM_THUMBNAIL_DELAYED" : "ANIM_THUMBNAIL";
32783280
Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
32793281
+ " anim=" + a + " nextAppTransition=" + animName
@@ -3334,7 +3336,8 @@ private boolean applyAnimationLocked(AppWindowToken wtoken,
33343336
break;
33353337
}
33363338
a = animAttr != 0 ? loadAnimation(lp, animAttr) : null;
3337-
if (DEBUG_ANIM) Slog.v(TAG, "applyAnimation: wtoken=" + wtoken
3339+
if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) Slog.v(TAG,
3340+
"applyAnimation: wtoken=" + wtoken
33383341
+ " anim=" + a
33393342
+ " animAttr=0x" + Integer.toHexString(animAttr)
33403343
+ " transit=" + transit + " Callers " + Debug.getCallers(3));
@@ -8042,6 +8045,7 @@ public int handleAppTransitionReadyLocked() {
80428045

80438046
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
80448047
"New wallpaper target=" + mWallpaperTarget
8048+
+ ", oldWallpaper=" + oldWallpaper
80458049
+ ", lower target=" + mLowerWallpaperTarget
80468050
+ ", upper target=" + mUpperWallpaperTarget);
80478051
int foundWallpapers = 0;
@@ -8108,7 +8112,7 @@ public int handleAppTransitionReadyLocked() {
81088112
}
81098113
if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,
81108114
"New transit: " + transit);
8111-
} else if (oldWallpaper != null) {
8115+
} else if ((oldWallpaper != null) && !mOpeningApps.contains(oldWallpaper.mAppToken)) {
81128116
// We are transitioning from an activity with
81138117
// a wallpaper to one without.
81148118
transit = WindowManagerPolicy.TRANSIT_WALLPAPER_CLOSE;
@@ -8133,7 +8137,6 @@ public int handleAppTransitionReadyLocked() {
81338137
AppWindowToken topOpeningApp = null;
81348138
int topOpeningLayer = 0;
81358139

8136-
// TODO(cmautner): Move to animation side.
81378140
NN = mOpeningApps.size();
81388141
for (i=0; i<NN; i++) {
81398142
AppWindowToken wtoken = mOpeningApps.get(i);

0 commit comments

Comments
 (0)