Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4120956 authored by Craig Mautner's avatar Craig Mautner
Browse files

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
parent 95cf8c11
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -4042,7 +4042,9 @@ public class WindowManagerService extends IWindowManager.Stub
                        // token.
                        wtoken.startingData = ttoken.startingData;
                        wtoken.startingView = ttoken.startingView;
                        wtoken.startingDisplayed = ttoken.startingDisplayed;
                        wtoken.startingWindow = startingWindow;
                        wtoken.reportedVisible = ttoken.reportedVisible;
                        ttoken.startingData = null;
                        ttoken.startingView = null;
                        ttoken.startingWindow = null;
@@ -4331,14 +4333,15 @@ public class WindowManagerService extends IWindowManager.Stub

                if (DEBUG_APP_TRANSITIONS) Slog.v(
                        TAG, "Setting dummy animation on: " + wtoken);
                if (!wtoken.startingDisplayed) {
                    wtoken.mAppAnimator.setDummyAnimation();
                }
                mOpeningApps.remove(wtoken);
                mClosingApps.remove(wtoken);
                wtoken.waitingToShow = wtoken.waitingToHide = false;
                wtoken.inPendingTransaction = true;
                if (visible) {
                    mOpeningApps.add(wtoken);
                    wtoken.startingDisplayed = false;
                    wtoken.startingMoved = false;

                    // If the token is currently hidden (should be the
+1 −1
Original line number Diff line number Diff line
@@ -587,7 +587,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    public boolean hasAppShownWindows() {
        return mAppToken != null ? mAppToken.firstWindowDrawn : false;
        return mAppToken != null && (mAppToken.firstWindowDrawn || mAppToken.startingDisplayed);
    }

    boolean isIdentityMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
+7 −3
Original line number Diff line number Diff line
@@ -896,10 +896,14 @@ class WindowStateAnimator {
                //Slog.i(TAG, "Not applying alpha transform");
            }

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