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

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

Ensure that mAllAppWinAnimators is not null.

The method showAllWindowsLocked can be called from the layout
side of the WindowManagerService. Previously the AppWindowAnimator
member mAllAppWinAnimators was created on the animation side. If
showAllWindowsLocked was called before the first animation of the
activity an NPE would occur. This fix creates mAllAppWinAnimators
when the AppWindowAnimator is created and also updates it with
current values before calling showAllWindowsLocked.

Fixes bug 6917136.

Change-Id: If3ace22022b65c6888bbb9d0575efe9a45d86475
parent 82d53ce2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class AppWindowAnimator {
    final Transformation thumbnailTransformation = new Transformation();

    /** WindowStateAnimator from mAppAnimator.allAppWindows as of last performLayout */
    ArrayList<WindowStateAnimator> mAllAppWinAnimators;
    ArrayList<WindowStateAnimator> mAllAppWinAnimators = new ArrayList<WindowStateAnimator>();

    static final Animation sDummyAnimation = new DummyAnimation();

+2 −2
Original line number Diff line number Diff line
@@ -190,8 +190,8 @@ public class WindowAnimator {
            for (int i = 0; i < N; i++) {
                final AppWindowAnimParams params = layoutToAnim.mAppWindowAnimParams.get(i);
                AppWindowAnimator appAnimator = params.mAppAnimator;
                appAnimator.mAllAppWinAnimators =
                        new ArrayList<WindowStateAnimator>(params.mWinAnimators);
                appAnimator.mAllAppWinAnimators.clear();
                appAnimator.mAllAppWinAnimators.addAll(params.mWinAnimators);
                mAppAnimators.add(appAnimator);
            }
        }
+11 −3
Original line number Diff line number Diff line
@@ -8367,15 +8367,23 @@ public class WindowManagerService extends IWindowManager.Stub
            NN = mOpeningApps.size();
            for (i=0; i<NN; i++) {
                AppWindowToken wtoken = mOpeningApps.get(i);
                final AppWindowAnimator appAnimator = wtoken.mAppAnimator;
                if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken);
                wtoken.mAppAnimator.clearThumbnail();
                appAnimator.clearThumbnail();
                wtoken.reportedVisible = false;
                wtoken.inPendingTransaction = false;
                wtoken.mAppAnimator.animation = null;
                appAnimator.animation = null;
                setTokenVisibilityLocked(wtoken, animLp, true, transit, false);
                wtoken.updateReportedVisibilityLocked();
                wtoken.waitingToShow = false;
                mAnimator.mAnimating |= wtoken.mAppAnimator.showAllWindowsLocked();

                appAnimator.mAllAppWinAnimators.clear();
                final int N = wtoken.allAppWindows.size();
                for (int j = 0; j < N; j++) {
                    appAnimator.mAllAppWinAnimators.add(wtoken.allAppWindows.get(j).mWinAnimator);
                }
                mAnimator.mAnimating |= appAnimator.showAllWindowsLocked();

                if (animLp != null) {
                    int layer = -1;
                    for (int j=0; j<wtoken.windows.size(); j++) {