summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2019-10-25 13:18:29 -0700
committer Robert Carr <racarr@google.com> 2019-10-25 13:18:29 -0700
commitde63cc6e8fe619193f06921d9fc51cfb0de49d2f (patch)
treee50f6007ecad7760bc0ff8b0d265e06f92b36f34
parent62296e3ddf8cc785e3a68a12e81b2c4ba13799b0 (diff)
Fix mistake in SurfaceView lifetime refactoring.
When moving the SurfaceControl lifetime to the render-thread callback I also moved the Surface lifetime. There was no reason to do this since the SurfaceView Surface isn't accessed from render-thread. It introduces a small indeterminism in lifetime making a test fail, so we revert it for cleanness. Bug: 142011183 Test: Manual Change-Id: I98a3daf21e7ed598d557046fc5b2e4cfebf1c845
-rw-r--r--core/java/android/view/SurfaceView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index a85830009f58..f8b20cf21a4c 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -716,6 +716,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
mSurfaceAlpha = 1f;
synchronized (mSurfaceControlLock) {
+ mSurface.release();
+
if (mRtHandlingPositionUpdates) {
mRtReleaseSurfaces = true;
return;
@@ -729,7 +731,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
mTmpTransaction.remove(mBackgroundControl);
mBackgroundControl = null;
}
- mSurface.release();
mTmpTransaction.apply();
}
}
@@ -1202,7 +1203,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
mRtTransaction.remove(mBackgroundControl);
mSurfaceControl = null;
mBackgroundControl = null;
- mSurface.release();
}
mRtHandlingPositionUpdates = false;
}