API review cleanup.

Change-Id: Ieae7d450308b5637ed4253fe9baed3634c6ed141
diff --git a/RenderScript.h b/RenderScript.h
index f00f748..7351793 100644
--- a/RenderScript.h
+++ b/RenderScript.h
@@ -328,8 +328,7 @@
 void rsaElementGetSubElements(RsContext, RsElement, uint32_t *ids, const char **names, uint32_t dataSize);
 
 // Async commands for returning new IDS
-RsType rsaTypeCreate(RsContext, RsElement, uint32_t dimCount,
-                     const RsDimension *dims, const uint32_t *vals);
+RsType rsaTypeCreate(RsContext, RsElement, uint32_t dimX, uint32_t dimY, uint32_t dimZ, bool mips, bool faces);
 RsAllocation rsaAllocationCreateTyped(RsContext rsc, RsType vtype);
 RsAllocation rsaAllocationCreateFromBitmap(RsContext con, uint32_t w, uint32_t h, RsElement _dst, RsElement _src,  bool genMips, const void *data);
 RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, uint32_t w, uint32_t h, RsElement _dst, RsElement _src,  bool genMips, const void *data);
diff --git a/java/Balls/src/com/android/balls/Balls.java b/java/Balls/src/com/android/balls/Balls.java
index 5957c94..c24e616 100644
--- a/java/Balls/src/com/android/balls/Balls.java
+++ b/java/Balls/src/com/android/balls/Balls.java
@@ -94,21 +94,14 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
     protected void onPause() {
-        Log.e("rs", "onPause");
-
-        // Ideally a game should implement onResume() and onPause()
-        // to take appropriate action when the activity looses focus
         super.onPause();
-        mView.onPause();
-
-
-
-        //Runtime.getRuntime().exit(0);
+        mView.pause();
+        Runtime.getRuntime().exit(0);
     }
 
     @Override
diff --git a/java/Balls/src/com/android/balls/BallsRS.java b/java/Balls/src/com/android/balls/BallsRS.java
index 42eaede..83b755f 100644
--- a/java/Balls/src/com/android/balls/BallsRS.java
+++ b/java/Balls/src/com/android/balls/BallsRS.java
@@ -63,7 +63,7 @@
         sb.addInput(mPoints.getElement());
         ProgramVertex pvs = sb.create();
         pvs.bindConstants(mVpConsts.getAllocation(), 0);
