Skip to content

Commit f412095

Browse files
author
Craig Mautner
committed
Fix starting window problems.
Three problems fixed: 1. When one Activity took over for another Activity not all of the starting window state was being copied over. Now copying over more parameters. 2. When the visibility of an Activity was being changed the dummy animation was overwriting the existing animation. If that animation was the starting window animating then it started over when the dummy animation was assigned. Now the dummy animation no longer replaces an existing starting window animation. 3. The test for whether to animate away the starting window only looked to see if the Activity had already drawn a window but did not include the starting window. This caused the starting window to immediately be hidden when the Activity was removed if no windows were drawn, thereby exposing the fading window behind. Now the starting window is included in the hasAppShownWindows test and is animated away if it is exposed. Fixes bug 6691421. Change-Id: I4d32a1546c201652574a44d9e7f2752f1f1eb5a6
1 parent 95cf8c1 commit f412095

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4042,7 +4042,9 @@ public void setAppStartingWindow(IBinder token, String pkg,
40424042
// token.
40434043
wtoken.startingData = ttoken.startingData;
40444044
wtoken.startingView = ttoken.startingView;
4045+
wtoken.startingDisplayed = ttoken.startingDisplayed;
40454046
wtoken.startingWindow = startingWindow;
4047+
wtoken.reportedVisible = ttoken.reportedVisible;
40464048
ttoken.startingData = null;
40474049
ttoken.startingView = null;
40484050
ttoken.startingWindow = null;
@@ -4331,14 +4333,15 @@ public void setAppVisibility(IBinder token, boolean visible) {
43314333

43324334
if (DEBUG_APP_TRANSITIONS) Slog.v(
43334335
TAG, "Setting dummy animation on: " + wtoken);
4334-
wtoken.mAppAnimator.setDummyAnimation();
4336+
if (!wtoken.startingDisplayed) {
4337+
wtoken.mAppAnimator.setDummyAnimation();
4338+
}
43354339
mOpeningApps.remove(wtoken);
43364340
mClosingApps.remove(wtoken);
43374341
wtoken.waitingToShow = wtoken.waitingToHide = false;
43384342
wtoken.inPendingTransaction = true;
43394343
if (visible) {
43404344
mOpeningApps.add(wtoken);
4341-
wtoken.startingDisplayed = false;
43424345
wtoken.startingMoved = false;
43434346

43444347
// If the token is currently hidden (should be the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ public long getInputDispatchingTimeoutNanos() {
587587
}
588588

589589
public boolean hasAppShownWindows() {
590-
return mAppToken != null ? mAppToken.firstWindowDrawn : false;
590+
return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed);
591591
}
592592

593593
boolean isIdentityMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,14 @@ void computeShownFrameLocked() {
896896
//Slog.i(TAG, "Not applying alpha transform");
897897
}
898898

899-
if (WindowManagerService.localLOGV) Slog.v(
899+
if (WindowManagerService.localLOGV && (mShownAlpha == 1.0 || mShownAlpha == 0.0)) Slog.v(
900900
TAG, "computeShownFrameLocked: Animating " + this +
901-
": " + mWin.mShownFrame +
902-
", alpha=" + mTransformation.getAlpha() + ", mShownAlpha=" + mShownAlpha);
901+
" mAlpha=" + mAlpha +
902+
" self=" + (selfTransformation ? mTransformation.getAlpha() : "null") +
903+
" attached=" + (attachedTransformation == null ? "null" : attachedTransformation.getAlpha()) +
904+
" app=" + (appTransformation == null ? "null" : appTransformation.getAlpha()) +
905+
" screen=" + (screenAnimation ? mService.mAnimator.mScreenRotationAnimation.getEnterTransformation().getAlpha()
906+
: "null"));
903907
return;
904908
} else if (mWin.mIsWallpaper &&
905909
(mAnimator.mPendingActions & WindowAnimator.WALLPAPER_ACTION_PENDING) != 0) {

0 commit comments

Comments
 (0)