diff options
author | 2025-03-24 12:46:31 +0000 | |
---|---|---|
committer | 2025-03-24 12:46:31 +0000 | |
commit | 09782e973223ebc1d3fecc14877a11fa3e66e51a (patch) | |
tree | 6007f8a3b6ef06087d3e1c3f9dc2dc325e6bd518 | |
parent | f6d3e7a71bb25588ef953c2ee2f7f6b3ab3f99fc (diff) |
Wrap reparent in a try-catch.
Apparently checking for validity is not enough, as there can be a
race condition that results in the leash being released between the
check and the reparent call. Wrapping in a try-catch and logging the
error instead to avoid crashing.
Fix: 404507270
Flag: EXEMPT bugfix
Test: manual
Change-Id: Ie5b0787ff6cb0262b03e43224e5652173f71b401
-rw-r--r-- | packages/SystemUI/animation/src/com/android/systemui/animation/RemoteAnimationRunnerCompat.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteAnimationRunnerCompat.java b/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteAnimationRunnerCompat.java index 9e08317d2c6b..041ccb567146 100644 --- a/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteAnimationRunnerCompat.java +++ b/packages/SystemUI/animation/src/com/android/systemui/animation/RemoteAnimationRunnerCompat.java @@ -199,8 +199,10 @@ public abstract class RemoteAnimationRunnerCompat extends IRemoteAnimationRunner info.releaseAllSurfaces(); // Make sure that the transition leashes created are not leaked. for (SurfaceControl leash : leashMap.values()) { - if (leash.isValid()) { + try { finishTransaction.reparent(leash, null); + } catch (Exception e) { + Log.e(TAG, "Failed to reparent leash", e); } } // Don't release here since launcher might still be using them. Instead |