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

Commit 848eac1d authored by Matthew Ng's avatar Matthew Ng Committed by android-build-merger
Browse files

Merge "Window can only be fully drawn if app window is not relaunching" into oc-dev

am: f7e6f581

Change-Id: I9556d5c24d9192674338cbcf45cd042e02740a73
parents 75a64a45 f7e6f581
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -893,6 +893,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        if (mPendingRelaunchCount > 0) {
        if (mPendingRelaunchCount > 0) {
            mPendingRelaunchCount--;
            mPendingRelaunchCount--;
        }
        }
        updateAllDrawn();
    }
    }


    void clearRelaunching() {
    void clearRelaunching() {
@@ -1301,16 +1302,20 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        }
        }
    }
    }


    void updateAllDrawn(DisplayContent dc) {
    void updateAllDrawn() {
        if (!allDrawn) {
        if (!allDrawn) {
            // Number of drawn windows can be less when a window is being relaunched, wait for
            // all windows to be launched and drawn for this token be considered all drawn
            final int numInteresting = mNumInterestingWindows;
            final int numInteresting = mNumInterestingWindows;
            if (numInteresting > 0 && mNumDrawnWindows >= numInteresting) {
            if (numInteresting > 0 && mNumDrawnWindows >= numInteresting && !isRelaunching()) {
                if (DEBUG_VISIBILITY) Slog.v(TAG, "allDrawn: " + this
                if (DEBUG_VISIBILITY) Slog.v(TAG, "allDrawn: " + this
                        + " interesting=" + numInteresting + " drawn=" + mNumDrawnWindows);
                        + " interesting=" + numInteresting + " drawn=" + mNumDrawnWindows);
                allDrawn = true;
                allDrawn = true;
                // Force an additional layout pass where
                // Force an additional layout pass where
                // WindowStateAnimator#commitFinishDrawingLocked() will call performShowLocked().
                // WindowStateAnimator#commitFinishDrawingLocked() will call performShowLocked().
                dc.setLayoutNeeded();
                if (mDisplayContent != null) {
                    mDisplayContent.setLayoutNeeded();
                }
                mService.mH.obtainMessage(NOTIFY_ACTIVITY_DRAWN, token).sendToTarget();
                mService.mH.obtainMessage(NOTIFY_ACTIVITY_DRAWN, token).sendToTarget();


                final TaskStack s = getStack();
                final TaskStack s = getStack();
@@ -1327,7 +1332,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                        + " interesting=" + numInteresting
                        + " interesting=" + numInteresting
                        + " drawn=" + mNumDrawnWindowsExcludingSaved);
                        + " drawn=" + mNumDrawnWindowsExcludingSaved);
                allDrawnExcludingSaved = true;
                allDrawnExcludingSaved = true;
                dc.setLayoutNeeded();
                if (mDisplayContent != null) {
                    mDisplayContent.setLayoutNeeded();
                }
                if (isAnimatingInvisibleWithSavedSurface()
                if (isAnimatingInvisibleWithSavedSurface()
                        && !mService.mFinishedEarlyAnim.contains(this)) {
                        && !mService.mFinishedEarlyAnim.contains(this)) {
                    mService.mFinishedEarlyAnim.add(this);
                    mService.mFinishedEarlyAnim.add(this);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2730,7 +2730,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            final AppWindowToken atoken = mTmpUpdateAllDrawn.removeLast();
            final AppWindowToken atoken = mTmpUpdateAllDrawn.removeLast();
            // See if any windows have been drawn, so they (and others associated with them)
            // See if any windows have been drawn, so they (and others associated with them)
            // can now be shown.
            // can now be shown.
            atoken.updateAllDrawn(this);
            atoken.updateAllDrawn();
        }
        }


        return mTmpApplySurfaceChangesTransactionState.focusDisplayed;
        return mTmpApplySurfaceChangesTransactionState.focusDisplayed;