Followup to a bug fix.
Addtion of synchronized to the methods triggers an API change.
Per council advice, pushing synch block into the function body.
Change-Id: Iaa395d9720bce499259ab750fe97149715e9f271
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index 20eb93f..a8e3107 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.java
@@ -77,10 +77,12 @@
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceDestroyed(SurfaceHolder holder) {
- // Surface will be destroyed when we return
- if (mRS != null) {
- mRS.setSurface(null, 0, 0);
+ public void surfaceDestroyed(SurfaceHolder holder) {
+ synchronized (this) {
+ // Surface will be destroyed when we return
+ if (mRS != null) {
+ mRS.setSurface(null, 0, 0);
+ }
}
}
@@ -88,9 +90,11 @@
* This method is part of the SurfaceHolder.Callback interface, and is
* not normally called or subclassed by clients of RSSurfaceView.
*/
- public synchronized void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
- if (mRS != null) {
- mRS.setSurface(holder, w, h);
+ public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+ synchronized (this) {
+ if (mRS != null) {
+ mRS.setSurface(holder, w, h);
+ }
}
}
@@ -125,9 +129,11 @@
return rs;
}
- public synchronized void destroyRenderScriptGL() {
- mRS.destroy();
- mRS = null;
+ public void destroyRenderScriptGL() {
+ synchronized (this) {
+ mRS.destroy();
+ mRS = null;
+ }
}
public void setRenderScriptGL(RenderScriptGL rs) {