diff options
| author | 2024-01-10 23:02:53 +0000 | |
|---|---|---|
| committer | 2024-01-10 23:02:53 +0000 | |
| commit | 8ca90fd1e882dcf7e6d291899c17aa564aef5307 (patch) | |
| tree | 95c406cae8d71c2fff3188756e409ab6f53cecd1 | |
| parent | 82d145ca37b9de0df8c5d0437f0e28831b362539 (diff) | |
| parent | bdb639ea066d68e2250b235e23da6530afafadac (diff) | |
Merge "Prevent duplicate release same transaction from TransactionPool" into main am: bdb639ea06
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2809333
Change-Id: If281620871929ef4ae8302edf9c7e44ed3ec3fdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java index 7dec12aac39b..2c0ba92524ad 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java @@ -479,18 +479,20 @@ class SplitScreenTransitions { private void startFadeAnimation(@NonNull SurfaceControl leash, boolean show) { final float end = show ? 1.f : 0.f; final float start = 1.f - end; - final SurfaceControl.Transaction transaction = mTransactionPool.acquire(); final ValueAnimator va = ValueAnimator.ofFloat(start, end); va.setDuration(FADE_DURATION); va.setInterpolator(show ? ALPHA_IN : ALPHA_OUT); va.addUpdateListener(animation -> { float fraction = animation.getAnimatedFraction(); + final SurfaceControl.Transaction transaction = mTransactionPool.acquire(); transaction.setAlpha(leash, start * (1.f - fraction) + end * fraction); transaction.apply(); + mTransactionPool.release(transaction); }); va.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { + final SurfaceControl.Transaction transaction = mTransactionPool.acquire(); transaction.setAlpha(leash, end); transaction.apply(); mTransactionPool.release(transaction); |