Fix RS bug with message ID 0.
Clamp RSTest list to nice viewable range.
Change-Id: I0909511e16984ec78150cda17c22e22af1fa0cdb
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 2aa3e84..c4421c3 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -601,9 +601,9 @@
while(mRun) {
rbuf[0] = 0;
int msg = mRS.nContextGetMessage(mRS.mContext, rbuf, true);
- if ((msg == 0) && mRun) {
+ if ((msg == 0)) {
// Can happen for two reasons
- if (rbuf[0] > 0) {
+ if (rbuf[0] > 0 && mRun) {
// 1: Buffer needs to be enlarged.
rbuf = new int[rbuf[0] + 2];
} else {
@@ -616,6 +616,7 @@
} catch(InterruptedException e) {
}
}
+ continue;
}
if(mRS.mMessageCallback != null) {
mRS.mMessageCallback.mData = rbuf;