More error checks
Change-Id: Id2b9ab7a76bbdf2ed745f5e36e552dc9b101982f
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 0660441..f16e045 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -685,6 +685,8 @@
public static final int RS_MESSAGE_TO_CLIENT_ERROR = 3;
public static final int RS_MESSAGE_TO_CLIENT_USER = 4;
+ public static final int RS_ERROR_FATAL_UNKNOWN = 0x1000;
+
MessageThread(RenderScript rs) {
super("RSMessageThread");
mRS = rs;
@@ -722,6 +724,10 @@
if (msg == RS_MESSAGE_TO_CLIENT_ERROR) {
String e = mRS.nContextGetErrorMessage(mRS.mContext);
+ if (subID >= RS_ERROR_FATAL_UNKNOWN) {
+ throw new RSRuntimeException("Fatal error " + subID + ", details: " + e);
+ }
+
if(mRS.mErrorCallback != null) {
mRS.mErrorCallback.mErrorMessage = e;
mRS.mErrorCallback.mErrorNum = subID;