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

Commit 756090d4 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Defer copy splash screen to client after transaction committed." into...

Merge "Defer copy splash screen to client after transaction committed." into udc-qpr-dev am: 682e210e am: 4b165e64

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24405299



Change-Id: I5ac42edd8ca155af64f68338284dc4878a37bbbf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0b5c9aee 4b165e64
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -224,6 +224,9 @@ import static com.android.server.wm.IdentifierProto.TITLE;
import static com.android.server.wm.IdentifierProto.USER_ID;
import static com.android.server.wm.LetterboxConfiguration.DEFAULT_LETTERBOX_ASPECT_RATIO_FOR_MULTI_WINDOW;
import static com.android.server.wm.LetterboxConfiguration.MIN_FIXED_ORIENTATION_LETTERBOX_ASPECT_RATIO;
import static com.android.server.wm.StartingData.AFTER_TRANSACTION_COPY_TO_CLIENT;
import static com.android.server.wm.StartingData.AFTER_TRANSACTION_IDLE;
import static com.android.server.wm.StartingData.AFTER_TRANSACTION_REMOVE_DIRECTLY;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_PREDICT_BACK;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
@@ -2690,6 +2693,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (isTransferringSplashScreen()) {
            return true;
        }
        // Only do transfer after transaction has done when starting window exist.
        if (mStartingData != null && mStartingData.mWaitForSyncTransactionCommit) {
            mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_COPY_TO_CLIENT;
            return true;
        }
        requestCopySplashScreen();
        return isTransferringSplashScreen();
    }
@@ -2850,11 +2858,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (mStartingData == null) {
            return;
        }
        mStartingData.mWaitForSyncTransactionCommit = false;
        if (mStartingData.mRemoveAfterTransaction) {
            mStartingData.mRemoveAfterTransaction = false;
            removeStartingWindowAnimation(mStartingData.mPrepareRemoveAnimation);
        final StartingData lastData = mStartingData;
        lastData.mWaitForSyncTransactionCommit = false;
        if (lastData.mRemoveAfterTransaction == AFTER_TRANSACTION_REMOVE_DIRECTLY) {
            removeStartingWindowAnimation(lastData.mPrepareRemoveAnimation);
        } else if (lastData.mRemoveAfterTransaction == AFTER_TRANSACTION_COPY_TO_CLIENT) {
            removeStartingWindow();
        }
        lastData.mRemoveAfterTransaction = AFTER_TRANSACTION_IDLE;
    }

    void removeStartingWindowAnimation(boolean prepareAnimation) {
@@ -2881,7 +2892,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (mStartingData != null) {
            if (mStartingData.mWaitForSyncTransactionCommit
                    || mTransitionController.inCollectingTransition(startingWindow)) {
                mStartingData.mRemoveAfterTransaction = true;
                mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_REMOVE_DIRECTLY;
                mStartingData.mPrepareRemoveAnimation = prepareAnimation;
                return;
            }
+17 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.server.wm;

import android.annotation.IntDef;

import com.android.server.wm.StartingSurfaceController.StartingSurface;

/**
@@ -23,6 +25,20 @@ import com.android.server.wm.StartingSurfaceController.StartingSurface;
 */
public abstract class StartingData {

    /** Nothing need to do after transaction */
    static final int AFTER_TRANSACTION_IDLE = 0;
    /** Remove the starting window directly after transaction done. */
    static final int AFTER_TRANSACTION_REMOVE_DIRECTLY = 1;
    /** Do copy splash screen to client after transaction done. */
    static final int AFTER_TRANSACTION_COPY_TO_CLIENT = 2;

    @IntDef(prefix = { "AFTER_TRANSACTION" }, value = {
            AFTER_TRANSACTION_IDLE,
            AFTER_TRANSACTION_REMOVE_DIRECTLY,
            AFTER_TRANSACTION_COPY_TO_CLIENT,
    })
    @interface AfterTransaction {}

    protected final WindowManagerService mService;
    protected final int mTypeParams;

@@ -60,7 +76,7 @@ public abstract class StartingData {
     * This starting window should be removed after applying the start transaction of transition,
     * which ensures the app window has shown.
     */
    boolean mRemoveAfterTransaction;
    @AfterTransaction int mRemoveAfterTransaction;

    /** Whether to prepare the removal animation. */
    boolean mPrepareRemoveAnimation;