summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2020-06-01 11:02:19 -0700
committer Rob Carr <racarr@google.com> 2020-06-02 18:11:51 +0000
commit6ce9ffb2cdcfe69cb01ec8f756380c3438f6f471 (patch)
treebb6910c1d341feb978b6dbaa464a5d06064a3aea
parent54eec4b7f678c0dff4a2409da566923c465788e0 (diff)
SurfaceView: Lock mDeferredDestroySurfaceControl
Since mDeferredDestroySurfaceControl is the same underlying object as mSurfaceControl we also need to hold the mSurfaceControlLock when writing to it. Bug: 157657896 Test: Existing tests pass Change-Id: Ie0da3ed5d94c7aae2593423fa2767dbc902da4c8
-rw-r--r--core/java/android/view/SurfaceView.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index bd811fc1f052..a954f3631a01 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -1200,8 +1200,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
}
if (mDeferredDestroySurfaceControl != null) {
- mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
- mDeferredDestroySurfaceControl = null;
+ synchronized (mSurfaceControlLock) {
+ mTmpTransaction.remove(mDeferredDestroySurfaceControl).apply();
+ mDeferredDestroySurfaceControl = null;
+ }
}
runOnUiThread(this::performDrawFinished);