Add Java exceptions to catch RS calls with no context or no surface.
diff --git a/graphics/java/android/renderscript/SimpleMesh.java b/graphics/java/android/renderscript/SimpleMesh.java
index 3d10e3b..f45074e 100644
--- a/graphics/java/android/renderscript/SimpleMesh.java
+++ b/graphics/java/android/renderscript/SimpleMesh.java
@@ -35,18 +35,22 @@
     }
 
     public void bindVertexAllocation(Allocation a, int slot) {
+        mRS.validate();
         mRS.nSimpleMeshBindVertex(mID, a.mID, slot);
     }
 
     public void bindIndexAllocation(Allocation a) {
+        mRS.validate();
         mRS.nSimpleMeshBindIndex(mID, a.mID);
     }
 
     public Allocation createVertexAllocation(int slot) {
+        mRS.validate();
         return Allocation.createTyped(mRS, mVertexTypes[slot]);
     }
 
     public Allocation createIndexAllocation() {
+        mRS.validate();
         return Allocation.createTyped(mRS, mIndexType);
     }
 
@@ -162,6 +166,7 @@
         }
 
         public SimpleMesh create() {
+            mRS.validate();
             SimpleMesh sm = internalCreate(mRS, this);
             sm.mVertexTypes = new Type[mVertexTypeCount];
             for(int ct=0; ct < mVertexTypeCount; ct++) {