diff options
| author | 2025-02-17 20:07:52 +0800 | |
|---|---|---|
| committer | 2025-02-18 11:00:21 +0800 | |
| commit | dde0d562818cdd5ad02d05a4780e8ba4cc35556c (patch) | |
| tree | 7fb15e8274b588e9c262e7cba2c458b631e89719 | |
| parent | a513c2600f906c3b511794f295fce061c65d14e8 (diff) | |
Release starting_reveal leashes
When able to remove splash screen surface.
Flag: EXEMPT bugfix
Bug: 359853073
Test: launch app from Launcher, verify no starting_reveal left in
offscreen layer.
Change-Id: Ief3e353678f01f83314ff753099e550cb1d37147
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 1 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 2d7ed46fe64a..54589d2e84f5 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -4758,6 +4758,7 @@ public final class ActivityThread extends ClientTransactionHandler // frame. final SurfaceControl.Transaction transaction = new SurfaceControl.Transaction(); transaction.hide(startingWindowLeash); + startingWindowLeash.release(); view.syncTransferSurfaceOnDraw(); diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java index cc962acf1182..caed194c5fd8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenWindowCreator.java @@ -368,8 +368,12 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator { mStartingWindowRecordManager.addRecord(taskId, tView); } - private void removeWindowInner(@NonNull View decorView, boolean hideView) { + private void removeWindowInner(@NonNull View decorView, StartingWindowRemovalInfo info, + boolean hideView) { requestTopUi(false); + if (info.windowAnimationLeash != null && info.windowAnimationLeash.isValid()) { + info.windowAnimationLeash.release(); + } if (decorView.getParent() == null) { Slog.w(TAG, "This root view has no parent, never been added to a ViewRootImpl?"); return; @@ -452,22 +456,22 @@ class SplashscreenWindowCreator extends AbsSplashWindowCreator { if (mSplashView == null) { // shouldn't happen, the app window may be drawn earlier than starting window? Slog.e(TAG, "Found empty splash screen, remove!"); - removeWindowInner(mRootView, false); + removeWindowInner(mRootView, info, false); return true; } if (immediately || mSuggestType == STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN) { - removeWindowInner(mRootView, false); + removeWindowInner(mRootView, info, false); } else { if (info.playRevealAnimation) { mSplashscreenContentDrawer.applyExitAnimation(mSplashView, info.windowAnimationLeash, info.mainFrame, - () -> removeWindowInner(mRootView, true), + () -> removeWindowInner(mRootView, info, true), mCreateTime, info.roundedCornerRadius); } else { // the SplashScreenView has been copied to client, hide the view to skip // default exit animation - removeWindowInner(mRootView, true); + removeWindowInner(mRootView, info, true); } } return true; |