Merge "Fix race of releasing leashes with shell recents transition" into tm-qpr-dev am: 456f79de0d am: e37731883a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19201346

Change-Id: Iead17ae16a7cd3b70484995eb2c76d3116133ace
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2022-07-08 03:03:13 +00:00
committed by Automerger Merge Worker

View File

@@ -427,18 +427,14 @@ public class RemoteTransitionCompat implements Parcelable {
mPipTransaction = null;
}
}
// Release surface references now. This is apparently to free GPU
// memory while doing quick operations (eg. during CTS).
for (int i = 0; i < mLeashMap.size(); ++i) {
if (mLeashMap.keyAt(i) == mLeashMap.valueAt(i)) continue;
t.remove(mLeashMap.valueAt(i));
}
try {
mFinishCB.onTransitionFinished(wct.isEmpty() ? null : wct, t);
} catch (RemoteException e) {
Log.e("RemoteTransitionCompat", "Failed to call animation finish callback", e);
t.apply();
}
// Only release the non-local created surface references. The animator is responsible
// for releasing the leashes created by local.
for (int i = 0; i < mInfo.getChanges().size(); ++i) {
mInfo.getChanges().get(i).getLeash().release();
}