-        mRS.contextBindProgramVertex(pvs);
+        mRS.bindProgramVertex(pvs);
     }
 
     private Allocation loadTexture(int id) {
@@ -118,14 +118,14 @@
         mScript.set_gPFPoints(mPFPoints);
         createProgramVertex();
 
-        mRS.contextBindProgramStore(ProgramStore.BLEND_ADD_DEPTH_NO_DEPTH(mRS));
+        mRS.bindProgramStore(ProgramStore.BLEND_ADD_DEPTH_NO_DEPTH(mRS));
 
         mPhysicsScript.set_gMinPos(new Float2(5, 5));
         mPhysicsScript.set_gMaxPos(new Float2(width - 5, height - 5));
 
         mScript.invoke_initParts(width, height);
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 
     public void newTouchPosition(float x, float y, float pressure, int id) {
diff --git a/java/Balls/src/com/android/balls/BallsView.java b/java/Balls/src/com/android/balls/BallsView.java
index 635dac9..12f017b 100644
--- a/java/Balls/src/com/android/balls/BallsView.java
+++ b/java/Balls/src/com/android/balls/BallsView.java
@@ -53,8 +53,8 @@
         super.surfaceChanged(holder, format, w, h);
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new BallsRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -65,7 +65,7 @@
     protected void onDetachedFromWindow() {
         if(mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/Fountain/src/com/android/fountain/Fountain.java b/java/Fountain/src/com/android/fountain/Fountain.java
index 9ae3e67..116c478 100644
--- a/java/Fountain/src/com/android/fountain/Fountain.java
+++ b/java/Fountain/src/com/android/fountain/Fountain.java
@@ -67,7 +67,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -77,7 +77,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
 
 
 
diff --git a/java/Fountain/src/com/android/fountain/FountainRS.java b/java/Fountain/src/com/android/fountain/FountainRS.java
index 53fb646..5188050 100644
--- a/java/Fountain/src/com/android/fountain/FountainRS.java
+++ b/java/Fountain/src/com/android/fountain/FountainRS.java
@@ -36,7 +36,7 @@
 
         ProgramFragment.Builder pfb = new ProgramFragment.Builder(rs);
         pfb.setVaryingColor(true);
-        rs.contextBindProgramFragment(pfb.create());
+        rs.bindProgramFragment(pfb.create());
 
         ScriptField_Point points = new ScriptField_Point(mRS, PART_COUNT);
 
@@ -48,7 +48,7 @@
         mScript = new ScriptC_fountain(mRS, mRes, R.raw.fountain);
         mScript.set_partMesh(sm);
         mScript.bind_point(points);
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 
     boolean holdingColor[] = new boolean[10];
diff --git a/java/Fountain/src/com/android/fountain/FountainView.java b/java/Fountain/src/com/android/fountain/FountainView.java
index 50a9707..69b181d 100644
--- a/java/Fountain/src/com/android/fountain/FountainView.java
+++ b/java/Fountain/src/com/android/fountain/FountainView.java
@@ -53,8 +53,8 @@
         super.surfaceChanged(holder, format, w, h);
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new FountainRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -64,7 +64,7 @@
     protected void onDetachedFromWindow() {
         if (mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java b/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
index c617759..e935fa9 100644
--- a/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
+++ b/java/ImageProcessing/src/com/android/rs/image/ImageProcessingActivity.java
@@ -78,7 +78,7 @@
     private SurfaceView mSurfaceView;
     private ImageView mDisplayView;
 
-    class FilterCallback extends RenderScript.RSMessage {
+    class FilterCallback extends RenderScript.RSMessageHandler {
         private Runnable mAction = new Runnable() {
             public void run() {
                 mDisplayView.invalidate();
@@ -363,14 +363,14 @@
 
     private void createScript() {
         mRS = RenderScript.create();
-        mRS.mMessageCallback = new FilterCallback();
+        mRS.setMessageHandler(new FilterCallback());
 
         mInPixelsAllocation = Allocation.createBitmapRef(mRS, mBitmapIn);
         mOutPixelsAllocation = Allocation.createBitmapRef(mRS, mBitmapOut);
 
         Type.Builder tb = new Type.Builder(mRS, Element.F32_4(mRS));
-        tb.add(android.renderscript.Dimension.X, mBitmapIn.getWidth());
-        tb.add(android.renderscript.Dimension.Y, mBitmapIn.getHeight());
+        tb.setX(mBitmapIn.getWidth());
+        tb.setY(mBitmapIn.getHeight());
         mScratchPixelsAllocation1 = Allocation.createTyped(mRS, tb.create());
         mScratchPixelsAllocation2 = Allocation.createTyped(mRS, tb.create());
 
diff --git a/java/ModelViewer/src/com/android/modelviewer/SceneGraph.java b/java/ModelViewer/src/com/android/modelviewer/SceneGraph.java
index 557e0cc..b8717a7 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SceneGraph.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SceneGraph.java
@@ -56,7 +56,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -64,7 +64,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
     }
 
 }
diff --git a/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java b/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java
index 954ec96..07a4412 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SceneGraphRS.java
@@ -210,7 +210,7 @@
         mScript.bind_gRobot2(mRobot2.mParent.mChildField);
         mScript.set_gRobot2Index(mRobot2.mIndexInParentGroup);
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 }
 
diff --git a/java/ModelViewer/src/com/android/modelviewer/SceneGraphView.java b/java/ModelViewer/src/com/android/modelviewer/SceneGraphView.java
index 1cabba1..0b6a3b8 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SceneGraphView.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SceneGraphView.java
@@ -55,8 +55,8 @@
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
             sc.setDepth(16, 24);
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new SceneGraphRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -66,7 +66,7 @@
     protected void onDetachedFromWindow() {
         if (mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/ModelViewer/src/com/android/modelviewer/SimpleModel.java b/java/ModelViewer/src/com/android/modelviewer/SimpleModel.java
index cb7c39c..9910970 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SimpleModel.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SimpleModel.java
@@ -56,7 +56,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -64,7 +64,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
     }
 
 }
diff --git a/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java b/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java
index 29c3728..fb9e4c1 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SimpleModelRS.java
@@ -160,7 +160,7 @@
 
         initTextAllocation();
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 }
 
diff --git a/java/ModelViewer/src/com/android/modelviewer/SimpleModelView.java b/java/ModelViewer/src/com/android/modelviewer/SimpleModelView.java
index 875c4bd..5c5956d 100644
--- a/java/ModelViewer/src/com/android/modelviewer/SimpleModelView.java
+++ b/java/ModelViewer/src/com/android/modelviewer/SimpleModelView.java
@@ -55,8 +55,8 @@
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
             sc.setDepth(16, 24);
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new SimpleModelRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -66,7 +66,7 @@
     protected void onDetachedFromWindow() {
         if (mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/Samples/src/com/android/samples/RsList.java b/java/Samples/src/com/android/samples/RsList.java
index 0f6b1ac..d47be42 100644
--- a/java/Samples/src/com/android/samples/RsList.java
+++ b/java/Samples/src/com/android/samples/RsList.java
@@ -56,7 +56,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity loses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -64,7 +64,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity loses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
     }
 
 }
diff --git a/java/Samples/src/com/android/samples/RsListRS.java b/java/Samples/src/com/android/samples/RsListRS.java
index 3aa20e8..e139107 100644
--- a/java/Samples/src/com/android/samples/RsListRS.java
+++ b/java/Samples/src/com/android/samples/RsListRS.java
@@ -137,7 +137,7 @@
         mItalic = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD_ITALIC, 8);
         mScript.set_gItalic(mItalic);
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 }
 
diff --git a/java/Samples/src/com/android/samples/RsListView.java b/java/Samples/src/com/android/samples/RsListView.java
index 21b58b1..00b1723 100644
--- a/java/Samples/src/com/android/samples/RsListView.java
+++ b/java/Samples/src/com/android/samples/RsListView.java
@@ -55,8 +55,8 @@
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
             sc.setDepth(16, 24);
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new RsListRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -66,7 +66,7 @@
     protected void onDetachedFromWindow() {
         if (mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/Samples/src/com/android/samples/RsRenderStates.java b/java/Samples/src/com/android/samples/RsRenderStates.java
index 391007e..33c1719 100644
--- a/java/Samples/src/com/android/samples/RsRenderStates.java
+++ b/java/Samples/src/com/android/samples/RsRenderStates.java
@@ -56,7 +56,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -64,7 +64,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity looses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
     }
 
 }
diff --git a/java/Samples/src/com/android/samples/RsRenderStatesRS.java b/java/Samples/src/com/android/samples/RsRenderStatesRS.java
index 766601b..aff36de 100644
--- a/java/Samples/src/com/android/samples/RsRenderStatesRS.java
+++ b/java/Samples/src/com/android/samples/RsRenderStatesRS.java
@@ -396,7 +396,7 @@
         initProgramRaster();
         initCustomShaders();
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
     }
 }
 
diff --git a/java/Samples/src/com/android/samples/RsRenderStatesView.java b/java/Samples/src/com/android/samples/RsRenderStatesView.java
index 6893d20..235d29b 100644
--- a/java/Samples/src/com/android/samples/RsRenderStatesView.java
+++ b/java/Samples/src/com/android/samples/RsRenderStatesView.java
@@ -55,8 +55,8 @@
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
             sc.setDepth(16, 24);
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new RsRenderStatesRS();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -66,7 +66,7 @@
     protected void onDetachedFromWindow() {
         if (mRS != null) {
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/tests/src/com/android/rs/test/RSTest.java b/java/tests/src/com/android/rs/test/RSTest.java
index c264649..6b8fa6b 100644
--- a/java/tests/src/com/android/rs/test/RSTest.java
+++ b/java/tests/src/com/android/rs/test/RSTest.java
@@ -63,7 +63,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity loses focus
         super.onResume();
-        mView.onResume();
+        mView.resume();
     }
 
     @Override
@@ -71,7 +71,7 @@
         // Ideally a game should implement onResume() and onPause()
         // to take appropriate action when the activity loses focus
         super.onPause();
-        mView.onPause();
+        mView.pause();
     }
 
     static void log(String message) {
diff --git a/java/tests/src/com/android/rs/test/RSTestCore.java b/java/tests/src/com/android/rs/test/RSTestCore.java
index d2ce6c8..a1d1c2b 100644
--- a/java/tests/src/com/android/rs/test/RSTestCore.java
+++ b/java/tests/src/com/android/rs/test/RSTestCore.java
@@ -95,7 +95,7 @@
         mFont = Font.createFromFamily(mRS, mRes, "serif", Font.Style.BOLD, 8);
         mScript.set_gFont(mFont);
 
-        mRS.contextBindRootScript(mScript);
+        mRS.bindRootScript(mScript);
 
         test_iter = unitTests.listIterator();
         refreshTestResults(); /* Kick off the first test */
@@ -148,7 +148,7 @@
             mListAllocs.copyAll();
 
             mScript.bind_gList(mListAllocs);
-            mRS.contextBindRootScript(mScript);
+            mRS.bindRootScript(mScript);
         }
     }
 
diff --git a/java/tests/src/com/android/rs/test/RSTestView.java b/java/tests/src/com/android/rs/test/RSTestView.java
index c65f8c6..2f7542d 100644
--- a/java/tests/src/com/android/rs/test/RSTestView.java
+++ b/java/tests/src/com/android/rs/test/RSTestView.java
@@ -53,8 +53,8 @@
         super.surfaceChanged(holder, format, w, h);
         if (mRS == null) {
             RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
-            mRS = createRenderScript(sc);
-            mRS.contextSetSurface(w, h, holder.getSurface());
+            mRS = createRenderScriptGL(sc);
+            mRS.setSurface(holder, w, h);
             mRender = new RSTestCore();
             mRender.init(mRS, getResources(), w, h);
         }
@@ -65,7 +65,7 @@
         if(mRS != null) {
             mRender.cleanup();
             mRS = null;
-            destroyRenderScript();
+            destroyRenderScriptGL();
         }
     }
 
diff --git a/java/tests/src/com/android/rs/test/UT_fp_mad.java b/java/tests/src/com/android/rs/test/UT_fp_mad.java
index e2cff00..409192b 100644
--- a/java/tests/src/com/android/rs/test/UT_fp_mad.java
+++ b/java/tests/src/com/android/rs/test/UT_fp_mad.java
@@ -30,7 +30,7 @@
     public void run() {
         RenderScript pRS = RenderScript.create();
         ScriptC_fp_mad s = new ScriptC_fp_mad(pRS, mRes, R.raw.fp_mad);
-        pRS.mMessageCallback = mRsMessage;
+        pRS.setMessageHandler(mRsMessage);
         s.invoke_fp_mad_test(0, 0);
         pRS.finish();
         waitForMessage();
diff --git a/java/tests/src/com/android/rs/test/UT_primitives.java b/java/tests/src/com/android/rs/test/UT_primitives.java
index 2da43fc..6e0859a 100644
--- a/java/tests/src/com/android/rs/test/UT_primitives.java
+++ b/java/tests/src/com/android/rs/test/UT_primitives.java
@@ -89,7 +89,7 @@
     public void run() {
         RenderScript pRS = RenderScript.create();
         ScriptC_primitives s = new ScriptC_primitives(pRS, mRes, R.raw.primitives);
-        pRS.mMessageCallback = mRsMessage;
+        pRS.setMessageHandler(mRsMessage);
         if (!initializeGlobals(s)) {
             // initializeGlobals failed
             result = -1;
diff --git a/java/tests/src/com/android/rs/test/UT_rsdebug.java b/java/tests/src/com/android/rs/test/UT_rsdebug.java
index 7ad77c7..df31f98 100644
--- a/java/tests/src/com/android/rs/test/UT_rsdebug.java
+++ b/java/tests/src/com/android/rs/test/UT_rsdebug.java
@@ -30,7 +30,7 @@
     public void run() {
         RenderScript pRS = RenderScript.create();
         ScriptC_rsdebug s = new ScriptC_rsdebug(pRS, mRes, R.raw.rsdebug);
-        pRS.mMessageCallback = mRsMessage;
+        pRS.setMessageHandler(mRsMessage);
         s.invoke_test_rsdebug(0, 0);
         pRS.finish();
         waitForMessage();
diff --git a/java/tests/src/com/android/rs/test/UT_rstypes.java b/java/tests/src/com/android/rs/test/UT_rstypes.java
index 55f3746..d1232ce 100644
--- a/java/tests/src/com/android/rs/test/UT_rstypes.java
+++ b/java/tests/src/com/android/rs/test/UT_rstypes.java
@@ -29,8 +29,8 @@
 
     public void run() {
         RenderScript pRS = RenderScript.create();
-        ScriptC_rstypes s = new ScriptC_rstypes(pRS, mRes, R.raw.rstypes, true);
-        pRS.mMessageCallback = mRsMessage;
+        ScriptC_rstypes s = new ScriptC_rstypes(pRS, mRes, R.raw.rstypes);
+        pRS.setMessageHandler(mRsMessage);
         s.invoke_test_rstypes(0, 0);
         pRS.finish();
         waitForMessage();
diff --git a/java/tests/src/com/android/rs/test/UT_vector_array.java b/java/tests/src/com/android/rs/test/UT_vector_array.java
index 615ce14..6798781 100644
--- a/java/tests/src/com/android/rs/test/UT_vector_array.java
+++ b/java/tests/src/com/android/rs/test/UT_vector_array.java
@@ -30,7 +30,7 @@
     public void run() {
         RenderScript pRS = RenderScript.create();
         ScriptC_vector_array s = new ScriptC_vector_array(pRS, mRes, R.raw.vector_array);
-        pRS.mMessageCallback = mRsMessage;
+        pRS.setMessageHandler(mRsMessage);
         s.invoke_vector_array_test();
         pRS.finish();
         waitForMessage();
diff --git a/java/tests/src/com/android/rs/test/UnitTest.java b/java/tests/src/com/android/rs/test/UnitTest.java
index 90bb8a3..8923a19 100644
--- a/java/tests/src/com/android/rs/test/UnitTest.java
+++ b/java/tests/src/com/android/rs/test/UnitTest.java
@@ -15,7 +15,7 @@
  */
 
 package com.android.rs.test;
-import android.renderscript.RenderScript.RSMessage;
+import android.renderscript.RenderScript.RSMessageHandler;
 import android.util.Log;
 
 public class UnitTest extends Thread {
@@ -53,7 +53,7 @@
         this (null);
     }
 
-    protected RSMessage mRsMessage = new RSMessage() {
+    protected RSMessageHandler mRsMessage = new RSMessageHandler() {
         public void run() {
             if (result == 0) {
                 switch (mID) {
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index 4ade714..fbb5ac9 100644
--- a/rsAllocation.cpp
+++ b/rsAllocation.cpp
@@ -848,9 +848,7 @@
     const Element *dst = static_cast<const Element *>(_dst);
 
     //LOGE("%p rsi_AllocationCreateFromBitmap %i %i %i", rsc, w, h, genMips);
-    RsDimension dims[] = {RS_DIMENSION_X, RS_DIMENSION_Y, RS_DIMENSION_LOD};
-    uint32_t dimValues[] = {w, h, genMips};
-    RsType type = rsaTypeCreate(rsc, _dst, 3, dims, dimValues);
+    RsType type = rsaTypeCreate(rsc, _dst, w, h, 0, genMips, false);
 
     RsAllocation vTexAlloc = rsaAllocationCreateTyped(rsc, type);
     Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
@@ -888,9 +886,7 @@
     // Cubemap allocation's faces should be Width by Width each.
     // Source data should have 6 * Width by Width pixels
     // Error checking is done in the java layer
-    RsDimension dims[] = {RS_DIMENSION_X, RS_DIMENSION_Y, RS_DIMENSION_LOD, RS_DIMENSION_FACE};
-    uint32_t dimValues[] = {w, w, genMips, true};
-    RsType type = rsaTypeCreate(rsc, _dst, 4, dims, dimValues);
+    RsType type = rsaTypeCreate(rsc, _dst, w, h, 0, genMips, true);
 
     RsAllocation vTexAlloc = rsaAllocationCreateTyped(rsc, type);
     Allocation *texAlloc = static_cast<Allocation *>(vTexAlloc);
diff --git a/rsType.cpp b/rsType.cpp
index c195b9b..670ea33 100644
--- a/rsType.cpp
+++ b/rsType.cpp
@@ -272,33 +272,12 @@
 }
 }
 
-RsType rsaTypeCreate(RsContext con, RsElement _e, uint32_t dimCount,
-                     const RsDimension *dims, const uint32_t *vals) {
+RsType rsaTypeCreate(RsContext con, RsElement _e, uint32_t dimX,
+                     uint32_t dimY, uint32_t dimZ, bool mips, bool faces) {
     Context *rsc = static_cast<Context *>(con);
     Element *e = static_cast<Element *>(_e);
-    TypeState * stc = &rsc->mStateType;
 
-    uint32_t dimX = 0;
-    uint32_t dimY = 0;
-    uint32_t dimZ = 0;
-    uint32_t dimLOD = 0;
-    uint32_t dimFaces = 0;
-
-    for (uint32_t ct=0; ct < dimCount; ct++) {
-        switch (dims[ct]) {
-        case RS_DIMENSION_X: dimX = vals[ct]; break;
-        case RS_DIMENSION_Y: dimY = vals[ct]; break;
-        case RS_DIMENSION_Z: dimZ = vals[ct]; break;
-        case RS_DIMENSION_LOD: dimLOD = vals[ct]; break;
-        case RS_DIMENSION_FACE: dimFaces = vals[ct]; break;
-
-        default:
-            LOGE("rsaTypeCreate: Bad dimension");
-            rsAssert(0);
-        }
-    }
-
-    return Type::getType(rsc, e, dimX, dimY, dimZ, dimLOD, dimFaces);
+    return Type::getType(rsc, e, dimX, dimY, dimZ, mips, faces);
 }
 
 void rsaTypeGetNativeData(RsContext con, RsType type, uint32_t *typeData, uint32_t typeDataSize) {