Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a412668a authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "Fix Invalid Surface error" into main am: c3199051

parents e4de34bd c3199051
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -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;
        }