diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 21 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/StartingData.java | 18 |
2 files changed, 33 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 5a6851ea196c..d0f86c0a9239 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -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; @@ -2684,6 +2687,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(); } @@ -2844,11 +2852,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) { @@ -2875,7 +2886,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; } diff --git a/services/core/java/com/android/server/wm/StartingData.java b/services/core/java/com/android/server/wm/StartingData.java index 34806bd023a0..a23547ef1d5b 100644 --- a/services/core/java/com/android/server/wm/StartingData.java +++ b/services/core/java/com/android/server/wm/StartingData.java @@ -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; |