summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Li <lihongyu@google.com> 2023-07-21 07:12:11 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-07-21 07:12:11 +0000
commita412668aea179dd1e6d43f7e1457198a165a3d74 (patch)
tree8848612f7363d6496393b060c7e3beb1a48133da
parente4de34bd6c98895c17415def063778ea78d46007 (diff)
parentc3199051ac255cacab94a382b35f29f12782640a (diff)
Merge "Fix Invalid Surface error" into main am: c3199051ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2670876 Change-Id: I5bc4f5c897e8d75262c6a6910b8abe24705a3ce6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/wm/SurfaceAnimationRunner.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
index 1ae7816ecd24..b93dbceef015 100644
--- a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
+++ b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
@@ -62,6 +62,8 @@ import java.util.function.Supplier;
*/
class SurfaceAnimationRunner {
+ private static final String TAG = SurfaceAnimationRunner.class.getSimpleName();
+
private final Object mLock = new Object();
/**
@@ -185,6 +187,16 @@ class SurfaceAnimationRunner {
// We must wait for t to be committed since otherwise the leash doesn't have the
// windows we want to screenshot and extend as children.
t.addTransactionCommittedListener(mEdgeExtensionExecutor, () -> {
+ if (!animationLeash.isValid()) {
+ Log.e(TAG, "Animation leash is not valid");
+ synchronized (mEdgeExtensionLock) {
+ mEdgeExtensions.remove(animationLeash);
+ }
+ synchronized (mLock) {
+ mPreProcessingAnimations.remove(animationLeash);
+ }
+ return;
+ }
final WindowAnimationSpec animationSpec = a.asWindowAnimationSpec();
final Transaction edgeExtensionCreationTransaction = new Transaction();
@@ -449,8 +461,7 @@ class SurfaceAnimationRunner {
// The leash we are trying to screenshot may have been removed by this point, which is
// likely the reason for ending up with a null edgeBuffer, in which case we just want to
// return and do nothing.
- Log.e("SurfaceAnimationRunner", "Failed to create edge extension - "
- + "edge buffer is null");
+ Log.e(TAG, "Failed to create edge extension - edge buffer is null");
return;
}