diff options
| author | 2022-09-23 12:42:46 +0000 | |
|---|---|---|
| committer | 2022-09-23 12:42:46 +0000 | |
| commit | 32b7c278ba9088a795c041644b9cc46c482e6df4 (patch) | |
| tree | c168273ca880f2f8bcee7bae44fcf55c4b1f0e9d | |
| parent | d0d6108d10c23dfd032d5f621ca66357b4a5a863 (diff) | |
| parent | 9394254fe561363807cca3f694b66bf8b1d2bdf5 (diff) | |
Merge "[Shell Transition] Defer remove splash screen window when it is inTransition." into tm-qpr-dev am: 9394254fe5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19953044
Change-Id: I2f83699e9b3768f0e9be42f3d0776527b328f34b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityRecord.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index e9fbeb614dfa..b8486e7aa2b4 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -2764,6 +2764,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A final StartingSurfaceController.StartingSurface surface; final StartingData startingData = mStartingData; + final WindowState startingWindow = mStartingWindow; if (mStartingData != null) { surface = mStartingSurface; mStartingData = null; @@ -2782,21 +2783,31 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return; } - ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Schedule remove starting %s startingWindow=%s" + " startingView=%s Callers=%s", this, mStartingWindow, mStartingSurface, Debug.getCallers(5)); - + final boolean removeWithAnimate = prepareAnimation && startingData.needRevealAnimation(); final Runnable removeSurface = () -> { ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Removing startingView=%s", surface); try { - surface.remove(prepareAnimation && startingData.needRevealAnimation()); + surface.remove(removeWithAnimate); } catch (Exception e) { Slog.w(TAG_WM, "Exception when removing starting window", e); } }; - - removeSurface.run(); + if (removeWithAnimate && mTransitionController.inCollectingTransition(startingWindow) + && startingWindow.cancelAndRedraw()) { + // Defer remove starting window after transition start. + // If splash screen window was in collecting, the client side is unable to draw because + // of Session#cancelDraw, which will blocking the remove animation. + startingWindow.mSyncTransaction.addTransactionCommittedListener(Runnable::run, () -> { + synchronized (mAtmService.mGlobalLock) { + removeSurface.run(); + } + }); + } else { + removeSurface.run(); + } } /** |