Merge "Remove unused imports from frameworks/base."
diff --git a/Android.mk b/Android.mk
index 8b137ea..82b23f1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -843,7 +843,7 @@
 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
-LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /intl/
+LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
 
 LOCAL_MODULE := online-sdk
 
@@ -870,7 +870,7 @@
 LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)
 LOCAL_ADDITIONAL_DEPENDENCIES:=$(framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES)
 # specify a second html input dir and an output path relative to OUT_DIR)
-LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl /
+LOCAL_ADDITIONAL_HTML_DIR:=docs/html-intl/intl /
 
 LOCAL_MODULE := ds
 
diff --git a/api/current.txt b/api/current.txt
index 2845af1..4d500c6 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2537,22 +2537,36 @@
     method public static android.animation.ObjectAnimator ofArgb(java.lang.Object, java.lang.String, int...);
     method public static android.animation.ObjectAnimator ofArgb(T, android.util.Property<T, java.lang.Integer>, int...);
     method public static android.animation.ObjectAnimator ofFloat(java.lang.Object, java.lang.String, float...);
+    method public static android.animation.ObjectAnimator ofFloat(java.lang.Object, java.lang.String, java.lang.String, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofFloat(T, android.util.Property<T, java.lang.Float>, float...);
+    method public static android.animation.ObjectAnimator ofFloat(T, android.util.Property<T, java.lang.Float>, android.util.Property<T, java.lang.Float>, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofInt(java.lang.Object, java.lang.String, int...);
+    method public static android.animation.ObjectAnimator ofInt(java.lang.Object, java.lang.String, java.lang.String, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofInt(T, android.util.Property<T, java.lang.Integer>, int...);
+    method public static android.animation.ObjectAnimator ofInt(T, android.util.Property<T, java.lang.Integer>, android.util.Property<T, java.lang.Integer>, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofMultiFloat(java.lang.Object, java.lang.String, float[][]);
+    method public static android.animation.ObjectAnimator ofMultiFloat(java.lang.Object, java.lang.String, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofMultiFloat(java.lang.Object, java.lang.String, android.animation.TypeConverter<T, float[]>, android.animation.TypeEvaluator<T>, T...);
     method public static android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, int[][]);
+    method public static android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofMultiInt(java.lang.Object, java.lang.String, android.animation.TypeConverter<T, int[]>, android.animation.TypeEvaluator<T>, T...);
     method public static android.animation.ObjectAnimator ofObject(java.lang.Object, java.lang.String, android.animation.TypeEvaluator, java.lang.Object...);
+    method public static android.animation.ObjectAnimator ofObject(java.lang.Object, java.lang.String, android.animation.TypeConverter<android.graphics.PointF, ?>, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofObject(T, android.util.Property<T, V>, android.animation.TypeEvaluator<V>, V...);
     method public static android.animation.ObjectAnimator ofObject(T, android.util.Property<T, P>, android.animation.TypeConverter<V, P>, android.animation.TypeEvaluator<V>, V...);
+    method public static android.animation.ObjectAnimator ofObject(T, android.util.Property<T, V>, android.animation.TypeConverter<android.graphics.PointF, V>, android.graphics.Path);
     method public static android.animation.ObjectAnimator ofPropertyValuesHolder(java.lang.Object, android.animation.PropertyValuesHolder...);
     method public void setAutoCancel(boolean);
     method public void setProperty(android.util.Property);
     method public void setPropertyName(java.lang.String);
   }
 
+  public class PointFEvaluator implements android.animation.TypeEvaluator {
+    ctor public PointFEvaluator();
+    ctor public PointFEvaluator(android.graphics.PointF);
+    method public android.graphics.PointF evaluate(float, android.graphics.PointF, android.graphics.PointF);
+  }
+
   public class PropertyValuesHolder implements java.lang.Cloneable {
     method public android.animation.PropertyValuesHolder clone();
     method public java.lang.String getPropertyName();
@@ -2563,14 +2577,18 @@
     method public static android.animation.PropertyValuesHolder ofKeyframe(java.lang.String, android.animation.Keyframe...);
     method public static android.animation.PropertyValuesHolder ofKeyframe(android.util.Property, android.animation.Keyframe...);
     method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, float[][]);
+    method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.graphics.Path);
     method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.animation.TypeConverter<V, float[]>, android.animation.TypeEvaluator<V>, V...);
     method public static android.animation.PropertyValuesHolder ofMultiFloat(java.lang.String, android.animation.TypeConverter<T, float[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
     method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, int[][]);
+    method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.graphics.Path);
     method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.animation.TypeConverter<V, int[]>, android.animation.TypeEvaluator<V>, V...);
     method public static android.animation.PropertyValuesHolder ofMultiInt(java.lang.String, android.animation.TypeConverter<T, int[]>, android.animation.TypeEvaluator<T>, android.animation.Keyframe...);
     method public static android.animation.PropertyValuesHolder ofObject(java.lang.String, android.animation.TypeEvaluator, java.lang.Object...);
+    method public static android.animation.PropertyValuesHolder ofObject(java.lang.String, android.animation.TypeConverter<android.graphics.PointF, ?>, android.graphics.Path);
     method public static android.animation.PropertyValuesHolder ofObject(android.util.Property, android.animation.TypeEvaluator<V>, V...);
     method public static android.animation.PropertyValuesHolder ofObject(android.util.Property<?, V>, android.animation.TypeConverter<T, V>, android.animation.TypeEvaluator<T>, T...);
+    method public static android.animation.PropertyValuesHolder ofObject(android.util.Property<?, V>, android.animation.TypeConverter<android.graphics.PointF, V>, android.graphics.Path);
     method public void setConverter(android.animation.TypeConverter);
     method public void setEvaluator(android.animation.TypeEvaluator);
     method public void setFloatValues(float...);
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index 3adbf08..c0ce795 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -16,6 +16,8 @@
 
 package android.animation;
 
+import android.graphics.Path;
+import android.graphics.PointF;
 import android.util.Log;
 import android.util.Property;
 
@@ -210,6 +212,31 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
+     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
+     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are integers that are set to separate properties designated by
+     * <code>xPropertyName</code> and <code>yPropertyName</code>.
+     *
+     * @param target The object whose properties are to be animated. This object should
+     *               have public methods on it called <code>setNameX()</code> and
+     *               <code>setNameY</code>, where <code>nameX</code> and <code>nameY</code>
+     *               are the value of <code>xPropertyName</code> and <code>yPropertyName</code>
+     *               parameters, respectively.
+     * @param xPropertyName The name of the property for the x coordinate being animated.
+     * @param yPropertyName The name of the property for the y coordinate being animated.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static ObjectAnimator ofInt(Object target, String xPropertyName, String yPropertyName,
+            Path path) {
+        Keyframe[][] keyframes = PropertyValuesHolder.createKeyframes(path, true);
+        PropertyValuesHolder x = PropertyValuesHolder.ofKeyframe(xPropertyName, keyframes[0]);
+        PropertyValuesHolder y = PropertyValuesHolder.ofKeyframe(yPropertyName, keyframes[1]);
+        return ofPropertyValuesHolder(target, x, y);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates between int values. A single
      * value implies that that value is the one being animated to. Two values imply starting
      * and ending values. More than two values imply a starting value, values to animate through
@@ -228,6 +255,27 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
+     * using two properties.  A <code>Path</code></> animation moves in two dimensions, animating
+     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are integers that are set to separate properties, <code>xProperty</code> and
+     * <code>yProperty</code>.
+     *
+     * @param target The object whose properties are to be animated.
+     * @param xProperty The property for the x coordinate being animated.
+     * @param yProperty The property for the y coordinate being animated.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static <T> ObjectAnimator ofInt(T target, Property<T, Integer> xProperty,
+            Property<T, Integer> yProperty, Path path) {
+        Keyframe[][] keyframes = PropertyValuesHolder.createKeyframes(path, true);
+        PropertyValuesHolder x = PropertyValuesHolder.ofKeyframe(xProperty, keyframes[0]);
+        PropertyValuesHolder y = PropertyValuesHolder.ofKeyframe(yProperty, keyframes[1]);
+        return ofPropertyValuesHolder(target, x, y);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates over int values for a multiple
      * parameters setter. Only public methods that take only int parameters are supported.
      * Each <code>int[]</code> contains a complete set of parameters to the setter method.
@@ -249,6 +297,26 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates the target using a multi-int setter
+     * along the given <code>Path</code>. A <code>Path</code></> animation moves in two dimensions,
+     * animating coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are integer x and y coordinates used in the first and second parameter of the
+     * setter, respectively.
+     *
+     * @param target The object whose property is to be animated. This object may
+     * have a public method on it called <code>setName()</code>, where <code>name</code> is
+     * the value of the <code>propertyName</code> parameter. <code>propertyName</code> may also
+     * be the case-sensitive complete name of the public setter method.
+     * @param propertyName The name of the property being animated or the name of the setter method.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static ObjectAnimator ofMultiInt(Object target, String propertyName, Path path) {
+        PropertyValuesHolder pvh = PropertyValuesHolder.ofMultiInt(propertyName, path);
+        return ofPropertyValuesHolder(target, pvh);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates over values for a multiple int
      * parameters setter. Only public methods that take only int parameters are supported.
      * <p>At least two values must be provided, a start and end. More than two
@@ -258,7 +326,7 @@
      * @param target The object whose property is to be animated. This object may
      * have a public method on it called <code>setName()</code>, where <code>name</code> is
      * the value of the <code>propertyName</code> parameter. <code>propertyName</code> may also
-     * be the complete name of the public method.
+     * be the case-sensitive complete name of the public setter method.
      * @param propertyName The name of the property being animated or the name of the setter method.
      * @param converter Converts T objects into int parameters for the multi-value setter.
      * @param evaluator A TypeEvaluator that will be called on each animation frame to
@@ -334,6 +402,31 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
+     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
+     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are floats that are set to separate properties designated by
+     * <code>xPropertyName</code> and <code>yPropertyName</code>.
+     *
+     * @param target The object whose properties are to be animated. This object should
+     *               have public methods on it called <code>setNameX()</code> and
+     *               <code>setNameY</code>, where <code>nameX</code> and <code>nameY</code>
+     *               are the value of the <code>xPropertyName</code> and <code>yPropertyName</code>
+     *               parameters, respectively.
+     * @param xPropertyName The name of the property for the x coordinate being animated.
+     * @param yPropertyName The name of the property for the y coordinate being animated.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static ObjectAnimator ofFloat(Object target, String xPropertyName, String yPropertyName,
+            Path path) {
+        Keyframe[][] keyframes = PropertyValuesHolder.createKeyframes(path, false);
+        PropertyValuesHolder x = PropertyValuesHolder.ofKeyframe(xPropertyName, keyframes[0]);
+        PropertyValuesHolder y = PropertyValuesHolder.ofKeyframe(yPropertyName, keyframes[1]);
+        return ofPropertyValuesHolder(target, x, y);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates between float values. A single
      * value implies that that value is the one being animated to. Two values imply starting
      * and ending values. More than two values imply a starting value, values to animate through
@@ -353,6 +446,24 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
+     * using two properties. A <code>Path</code></> animation moves in two dimensions, animating
+     * coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are floats that are set to separate properties, <code>xProperty</code> and
+     * <code>yProperty</code>.
+     *
+     * @param target The object whose properties are to be animated.
+     * @param xProperty The property for the x coordinate being animated.
+     * @param yProperty The property for the y coordinate being animated.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> xProperty,
+            Property<T, Float> yProperty, Path path) {
+        return ofFloat(target, xProperty.getName(), yProperty.getName(), path);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates over float values for a multiple
      * parameters setter. Only public methods that take only float parameters are supported.
      * Each <code>float[]</code> contains a complete set of parameters to the setter method.
@@ -363,7 +474,7 @@
      * @param target The object whose property is to be animated. This object may
      * have a public method on it called <code>setName()</code>, where <code>name</code> is
      * the value of the <code>propertyName</code> parameter. <code>propertyName</code> may also
-     * be the complete name of the public method.
+     * be the case-sensitive complete name of the public setter method.
      * @param propertyName The name of the property being animated or the name of the setter method.
      * @param values A set of values that the animation will animate between over time.
      * @return An ObjectAnimator object that is set up to animate between the given values.
@@ -375,6 +486,26 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates the target using a multi-float setter
+     * along the given <code>Path</code>. A <code>Path</code></> animation moves in two dimensions,
+     * animating coordinates <code>(x, y)</code> together to follow the line. In this variation, the
+     * coordinates are float x and y coordinates used in the first and second parameter of the
+     * setter, respectively.
+     *
+     * @param target The object whose property is to be animated. This object may
+     * have a public method on it called <code>setName()</code>, where <code>name</code> is
+     * the value of the <code>propertyName</code> parameter. <code>propertyName</code> may also
+     * be the case-sensitive complete name of the public setter method.
+     * @param propertyName The name of the property being animated or the name of the setter method.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static ObjectAnimator ofMultiFloat(Object target, String propertyName, Path path) {
+        PropertyValuesHolder pvh = PropertyValuesHolder.ofMultiFloat(propertyName, path);
+        return ofPropertyValuesHolder(target, pvh);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates over values for a multiple float
      * parameters setter. Only public methods that take only float parameters are supported.
      * <p>At least two values must be provided, a start and end. More than two
@@ -426,6 +557,30 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates a property along a <code>Path</code>.
+     * A <code>Path</code></> animation moves in two dimensions, animating coordinates
+     * <code>(x, y)</code> together to follow the line. This variant animates the coordinates
+     * in a <code>PointF</code> to follow the <code>Path</code>. If the <code>Property</code>
+     * associated with <code>propertyName</code> uses a type other than <code>PointF</code>,
+     * <code>converter</code> can be used to change from <code>PointF</code> to the type
+     * associated with the <code>Property</code>.
+     *
+     * @param target The object whose property is to be animated. This object should
+     * have a public method on it called <code>setName()</code>, where <code>name</code> is
+     * the value of the <code>propertyName</code> parameter.
+     * @param propertyName The name of the property being animated.
+     * @param converter Converts a PointF to the type associated with the setter. May be
+     *                  null if conversion is unnecessary.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static ObjectAnimator ofObject(Object target, String propertyName,
+            TypeConverter<PointF, ?> converter, Path path) {
+        PropertyValuesHolder pvh = PropertyValuesHolder.ofObject(propertyName, converter, path);
+        return ofPropertyValuesHolder(target, pvh);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates between Object values. A single
      * value implies that that value is the one being animated to. Two values imply starting
      * and ending values. More than two values imply a starting value, values to animate through
@@ -475,6 +630,27 @@
     }
 
     /**
+     * Constructs and returns an ObjectAnimator that animates a property along a <code>Path</code>.
+     * A <code>Path</code></> animation moves in two dimensions, animating coordinates
+     * <code>(x, y)</code> together to follow the line. This variant animates the coordinates
+     * in a <code>PointF</code> to follow the <code>Path</code>. If <code>property</code>
+     * uses a type other than <code>PointF</code>, <code>converter</code> can be used to change
+     * from <code>PointF</code> to the type associated with the <code>Property</code>.
+     *
+     * @param target The object whose property is to be animated.
+     * @param property The property being animated. Should not be null.
+     * @param converter Converts a PointF to the type associated with the setter. May be
+     *                  null if conversion is unnecessary.
+     * @param path The <code>Path</code> to animate values along.
+     * @return An ObjectAnimator object that is set up to animate along <code>path</code>.
+     */
+    public static <T, V> ObjectAnimator ofObject(T target, Property<T, V> property,
+            TypeConverter<PointF, V> converter, Path path) {
+        PropertyValuesHolder pvh = PropertyValuesHolder.ofObject(property, converter, path);
+        return ofPropertyValuesHolder(target, pvh);
+    }
+
+    /**
      * Constructs and returns an ObjectAnimator that animates between the sets of values specified
      * in <code>PropertyValueHolder</code> objects. This variant should be used when animating
      * several properties at once with the same ObjectAnimator, since PropertyValuesHolder allows
diff --git a/core/java/android/animation/PointFEvaluator.java b/core/java/android/animation/PointFEvaluator.java
new file mode 100644
index 0000000..91d501f
--- /dev/null
+++ b/core/java/android/animation/PointFEvaluator.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.animation;
+
+import android.graphics.PointF;
+
+/**
+ * This evaluator can be used to perform type interpolation between <code>PointF</code> values.
+ */
+public class PointFEvaluator implements TypeEvaluator<PointF> {
+
+    /**
+     * When null, a new PointF is returned on every evaluate call. When non-null,
+     * mPoint will be modified and returned on every evaluate.
+     */
+    private PointF mPoint;
+
+    /**
+     * Construct a PointFEvaluator that returns a new PointF on every evaluate call.
+     * To avoid creating an object for each evaluate call,
+     * {@link PointFEvaluator#PointFEvaluator(android.graphics.PointF)} should be used
+     * whenever possible.
+     */
+    public PointFEvaluator() {
+    }
+
+    /**
+     * Constructs a PointFEvaluator that modifies and returns <code>reuse</code>
+     * in {@link #evaluate(float, android.graphics.PointF, android.graphics.PointF)} calls.
+     * The value returned from
+     * {@link #evaluate(float, android.graphics.PointF, android.graphics.PointF)} should
+     * not be cached because it will change over time as the object is reused on each
+     * call.
+     *
+     * @param reuse A PointF to be modified and returned by evaluate.
+     */
+    public PointFEvaluator(PointF reuse) {
+        mPoint = reuse;
+    }
+
+    /**
+     * This function returns the result of linearly interpolating the start and
+     * end PointF values, with <code>fraction</code> representing the proportion
+     * between the start and end values. The calculation is a simple parametric
+     * calculation on each of the separate components in the PointF objects
+     * (x, y).
+     *
+     * <p>If {@link #PointFEvaluator(android.graphics.PointF)} was used to construct
+     * this PointFEvaluator, the object returned will be the <code>reuse</code>
+     * passed into the constructor.</p>
+     *
+     * @param fraction   The fraction from the starting to the ending values
+     * @param startValue The start PointF
+     * @param endValue   The end PointF
+     * @return A linear interpolation between the start and end values, given the
+     *         <code>fraction</code> parameter.
+     */
+    @Override
+    public PointF evaluate(float fraction, PointF startValue, PointF endValue) {
+        float x = startValue.x + (fraction * (endValue.x - startValue.x));
+        float y = startValue.y + (fraction * (endValue.y - startValue.y));
+
+        if (mPoint != null) {
+            mPoint.set(x, y);
+            return mPoint;
+        } else {
+            return new PointF(x, y);
+        }
+    }
+}
diff --git a/core/java/android/animation/PropertyValuesHolder.java b/core/java/android/animation/PropertyValuesHolder.java
index c291970..1b028e0 100644
--- a/core/java/android/animation/PropertyValuesHolder.java
+++ b/core/java/android/animation/PropertyValuesHolder.java
@@ -16,6 +16,9 @@
 
 package android.animation;
 
+import android.graphics.Path;
+import android.graphics.PointF;
+import android.util.FloatMath;
 import android.util.FloatProperty;
 import android.util.IntProperty;
 import android.util.Log;
@@ -176,8 +179,8 @@
      * start, through all intermediate values to the end value. When used with ObjectAnimator,
      * the elements of the array represent the parameters of the setter function.
      *
-     * @param propertyName The name of the property being animated. Can also be the name of the
-     *                     entire setter method. Should not be null.
+     * @param propertyName The name of the property being animated. Can also be the
+     *                     case-sensitive name of the entire setter method. Should not be null.
      * @param values The values that the property will animate between.
      * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
      * @see IntArrayEvaluator#IntArrayEvaluator(int[])
@@ -204,6 +207,26 @@
     }
 
     /**
+     * Constructs and returns a PropertyValuesHolder with a given property name to use
+     * as a multi-int setter. The values are animated along the path, with the first
+     * parameter of the setter set to the x coordinate and the second set to the y coordinate.
+     *
+     * @param propertyName The name of the property being animated. Can also be the
+     *                     case-sensitive name of the entire setter method. Should not be null.
+     *                     The setter must take exactly two <code>int</code> parameters.
+     * @param path The Path along which the values should be animated.
+     * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+     * @see ObjectAnimator#ofPropertyValuesHolder(Object, PropertyValuesHolder...)
+     */
+    public static PropertyValuesHolder ofMultiInt(String propertyName, Path path) {
+        Keyframe[] keyframes = createKeyframes(path);
+        KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(keyframes);
+        TypeEvaluator<PointF> evaluator = new PointFEvaluator(new PointF());
+        PointFToIntArray converter = new PointFToIntArray();
+        return new MultiIntValuesHolder(propertyName, converter, evaluator, keyframeSet);
+    }
+
+    /**
      * Constructs and returns a PropertyValuesHolder with a given property and
      * set of Object values for use with ObjectAnimator multi-value setters. The Object
      * values are converted to <code>int[]</code> using the converter.
@@ -276,8 +299,8 @@
      * start, through all intermediate values to the end value. When used with ObjectAnimator,
      * the elements of the array represent the parameters of the setter function.
      *
-     * @param propertyName The name of the property being animated. Can also be the name of the
-     *                     entire setter method. Should not be null.
+     * @param propertyName The name of the property being animated. Can also be the
+     *                     case-sensitive name of the entire setter method. Should not be null.
      * @param values The values that the property will animate between.
      * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
      * @see FloatArrayEvaluator#FloatArrayEvaluator(float[])
@@ -304,6 +327,26 @@
     }
 
     /**
+     * Constructs and returns a PropertyValuesHolder with a given property name to use
+     * as a multi-float setter. The values are animated along the path, with the first
+     * parameter of the setter set to the x coordinate and the second set to the y coordinate.
+     *
+     * @param propertyName The name of the property being animated. Can also be the
+     *                     case-sensitive name of the entire setter method. Should not be null.
+     *                     The setter must take exactly two <code>float</code> parameters.
+     * @param path The Path along which the values should be animated.
+     * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+     * @see ObjectAnimator#ofPropertyValuesHolder(Object, PropertyValuesHolder...)
+     */
+    public static PropertyValuesHolder ofMultiFloat(String propertyName, Path path) {
+        Keyframe[] keyframes = createKeyframes(path);
+        KeyframeSet keyframeSet = KeyframeSet.ofKeyframe(keyframes);
+        TypeEvaluator<PointF> evaluator = new PointFEvaluator(new PointF());
+        PointFToFloatArray converter = new PointFToFloatArray();
+        return new MultiFloatValuesHolder(propertyName, converter, evaluator, keyframeSet);
+    }
+
+    /**
      * Constructs and returns a PropertyValuesHolder with a given property and
      * set of Object values for use with ObjectAnimator multi-value setters. The Object
      * values are converted to <code>float[]</code> using the converter.
@@ -367,6 +410,27 @@
     }
 
     /**
+     * Constructs and returns a PropertyValuesHolder with a given property name and
+     * a Path along which the values should be animated. This variant supports a
+     * <code>TypeConverter</code> to convert from <code>PointF</code> to the target
+     * type.
+     *
+     * @param propertyName The name of the property being animated.
+     * @param converter Converts a PointF to the type associated with the setter. May be
+     *                  null if conversion is unnecessary.
+     * @param path The Path along which the values should be animated.
+     * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+     */
+    public static PropertyValuesHolder ofObject(String propertyName,
+            TypeConverter<PointF, ?> converter, Path path) {
+        Keyframe[] keyframes = createKeyframes(path);
+        PropertyValuesHolder pvh = ofKeyframe(propertyName, keyframes);
+        pvh.setEvaluator(new PointFEvaluator(new PointF()));
+        pvh.setConverter(converter);
+        return pvh;
+    }
+
+    /**
      * Constructs and returns a PropertyValuesHolder with a given property and
      * set of Object values. This variant also takes a TypeEvaluator because the system
      * cannot automatically interpolate between objects of unknown type.
@@ -415,6 +479,27 @@
     }
 
     /**
+     * Constructs and returns a PropertyValuesHolder with a given property and
+     * a Path along which the values should be animated. This variant supports a
+     * <code>TypeConverter</code> to convert from <code>PointF</code> to the target
+     * type.
+     *
+     * @param property The property being animated. Should not be null.
+     * @param converter Converts a PointF to the type associated with the setter. May be
+     *                  null if conversion is unnecessary.
+     * @param path The Path along which the values should be animated.
+     * @return PropertyValuesHolder The constructed PropertyValuesHolder object.
+     */
+    public static <V> PropertyValuesHolder ofObject(Property<?, V> property,
+            TypeConverter<PointF, V> converter, Path path) {
+        Keyframe[] keyframes = createKeyframes(path);
+        PropertyValuesHolder pvh = ofKeyframe(property, keyframes);
+        pvh.setEvaluator(new PointFEvaluator(new PointF()));
+        pvh.setConverter(converter);
+        return pvh;
+    }
+
+    /**
      * Constructs and returns a PropertyValuesHolder object with the specified property name and set
      * of values. These values can be of any type, but the type should be consistent so that
      * an appropriate {@link android.animation.TypeEvaluator} can be found that matches
@@ -1439,6 +1524,113 @@
         }
     }
 
+    /* Path interpolation relies on approximating the Path as a series of line segments.
+       The line segments are recursively divided until there is less than 1/2 pixel error
+       between the lines and the curve. Each point of the line segment is converted
+       to a Keyframe and a linear interpolation between Keyframes creates a good approximation
+       of the curve.
+
+       The fraction for each Keyframe is the length along the Path to the point, divided by
+       the total Path length. Two points may have the same fraction in the case of a move
+       command causing a disjoint Path.
+
+       The value for each Keyframe is either the point as a PointF or one of the x or y
+       coordinates as an int or float. In the latter case, two Keyframes are generated for
+       each point that have the same fraction. */
+
+    /**
+     * Returns separate Keyframes arrays for the x and y coordinates along a Path. If
+     * isInt is true, the Keyframes will be IntKeyframes, otherwise they will be FloatKeyframes.
+     * The element at index 0 are the x coordinate Keyframes and element at index 1 are the
+     * y coordinate Keyframes. The returned values can be linearly interpolated and get less
+     * than 1/2 pixel error.
+     */
+    static Keyframe[][] createKeyframes(Path path, boolean isInt) {
+        if (path == null || path.isEmpty()) {
+            throw new IllegalArgumentException("The path must not be null or empty");
+        }
+        float[] pointComponents = path.approximate(0.5f);
+
+        int numPoints = pointComponents.length / 3;
+
+        Keyframe[][] keyframes = new Keyframe[2][];
+        keyframes[0] = new Keyframe[numPoints];
+        keyframes[1] = new Keyframe[numPoints];
+        int componentIndex = 0;
+        for (int i = 0; i < numPoints; i++) {
+            float fraction = pointComponents[componentIndex++];
+            float x = pointComponents[componentIndex++];
+            float y = pointComponents[componentIndex++];
+            if (isInt) {
+                keyframes[0][i] = Keyframe.ofInt(fraction, Math.round(x));
+                keyframes[1][i] = Keyframe.ofInt(fraction, Math.round(y));
+            } else {
+                keyframes[0][i] = Keyframe.ofFloat(fraction, x);
+                keyframes[1][i] = Keyframe.ofFloat(fraction, y);
+            }
+        }
+        return keyframes;
+    }
+
+    /**
+     * Returns PointF Keyframes for a Path. The resulting points can be linearly interpolated
+     * with less than 1/2 pixel in error.
+     */
+    private static Keyframe[] createKeyframes(Path path) {
+        if (path == null || path.isEmpty()) {
+            throw new IllegalArgumentException("The path must not be null or empty");
+        }
+        float[] pointComponents = path.approximate(0.5f);
+
+        int numPoints = pointComponents.length / 3;
+
+        Keyframe[] keyframes = new Keyframe[numPoints];
+        int componentIndex = 0;
+        for (int i = 0; i < numPoints; i++) {
+            float fraction = pointComponents[componentIndex++];
+            float x = pointComponents[componentIndex++];
+            float y = pointComponents[componentIndex++];
+            keyframes[i] = Keyframe.ofObject(fraction, new PointF(x, y));
+        }
+        return keyframes;
+    }
+
+    /**
+     * Convert from PointF to float[] for multi-float setters along a Path.
+     */
+    private static class PointFToFloatArray extends TypeConverter<PointF, float[]> {
+        private float[] mCoordinates = new float[2];
+
+        public PointFToFloatArray() {
+            super(PointF.class, float[].class);
+        }
+
+        @Override
+        public float[] convert(PointF value) {
+            mCoordinates[0] = value.x;
+            mCoordinates[1] = value.y;
+            return mCoordinates;
+        }
+    };
+
+    /**
+     * Convert from PointF to int[] for multi-int setters along a Path.
+     */
+    private static class PointFToIntArray extends TypeConverter<PointF, int[]> {
+        private int[] mCoordinates = new int[2];
+
+        public PointFToIntArray() {
+            super(PointF.class, int[].class);
+        }
+
+        @Override
+        public int[] convert(PointF value) {
+            mCoordinates[0] = Math.round(value.x);
+            mCoordinates[1] = Math.round(value.y);
+            return mCoordinates;
+        }
+    };
+
     native static private int nGetIntMethod(Class targetClass, String methodName);
     native static private int nGetFloatMethod(Class targetClass, String methodName);
     native static private int nGetMultipleIntMethod(Class targetClass, String methodName,
@@ -1456,4 +1648,4 @@
     native static private void nCallFourFloatMethod(Object target, int methodID, float arg1,
             float arg2, float arg3, float arg4);
     native static private void nCallMultipleFloatMethod(Object target, int methodID, float[] args);
-}
\ No newline at end of file
+}
diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp
index ab7f1dc..97a7de6 100644
--- a/core/jni/android/graphics/Path.cpp
+++ b/core/jni/android/graphics/Path.cpp
@@ -28,6 +28,8 @@
 #include "pathops/SkPathOps.h"
 
 #include <Caches.h>
+#include <vector>
+#include <map>
 
 namespace android {
 
@@ -265,6 +267,196 @@
     static jboolean op(JNIEnv* env, jobject clazz, SkPath* p1, SkPath* p2, SkPathOp op, SkPath* r) {
          return Op(*p1, *p2, op, r);
      }
+
+
+    typedef SkPoint (*bezierCalculation)(float t, const SkPoint* points);
+
+    static void addMove(std::vector<SkPoint>& segmentPoints, std::vector<float>& lengths,
+            const SkPoint& point) {
+        float length = 0;
+        if (!lengths.empty()) {
+            length = lengths.back();
+        }
+        segmentPoints.push_back(point);
+        lengths.push_back(length);
+    }
+
+    static void addLine(std::vector<SkPoint>& segmentPoints, std::vector<float>& lengths,
+            const SkPoint& toPoint) {
+        if (segmentPoints.empty()) {
+            segmentPoints.push_back(SkPoint::Make(0, 0));
+            lengths.push_back(0);
+        } else if (segmentPoints.back() == toPoint) {
+            return; // Empty line
+        }
+        float length = lengths.back() + SkPoint::Distance(segmentPoints.back(), toPoint);
+        segmentPoints.push_back(toPoint);
+        lengths.push_back(length);
+    }
+
+    static float cubicCoordinateCalculation(float t, float p0, float p1, float p2, float p3) {
+        float oneMinusT = 1 - t;
+        float oneMinusTSquared = oneMinusT * oneMinusT;
+        float oneMinusTCubed = oneMinusTSquared * oneMinusT;
+        float tSquared = t * t;
+        float tCubed = tSquared * t;
+        return (oneMinusTCubed * p0) + (3 * oneMinusTSquared * t * p1)
+                + (3 * oneMinusT * tSquared * p2) + (tCubed * p3);
+    }
+
+    static SkPoint cubicBezierCalculation(float t, const SkPoint* points) {
+        float x = cubicCoordinateCalculation(t, points[0].x(), points[1].x(),
+            points[2].x(), points[3].x());
+        float y = cubicCoordinateCalculation(t, points[0].y(), points[1].y(),
+            points[2].y(), points[3].y());
+        return SkPoint::Make(x, y);
+    }
+
+    static float quadraticCoordinateCalculation(float t, float p0, float p1, float p2) {
+        float oneMinusT = 1 - t;
+        return oneMinusT * ((oneMinusT * p0) + (t * p1)) + t * ((oneMinusT * p1) + (t * p2));
+    }
+
+    static SkPoint quadraticBezierCalculation(float t, const SkPoint* points) {
+        float x = quadraticCoordinateCalculation(t, points[0].x(), points[1].x(), points[2].x());
+        float y = quadraticCoordinateCalculation(t, points[0].y(), points[1].y(), points[2].y());
+        return SkPoint::Make(x, y);
+    }
+
+    // Subdivide a section of the Bezier curve, set the mid-point and the mid-t value.
+    // Returns true if further subdivision is necessary as defined by errorSquared.
+    static bool subdividePoints(const SkPoint* points, bezierCalculation bezierFunction,
+            float t0, const SkPoint &p0, float t1, const SkPoint &p1,
+            float& midT, SkPoint &midPoint, float errorSquared) {
+        midT = (t1 + t0) / 2;
+        float midX = (p1.x() + p0.x()) / 2;
+        float midY = (p1.y() + p0.y()) / 2;
+
+        midPoint = (*bezierFunction)(midT, points);
+        float xError = midPoint.x() - midX;
+        float yError = midPoint.y() - midY;
+        float midErrorSquared = (xError * xError) + (yError * yError);
+        return midErrorSquared > errorSquared;
+    }
+
+    // Divides Bezier curves until linear interpolation is very close to accurate, using
+    // errorSquared as a metric. Cubic Bezier curves can have an inflection point that improperly
+    // short-circuit subdivision. If you imagine an S shape, the top and bottom points being the
+    // starting and end points, linear interpolation would mark the center where the curve places
+    // the point. It is clearly not the case that we can linearly interpolate at that point.
+    // doubleCheckDivision forces a second examination between subdivisions to ensure that linear
+    // interpolation works.
+    static void addBezier(const SkPoint* points,
+            bezierCalculation bezierFunction, std::vector<SkPoint>& segmentPoints,
+            std::vector<float>& lengths, float errorSquared, bool doubleCheckDivision) {
+        typedef std::map<float, SkPoint> PointMap;
+        PointMap tToPoint;
+
+        tToPoint[0] = (*bezierFunction)(0, points);
+        tToPoint[1] = (*bezierFunction)(1, points);
+
+        PointMap::iterator iter = tToPoint.begin();
+        PointMap::iterator next = iter;
+        ++next;
+        while (next != tToPoint.end()) {
+            bool needsSubdivision = true;
+            SkPoint midPoint;
+            do {
+                float midT;
+                needsSubdivision = subdividePoints(points, bezierFunction, iter->first,
+                    iter->second, next->first, next->second, midT, midPoint, errorSquared);
+                if (!needsSubdivision && doubleCheckDivision) {
+                    SkPoint quarterPoint;
+                    float quarterT;
+                    needsSubdivision = subdividePoints(points, bezierFunction, iter->first,
+                        iter->second, midT, midPoint, quarterT, quarterPoint, errorSquared);
+                    if (needsSubdivision) {
+                        // Found an inflection point. No need to double-check.
+                        doubleCheckDivision = false;
+                    }
+                }
+                if (needsSubdivision) {
+                    next = tToPoint.insert(iter, PointMap::value_type(midT, midPoint));
+                }
+            } while (needsSubdivision);
+            iter = next;
+            next++;
+        }
+
+        // Now that each division can use linear interpolation with less than the allowed error
+        for (iter = tToPoint.begin(); iter != tToPoint.end(); ++iter) {
+            addLine(segmentPoints, lengths, iter->second);
+        }
+    }
+
+    static void createVerbSegments(SkPath::Verb verb, const SkPoint* points,
+        std::vector<SkPoint>& segmentPoints, std::vector<float>& lengths, float errorSquared) {
+        switch (verb) {
+            case SkPath::kMove_Verb:
+                addMove(segmentPoints, lengths, points[0]);
+                break;
+            case SkPath::kClose_Verb:
+            case SkPath::kLine_Verb:
+                addLine(segmentPoints, lengths, points[1]);
+                break;
+            case SkPath::kQuad_Verb:
+                addBezier(points, quadraticBezierCalculation, segmentPoints, lengths,
+                    errorSquared, false);
+                break;
+            case SkPath::kCubic_Verb:
+                addBezier(points, cubicBezierCalculation, segmentPoints, lengths,
+                    errorSquared, true);
+                break;
+            default:
+                // Leave element as NULL, Conic sections are not supported.
+                break;
+        }
+    }
+
+    // Returns a float[] with each point along the path represented by 3 floats
+    // * fractional length along the path that the point resides
+    // * x coordinate
+    // * y coordinate
+    // Note that more than one point may have the same length along the path in
+    // the case of a move.
+    // NULL can be returned if the Path is empty.
+    static jfloatArray approximate(JNIEnv* env, jclass, SkPath* path, float acceptableError)
+    {
+        SkASSERT(path);
+        SkPath::Iter pathIter(*path, false);
+        SkPath::Verb verb;
+        SkPoint points[4];
+        std::vector<SkPoint> segmentPoints;
+        std::vector<float> lengths;
+        float errorSquared = acceptableError * acceptableError;
+
+        while ((verb = pathIter.next(points)) != SkPath::kDone_Verb) {
+            createVerbSegments(verb, points, segmentPoints, lengths, errorSquared);
+        }
+
+        if (segmentPoints.empty()) {
+            return NULL;
+        }
+
+        size_t numPoints = segmentPoints.size();
+        size_t approximationArraySize = numPoints * 3;
+
+        float* approximation = new float[approximationArraySize];
+        float totalLength = lengths.back();
+
+        int approximationIndex = 0;
+        for (int i = 0; i < numPoints; i++) {
+            const SkPoint& point = segmentPoints[i];
+            approximation[approximationIndex++] = lengths[i] / totalLength;
+            approximation[approximationIndex++] = point.x();
+            approximation[approximationIndex++] = point.y();
+        }
+
+        jfloatArray result = env->NewFloatArray(approximationArraySize);
+        env->SetFloatArrayRegion(result, 0, approximationArraySize, approximation);
+        delete[] approximation;
+        return result;
+    }
 };
 
 static JNINativeMethod methods[] = {
@@ -305,7 +497,8 @@
     {"native_setLastPoint","(IFF)V", (void*) SkPathGlue::setLastPoint},
     {"native_transform","(III)V", (void*) SkPathGlue::transform__MatrixPath},
     {"native_transform","(II)V", (void*) SkPathGlue::transform__Matrix},
-    {"native_op","(IIII)Z", (void*) SkPathGlue::op}
+    {"native_op","(IIII)Z", (void*) SkPathGlue::op},
+    {"native_approximate", "(IF)[F", (void*) SkPathGlue::approximate},
 };
 
 int register_android_graphics_Path(JNIEnv* env) {
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 0547c6e..c0af07b 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1547,6 +1547,8 @@
     <string name="media_route_button_content_description" msgid="5758553567065145276">"Мультымедыйны выхад"</string>
     <!-- no translation found for media_route_chooser_title (1751618554539087622) -->
     <skip />
+    <!-- no translation found for media_route_chooser_title_for_remote_display (3395541745872017583) -->
+    <skip />
     <!-- no translation found for media_route_chooser_searching (4776236202610828706) -->
     <skip />
     <!-- no translation found for media_route_chooser_extended_settings (87015534236701604) -->
@@ -1565,11 +1567,11 @@
     <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g>x<xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> кр. на цалю"</string>
     <!-- no translation found for display_manager_overlay_display_secure_suffix (6022119702628572080) -->
     <skip />
-    <!-- no translation found for wifi_display_notification_connecting_title (9102788196896266990) -->
+    <!-- no translation found for wifi_display_notification_connecting_title (2838646471050359706) -->
     <skip />
     <!-- no translation found for wifi_display_notification_connecting_message (5837350993752841389) -->
     <skip />
-    <!-- no translation found for wifi_display_notification_connected_title (4118323329495921271) -->
+    <!-- no translation found for wifi_display_notification_connected_title (8567308065912676285) -->
     <skip />
     <!-- no translation found for wifi_display_notification_connected_message (2587209325701109715) -->
     <skip />
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index d0ebba8..fb3dd83 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -990,10 +990,10 @@
     <string name="enable_explore_by_touch_warning_message" product="tablet" msgid="8655887539089910577">"<xliff:g id="ACCESSIBILITY_SERVICE_NAME">%1$s</xliff:g> vol activar l\'exploració tàctil. Quan l\'exploració tàctil està activada, pots escoltar o veure les descripcions del contingut seleccionat o utilitzar gestos per interactuar amb la tauleta."</string>
     <string name="enable_explore_by_touch_warning_message" product="default" msgid="2708199672852373195">"<xliff:g id="ACCESSIBILITY_SERVICE_NAME">%1$s</xliff:g> vol activar l\'exploració tàctil. Quan l\'exploració per tàctil està activada, pots escoltar o veure les descripcions del contingut seleccionat o utilitzar gestos per interactuar amb el telèfon."</string>
     <string name="oneMonthDurationPast" msgid="7396384508953779925">"Fa 1 mes"</string>
-    <string name="beforeOneMonthDurationPast" msgid="909134546836499826">"Fa menys d\'1 mes"</string>
+    <string name="beforeOneMonthDurationPast" msgid="909134546836499826">"Fa més d\'1 mes"</string>
   <plurals name="num_seconds_ago">
     <item quantity="one" msgid="4869870056547896011">"Fa 1 segon"</item>
-    <item quantity="other" msgid="3903706804349556379">"fa <xliff:g id="COUNT">%d</xliff:g> segons"</item>
+    <item quantity="other" msgid="3903706804349556379">"Fa <xliff:g id="COUNT">%d</xliff:g> segons"</item>
   </plurals>
   <plurals name="num_minutes_ago">
     <item quantity="one" msgid="3306787433088810191">"Fa 1 minut"</item>
@@ -1009,7 +1009,7 @@
     <string name="last_month" msgid="3959346739979055432">"El mes passat"</string>
     <string name="older" msgid="5211975022815554840">"Més antigues"</string>
   <plurals name="num_days_ago">
-    <item quantity="one" msgid="861358534398115820">"ahir"</item>
+    <item quantity="one" msgid="861358534398115820">"Ahir"</item>
     <item quantity="other" msgid="2479586466153314633">"Fa <xliff:g id="COUNT">%d</xliff:g> dies"</item>
   </plurals>
   <plurals name="in_num_seconds">
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 80d8b6c..ab7c230 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -1124,7 +1124,7 @@
     <string name="capital_on" msgid="1544682755514494298">"TIL"</string>
     <string name="capital_off" msgid="6815870386972805832">"FRA"</string>
     <string name="whichApplication" msgid="4533185947064773386">"Brug"</string>
-    <string name="whichHomeApplication" msgid="4616420172727326782">"Vælg en startsideapp"</string>
+    <string name="whichHomeApplication" msgid="4616420172727326782">"Vælg en startapp"</string>
     <string name="alwaysUse" msgid="4583018368000610438">"Brug som standard til denne handling."</string>
     <string name="clearDefaultHintMsg" msgid="3252584689512077257">"Ryd standard i Systemindstillinger &gt; Apps &gt; Downloadet."</string>
     <string name="chooseActivity" msgid="7486876147751803333">"Vælg en handling"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index b2b61d0..c8cc660 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -1495,7 +1495,7 @@
     <string name="wireless_display_route_description" msgid="9070346425023979651">"Uonyeshaji usiotumia waya"</string>
     <string name="media_route_button_content_description" msgid="5758553567065145276">"Towe la midia"</string>
     <string name="media_route_chooser_title" msgid="1751618554539087622">"Unganisha kwenye kifaa"</string>
-    <string name="media_route_chooser_title_for_remote_display" msgid="3395541745872017583">"Tuma skrini kwa kifaa"</string>
+    <string name="media_route_chooser_title_for_remote_display" msgid="3395541745872017583">"Tuma skrini kwenye kifaa"</string>
     <string name="media_route_chooser_searching" msgid="4776236202610828706">"Inatafuta vifaa..."</string>
     <string name="media_route_chooser_extended_settings" msgid="87015534236701604">"Mipangilio"</string>
     <string name="media_route_controller_disconnect" msgid="8966120286374158649">"Ondoa"</string>
@@ -1509,10 +1509,10 @@
     <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"Uwekeleaji #<xliff:g id="ID">%1$d</xliff:g>"</string>
     <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g>x<xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> dpi"</string>
     <string name="display_manager_overlay_display_secure_suffix" msgid="6022119702628572080">", salama"</string>
-    <string name="wifi_display_notification_connecting_title" msgid="2838646471050359706">"Utumaji wa skrini"</string>
-    <string name="wifi_display_notification_connecting_message" msgid="5837350993752841389">"Inaunganishwa kwenye <xliff:g id="NAME">%1$s</xliff:g>"</string>
-    <string name="wifi_display_notification_connected_title" msgid="8567308065912676285">"Utumaji wa skrini"</string>
-    <string name="wifi_display_notification_connected_message" msgid="2587209325701109715">"Imeungwanishwa kwenye <xliff:g id="NAME">%1$s</xliff:g>"</string>
+    <string name="wifi_display_notification_connecting_title" msgid="2838646471050359706">"Inatuma skrini"</string>
+    <string name="wifi_display_notification_connecting_message" msgid="5837350993752841389">"Inaunganishwa na <xliff:g id="NAME">%1$s</xliff:g>"</string>
+    <string name="wifi_display_notification_connected_title" msgid="8567308065912676285">"Inatuma skrini"</string>
+    <string name="wifi_display_notification_connected_message" msgid="2587209325701109715">"Imeungwanishwa na <xliff:g id="NAME">%1$s</xliff:g>"</string>
     <string name="wifi_display_notification_disconnect" msgid="6183754463561153372">"Tenganisha"</string>
     <string name="kg_emergency_call_label" msgid="684946192523830531">"Simu ya dharura"</string>
     <string name="kg_forgot_pattern_button_text" msgid="8852021467868220608">"Umesahau Ruwaza"</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index eaa859a..7cb7de2 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -1509,9 +1509,9 @@
     <string name="display_manager_overlay_display_name" msgid="5142365982271620716">"重疊效果 #<xliff:g id="ID">%1$d</xliff:g>"</string>
     <string name="display_manager_overlay_display_title" msgid="652124517672257172">"<xliff:g id="NAME">%1$s</xliff:g>:<xliff:g id="WIDTH">%2$d</xliff:g>x<xliff:g id="HEIGHT">%3$d</xliff:g>,<xliff:g id="DPI">%4$d</xliff:g> dpi"</string>
     <string name="display_manager_overlay_display_secure_suffix" msgid="6022119702628572080">"(安全)"</string>
-    <string name="wifi_display_notification_connecting_title" msgid="2838646471050359706">"正在放送螢幕"</string>
+    <string name="wifi_display_notification_connecting_title" msgid="2838646471050359706">"正在此放送螢幕"</string>
     <string name="wifi_display_notification_connecting_message" msgid="5837350993752841389">"正在連線到「<xliff:g id="NAME">%1$s</xliff:g>」"</string>
-    <string name="wifi_display_notification_connected_title" msgid="8567308065912676285">"正在放送螢幕"</string>
+    <string name="wifi_display_notification_connected_title" msgid="8567308065912676285">"正在此放送螢幕"</string>
     <string name="wifi_display_notification_connected_message" msgid="2587209325701109715">"已連線到「<xliff:g id="NAME">%1$s</xliff:g>」"</string>
     <string name="wifi_display_notification_disconnect" msgid="6183754463561153372">"中斷連線"</string>
     <string name="kg_emergency_call_label" msgid="684946192523830531">"緊急電話"</string>
diff --git a/docs/html-intl/es/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/es/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/index.jd b/docs/html-intl/intl/es/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/es/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/es/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/es/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/es/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/es/training/multiscreen/adaptui.jd b/docs/html-intl/intl/es/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/es/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/es/training/multiscreen/index.jd b/docs/html-intl/intl/es/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/index.jd
rename to docs/html-intl/intl/es/training/multiscreen/index.jd
diff --git a/docs/html-intl/es/training/multiscreen/screendensities.jd b/docs/html-intl/intl/es/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/es/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/es/training/multiscreen/screensizes.jd b/docs/html-intl/intl/es/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/es/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/es/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ja/guide/publishing/app-signing.jd b/docs/html-intl/intl/ja/guide/publishing/app-signing.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/app-signing.jd
rename to docs/html-intl/intl/ja/guide/publishing/app-signing.jd
diff --git a/docs/html-intl/ja/guide/publishing/preparing.jd b/docs/html-intl/intl/ja/guide/publishing/preparing.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/preparing.jd
rename to docs/html-intl/intl/ja/guide/publishing/preparing.jd
diff --git a/docs/html-intl/ja/guide/publishing/versioning.jd b/docs/html-intl/intl/ja/guide/publishing/versioning.jd
similarity index 100%
rename from docs/html-intl/ja/guide/publishing/versioning.jd
rename to docs/html-intl/intl/ja/guide/publishing/versioning.jd
diff --git a/docs/html-intl/ja/guide/topics/fundamentals.jd b/docs/html-intl/intl/ja/guide/topics/fundamentals.jd
similarity index 100%
rename from docs/html-intl/ja/guide/topics/fundamentals.jd
rename to docs/html-intl/intl/ja/guide/topics/fundamentals.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ja/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ja/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ja/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ja/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ja/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ja/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ja/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ja/training/multiscreen/index.jd b/docs/html-intl/intl/ja/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/index.jd
rename to docs/html-intl/intl/ja/training/multiscreen/index.jd
diff --git a/docs/html-intl/ja/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ja/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ja/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ja/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ja/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ja/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ja/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ko/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ko/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ko/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ko/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ko/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ko/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ko/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ko/training/multiscreen/index.jd b/docs/html-intl/intl/ko/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/index.jd
rename to docs/html-intl/intl/ko/training/multiscreen/index.jd
diff --git a/docs/html-intl/ko/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ko/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ko/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ko/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ko/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ko/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ko/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/index.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/ru/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/ru/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/ru/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/ru/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/ru/training/multiscreen/adaptui.jd b/docs/html-intl/intl/ru/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/ru/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/ru/training/multiscreen/index.jd b/docs/html-intl/intl/ru/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/index.jd
rename to docs/html-intl/intl/ru/training/multiscreen/index.jd
diff --git a/docs/html-intl/ru/training/multiscreen/screendensities.jd b/docs/html-intl/intl/ru/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/ru/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/ru/training/multiscreen/screensizes.jd b/docs/html-intl/intl/ru/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/ru/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/ru/training/multiscreen/screensizes.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/battery-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/connectivity-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/docking-monitoring.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/index.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/index.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/index.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/index.jd
diff --git a/docs/html-intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd b/docs/html-intl/intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
rename to docs/html-intl/intl/zh-cn/training/monitoring-device-state/manifest-receivers.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/adaptui.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/adaptui.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/adaptui.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/adaptui.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/index.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/index.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/index.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/index.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/screendensities.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/screendensities.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/screendensities.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/screendensities.jd
diff --git a/docs/html-intl/zh-cn/training/multiscreen/screensizes.jd b/docs/html-intl/intl/zh-cn/training/multiscreen/screensizes.jd
similarity index 100%
rename from docs/html-intl/zh-cn/training/multiscreen/screensizes.jd
rename to docs/html-intl/intl/zh-cn/training/multiscreen/screensizes.jd
diff --git a/docs/html/channels/io2013.jd b/docs/html/channels/io2013.jd
index 977eb2f..2efda28 100644
--- a/docs/html/channels/io2013.jd
+++ b/docs/html/channels/io2013.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 fullpage=true
 page.title=Google I/O 13
 @jd:body
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 61a98b7..3f88b9d 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -3,6 +3,7 @@
 header.hide=1
 carousel=1
 tabbedList=1
+excludeFromSuggestions=true
 @jd:body
 
 <style>
diff --git a/docs/html/google/gcm/adv.jd b/docs/html/google/gcm/adv.jd
index 567b12c..245467f 100644
--- a/docs/html/google/gcm/adv.jd
+++ b/docs/html/google/gcm/adv.jd
@@ -96,7 +96,7 @@
 will get a <code>NotRegistered</code> error. See <a href="#unreg">
 How Unregistration Works</a> for more information.</p>
 <p>Although is not possible to track the status of each individual message, the
-Google APIs Console stats are broken down by messages sent to device, messages
+Google Cloud Console stats are broken down by messages sent to device, messages
 collapsed, and messages waiting for delivery.</p>
 
 <h2 id="throttling">Throttling</h2>
@@ -312,14 +312,10 @@
 <p>GCM will store up to 100 non-collapsible messages. After that, all messages
 are discarded from GCM, and a new message is created that tells the client how
 far behind it is. The message is delivered through a regular
-<code>com.google.android.c2dm.intent.RECEIVE</code> intent, with the following
-extras:</p>
-<ul>
-  <li> <code>message_type</code>&mdash;The value is always the string
-&quot;deleted_messages&quot;.</li>
-  <li><code>total_deleted</code>&mdash;The value  is a string with the number of
-deleted messages.</li>
-</ul>
+<code>com.google.android.c2dm.intent.RECEIVE</code> intent with the
+extra <code>message_type</code>, for which the value is always the string
+&quot;deleted_messages&quot;.</p>
+
 <p>The application should respond by syncing with the server to recover the
 discarded messages. </p>
 
diff --git a/docs/html/google/gcm/client.jd b/docs/html/google/gcm/client.jd
index ca311ed..916ecee 100644
--- a/docs/html/google/gcm/client.jd
+++ b/docs/html/google/gcm/client.jd
@@ -416,15 +416,18 @@
         }
     }.execute(null, null, null);
     ...
-    /**
-     * Sends the registration ID to your server over HTTP, so it can use GCM/HTTP
-     * or CCS to send messages to your app. Not needed for this demo since the
-     * device sends upstream messages to a server that echoes back the message
-     * using the 'from' address in the message.
-     */
-    private void sendRegistrationIdToBackend() {
-      // Your implementation here.
-    }
+}</pre>
+
+<p>Once you've received your registration ID, send it to your server:</p>
+<pre>
+/**
+ * Sends the registration ID to your server over HTTP, so it can use GCM/HTTP
+ * or CCS to send messages to your app. Not needed for this demo since the
+ * device sends upstream messages to a server that echoes back the message
+ * using the 'from' address in the message.
+ */
+private void sendRegistrationIdToBackend() {
+    // Your implementation here.
 }</pre>
 
 <p>After registering, the app calls {@code storeRegistrationId()} to store the
@@ -660,4 +663,3 @@
 <p class="note"><strong>Note:</strong> Stats on the Google API Console are not
 enabled for GCM. You must use the <a href="http://play.google.com/apps/publish">Developer Console</a>.</p>
 
-
diff --git a/docs/html/google/gcm/gcm.jd b/docs/html/google/gcm/gcm.jd
index 3c80b5f..88bf659 100644
--- a/docs/html/google/gcm/gcm.jd
+++ b/docs/html/google/gcm/gcm.jd
@@ -104,7 +104,7 @@
     <th colspan="2">Credentials</th>
   </tr>
   <tr>
-    <td><strong>Sender ID</strong></td>
+    <td id="senderid"><strong>Sender ID</strong></td>
     <td>A project number you acquire from the API console, as described in
 <a href="gs.html#create-proj">Getting Started</a>. The sender
 ID is used in the <a href="#register">registration process</a> to identify a
@@ -140,7 +140,7 @@
 account if the device is running a version lower than Android 4.0.4.</td>
   </tr>
   <tr>
-    <td><strong>Sender Auth Token</strong></td>
+    <td id="apikey"><strong>Sender Auth Token</strong></td>
     <td>An API key that is saved on the 3rd-party application
 server that gives the application server authorized access to Google services.
 The API key is included in the header of POST requests  that send messages.</td>
diff --git a/docs/html/google/gcm/gs.jd b/docs/html/google/gcm/gs.jd
index 3700f3f..3f02907 100644
--- a/docs/html/google/gcm/gs.jd
+++ b/docs/html/google/gcm/gs.jd
@@ -18,7 +18,8 @@
 <h2>See Also</h2>
 
 <ol class="toc">
-<li><a href="https://code.google.com/apis/console">Google APIs Console page</a></li>
+<li><a href="https://cloud.google.com/console">Google Cloud Console</a></li>
+<li><a href="https://developers.google.com/console/help/new/">Google Cloud Console Help</a></li>
 <li><a href="https://services.google.com/fb/forms/gcm/" class="external-link" target="_android">CCS and User Notifications Signup Form</a></li>
 </ol>
 
@@ -32,66 +33,53 @@
 <a href="{@docRoot}reference/com/google/android/gms/gcm/GoogleCloudMessaging.html">
 {@code GoogleCloudMessaging}</a> methods.</p>
 
-
 <h2 id="create-proj">Creating a Google API project</h2>
 <p>To create a Google API project:</p>
 <ol>
-  <li>Open the <a href="https://code.google.com/apis/console">Google APIs Console page</a>.
+  <li>Open the <a href="https://cloud.google.com/console">Google Cloud Console</a>.
   </li>
-  <li>If you haven't created an API project yet, this page will prompt you to do so:
-  <p><img src="{@docRoot}images/gcm/gcm-create-api-proj.png" class="screenshot" /></p>
-<p class="note"><strong>Note:</strong> If you already have existing projects,
-the first page you see will be the <strong>Dashboard</strong> page. From there
-you can create a new project by opening the project drop-down menu (upper left corner)
-and choosing <strong>Other projects > Create</strong>.</p></li>
-  <li> Click <strong>Create project</strong>.
-    Your browser URL will change to something like:</li>
+  <li>If you haven't created an API project yet, click <strong>Create Project</strong>.</li>
 
-<pre> https://code.google.com/apis/console/#project:<strong>4815162342</strong></pre>
+ <li>Supply a project name and click <strong>Create</strong>.
 
-  <li> Take note of the value after <code>#project:</code> (4815162342 in this
-example). This is your project number, and it will be used later on as the GCM sender ID.</li>
+<p>Once the project has been created, a page appears that displays your project ID and
+project number. For example, <strong>Project Number: 670330094152</strong>.</p></li>
+
+  <li>Copy down your project number. You will use it later on as the
+  <a href="{@docRoot}google/gcm/gcm.html#senderid">GCM sender ID</a>.</li>
   
 </ol>
 <h2 id="gcm-service">Enabling the GCM Service</h2>
 <p>To enable the GCM service:</p>
 <ol>
-  <li> In the main Google APIs Console page, select <strong>Services</strong>.</li>
-  <li>Turn the <strong>Google Cloud Messaging</strong> toggle to ON.</li>
-  <li>In the Terms of Service page, accept the terms.
-  </li>
+  <li>In the sidebar on the left, select <strong>APIs &amp; auth</strong>. </li>
+  <li>In the displayed list of APIs, turn the <strong>Google Cloud Messaging for Android
+  </strong> toggle to ON.</li>
+
 </ol>
 <h2 id="access-key">Obtaining an API Key</h2>
 <p>To obtain an API  key:</p>
 <ol>
-  <li> In the main Google APIs Console page, select <strong>API Access</strong>.
-You will see a screen that resembles the following:</li>
+ <li>In the sidebar on the left, select <strong>APIs &amp; auth > Registered apps</strong>.</li>
+<li>Click <strong>Register app</strong>. </li>
 
+<li>In the <strong>Name</strong> field, type your app's name.</li>
+<li>Click <strong>Android > Accessing APIs directly from Android</strong>.</li>
+<li>Under <strong>Android identification</strong>, type the package name for your app.</li>
+<li>Enter an SHA1 fingerprint. To get this value, follow the instructions in the
+<a href="http://developers.google.com/console/help/new/#installedapplications">console
+help</a>.</li>
+<li>Click <strong>Register</strong>.</li>
 
-<img src="{@docRoot}images/gcm/gcm-api-access.png" style="width:400px;padding:4px;">
+<li>In the new page, open the <strong>Android Key</strong> section and copy the
+<a href="{@docRoot}google/gcm/gcm.html#apikey">API key</a>.
+You will need the API key later on to perform authentication in your application server.</li>
 
-  <li>Click  <strong>Create new Server key</strong>. Either a server key or a
-browser key should work. The advantage to using a server key is that it allows
-you to whitelist IP addresses. The following screen appears:</li>
-
-
-<img src="{@docRoot}images/gcm/gcm-config-server-key.png" style="width:400px;padding:4px;">
-
-  
-  <li>Click <strong>Create</strong>:</li>
-  
-
-<img src="{@docRoot}images/gcm/gcm-api-key.png" style="width:400px;padding:4px;">
-
-
-
-</ol>
-<p> Take note of the <strong>API key</strong> value (<code>YourKeyWillBeShownHere</code>)
-in this example, as it will be used later on.</p>
 <p class="note"><strong>Note:</strong> If you need to rotate the key, click
-<strong>Generate new key</strong>. A new key  will be created while the old one
-will still be active for up to 24 hours. If you want to get rid of the old key
-immediately (for example, if you feel it was compromised), click <strong>Delete key</strong>.</p>
+the "recycle key" icon. A new key  will be created. If you think the key has been compromised
+and you want to delete it immediately, you can accomplish this by deleting the app from
+the console. Then create a new entry for the app with the same SHA1 and package name.</p>
+</ol>
 
 <h2 id="next">Next Steps</h2>
 
@@ -113,4 +101,3 @@
 on a device. See <a href="client.html">Implementing GCM Client</a> for more information.</li>
 </ol>
 
-
diff --git a/docs/html/google/gcm/server.jd b/docs/html/google/gcm/server.jd
index b5e6b48..7ba1bd5 100644
--- a/docs/html/google/gcm/server.jd
+++ b/docs/html/google/gcm/server.jd
@@ -134,7 +134,7 @@
   <li>When the device is online, Google sends the message to the device.</li>
   <li>On the device, the system broadcasts the message to the specified Android
 application via Intent broadcast with proper permissions, so that only the targeted
-ndroid application gets the message. This wakes the Android application up.
+Android application gets the message. This wakes the Android application up.
 The Android application does not need to be running beforehand to receive the message.</li>
   <li>The Android application processes the message. </li>
 </ol>
@@ -146,7 +146,7 @@
 <p>Required. When your app server sends a message in GCM, it must specify a target.</p>
 <p>For HTTP you must specify the target as one of:</p>
 <ul>
-<li><code>registration_ids</code>: For sending to 1 more more devices (up to 1000).
+<li><code>registration_ids</code>: For sending to 1 or more devices (up to 1000).
 When you send a message to multiple registration IDs, that is called a multicast message.</li>
 <li><code>notification_key</code>: For sending to multiple devices owned by a single user.</li>
 </ul>
diff --git a/docs/html/guide/topics/connectivity/bluetooth-le.jd b/docs/html/guide/topics/connectivity/bluetooth-le.jd
index fa0d36e..5c32e56 100644
--- a/docs/html/guide/topics/connectivity/bluetooth-le.jd
+++ b/docs/html/guide/topics/connectivity/bluetooth-le.jd
@@ -44,6 +44,15 @@
 </div>
 </div>
 
+<a class="notice-developers-video" href="http://www.youtube.com/watch?v=vUbFB1Qypg8">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Bluetooth Low Energy API</p>
+</div>
+</a>
+
+
+
 
 <p>
 Android 4.3 (API Level 18) introduces built-in platform support for Bluetooth Low
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 3e59068..191e0fb 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -1,6 +1,7 @@
 fullpage=true
 no_footer_links=true
 carousel=true
+excludeFromSuggestions=true
 page.metaDescription=The official site for Android developers. Provides the Android SDK and documentation for app developers and designers.
 page.customHeadTag=<meta name="google-site-verification" content="sa-bIAI6GKvct3f61-WpRguHq-aNjtF7xJjMTSi79as" />
 
diff --git a/docs/html/license.jd b/docs/html/license.jd
index 20e68fa..b98c912 100644
--- a/docs/html/license.jd
+++ b/docs/html/license.jd
@@ -1,5 +1,6 @@
 page.title=Content License
 fullpage=1
+excludeFromSuggestions=true
 @jd:body
 
 <div class="wrap" style="width:940px;">
diff --git a/docs/html/offline.jd b/docs/html/offline.jd
index 73da779..6d4483f 100644
--- a/docs/html/offline.jd
+++ b/docs/html/offline.jd
@@ -1,5 +1,6 @@
 home=true
 page.title=Welcome
+excludeFromSuggestions=true
 @jd:body
 
 <style type="text/css">
diff --git a/docs/html/sdk/installing/studio.jd b/docs/html/sdk/installing/studio.jd
index e83d1e0..f3027a9 100644
--- a/docs/html/sdk/installing/studio.jd
+++ b/docs/html/sdk/installing/studio.jd
@@ -664,6 +664,7 @@
       $("#tos").hide();
       $("#main").show();
       location.hash = "Updating";
+      _gaq.push(['_trackEvent', 'SDK', 'Android Studio', $("#downloadForRealz").html()]);
       return true;
     } else {
       $("label#agreeLabel,#bitpicker input").parent().stop().animate({color: "#258AAF"}, 200,
diff --git a/docs/html/support.jd b/docs/html/support.jd
index 2f1222f..1f21b58 100644
--- a/docs/html/support.jd
+++ b/docs/html/support.jd
@@ -1,5 +1,6 @@
 page.title=Developer Support
 fullpage=1
+excludeFromSuggestions=true
 @jd:body
 
 <div class="wrap" style="width:940px;">
diff --git a/docs/html/tools/sdk/preview/features.jd b/docs/html/tools/sdk/preview/features.jd
index 02897cd..2bdb0f4 100644
--- a/docs/html/tools/sdk/preview/features.jd
+++ b/docs/html/tools/sdk/preview/features.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 @jd:body
 
 <script type="text/javascript">
diff --git a/docs/html/tools/sdk/preview/index.jd b/docs/html/tools/sdk/preview/index.jd
index d96df93..713730e 100644
--- a/docs/html/tools/sdk/preview/index.jd
+++ b/docs/html/tools/sdk/preview/index.jd
@@ -1,3 +1,4 @@
 sdk.redirect=true
 page.template=sdk
+excludeFromSuggestions=true
 @jd:body
diff --git a/docs/html/tools/sdk/preview/installing.jd b/docs/html/tools/sdk/preview/installing.jd
index c40e531..d248b67 100644
--- a/docs/html/tools/sdk/preview/installing.jd
+++ b/docs/html/tools/sdk/preview/installing.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 @jd:body
 
 <script type="text/javascript">
diff --git a/docs/html/tools/sdk/preview/requirements.jd b/docs/html/tools/sdk/preview/requirements.jd
index b5aed80..b62ee05 100644
--- a/docs/html/tools/sdk/preview/requirements.jd
+++ b/docs/html/tools/sdk/preview/requirements.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 @jd:body
 
 <script type="text/javascript">
diff --git a/docs/html/tools/sdk/preview/upgrading.jd b/docs/html/tools/sdk/preview/upgrading.jd
index 1c53bdb..3b90696 100644
--- a/docs/html/tools/sdk/preview/upgrading.jd
+++ b/docs/html/tools/sdk/preview/upgrading.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 @jd:body
 
 <script type="text/javascript">
diff --git a/docs/html/training/connect-devices-wirelessly/index.jd b/docs/html/training/connect-devices-wirelessly/index.jd
index 2da4e38..3206d7f 100644
--- a/docs/html/training/connect-devices-wirelessly/index.jd
+++ b/docs/html/training/connect-devices-wirelessly/index.jd
@@ -20,9 +20,15 @@
   <li><a href="{@docRoot}guide/topics/connectivity/wifip2p.html">Wi-Fi P2P</a></li>
 </ul>
 
+</div>
+</div>
 
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=oi_ARV_I8Dc">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Network Service Discovery</p>
 </div>
-</div>
+</a>
 
 
 <p>Besides enabling communication with the cloud, Android's wireless APIs also
diff --git a/docs/html/training/displaying-bitmaps/index.jd b/docs/html/training/displaying-bitmaps/index.jd
index 5521870..7003585 100644
--- a/docs/html/training/displaying-bitmaps/index.jd
+++ b/docs/html/training/displaying-bitmaps/index.jd
@@ -25,6 +25,20 @@
 </div>
 </div>
 
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=rsQet4nBVi8">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Bitmap Allocation</p>
+</div>
+</a>
+
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=pMRnGDR6Cu0">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Making Apps Beautiful - Part 4 - Performance Tuning</p>
+</div>
+</a>
+
 <p>Learn how to use common techniques to process and load {@link
 android.graphics.Bitmap} objects in a way that keeps your user interface (UI) components responsive
 and avoids exceeding your application memory limit. If you're not careful, bitmaps can quickly
diff --git a/docs/html/training/improving-layouts/index.jd b/docs/html/training/improving-layouts/index.jd
index 2f44c30..a2ab7a1 100644
--- a/docs/html/training/improving-layouts/index.jd
+++ b/docs/html/training/improving-layouts/index.jd
@@ -26,6 +26,13 @@
 </div>
 </div>
 
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=-FUw8HMbmBQ">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Optimising Layouts with Hierarchy Viewer</p>
+</div>
+</a>
+
 
 
 <p>Layouts are a key part of Android applications that directly affect the user experience. If
diff --git a/docs/html/training/notepad/index.jd b/docs/html/training/notepad/index.jd
index 64ba144..d1aa221 100644
--- a/docs/html/training/notepad/index.jd
+++ b/docs/html/training/notepad/index.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=Notepad Tutorial
 parent.title=Tutorials
 @jd:body
diff --git a/docs/html/training/notepad/notepad-ex1.jd b/docs/html/training/notepad/notepad-ex1.jd
index 0decbb2..f680f15 100644
--- a/docs/html/training/notepad/notepad-ex1.jd
+++ b/docs/html/training/notepad/notepad-ex1.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=Notepad Exercise 1
 parent.title=Notepad Tutorial
 parent.link=index.html
diff --git a/docs/html/training/notepad/notepad-ex2.jd b/docs/html/training/notepad/notepad-ex2.jd
index 895a071..d15499b3 100644
--- a/docs/html/training/notepad/notepad-ex2.jd
+++ b/docs/html/training/notepad/notepad-ex2.jd
@@ -1,4 +1,5 @@
-Rpage.title=Notepad Exercise 2
+excludeFromSuggestions=true
+page.title=Notepad Exercise 2
 parent.title=Notepad Tutorial
 parent.link=index.html
 @jd:body
diff --git a/docs/html/training/notepad/notepad-ex3.jd b/docs/html/training/notepad/notepad-ex3.jd
index e31ecda..648f9f2 100644
--- a/docs/html/training/notepad/notepad-ex3.jd
+++ b/docs/html/training/notepad/notepad-ex3.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=Notepad Exercise 3
 parent.title=Notepad Tutorial
 parent.link=index.html
diff --git a/docs/html/training/notepad/notepad-extra-credit.jd b/docs/html/training/notepad/notepad-extra-credit.jd
index d5fd771..8ab2021 100644
--- a/docs/html/training/notepad/notepad-extra-credit.jd
+++ b/docs/html/training/notepad/notepad-extra-credit.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=Notepad Extra Credit
 parent.title=Notepad Tutorial
 parent.link=index.html
diff --git a/docs/html/training/notepad/notepad-index.jd b/docs/html/training/notepad/notepad-index.jd
index 151c50d..fde43fa 100644
--- a/docs/html/training/notepad/notepad-index.jd
+++ b/docs/html/training/notepad/notepad-index.jd
@@ -1,3 +1,4 @@
+excludeFromSuggestions=true
 page.title=Notepad Tutorial
 @jd:body
 
diff --git a/docs/html/training/printing/index.jd b/docs/html/training/printing/index.jd
index 5b34a9d..e33e5e8 100644
--- a/docs/html/training/printing/index.jd
+++ b/docs/html/training/printing/index.jd
@@ -17,6 +17,13 @@
   </div>
 </div>
 
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=Iub67ic87KI">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Android 4.4 Printing API</p>
+</div>
+</a>
+
 <p>
   Android users frequently view content solely on their devices, but there are times when
   showing someone a screen is not an adequate way to share information. Being able to print
diff --git a/docs/html/training/tv/index.jd b/docs/html/training/tv/index.jd
index 7c4abc7..a99e378 100644
--- a/docs/html/training/tv/index.jd
+++ b/docs/html/training/tv/index.jd
@@ -17,6 +17,14 @@
 
 </div>
 </div>
+
+<a class="notice-developers-video wide" href="http://www.youtube.com/watch?v=zsRnRLh-O34">
+<div>
+    <h3>Video</h3>
+    <p>DevBytes: Design for Large Displays - Part 1</p>
+</div>
+</a>
+
 <p> 
   Smart TVs powered by Android bring your favorite Android apps to the best screen in your house. 
   Thousands of apps in the Google Play Store are already optimized for TVs. This class shows how 
diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java
index 09481d4..1a7e3ec 100644
--- a/graphics/java/android/graphics/Path.java
+++ b/graphics/java/android/graphics/Path.java
@@ -692,6 +692,28 @@
         return mNativePath;
     }
 
+    /**
+     * Approximate the <code>Path</code> with a series of line segments.
+     * This returns float[] with the array containing point components.
+     * There are three components for each point, in order:
+     * <ul>
+     *     <li>Fraction along the length of the path that the point resides</li>
+     *     <li>The x coordinate of the point</li>
+     *     <li>The y coordinate of the point</li>
+     * </ul>
+     * <p>Two points may share the same fraction along its length when there is
+     * a move action within the Path.</p>
+     *
+     * @param acceptableError The acceptable error for a line on the
+     *                        Path. Typically this would be 0.5 so that
+     *                        the error is less than half a pixel.
+     * @return An array of components for points approximating the Path.
+     * @hide
+     */
+    public float[] approximate(float acceptableError) {
+        return native_approximate(mNativePath, acceptableError);
+    }
+
     private static native int init1();
     private static native int init2(int nPath);
     private static native void native_reset(int nPath);
@@ -738,4 +760,5 @@
     private static native void native_transform(int nPath, int matrix);
     private static native boolean native_op(int path1, int path2, int op, int result);
     private static native void finalizer(int nPath);
+    private static native float[] native_approximate(int nPath, float error);
 }
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 0aae9ca..6694e5b8 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -87,14 +87,14 @@
     }
 
     // Non-threadsafe functions.
-    native int  nDeviceCreate();
-    native void nDeviceDestroy(int dev);
-    native void nDeviceSetConfig(int dev, int param, int value);
-    native int nContextGetUserMessage(int con, int[] data);
-    native String nContextGetErrorMessage(int con);
-    native int  nContextPeekMessage(int con, int[] subID);
-    native void nContextInitToClient(int con);
-    native void nContextDeinitToClient(int con);
+    native long  nDeviceCreate();
+    native void nDeviceDestroy(long dev);
+    native void nDeviceSetConfig(long dev, int param, int value);
+    native int nContextGetUserMessage(long con, int[] data);
+    native String nContextGetErrorMessage(long con);
+    native int  nContextPeekMessage(long con, int[] subID);
+    native void nContextInitToClient(long con);
+    native void nContextDeinitToClient(long con);
 
     static File mCacheDir;
 
@@ -150,13 +150,13 @@
 
     // Methods below are wrapped to protect the non-threadsafe
     // lockless fifo.
-    native int  rsnContextCreateGL(int dev, int ver, int sdkVer,
+    native long  rsnContextCreateGL(long dev, int ver, int sdkVer,
                  int colorMin, int colorPref,
                  int alphaMin, int alphaPref,
                  int depthMin, int depthPref,
                  int stencilMin, int stencilPref,
                  int samplesMin, int samplesPref, float samplesQ, int dpi);
-    synchronized int nContextCreateGL(int dev, int ver, int sdkVer,
+    synchronized long nContextCreateGL(long dev, int ver, int sdkVer,
                  int colorMin, int colorPref,
                  int alphaMin, int alphaPref,
                  int depthMin, int depthPref,
@@ -167,99 +167,99 @@
                                   stencilMin, stencilPref,
                                   samplesMin, samplesPref, samplesQ, dpi);
     }
-    native int  rsnContextCreate(int dev, int ver, int sdkVer, int contextType);
-    synchronized int nContextCreate(int dev, int ver, int sdkVer, int contextType) {
+    native long  rsnContextCreate(long dev, int ver, int sdkVer, int contextType);
+    synchronized long nContextCreate(long dev, int ver, int sdkVer, int contextType) {
         return rsnContextCreate(dev, ver, sdkVer, contextType);
     }
-    native void rsnContextDestroy(int con);
+    native void rsnContextDestroy(long con);
     synchronized void nContextDestroy() {
         validate();
         rsnContextDestroy(mContext);
     }
-    native void rsnContextSetSurface(int con, int w, int h, Surface sur);
+    native void rsnContextSetSurface(long con, int w, int h, Surface sur);
     synchronized void nContextSetSurface(int w, int h, Surface sur) {
         validate();
         rsnContextSetSurface(mContext, w, h, sur);
     }
-    native void rsnContextSetSurfaceTexture(int con, int w, int h, SurfaceTexture sur);
+    native void rsnContextSetSurfaceTexture(long con, int w, int h, SurfaceTexture sur);
     synchronized void nContextSetSurfaceTexture(int w, int h, SurfaceTexture sur) {
         validate();
         rsnContextSetSurfaceTexture(mContext, w, h, sur);
     }
-    native void rsnContextSetPriority(int con, int p);
+    native void rsnContextSetPriority(long con, int p);
     synchronized void nContextSetPriority(int p) {
         validate();
         rsnContextSetPriority(mContext, p);
     }
-    native void rsnContextDump(int con, int bits);
+    native void rsnContextDump(long con, int bits);
     synchronized void nContextDump(int bits) {
         validate();
         rsnContextDump(mContext, bits);
     }
-    native void rsnContextFinish(int con);
+    native void rsnContextFinish(long con);
     synchronized void nContextFinish() {
         validate();
         rsnContextFinish(mContext);
     }
 
-    native void rsnContextSendMessage(int con, int id, int[] data);
+    native void rsnContextSendMessage(long con, int id, int[] data);
     synchronized void nContextSendMessage(int id, int[] data) {
         validate();
         rsnContextSendMessage(mContext, id, data);
     }
 
-    native void rsnContextBindRootScript(int con, int script);
+    native void rsnContextBindRootScript(long con, int script);
     synchronized void nContextBindRootScript(int script) {
         validate();
         rsnContextBindRootScript(mContext, script);
     }
-    native void rsnContextBindSampler(int con, int sampler, int slot);
+    native void rsnContextBindSampler(long con, int sampler, int slot);
     synchronized void nContextBindSampler(int sampler, int slot) {
         validate();
         rsnContextBindSampler(mContext, sampler, slot);
     }
-    native void rsnContextBindProgramStore(int con, int pfs);
+    native void rsnContextBindProgramStore(long con, int pfs);
     synchronized void nContextBindProgramStore(int pfs) {
         validate();
         rsnContextBindProgramStore(mContext, pfs);
     }
-    native void rsnContextBindProgramFragment(int con, int pf);
+    native void rsnContextBindProgramFragment(long con, int pf);
     synchronized void nContextBindProgramFragment(int pf) {
         validate();
         rsnContextBindProgramFragment(mContext, pf);
     }
-    native void rsnContextBindProgramVertex(int con, int pv);
+    native void rsnContextBindProgramVertex(long con, int pv);
     synchronized void nContextBindProgramVertex(int pv) {
         validate();
         rsnContextBindProgramVertex(mContext, pv);
     }
-    native void rsnContextBindProgramRaster(int con, int pr);
+    native void rsnContextBindProgramRaster(long con, int pr);
     synchronized void nContextBindProgramRaster(int pr) {
         validate();
         rsnContextBindProgramRaster(mContext, pr);
     }
-    native void rsnContextPause(int con);
+    native void rsnContextPause(long con);
     synchronized void nContextPause() {
         validate();
         rsnContextPause(mContext);
     }
-    native void rsnContextResume(int con);
+    native void rsnContextResume(long con);
     synchronized void nContextResume() {
         validate();
         rsnContextResume(mContext);
     }
 
-    native void rsnAssignName(int con, int obj, byte[] name);
+    native void rsnAssignName(long con, int obj, byte[] name);
     synchronized void nAssignName(int obj, byte[] name) {
         validate();
         rsnAssignName(mContext, obj, name);
     }
-    native String rsnGetName(int con, int obj);
+    native String rsnGetName(long con, int obj);
     synchronized String nGetName(int obj) {
         validate();
         return rsnGetName(mContext, obj);
     }
-    native void rsnObjDestroy(int con, int id);
+    native void rsnObjDestroy(long con, int id);
     synchronized void nObjDestroy(int id) {
         // There is a race condition here.  The calling code may be run
         // by the gc while teardown is occuring.  This protects againts
@@ -269,132 +269,132 @@
         }
     }
 
-    native int  rsnElementCreate(int con, int type, int kind, boolean norm, int vecSize);
+    native int  rsnElementCreate(long con, int type, int kind, boolean norm, int vecSize);
     synchronized int nElementCreate(int type, int kind, boolean norm, int vecSize) {
         validate();
         return rsnElementCreate(mContext, type, kind, norm, vecSize);
     }
-    native int  rsnElementCreate2(int con, int[] elements, String[] names, int[] arraySizes);
+    native int  rsnElementCreate2(long con, int[] elements, String[] names, int[] arraySizes);
     synchronized int nElementCreate2(int[] elements, String[] names, int[] arraySizes) {
         validate();
         return rsnElementCreate2(mContext, elements, names, arraySizes);
     }
-    native void rsnElementGetNativeData(int con, int id, int[] elementData);
+    native void rsnElementGetNativeData(long con, int id, int[] elementData);
     synchronized void nElementGetNativeData(int id, int[] elementData) {
         validate();
         rsnElementGetNativeData(mContext, id, elementData);
     }
-    native void rsnElementGetSubElements(int con, int id,
+    native void rsnElementGetSubElements(long con, int id,
                                          int[] IDs, String[] names, int[] arraySizes);
     synchronized void nElementGetSubElements(int id, int[] IDs, String[] names, int[] arraySizes) {
         validate();
         rsnElementGetSubElements(mContext, id, IDs, names, arraySizes);
     }
 
-    native int rsnTypeCreate(int con, int eid, int x, int y, int z, boolean mips, boolean faces, int yuv);
+    native int rsnTypeCreate(long con, int eid, int x, int y, int z, boolean mips, boolean faces, int yuv);
     synchronized int nTypeCreate(int eid, int x, int y, int z, boolean mips, boolean faces, int yuv) {
         validate();
         return rsnTypeCreate(mContext, eid, x, y, z, mips, faces, yuv);
     }
-    native void rsnTypeGetNativeData(int con, int id, int[] typeData);
+    native void rsnTypeGetNativeData(long con, int id, int[] typeData);
     synchronized void nTypeGetNativeData(int id, int[] typeData) {
         validate();
         rsnTypeGetNativeData(mContext, id, typeData);
     }
 
-    native int  rsnAllocationCreateTyped(int con, int type, int mip, int usage, int pointer);
+    native int  rsnAllocationCreateTyped(long con, int type, int mip, int usage, int pointer);
     synchronized int nAllocationCreateTyped(int type, int mip, int usage, int pointer) {
         validate();
         return rsnAllocationCreateTyped(mContext, type, mip, usage, pointer);
     }
-    native int  rsnAllocationCreateFromBitmap(int con, int type, int mip, Bitmap bmp, int usage);
+    native int  rsnAllocationCreateFromBitmap(long con, int type, int mip, Bitmap bmp, int usage);
     synchronized int nAllocationCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) {
         validate();
         return rsnAllocationCreateFromBitmap(mContext, type, mip, bmp, usage);
     }
 
-    native int  rsnAllocationCreateBitmapBackedAllocation(int con, int type, int mip, Bitmap bmp, int usage);
+    native int  rsnAllocationCreateBitmapBackedAllocation(long con, int type, int mip, Bitmap bmp, int usage);
     synchronized int nAllocationCreateBitmapBackedAllocation(int type, int mip, Bitmap bmp, int usage) {
         validate();
         return rsnAllocationCreateBitmapBackedAllocation(mContext, type, mip, bmp, usage);
     }
 
 
-    native int  rsnAllocationCubeCreateFromBitmap(int con, int type, int mip, Bitmap bmp, int usage);
+    native int  rsnAllocationCubeCreateFromBitmap(long con, int type, int mip, Bitmap bmp, int usage);
     synchronized int nAllocationCubeCreateFromBitmap(int type, int mip, Bitmap bmp, int usage) {
         validate();
         return rsnAllocationCubeCreateFromBitmap(mContext, type, mip, bmp, usage);
     }
-    native int  rsnAllocationCreateBitmapRef(int con, int type, Bitmap bmp);
+    native int  rsnAllocationCreateBitmapRef(long con, int type, Bitmap bmp);
     synchronized int nAllocationCreateBitmapRef(int type, Bitmap bmp) {
         validate();
         return rsnAllocationCreateBitmapRef(mContext, type, bmp);
     }
-    native int  rsnAllocationCreateFromAssetStream(int con, int mips, int assetStream, int usage);
+    native int  rsnAllocationCreateFromAssetStream(long con, int mips, int assetStream, int usage);
     synchronized int nAllocationCreateFromAssetStream(int mips, int assetStream, int usage) {
         validate();
         return rsnAllocationCreateFromAssetStream(mContext, mips, assetStream, usage);
     }
 
-    native void  rsnAllocationCopyToBitmap(int con, int alloc, Bitmap bmp);
+    native void  rsnAllocationCopyToBitmap(long con, int alloc, Bitmap bmp);
     synchronized void nAllocationCopyToBitmap(int alloc, Bitmap bmp) {
         validate();
         rsnAllocationCopyToBitmap(mContext, alloc, bmp);
     }
 
 
-    native void rsnAllocationSyncAll(int con, int alloc, int src);
+    native void rsnAllocationSyncAll(long con, int alloc, int src);
     synchronized void nAllocationSyncAll(int alloc, int src) {
         validate();
         rsnAllocationSyncAll(mContext, alloc, src);
     }
-    native Surface rsnAllocationGetSurface(int con, int alloc);
+    native Surface rsnAllocationGetSurface(long con, int alloc);
     synchronized Surface nAllocationGetSurface(int alloc) {
         validate();
         return rsnAllocationGetSurface(mContext, alloc);
     }
-    native void rsnAllocationSetSurface(int con, int alloc, Surface sur);
+    native void rsnAllocationSetSurface(long con, int alloc, Surface sur);
     synchronized void nAllocationSetSurface(int alloc, Surface sur) {
         validate();
         rsnAllocationSetSurface(mContext, alloc, sur);
     }
-    native void rsnAllocationIoSend(int con, int alloc);
+    native void rsnAllocationIoSend(long con, int alloc);
     synchronized void nAllocationIoSend(int alloc) {
         validate();
         rsnAllocationIoSend(mContext, alloc);
     }
-    native void rsnAllocationIoReceive(int con, int alloc);
+    native void rsnAllocationIoReceive(long con, int alloc);
     synchronized void nAllocationIoReceive(int alloc) {
         validate();
         rsnAllocationIoReceive(mContext, alloc);
     }
 
 
-    native void rsnAllocationGenerateMipmaps(int con, int alloc);
+    native void rsnAllocationGenerateMipmaps(long con, int alloc);
     synchronized void nAllocationGenerateMipmaps(int alloc) {
         validate();
         rsnAllocationGenerateMipmaps(mContext, alloc);
     }
-    native void  rsnAllocationCopyFromBitmap(int con, int alloc, Bitmap bmp);
+    native void  rsnAllocationCopyFromBitmap(long con, int alloc, Bitmap bmp);
     synchronized void nAllocationCopyFromBitmap(int alloc, Bitmap bmp) {
         validate();
         rsnAllocationCopyFromBitmap(mContext, alloc, bmp);
     }
 
 
-    native void rsnAllocationData1D(int con, int id, int off, int mip, int count, Object d, int sizeBytes, int dt);
+    native void rsnAllocationData1D(long con, int id, int off, int mip, int count, Object d, int sizeBytes, int dt);
     synchronized void nAllocationData1D(int id, int off, int mip, int count, Object d, int sizeBytes, Element.DataType dt) {
         validate();
         rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID);
     }
 
-    native void rsnAllocationElementData1D(int con, int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes);
+    native void rsnAllocationElementData1D(long con, int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes);
     synchronized void nAllocationElementData1D(int id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes) {
         validate();
         rsnAllocationElementData1D(mContext, id, xoff, mip, compIdx, d, sizeBytes);
     }
 
-    native void rsnAllocationData2D(int con,
+    native void rsnAllocationData2D(long con,
                                     int dstAlloc, int dstXoff, int dstYoff,
                                     int dstMip, int dstFace,
                                     int width, int height,
@@ -414,7 +414,7 @@
                             srcMip, srcFace);
     }
 
-    native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face,
+    native void rsnAllocationData2D(long con, int id, int xoff, int yoff, int mip, int face,
                                     int w, int h, Object d, int sizeBytes, int dt);
     synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face,
                                         int w, int h, Object d, int sizeBytes, Element.DataType dt) {
@@ -422,13 +422,13 @@
         rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID);
     }
 
-    native void rsnAllocationData2D(int con, int id, int xoff, int yoff, int mip, int face, Bitmap b);
+    native void rsnAllocationData2D(long con, int id, int xoff, int yoff, int mip, int face, Bitmap b);
     synchronized void nAllocationData2D(int id, int xoff, int yoff, int mip, int face, Bitmap b) {
         validate();
         rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, b);
     }
 
-    native void rsnAllocationData3D(int con,
+    native void rsnAllocationData3D(long con,
                                     int dstAlloc, int dstXoff, int dstYoff, int dstZoff,
                                     int dstMip,
                                     int width, int height, int depth,
@@ -446,7 +446,7 @@
                             srcAlloc, srcXoff, srcYoff, srcZoff, srcMip);
     }
 
-    native void rsnAllocationData3D(int con, int id, int xoff, int yoff, int zoff, int mip,
+    native void rsnAllocationData3D(long con, int id, int xoff, int yoff, int zoff, int mip,
                                     int w, int h, int depth, Object d, int sizeBytes, int dt);
     synchronized void nAllocationData3D(int id, int xoff, int yoff, int zoff, int mip,
                                         int w, int h, int depth, Object d, int sizeBytes, Element.DataType dt) {
@@ -454,13 +454,13 @@
         rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes, dt.mID);
     }
 
-    native void rsnAllocationRead(int con, int id, Object d, int dt);
+    native void rsnAllocationRead(long con, int id, Object d, int dt);
     synchronized void nAllocationRead(int id, Object d, Element.DataType dt) {
         validate();
         rsnAllocationRead(mContext, id, d, dt.mID);
     }
 
-    native void rsnAllocationRead1D(int con, int id, int off, int mip, int count, Object d,
+    native void rsnAllocationRead1D(long con, int id, int off, int mip, int count, Object d,
                                     int sizeBytes, int dt);
     synchronized void nAllocationRead1D(int id, int off, int mip, int count, Object d,
                                         int sizeBytes, Element.DataType dt) {
@@ -468,7 +468,7 @@
         rsnAllocationRead1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID);
     }
 
-    native void rsnAllocationRead2D(int con, int id, int xoff, int yoff, int mip, int face,
+    native void rsnAllocationRead2D(long con, int id, int xoff, int yoff, int mip, int face,
                                     int w, int h, Object d, int sizeBytes, int dt);
     synchronized void nAllocationRead2D(int id, int xoff, int yoff, int mip, int face,
                                         int w, int h, Object d, int sizeBytes, Element.DataType dt) {
@@ -476,86 +476,86 @@
         rsnAllocationRead2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID);
     }
 
-    native int  rsnAllocationGetType(int con, int id);
+    native int  rsnAllocationGetType(long con, int id);
     synchronized int nAllocationGetType(int id) {
         validate();
         return rsnAllocationGetType(mContext, id);
     }
 
-    native void rsnAllocationResize1D(int con, int id, int dimX);
+    native void rsnAllocationResize1D(long con, int id, int dimX);
     synchronized void nAllocationResize1D(int id, int dimX) {
         validate();
         rsnAllocationResize1D(mContext, id, dimX);
     }
 
-    native int  rsnFileA3DCreateFromAssetStream(int con, int assetStream);
+    native int  rsnFileA3DCreateFromAssetStream(long con, int assetStream);
     synchronized int nFileA3DCreateFromAssetStream(int assetStream) {
         validate();
         return rsnFileA3DCreateFromAssetStream(mContext, assetStream);
     }
-    native int  rsnFileA3DCreateFromFile(int con, String path);
+    native int  rsnFileA3DCreateFromFile(long con, String path);
     synchronized int nFileA3DCreateFromFile(String path) {
         validate();
         return rsnFileA3DCreateFromFile(mContext, path);
     }
-    native int  rsnFileA3DCreateFromAsset(int con, AssetManager mgr, String path);
+    native int  rsnFileA3DCreateFromAsset(long con, AssetManager mgr, String path);
     synchronized int nFileA3DCreateFromAsset(AssetManager mgr, String path) {
         validate();
         return rsnFileA3DCreateFromAsset(mContext, mgr, path);
     }
-    native int  rsnFileA3DGetNumIndexEntries(int con, int fileA3D);
+    native int  rsnFileA3DGetNumIndexEntries(long con, int fileA3D);
     synchronized int nFileA3DGetNumIndexEntries(int fileA3D) {
         validate();
         return rsnFileA3DGetNumIndexEntries(mContext, fileA3D);
     }
-    native void rsnFileA3DGetIndexEntries(int con, int fileA3D, int numEntries, int[] IDs, String[] names);
+    native void rsnFileA3DGetIndexEntries(long con, int fileA3D, int numEntries, int[] IDs, String[] names);
     synchronized void nFileA3DGetIndexEntries(int fileA3D, int numEntries, int[] IDs, String[] names) {
         validate();
         rsnFileA3DGetIndexEntries(mContext, fileA3D, numEntries, IDs, names);
     }
-    native int  rsnFileA3DGetEntryByIndex(int con, int fileA3D, int index);
+    native int  rsnFileA3DGetEntryByIndex(long con, int fileA3D, int index);
     synchronized int nFileA3DGetEntryByIndex(int fileA3D, int index) {
         validate();
         return rsnFileA3DGetEntryByIndex(mContext, fileA3D, index);
     }
 
-    native int  rsnFontCreateFromFile(int con, String fileName, float size, int dpi);
+    native int  rsnFontCreateFromFile(long con, String fileName, float size, int dpi);
     synchronized int nFontCreateFromFile(String fileName, float size, int dpi) {
         validate();
         return rsnFontCreateFromFile(mContext, fileName, size, dpi);
     }
-    native int  rsnFontCreateFromAssetStream(int con, String name, float size, int dpi, int assetStream);
+    native int  rsnFontCreateFromAssetStream(long con, String name, float size, int dpi, int assetStream);
     synchronized int nFontCreateFromAssetStream(String name, float size, int dpi, int assetStream) {
         validate();
         return rsnFontCreateFromAssetStream(mContext, name, size, dpi, assetStream);
     }
-    native int  rsnFontCreateFromAsset(int con, AssetManager mgr, String path, float size, int dpi);
+    native int  rsnFontCreateFromAsset(long con, AssetManager mgr, String path, float size, int dpi);
     synchronized int nFontCreateFromAsset(AssetManager mgr, String path, float size, int dpi) {
         validate();
         return rsnFontCreateFromAsset(mContext, mgr, path, size, dpi);
     }
 
 
-    native void rsnScriptBindAllocation(int con, int script, int alloc, int slot);
+    native void rsnScriptBindAllocation(long con, int script, int alloc, int slot);
     synchronized void nScriptBindAllocation(int script, int alloc, int slot) {
         validate();
         rsnScriptBindAllocation(mContext, script, alloc, slot);
     }
-    native void rsnScriptSetTimeZone(int con, int script, byte[] timeZone);
+    native void rsnScriptSetTimeZone(long con, int script, byte[] timeZone);
     synchronized void nScriptSetTimeZone(int script, byte[] timeZone) {
         validate();
         rsnScriptSetTimeZone(mContext, script, timeZone);
     }
-    native void rsnScriptInvoke(int con, int id, int slot);
+    native void rsnScriptInvoke(long con, int id, int slot);
     synchronized void nScriptInvoke(int id, int slot) {
         validate();
         rsnScriptInvoke(mContext, id, slot);
     }
-    native void rsnScriptForEach(int con, int id, int slot, int ain, int aout, byte[] params);
-    native void rsnScriptForEach(int con, int id, int slot, int ain, int aout);
-    native void rsnScriptForEachClipped(int con, int id, int slot, int ain, int aout, byte[] params,
+    native void rsnScriptForEach(long con, int id, int slot, int ain, int aout, byte[] params);
+    native void rsnScriptForEach(long con, int id, int slot, int ain, int aout);
+    native void rsnScriptForEachClipped(long con, int id, int slot, int ain, int aout, byte[] params,
                                         int xstart, int xend, int ystart, int yend, int zstart, int zend);
-    native void rsnScriptForEachClipped(int con, int id, int slot, int ain, int aout,
+    native void rsnScriptForEachClipped(long con, int id, int slot, int ain, int aout,
                                         int xstart, int xend, int ystart, int yend, int zstart, int zend);
     synchronized void nScriptForEach(int id, int slot, int ain, int aout, byte[] params) {
         validate();
@@ -576,127 +576,127 @@
         }
     }
 
-    native void rsnScriptInvokeV(int con, int id, int slot, byte[] params);
+    native void rsnScriptInvokeV(long con, int id, int slot, byte[] params);
     synchronized void nScriptInvokeV(int id, int slot, byte[] params) {
         validate();
         rsnScriptInvokeV(mContext, id, slot, params);
     }
 
-    native void rsnScriptSetVarI(int con, int id, int slot, int val);
+    native void rsnScriptSetVarI(long con, int id, int slot, int val);
     synchronized void nScriptSetVarI(int id, int slot, int val) {
         validate();
         rsnScriptSetVarI(mContext, id, slot, val);
     }
-    native int rsnScriptGetVarI(int con, int id, int slot);
+    native int rsnScriptGetVarI(long con, int id, int slot);
     synchronized int nScriptGetVarI(int id, int slot) {
         validate();
         return rsnScriptGetVarI(mContext, id, slot);
     }
 
-    native void rsnScriptSetVarJ(int con, int id, int slot, long val);
+    native void rsnScriptSetVarJ(long con, int id, int slot, long val);
     synchronized void nScriptSetVarJ(int id, int slot, long val) {
         validate();
         rsnScriptSetVarJ(mContext, id, slot, val);
     }
-    native long rsnScriptGetVarJ(int con, int id, int slot);
+    native long rsnScriptGetVarJ(long con, int id, int slot);
     synchronized long nScriptGetVarJ(int id, int slot) {
         validate();
         return rsnScriptGetVarJ(mContext, id, slot);
     }
 
-    native void rsnScriptSetVarF(int con, int id, int slot, float val);
+    native void rsnScriptSetVarF(long con, int id, int slot, float val);
     synchronized void nScriptSetVarF(int id, int slot, float val) {
         validate();
         rsnScriptSetVarF(mContext, id, slot, val);
     }
-    native float rsnScriptGetVarF(int con, int id, int slot);
+    native float rsnScriptGetVarF(long con, int id, int slot);
     synchronized float nScriptGetVarF(int id, int slot) {
         validate();
         return rsnScriptGetVarF(mContext, id, slot);
     }
-    native void rsnScriptSetVarD(int con, int id, int slot, double val);
+    native void rsnScriptSetVarD(long con, int id, int slot, double val);
     synchronized void nScriptSetVarD(int id, int slot, double val) {
         validate();
         rsnScriptSetVarD(mContext, id, slot, val);
     }
-    native double rsnScriptGetVarD(int con, int id, int slot);
+    native double rsnScriptGetVarD(long con, int id, int slot);
     synchronized double nScriptGetVarD(int id, int slot) {
         validate();
         return rsnScriptGetVarD(mContext, id, slot);
     }
-    native void rsnScriptSetVarV(int con, int id, int slot, byte[] val);
+    native void rsnScriptSetVarV(long con, int id, int slot, byte[] val);
     synchronized void nScriptSetVarV(int id, int slot, byte[] val) {
         validate();
         rsnScriptSetVarV(mContext, id, slot, val);
     }
-    native void rsnScriptGetVarV(int con, int id, int slot, byte[] val);
+    native void rsnScriptGetVarV(long con, int id, int slot, byte[] val);
     synchronized void nScriptGetVarV(int id, int slot, byte[] val) {
         validate();
         rsnScriptGetVarV(mContext, id, slot, val);
     }
-    native void rsnScriptSetVarVE(int con, int id, int slot, byte[] val,
+    native void rsnScriptSetVarVE(long con, int id, int slot, byte[] val,
                                   int e, int[] dims);
     synchronized void nScriptSetVarVE(int id, int slot, byte[] val,
                                       int e, int[] dims) {
         validate();
         rsnScriptSetVarVE(mContext, id, slot, val, e, dims);
     }
-    native void rsnScriptSetVarObj(int con, int id, int slot, int val);
+    native void rsnScriptSetVarObj(long con, int id, int slot, int val);
     synchronized void nScriptSetVarObj(int id, int slot, int val) {
         validate();
         rsnScriptSetVarObj(mContext, id, slot, val);
     }
 
-    native int  rsnScriptCCreate(int con, String resName, String cacheDir,
+    native int  rsnScriptCCreate(long con, String resName, String cacheDir,
                                  byte[] script, int length);
     synchronized int nScriptCCreate(String resName, String cacheDir, byte[] script, int length) {
         validate();
         return rsnScriptCCreate(mContext, resName, cacheDir, script, length);
     }
 
-    native int  rsnScriptIntrinsicCreate(int con, int id, int eid);
+    native int  rsnScriptIntrinsicCreate(long con, int id, int eid);
     synchronized int nScriptIntrinsicCreate(int id, int eid) {
         validate();
         return rsnScriptIntrinsicCreate(mContext, id, eid);
     }
 
-    native int  rsnScriptKernelIDCreate(int con, int sid, int slot, int sig);
+    native int  rsnScriptKernelIDCreate(long con, int sid, int slot, int sig);
     synchronized int nScriptKernelIDCreate(int sid, int slot, int sig) {
         validate();
         return rsnScriptKernelIDCreate(mContext, sid, slot, sig);
     }
 
-    native int  rsnScriptFieldIDCreate(int con, int sid, int slot);
+    native int  rsnScriptFieldIDCreate(long con, int sid, int slot);
     synchronized int nScriptFieldIDCreate(int sid, int slot) {
         validate();
         return rsnScriptFieldIDCreate(mContext, sid, slot);
     }
 
-    native int  rsnScriptGroupCreate(int con, int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types);
+    native int  rsnScriptGroupCreate(long con, int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types);
     synchronized int nScriptGroupCreate(int[] kernels, int[] src, int[] dstk, int[] dstf, int[] types) {
         validate();
         return rsnScriptGroupCreate(mContext, kernels, src, dstk, dstf, types);
     }
 
-    native void rsnScriptGroupSetInput(int con, int group, int kernel, int alloc);
+    native void rsnScriptGroupSetInput(long con, int group, int kernel, int alloc);
     synchronized void nScriptGroupSetInput(int group, int kernel, int alloc) {
         validate();
         rsnScriptGroupSetInput(mContext, group, kernel, alloc);
     }
 
-    native void rsnScriptGroupSetOutput(int con, int group, int kernel, int alloc);
+    native void rsnScriptGroupSetOutput(long con, int group, int kernel, int alloc);
     synchronized void nScriptGroupSetOutput(int group, int kernel, int alloc) {
         validate();
         rsnScriptGroupSetOutput(mContext, group, kernel, alloc);
     }
 
-    native void rsnScriptGroupExecute(int con, int group);
+    native void rsnScriptGroupExecute(long con, int group);
     synchronized void nScriptGroupExecute(int group) {
         validate();
         rsnScriptGroupExecute(mContext, group);
     }
 
-    native int  rsnSamplerCreate(int con, int magFilter, int minFilter,
+    native int  rsnSamplerCreate(long con, int magFilter, int minFilter,
                                  int wrapS, int wrapT, int wrapR, float aniso);
     synchronized int nSamplerCreate(int magFilter, int minFilter,
                                  int wrapS, int wrapT, int wrapR, float aniso) {
@@ -704,7 +704,7 @@
         return rsnSamplerCreate(mContext, magFilter, minFilter, wrapS, wrapT, wrapR, aniso);
     }
 
-    native int  rsnProgramStoreCreate(int con, boolean r, boolean g, boolean b, boolean a,
+    native int  rsnProgramStoreCreate(long con, boolean r, boolean g, boolean b, boolean a,
                                       boolean depthMask, boolean dither,
                                       int srcMode, int dstMode, int depthFunc);
     synchronized int nProgramStoreCreate(boolean r, boolean g, boolean b, boolean a,
@@ -715,72 +715,72 @@
                                      dstMode, depthFunc);
     }
 
-    native int  rsnProgramRasterCreate(int con, boolean pointSprite, int cullMode);
+    native int  rsnProgramRasterCreate(long con, boolean pointSprite, int cullMode);
     synchronized int nProgramRasterCreate(boolean pointSprite, int cullMode) {
         validate();
         return rsnProgramRasterCreate(mContext, pointSprite, cullMode);
     }
 
-    native void rsnProgramBindConstants(int con, int pv, int slot, int mID);
+    native void rsnProgramBindConstants(long con, int pv, int slot, int mID);
     synchronized void nProgramBindConstants(int pv, int slot, int mID) {
         validate();
         rsnProgramBindConstants(mContext, pv, slot, mID);
     }
-    native void rsnProgramBindTexture(int con, int vpf, int slot, int a);
+    native void rsnProgramBindTexture(long con, int vpf, int slot, int a);
     synchronized void nProgramBindTexture(int vpf, int slot, int a) {
         validate();
         rsnProgramBindTexture(mContext, vpf, slot, a);
     }
-    native void rsnProgramBindSampler(int con, int vpf, int slot, int s);
+    native void rsnProgramBindSampler(long con, int vpf, int slot, int s);
     synchronized void nProgramBindSampler(int vpf, int slot, int s) {
         validate();
         rsnProgramBindSampler(mContext, vpf, slot, s);
     }
-    native int  rsnProgramFragmentCreate(int con, String shader, String[] texNames, int[] params);
+    native int  rsnProgramFragmentCreate(long con, String shader, String[] texNames, int[] params);
     synchronized int nProgramFragmentCreate(String shader, String[] texNames, int[] params) {
         validate();
         return rsnProgramFragmentCreate(mContext, shader, texNames, params);
     }
-    native int  rsnProgramVertexCreate(int con, String shader, String[] texNames, int[] params);
+    native int  rsnProgramVertexCreate(long con, String shader, String[] texNames, int[] params);
     synchronized int nProgramVertexCreate(String shader, String[] texNames, int[] params) {
         validate();
         return rsnProgramVertexCreate(mContext, shader, texNames, params);
     }
 
-    native int  rsnMeshCreate(int con, int[] vtx, int[] idx, int[] prim);
+    native int  rsnMeshCreate(long con, int[] vtx, int[] idx, int[] prim);
     synchronized int nMeshCreate(int[] vtx, int[] idx, int[] prim) {
         validate();
         return rsnMeshCreate(mContext, vtx, idx, prim);
     }
-    native int  rsnMeshGetVertexBufferCount(int con, int id);
+    native int  rsnMeshGetVertexBufferCount(long con, int id);
     synchronized int nMeshGetVertexBufferCount(int id) {
         validate();
         return rsnMeshGetVertexBufferCount(mContext, id);
     }
-    native int  rsnMeshGetIndexCount(int con, int id);
+    native int  rsnMeshGetIndexCount(long con, int id);
     synchronized int nMeshGetIndexCount(int id) {
         validate();
         return rsnMeshGetIndexCount(mContext, id);
     }
-    native void rsnMeshGetVertices(int con, int id, int[] vtxIds, int vtxIdCount);
+    native void rsnMeshGetVertices(long con, int id, int[] vtxIds, int vtxIdCount);
     synchronized void nMeshGetVertices(int id, int[] vtxIds, int vtxIdCount) {
         validate();
         rsnMeshGetVertices(mContext, id, vtxIds, vtxIdCount);
     }
-    native void rsnMeshGetIndices(int con, int id, int[] idxIds, int[] primitives, int vtxIdCount);
+    native void rsnMeshGetIndices(long con, int id, int[] idxIds, int[] primitives, int vtxIdCount);
     synchronized void nMeshGetIndices(int id, int[] idxIds, int[] primitives, int vtxIdCount) {
         validate();
         rsnMeshGetIndices(mContext, id, idxIds, primitives, vtxIdCount);
     }
 
-    native int  rsnPathCreate(int con, int prim, boolean isStatic, int vtx, int loop, float q);
+    native int  rsnPathCreate(long con, int prim, boolean isStatic, int vtx, int loop, float q);
     synchronized int nPathCreate(int prim, boolean isStatic, int vtx, int loop, float q) {
         validate();
         return rsnPathCreate(mContext, prim, isStatic, vtx, loop, q);
     }
 
-    int     mDev;
-    int     mContext;
+    long     mDev;
+    long     mContext;
     @SuppressWarnings({"FieldCanBeLocal"})
     MessageThread mMessageThread;
 
diff --git a/graphics/jni/Android.mk b/graphics/jni/Android.mk
index e8beae53..cbb5b3b 100644
--- a/graphics/jni/Android.mk
+++ b/graphics/jni/Android.mk
@@ -26,7 +26,7 @@
 	$(rs_generated_include_dir) \
 	$(call include-path-for, corecg graphics)
 
-LOCAL_CFLAGS +=
+LOCAL_CFLAGS += -Wno-unused-parameter
 
 LOCAL_LDLIBS := -lpthread
 LOCAL_ADDITIONAL_DEPENDENCIES := $(addprefix $(rs_generated_include_dir)/,rsgApiFuncDecl.h)
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 10d042c..6703fac6 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -170,7 +170,7 @@
 
 static void _nInit(JNIEnv *_env, jclass _this)
 {
-    gContextId             = _env->GetFieldID(_this, "mContext", "I");
+    gContextId             = _env->GetFieldID(_this, "mContext", "J");
 
     jclass bitmapClass = _env->FindClass("android/graphics/Bitmap");
     gNativeBitmapID = _env->GetFieldID(bitmapClass, "mNativeBitmap", "I");
@@ -179,28 +179,28 @@
 // ---------------------------------------------------------------------------
 
 static void
-nContextFinish(JNIEnv *_env, jobject _this, RsContext con)
+nContextFinish(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextFinish, con(%p)", con);
-    rsContextFinish(con);
+    rsContextFinish((RsContext)con);
 }
 
 static void
-nAssignName(JNIEnv *_env, jobject _this, RsContext con, jint obj, jbyteArray str)
+nAssignName(JNIEnv *_env, jobject _this, jlong con, jint obj, jbyteArray str)
 {
     LOG_API("nAssignName, con(%p), obj(%p)", con, (void *)obj);
     jint len = _env->GetArrayLength(str);
     jbyte * cptr = (jbyte *) _env->GetPrimitiveArrayCritical(str, 0);
-    rsAssignName(con, (void *)obj, (const char *)cptr, len);
+    rsAssignName((RsContext)con, (void *)obj, (const char *)cptr, len);
     _env->ReleasePrimitiveArrayCritical(str, cptr, JNI_ABORT);
 }
 
 static jstring
-nGetName(JNIEnv *_env, jobject _this, RsContext con, jint obj)
+nGetName(JNIEnv *_env, jobject _this, jlong con, jint obj)
 {
     LOG_API("nGetName, con(%p), obj(%p)", con, (void *)obj);
     const char *name = NULL;
-    rsaGetName(con, (void *)obj, &name);
+    rsaGetName((RsContext)con, (void *)obj, &name);
     if(name == NULL || strlen(name) == 0) {
         return NULL;
     }
@@ -208,15 +208,15 @@
 }
 
 static void
-nObjDestroy(JNIEnv *_env, jobject _this, RsContext con, jint obj)
+nObjDestroy(JNIEnv *_env, jobject _this, jlong con, jint obj)
 {
     LOG_API("nObjDestroy, con(%p) obj(%p)", con, (void *)obj);
-    rsObjDestroy(con, (void *)obj);
+    rsObjDestroy((RsContext)con, (void *)obj);
 }
 
 // ---------------------------------------------------------------------------
 
-static jint
+static jlong
 nDeviceCreate(JNIEnv *_env, jobject _this)
 {
     LOG_API("nDeviceCreate");
@@ -237,14 +237,14 @@
     return rsDeviceSetConfig((RsDevice)dev, (RsDeviceParam)p, value);
 }
 
-static jint
+static jlong
 nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer, jint ct)
 {
     LOG_API("nContextCreate");
     return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, 0);
 }
 
-static jint
+static jlong
 nContextCreateGL(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer,
                  int colorMin, int colorPref,
                  int alphaMin, int alphaPref,
@@ -269,16 +269,16 @@
 }
 
 static void
-nContextSetPriority(JNIEnv *_env, jobject _this, RsContext con, jint p)
+nContextSetPriority(JNIEnv *_env, jobject _this, jlong con, jint p)
 {
     LOG_API("ContextSetPriority, con(%p), priority(%i)", con, p);
-    rsContextSetPriority(con, p);
+    rsContextSetPriority((RsContext)con, p);
 }
 
 
 
 static void
-nContextSetSurface(JNIEnv *_env, jobject _this, RsContext con, jint width, jint height, jobject wnd)
+nContextSetSurface(JNIEnv *_env, jobject _this, jlong con, jint width, jint height, jobject wnd)
 {
     LOG_API("nContextSetSurface, con(%p), width(%i), height(%i), surface(%p)", con, width, height, (Surface *)wnd);
 
@@ -289,47 +289,47 @@
         window = android_view_Surface_getNativeWindow(_env, wnd).get();
     }
 
-    rsContextSetSurface(con, width, height, window);
+    rsContextSetSurface((RsContext)con, width, height, window);
 }
 
 static void
-nContextDestroy(JNIEnv *_env, jobject _this, RsContext con)
+nContextDestroy(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextDestroy, con(%p)", con);
-    rsContextDestroy(con);
+    rsContextDestroy((RsContext)con);
 }
 
 static void
-nContextDump(JNIEnv *_env, jobject _this, RsContext con, jint bits)
+nContextDump(JNIEnv *_env, jobject _this, jlong con, jint bits)
 {
     LOG_API("nContextDump, con(%p)  bits(%i)", (RsContext)con, bits);
     rsContextDump((RsContext)con, bits);
 }
 
 static void
-nContextPause(JNIEnv *_env, jobject _this, RsContext con)
+nContextPause(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextPause, con(%p)", con);
-    rsContextPause(con);
+    rsContextPause((RsContext)con);
 }
 
 static void
-nContextResume(JNIEnv *_env, jobject _this, RsContext con)
+nContextResume(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextResume, con(%p)", con);
-    rsContextResume(con);
+    rsContextResume((RsContext)con);
 }
 
 
 static jstring
-nContextGetErrorMessage(JNIEnv *_env, jobject _this, RsContext con)
+nContextGetErrorMessage(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextGetErrorMessage, con(%p)", con);
     char buf[1024];
 
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextGetMessage(con,
+    int id = rsContextGetMessage((RsContext)con,
                                  buf, sizeof(buf),
                                  &receiveLen, sizeof(receiveLen),
                                  &subID, sizeof(subID));
@@ -340,14 +340,14 @@
 }
 
 static jint
-nContextGetUserMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray data)
+nContextGetUserMessage(JNIEnv *_env, jobject _this, jlong con, jintArray data)
 {
     jint len = _env->GetArrayLength(data);
     LOG_API("nContextGetMessage, con(%p), len(%i)", con, len);
     jint *ptr = _env->GetIntArrayElements(data, NULL);
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextGetMessage(con,
+    int id = rsContextGetMessage((RsContext)con,
                                  ptr, len * 4,
                                  &receiveLen, sizeof(receiveLen),
                                  &subID, sizeof(subID));
@@ -359,13 +359,13 @@
 }
 
 static jint
-nContextPeekMessage(JNIEnv *_env, jobject _this, RsContext con, jintArray auxData)
+nContextPeekMessage(JNIEnv *_env, jobject _this, jlong con, jintArray auxData)
 {
     LOG_API("nContextPeekMessage, con(%p)", con);
     jint *auxDataPtr = _env->GetIntArrayElements(auxData, NULL);
     size_t receiveLen;
     uint32_t subID;
-    int id = rsContextPeekMessage(con, &receiveLen, sizeof(receiveLen),
+    int id = rsContextPeekMessage((RsContext)con, &receiveLen, sizeof(receiveLen),
                                   &subID, sizeof(subID));
     auxDataPtr[0] = (jint)subID;
     auxDataPtr[1] = (jint)receiveLen;
@@ -373,20 +373,20 @@
     return id;
 }
 
-static void nContextInitToClient(JNIEnv *_env, jobject _this, RsContext con)
+static void nContextInitToClient(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextInitToClient, con(%p)", con);
-    rsContextInitToClient(con);
+    rsContextInitToClient((RsContext)con);
 }
 
-static void nContextDeinitToClient(JNIEnv *_env, jobject _this, RsContext con)
+static void nContextDeinitToClient(JNIEnv *_env, jobject _this, jlong con)
 {
     LOG_API("nContextDeinitToClient, con(%p)", con);
-    rsContextDeinitToClient(con);
+    rsContextDeinitToClient((RsContext)con);
 }
 
 static void
-nContextSendMessage(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArray data)
+nContextSendMessage(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray data)
 {
     jint *ptr = NULL;
     jint len = 0;
@@ -395,7 +395,7 @@
         jint *ptr = _env->GetIntArrayElements(data, NULL);
     }
     LOG_API("nContextSendMessage, con(%p), id(%i), len(%i)", con, id, len);
-    rsContextSendMessage(con, id, (const uint8_t *)ptr, len * sizeof(int));
+    rsContextSendMessage((RsContext)con, id, (const uint8_t *)ptr, len * sizeof(int));
     if (data) {
         _env->ReleaseIntArrayElements(data, ptr, JNI_ABORT);
     }
@@ -404,14 +404,14 @@
 
 
 static jint
-nElementCreate(JNIEnv *_env, jobject _this, RsContext con, jint type, jint kind, jboolean norm, jint size)
+nElementCreate(JNIEnv *_env, jobject _this, jlong con, jint type, jint kind, jboolean norm, jint size)
 {
     LOG_API("nElementCreate, con(%p), type(%i), kind(%i), norm(%i), size(%i)", con, type, kind, norm, size);
-    return (jint)rsElementCreate(con, (RsDataType)type, (RsDataKind)kind, norm, size);
+    return (jint)rsElementCreate((RsContext)con, (RsDataType)type, (RsDataKind)kind, norm, size);
 }
 
 static jint
-nElementCreate2(JNIEnv *_env, jobject _this, RsContext con,
+nElementCreate2(JNIEnv *_env, jobject _this, jlong con,
                 jintArray _ids, jobjectArray _names, jintArray _arraySizes)
 {
     int fieldCount = _env->GetArrayLength(_ids);
@@ -425,7 +425,7 @@
     const char **nameArray = names.c_str();
     size_t *sizeArray = names.c_str_len();
 
-    jint id = (jint)rsElementCreate2(con,
+    jint id = (jint)rsElementCreate2((RsContext)con,
                                      (RsElement *)ids, fieldCount,
                                      nameArray, fieldCount * sizeof(size_t),  sizeArray,
                                      (const uint32_t *)arraySizes, fieldCount);
@@ -436,7 +436,7 @@
 }
 
 static void
-nElementGetNativeData(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArray _elementData)
+nElementGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray _elementData)
 {
     int dataSize = _env->GetArrayLength(_elementData);
     LOG_API("nElementGetNativeData, con(%p)", con);
@@ -445,7 +445,7 @@
     assert(dataSize == 5);
 
     uint32_t elementData[5];
-    rsaElementGetNativeData(con, (RsElement)id, elementData, dataSize);
+    rsaElementGetNativeData((RsContext)con, (RsElement)id, elementData, dataSize);
 
     for(jint i = 0; i < dataSize; i ++) {
         _env->SetIntArrayRegion(_elementData, i, 1, (const jint*)&elementData[i]);
@@ -454,7 +454,7 @@
 
 
 static void
-nElementGetSubElements(JNIEnv *_env, jobject _this, RsContext con, jint id,
+nElementGetSubElements(JNIEnv *_env, jobject _this, jlong con, jint id,
                        jintArray _IDs,
                        jobjectArray _names,
                        jintArray _arraySizes)
@@ -466,7 +466,7 @@
     const char **names = (const char **)malloc((uint32_t)dataSize * sizeof(const char *));
     uint32_t *arraySizes = (uint32_t *)malloc((uint32_t)dataSize * sizeof(uint32_t));
 
-    rsaElementGetSubElements(con, (RsElement)id, ids, names, arraySizes, (uint32_t)dataSize);
+    rsaElementGetSubElements((RsContext)con, (RsElement)id, ids, names, arraySizes, (uint32_t)dataSize);
 
     for(jint i = 0; i < dataSize; i++) {
         _env->SetObjectArrayElement(_names, i, _env->NewStringUTF(names[i]));
@@ -482,18 +482,18 @@
 // -----------------------------------
 
 static int
-nTypeCreate(JNIEnv *_env, jobject _this, RsContext con, RsElement eid,
+nTypeCreate(JNIEnv *_env, jobject _this, jlong con, RsElement eid,
             jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces, jint yuv)
 {
     LOG_API("nTypeCreate, con(%p) eid(%p), x(%i), y(%i), z(%i), mips(%i), faces(%i), yuv(%i)",
             con, eid, dimx, dimy, dimz, mips, faces, yuv);
 
-    jint id = (jint)rsTypeCreate(con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv);
+    jint id = (jint)rsTypeCreate((RsContext)con, (RsElement)eid, dimx, dimy, dimz, mips, faces, yuv);
     return (jint)id;
 }
 
 static void
-nTypeGetNativeData(JNIEnv *_env, jobject _this, RsContext con, jint id, jintArray _typeData)
+nTypeGetNativeData(JNIEnv *_env, jobject _this, jlong con, jint id, jintArray _typeData)
 {
     // We are packing 6 items: mDimX; mDimY; mDimZ;
     // mDimLOD; mDimFaces; mElement; into typeData
@@ -503,7 +503,7 @@
     LOG_API("nTypeCreate, con(%p)", con);
 
     uint32_t typeData[6];
-    rsaTypeGetNativeData(con, (RsType)id, typeData, 6);
+    rsaTypeGetNativeData((RsContext)con, (RsType)id, typeData, 6);
 
     for(jint i = 0; i < elementCount; i ++) {
         _env->SetIntArrayRegion(_typeData, i, 1, (const jint*)&typeData[i]);
@@ -513,25 +513,25 @@
 // -----------------------------------
 
 static jint
-nAllocationCreateTyped(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mips, jint usage, jint pointer)
+nAllocationCreateTyped(JNIEnv *_env, jobject _this, jlong con, jint type, jint mips, jint usage, jint pointer)
 {
     LOG_API("nAllocationCreateTyped, con(%p), type(%p), mip(%i), usage(%i), ptr(%p)", con, (RsElement)type, mips, usage, (void *)pointer);
-    return (jint) rsAllocationCreateTyped(con, (RsType)type, (RsAllocationMipmapControl)mips, (uint32_t)usage, (uint32_t)pointer);
+    return (jint) rsAllocationCreateTyped((RsContext)con, (RsType)type, (RsAllocationMipmapControl)mips, (uint32_t)usage, (uint32_t)pointer);
 }
 
 static void
-nAllocationSyncAll(JNIEnv *_env, jobject _this, RsContext con, jint a, jint bits)
+nAllocationSyncAll(JNIEnv *_env, jobject _this, jlong con, jint a, jint bits)
 {
     LOG_API("nAllocationSyncAll, con(%p), a(%p), bits(0x%08x)", con, (RsAllocation)a, bits);
-    rsAllocationSyncAll(con, (RsAllocation)a, (RsAllocationUsageType)bits);
+    rsAllocationSyncAll((RsContext)con, (RsAllocation)a, (RsAllocationUsageType)bits);
 }
 
 static jobject
-nAllocationGetSurface(JNIEnv *_env, jobject _this, RsContext con, jint a)
+nAllocationGetSurface(JNIEnv *_env, jobject _this, jlong con, jint a)
 {
     LOG_API("nAllocationGetSurface, con(%p), a(%p)", con, (RsAllocation)a);
 
-    IGraphicBufferProducer *v = (IGraphicBufferProducer *)rsAllocationGetSurface(con, (RsAllocation)a);
+    IGraphicBufferProducer *v = (IGraphicBufferProducer *)rsAllocationGetSurface((RsContext)con, (RsAllocation)a);
     sp<IGraphicBufferProducer> bp = v;
     v->decStrong(NULL);
 
@@ -540,7 +540,7 @@
 }
 
 static void
-nAllocationSetSurface(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc, jobject sur)
+nAllocationSetSurface(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc, jobject sur)
 {
     LOG_API("nAllocationSetSurface, con(%p), alloc(%p), surface(%p)",
             con, alloc, (Surface *)sur);
@@ -550,33 +550,33 @@
         s = android_view_Surface_getSurface(_env, sur);
     }
 
-    rsAllocationSetSurface(con, alloc, static_cast<ANativeWindow *>(s.get()));
+    rsAllocationSetSurface((RsContext)con, alloc, static_cast<ANativeWindow *>(s.get()));
 }
 
 static void
-nAllocationIoSend(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc)
+nAllocationIoSend(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc)
 {
     LOG_API("nAllocationIoSend, con(%p), alloc(%p)", con, alloc);
-    rsAllocationIoSend(con, alloc);
+    rsAllocationIoSend((RsContext)con, alloc);
 }
 
 static void
-nAllocationIoReceive(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc)
+nAllocationIoReceive(JNIEnv *_env, jobject _this, jlong con, RsAllocation alloc)
 {
     LOG_API("nAllocationIoReceive, con(%p), alloc(%p)", con, alloc);
-    rsAllocationIoReceive(con, alloc);
+    rsAllocationIoReceive((RsContext)con, alloc);
 }
 
 
 static void
-nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, RsContext con, jint alloc)
+nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, jlong con, jint alloc)
 {
     LOG_API("nAllocationGenerateMipmaps, con(%p), a(%p)", con, (RsAllocation)alloc);
-    rsAllocationGenerateMipmaps(con, (RsAllocation)alloc);
+    rsAllocationGenerateMipmaps((RsContext)con, (RsAllocation)alloc);
 }
 
 static int
-nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
+nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage)
 {
     SkBitmap const * nativeBitmap =
             (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
@@ -584,7 +584,7 @@
 
     bitmap.lockPixels();
     const void* ptr = bitmap.getPixels();
-    jint id = (jint)rsAllocationCreateFromBitmap(con,
+    jint id = (jint)rsAllocationCreateFromBitmap((RsContext)con,
                                                   (RsType)type, (RsAllocationMipmapControl)mip,
                                                   ptr, bitmap.getSize(), usage);
     bitmap.unlockPixels();
@@ -592,7 +592,7 @@
 }
 
 static int
-nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
+nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage)
 {
     SkBitmap const * nativeBitmap =
             (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
@@ -600,7 +600,7 @@
 
     bitmap.lockPixels();
     const void* ptr = bitmap.getPixels();
-    jint id = (jint)rsAllocationCreateTyped(con,
+    jint id = (jint)rsAllocationCreateTyped((RsContext)con,
                                             (RsType)type, (RsAllocationMipmapControl)mip,
                                             (uint32_t)usage, (size_t)ptr);
     bitmap.unlockPixels();
@@ -608,7 +608,7 @@
 }
 
 static int
-nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
+nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint type, jint mip, jobject jbitmap, jint usage)
 {
     SkBitmap const * nativeBitmap =
             (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
@@ -616,7 +616,7 @@
 
     bitmap.lockPixels();
     const void* ptr = bitmap.getPixels();
-    jint id = (jint)rsAllocationCubeCreateFromBitmap(con,
+    jint id = (jint)rsAllocationCubeCreateFromBitmap((RsContext)con,
                                                       (RsType)type, (RsAllocationMipmapControl)mip,
                                                       ptr, bitmap.getSize(), usage);
     bitmap.unlockPixels();
@@ -624,7 +624,7 @@
 }
 
 static void
-nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jobject jbitmap)
+nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jint alloc, jobject jbitmap)
 {
     SkBitmap const * nativeBitmap =
             (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
@@ -634,14 +634,14 @@
 
     bitmap.lockPixels();
     const void* ptr = bitmap.getPixels();
-    rsAllocation2DData(con, (RsAllocation)alloc, 0, 0,
+    rsAllocation2DData((RsContext)con, (RsAllocation)alloc, 0, 0,
                        0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X,
                        w, h, ptr, bitmap.getSize(), 0);
     bitmap.unlockPixels();
 }
 
 static void
-nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jobject jbitmap)
+nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jint alloc, jobject jbitmap)
 {
     SkBitmap const * nativeBitmap =
             (SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
@@ -649,7 +649,7 @@
 
     bitmap.lockPixels();
     void* ptr = bitmap.getPixels();
-    rsAllocationCopyToBitmap(con, (RsAllocation)alloc, ptr, bitmap.getSize());
+    rsAllocationCopyToBitmap((RsContext)con, (RsAllocation)alloc, ptr, bitmap.getSize());
     bitmap.unlockPixels();
     bitmap.notifyPixelsChanged();
 }
@@ -662,39 +662,39 @@
 
 
 static void
-nAllocationData1D(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jint offset, jint lod,
+nAllocationData1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offset, jint lod,
                   jint count, jobject data, int sizeBytes, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     LOG_API("nAllocation1DData, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i), dataType(%i)",
             con, alloc, offset, count, len, sizeBytes, dataType);
-    PER_ARRAY_TYPE(NULL, rsAllocation1DData, con, alloc, offset, lod, count, ptr, sizeBytes);
+    PER_ARRAY_TYPE(NULL, rsAllocation1DData, (RsContext)con, alloc, offset, lod, count, ptr, sizeBytes);
 }
 
 static void
 //    native void rsnAllocationElementData1D(int con, int id, int xoff, int compIdx, byte[] d, int sizeBytes);
-nAllocationElementData1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint offset, jint lod, jint compIdx, jbyteArray data, int sizeBytes)
+nAllocationElementData1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jint offset, jint lod, jint compIdx, jbyteArray data, int sizeBytes)
 {
     jint len = _env->GetArrayLength(data);
     LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
+    rsAllocation1DElementData((RsContext)con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
 static void
-nAllocationData2D(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face,
+nAllocationData2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face,
                   jint w, jint h, jobject data, int sizeBytes, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     RsAllocationCubemapFace face = (RsAllocationCubemapFace)_face;
     LOG_API("nAllocation2DData, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i) type(%i)",
             con, alloc, xoff, yoff, w, h, sizeBytes, dataType);
-    PER_ARRAY_TYPE(NULL, rsAllocation2DData, con, alloc, xoff, yoff, lod, face, w, h, ptr, sizeBytes, 0);
+    PER_ARRAY_TYPE(NULL, rsAllocation2DData, (RsContext)con, alloc, xoff, yoff, lod, face, w, h, ptr, sizeBytes, 0);
 }
 
 static void
-nAllocationData2D_alloc(JNIEnv *_env, jobject _this, RsContext con,
+nAllocationData2D_alloc(JNIEnv *_env, jobject _this, jlong con,
                         jint dstAlloc, jint dstXoff, jint dstYoff,
                         jint dstMip, jint dstFace,
                         jint width, jint height,
@@ -707,7 +707,7 @@
             con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace,
             width, height, (RsAllocation)srcAlloc, srcXoff, srcYoff, srcMip, srcFace);
 
-    rsAllocationCopy2DRange(con,
+    rsAllocationCopy2DRange((RsContext)con,
                             (RsAllocation)dstAlloc,
                             dstXoff, dstYoff,
                             dstMip, dstFace,
@@ -718,17 +718,17 @@
 }
 
 static void
-nAllocationData3D(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jint xoff, jint yoff, jint zoff, jint lod,
+nAllocationData3D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint zoff, jint lod,
                     jint w, jint h, jint d, jobject data, int sizeBytes, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     LOG_API("nAllocation3DData, con(%p), alloc(%p), xoff(%i), yoff(%i), zoff(%i), lod(%i), w(%i), h(%i), d(%i), sizeBytes(%i)",
             con, (RsAllocation)alloc, xoff, yoff, zoff, lod, w, h, d, sizeBytes);
-    PER_ARRAY_TYPE(NULL, rsAllocation3DData, con, alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
+    PER_ARRAY_TYPE(NULL, rsAllocation3DData, (RsContext)con, alloc, xoff, yoff, zoff, lod, w, h, d, ptr, sizeBytes, 0);
 }
 
 static void
-nAllocationData3D_alloc(JNIEnv *_env, jobject _this, RsContext con,
+nAllocationData3D_alloc(JNIEnv *_env, jobject _this, jlong con,
                         jint dstAlloc, jint dstXoff, jint dstYoff, jint dstZoff,
                         jint dstMip,
                         jint width, jint height, jint depth,
@@ -741,7 +741,7 @@
             con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace,
             width, height, (RsAllocation)srcAlloc, srcXoff, srcYoff, srcMip, srcFace);
 
-    rsAllocationCopy3DRange(con,
+    rsAllocationCopy3DRange((RsContext)con,
                             (RsAllocation)dstAlloc,
                             dstXoff, dstYoff, dstZoff, dstMip,
                             width, height, depth,
@@ -751,63 +751,63 @@
 
 
 static void
-nAllocationRead(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jobject data, int dataType)
+nAllocationRead(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jobject data, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     LOG_API("nAllocationRead, con(%p), alloc(%p)", con, (RsAllocation)alloc);
-    PER_ARRAY_TYPE(0, rsAllocationRead, con, alloc, ptr, len * typeBytes);
+    PER_ARRAY_TYPE(0, rsAllocationRead, (RsContext)con, alloc, ptr, len * typeBytes);
 }
 
 static void
-nAllocationRead1D(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jint offset, jint lod,
+nAllocationRead1D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint offset, jint lod,
                   jint count, jobject data, int sizeBytes, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     LOG_API("nAllocation1DRead, con(%p), adapter(%p), offset(%i), count(%i), len(%i), sizeBytes(%i), dataType(%i)",
             con, alloc, offset, count, len, sizeBytes, dataType);
-    PER_ARRAY_TYPE(0, rsAllocation1DRead, con, alloc, offset, lod, count, ptr, sizeBytes);
+    PER_ARRAY_TYPE(0, rsAllocation1DRead, (RsContext)con, alloc, offset, lod, count, ptr, sizeBytes);
 }
 
 static void
-nAllocationRead2D(JNIEnv *_env, jobject _this, RsContext con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face,
+nAllocationRead2D(JNIEnv *_env, jobject _this, jlong con, jint _alloc, jint xoff, jint yoff, jint lod, jint _face,
                   jint w, jint h, jobject data, int sizeBytes, int dataType)
 {
     RsAllocation *alloc = (RsAllocation *)_alloc;
     RsAllocationCubemapFace face = (RsAllocationCubemapFace)_face;
     LOG_API("nAllocation2DRead, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i) type(%i)",
             con, alloc, xoff, yoff, w, h, sizeBytes, dataType);
-    PER_ARRAY_TYPE(0, rsAllocation2DRead, con, alloc, xoff, yoff, lod, face, w, h, ptr, sizeBytes, 0);
+    PER_ARRAY_TYPE(0, rsAllocation2DRead, (RsContext)con, alloc, xoff, yoff, lod, face, w, h, ptr, sizeBytes, 0);
 }
 
 static jint
-nAllocationGetType(JNIEnv *_env, jobject _this, RsContext con, jint a)
+nAllocationGetType(JNIEnv *_env, jobject _this, jlong con, jint a)
 {
     LOG_API("nAllocationGetType, con(%p), a(%p)", con, (RsAllocation)a);
-    return (jint) rsaAllocationGetType(con, (RsAllocation)a);
+    return (jint) rsaAllocationGetType((RsContext)con, (RsAllocation)a);
 }
 
 static void
-nAllocationResize1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint dimX)
+nAllocationResize1D(JNIEnv *_env, jobject _this, jlong con, jint alloc, jint dimX)
 {
     LOG_API("nAllocationResize1D, con(%p), alloc(%p), sizeX(%i)", con, (RsAllocation)alloc, dimX);
-    rsAllocationResize1D(con, (RsAllocation)alloc, dimX);
+    rsAllocationResize1D((RsContext)con, (RsAllocation)alloc, dimX);
 }
 
 // -----------------------------------
 
 static int
-nFileA3DCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, jint native_asset)
+nFileA3DCreateFromAssetStream(JNIEnv *_env, jobject _this, jlong con, jint native_asset)
 {
     ALOGV("______nFileA3D %u", (uint32_t) native_asset);
 
     Asset* asset = reinterpret_cast<Asset*>(native_asset);
 
-    jint id = (jint)rsaFileA3DCreateFromMemory(con, asset->getBuffer(false), asset->getLength());
+    jint id = (jint)rsaFileA3DCreateFromMemory((RsContext)con, asset->getBuffer(false), asset->getLength());
     return id;
 }
 
 static int
-nFileA3DCreateFromAsset(JNIEnv *_env, jobject _this, RsContext con, jobject _assetMgr, jstring _path)
+nFileA3DCreateFromAsset(JNIEnv *_env, jobject _this, jlong con, jobject _assetMgr, jstring _path)
 {
     AssetManager* mgr = assetManagerForJavaObject(_env, _assetMgr);
     if (mgr == NULL) {
@@ -820,34 +820,34 @@
         return 0;
     }
 
-    jint id = (jint)rsaFileA3DCreateFromAsset(con, asset);
+    jint id = (jint)rsaFileA3DCreateFromAsset((RsContext)con, asset);
     return id;
 }
 
 static int
-nFileA3DCreateFromFile(JNIEnv *_env, jobject _this, RsContext con, jstring fileName)
+nFileA3DCreateFromFile(JNIEnv *_env, jobject _this, jlong con, jstring fileName)
 {
     AutoJavaStringToUTF8 fileNameUTF(_env, fileName);
-    jint id = (jint)rsaFileA3DCreateFromFile(con, fileNameUTF.c_str());
+    jint id = (jint)rsaFileA3DCreateFromFile((RsContext)con, fileNameUTF.c_str());
 
     return id;
 }
 
 static int
-nFileA3DGetNumIndexEntries(JNIEnv *_env, jobject _this, RsContext con, jint fileA3D)
+nFileA3DGetNumIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D)
 {
     int32_t numEntries = 0;
-    rsaFileA3DGetNumIndexEntries(con, &numEntries, (RsFile)fileA3D);
+    rsaFileA3DGetNumIndexEntries((RsContext)con, &numEntries, (RsFile)fileA3D);
     return numEntries;
 }
 
 static void
-nFileA3DGetIndexEntries(JNIEnv *_env, jobject _this, RsContext con, jint fileA3D, jint numEntries, jintArray _ids, jobjectArray _entries)
+nFileA3DGetIndexEntries(JNIEnv *_env, jobject _this, jlong con, jint fileA3D, jint numEntries, jintArray _ids, jobjectArray _entries)
 {
     ALOGV("______nFileA3D %u", (uint32_t) fileA3D);
     RsFileIndexEntry *fileEntries = (RsFileIndexEntry*)malloc((uint32_t)numEntries * sizeof(RsFileIndexEntry));
 
-    rsaFileA3DGetIndexEntries(con, fileEntries, (uint32_t)numEntries, (RsFile)fileA3D);
+    rsaFileA3DGetIndexEntries((RsContext)con, fileEntries, (uint32_t)numEntries, (RsFile)fileA3D);
 
     for(jint i = 0; i < numEntries; i ++) {
         _env->SetObjectArrayElement(_entries, i, _env->NewStringUTF(fileEntries[i].objectName));
@@ -858,21 +858,21 @@
 }
 
 static int
-nFileA3DGetEntryByIndex(JNIEnv *_env, jobject _this, RsContext con, jint fileA3D, jint index)
+nFileA3DGetEntryByIndex(JNIEnv *_env, jobject _this, jlong con, jint fileA3D, jint index)
 {
     ALOGV("______nFileA3D %u", (uint32_t) fileA3D);
-    jint id = (jint)rsaFileA3DGetEntryByIndex(con, (uint32_t)index, (RsFile)fileA3D);
+    jint id = (jint)rsaFileA3DGetEntryByIndex((RsContext)con, (uint32_t)index, (RsFile)fileA3D);
     return id;
 }
 
 // -----------------------------------
 
 static int
-nFontCreateFromFile(JNIEnv *_env, jobject _this, RsContext con,
+nFontCreateFromFile(JNIEnv *_env, jobject _this, jlong con,
                     jstring fileName, jfloat fontSize, jint dpi)
 {
     AutoJavaStringToUTF8 fileNameUTF(_env, fileName);
-    jint id = (jint)rsFontCreateFromFile(con,
+    jint id = (jint)rsFontCreateFromFile((RsContext)con,
                                          fileNameUTF.c_str(), fileNameUTF.length(),
                                          fontSize, dpi);
 
@@ -880,13 +880,13 @@
 }
 
 static int
-nFontCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con,
+nFontCreateFromAssetStream(JNIEnv *_env, jobject _this, jlong con,
                            jstring name, jfloat fontSize, jint dpi, jint native_asset)
 {
     Asset* asset = reinterpret_cast<Asset*>(native_asset);
     AutoJavaStringToUTF8 nameUTF(_env, name);
 
-    jint id = (jint)rsFontCreateFromMemory(con,
+    jint id = (jint)rsFontCreateFromMemory((RsContext)con,
                                            nameUTF.c_str(), nameUTF.length(),
                                            fontSize, dpi,
                                            asset->getBuffer(false), asset->getLength());
@@ -894,7 +894,7 @@
 }
 
 static int
-nFontCreateFromAsset(JNIEnv *_env, jobject _this, RsContext con, jobject _assetMgr, jstring _path,
+nFontCreateFromAsset(JNIEnv *_env, jobject _this, jlong con, jobject _assetMgr, jstring _path,
                      jfloat fontSize, jint dpi)
 {
     AssetManager* mgr = assetManagerForJavaObject(_env, _assetMgr);
@@ -908,7 +908,7 @@
         return 0;
     }
 
-    jint id = (jint)rsFontCreateFromMemory(con,
+    jint id = (jint)rsFontCreateFromMemory((RsContext)con,
                                            str.c_str(), str.length(),
                                            fontSize, dpi,
                                            asset->getBuffer(false), asset->getLength());
@@ -919,112 +919,112 @@
 // -----------------------------------
 
 static void
-nScriptBindAllocation(JNIEnv *_env, jobject _this, RsContext con, jint script, jint alloc, jint slot)
+nScriptBindAllocation(JNIEnv *_env, jobject _this, jlong con, jint script, jint alloc, jint slot)
 {
     LOG_API("nScriptBindAllocation, con(%p), script(%p), alloc(%p), slot(%i)", con, (RsScript)script, (RsAllocation)alloc, slot);
-    rsScriptBindAllocation(con, (RsScript)script, (RsAllocation)alloc, slot);
+    rsScriptBindAllocation((RsContext)con, (RsScript)script, (RsAllocation)alloc, slot);
 }
 
 static void
-nScriptSetVarI(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jint val)
+nScriptSetVarI(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jint val)
 {
     LOG_API("nScriptSetVarI, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val);
-    rsScriptSetVarI(con, (RsScript)script, slot, val);
+    rsScriptSetVarI((RsContext)con, (RsScript)script, slot, val);
 }
 
 static jint
-nScriptGetVarI(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot)
+nScriptGetVarI(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot)
 {
     LOG_API("nScriptGetVarI, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     int value = 0;
-    rsScriptGetVarV(con, (RsScript)script, slot, &value, sizeof(value));
+    rsScriptGetVarV((RsContext)con, (RsScript)script, slot, &value, sizeof(value));
     return value;
 }
 
 static void
-nScriptSetVarObj(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jint val)
+nScriptSetVarObj(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jint val)
 {
     LOG_API("nScriptSetVarObj, con(%p), s(%p), slot(%i), val(%i)", con, (void *)script, slot, val);
-    rsScriptSetVarObj(con, (RsScript)script, slot, (RsObjectBase)val);
+    rsScriptSetVarObj((RsContext)con, (RsScript)script, slot, (RsObjectBase)val);
 }
 
 static void
-nScriptSetVarJ(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jlong val)
+nScriptSetVarJ(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jlong val)
 {
     LOG_API("nScriptSetVarJ, con(%p), s(%p), slot(%i), val(%lli)", con, (void *)script, slot, val);
-    rsScriptSetVarJ(con, (RsScript)script, slot, val);
+    rsScriptSetVarJ((RsContext)con, (RsScript)script, slot, val);
 }
 
 static jlong
-nScriptGetVarJ(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot)
+nScriptGetVarJ(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot)
 {
     LOG_API("nScriptGetVarJ, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jlong value = 0;
-    rsScriptGetVarV(con, (RsScript)script, slot, &value, sizeof(value));
+    rsScriptGetVarV((RsContext)con, (RsScript)script, slot, &value, sizeof(value));
     return value;
 }
 
 static void
-nScriptSetVarF(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, float val)
+nScriptSetVarF(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, float val)
 {
     LOG_API("nScriptSetVarF, con(%p), s(%p), slot(%i), val(%f)", con, (void *)script, slot, val);
-    rsScriptSetVarF(con, (RsScript)script, slot, val);
+    rsScriptSetVarF((RsContext)con, (RsScript)script, slot, val);
 }
 
 static jfloat
-nScriptGetVarF(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot)
+nScriptGetVarF(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot)
 {
     LOG_API("nScriptGetVarF, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jfloat value = 0;
-    rsScriptGetVarV(con, (RsScript)script, slot, &value, sizeof(value));
+    rsScriptGetVarV((RsContext)con, (RsScript)script, slot, &value, sizeof(value));
     return value;
 }
 
 static void
-nScriptSetVarD(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, double val)
+nScriptSetVarD(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, double val)
 {
     LOG_API("nScriptSetVarD, con(%p), s(%p), slot(%i), val(%lf)", con, (void *)script, slot, val);
-    rsScriptSetVarD(con, (RsScript)script, slot, val);
+    rsScriptSetVarD((RsContext)con, (RsScript)script, slot, val);
 }
 
 static jdouble
-nScriptGetVarD(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot)
+nScriptGetVarD(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot)
 {
     LOG_API("nScriptGetVarD, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jdouble value = 0;
-    rsScriptGetVarV(con, (RsScript)script, slot, &value, sizeof(value));
+    rsScriptGetVarV((RsContext)con, (RsScript)script, slot, &value, sizeof(value));
     return value;
 }
 
 static void
-nScriptSetVarV(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jbyteArray data)
+nScriptSetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data)
 {
     LOG_API("nScriptSetVarV, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsScriptSetVarV(con, (RsScript)script, slot, ptr, len);
+    rsScriptSetVarV((RsContext)con, (RsScript)script, slot, ptr, len);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
 static void
-nScriptGetVarV(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jbyteArray data)
+nScriptGetVarV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data)
 {
     LOG_API("nScriptSetVarV, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsScriptGetVarV(con, (RsScript)script, slot, ptr, len);
+    rsScriptGetVarV((RsContext)con, (RsScript)script, slot, ptr, len);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
 static void
-nScriptSetVarVE(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jbyteArray data, jint elem, jintArray dims)
+nScriptSetVarVE(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data, jint elem, jintArray dims)
 {
     LOG_API("nScriptSetVarVE, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
     jint dimsLen = _env->GetArrayLength(dims) * sizeof(int);
     jint *dimsPtr = _env->GetIntArrayElements(dims, NULL);
-    rsScriptSetVarVE(con, (RsScript)script, slot, ptr, len, (RsElement)elem,
+    rsScriptSetVarVE((RsContext)con, (RsScript)script, slot, ptr, len, (RsElement)elem,
                      (const size_t*) dimsPtr, dimsLen);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
     _env->ReleaseIntArrayElements(dims, dimsPtr, JNI_ABORT);
@@ -1032,7 +1032,7 @@
 
 
 static void
-nScriptSetTimeZone(JNIEnv *_env, jobject _this, RsContext con, jint script, jbyteArray timeZone)
+nScriptSetTimeZone(JNIEnv *_env, jobject _this, jlong con, jint script, jbyteArray timeZone)
 {
     LOG_API("nScriptCSetTimeZone, con(%p), s(%p), timeZone(%s)", con, (void *)script, (const char *)timeZone);
 
@@ -1040,7 +1040,7 @@
     jbyte* timeZone_ptr;
     timeZone_ptr = (jbyte *) _env->GetPrimitiveArrayCritical(timeZone, (jboolean *)0);
 
-    rsScriptSetTimeZone(con, (RsScript)script, (const char *)timeZone_ptr, length);
+    rsScriptSetTimeZone((RsContext)con, (RsScript)script, (const char *)timeZone_ptr, length);
 
     if (timeZone_ptr) {
         _env->ReleasePrimitiveArrayCritical(timeZone, timeZone_ptr, 0);
@@ -1048,42 +1048,42 @@
 }
 
 static void
-nScriptInvoke(JNIEnv *_env, jobject _this, RsContext con, jint obj, jint slot)
+nScriptInvoke(JNIEnv *_env, jobject _this, jlong con, jint obj, jint slot)
 {
     LOG_API("nScriptInvoke, con(%p), script(%p)", con, (void *)obj);
-    rsScriptInvoke(con, (RsScript)obj, slot);
+    rsScriptInvoke((RsContext)con, (RsScript)obj, slot);
 }
 
 static void
-nScriptInvokeV(JNIEnv *_env, jobject _this, RsContext con, jint script, jint slot, jbyteArray data)
+nScriptInvokeV(JNIEnv *_env, jobject _this, jlong con, jint script, jint slot, jbyteArray data)
 {
     LOG_API("nScriptInvokeV, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(data);
     jbyte *ptr = _env->GetByteArrayElements(data, NULL);
-    rsScriptInvokeV(con, (RsScript)script, slot, ptr, len);
+    rsScriptInvokeV((RsContext)con, (RsScript)script, slot, ptr, len);
     _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
 }
 
 static void
-nScriptForEach(JNIEnv *_env, jobject _this, RsContext con,
+nScriptForEach(JNIEnv *_env, jobject _this, jlong con,
                jint script, jint slot, jint ain, jint aout)
 {
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0);
+    rsScriptForEach((RsContext)con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, NULL, 0);
 }
 static void
-nScriptForEachV(JNIEnv *_env, jobject _this, RsContext con,
+nScriptForEachV(JNIEnv *_env, jobject _this, jlong con,
                 jint script, jint slot, jint ain, jint aout, jbyteArray params)
 {
     LOG_API("nScriptForEach, con(%p), s(%p), slot(%i)", con, (void *)script, slot);
     jint len = _env->GetArrayLength(params);
     jbyte *ptr = _env->GetByteArrayElements(params, NULL);
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, NULL, 0);
+    rsScriptForEach((RsContext)con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, NULL, 0);
     _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
 }
 
 static void
-nScriptForEachClipped(JNIEnv *_env, jobject _this, RsContext con,
+nScriptForEachClipped(JNIEnv *_env, jobject _this, jlong con,
                       jint script, jint slot, jint ain, jint aout,
                       jint xstart, jint xend,
                       jint ystart, jint yend, jint zstart, jint zend)
@@ -1099,11 +1099,11 @@
     sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
     sc.arrayStart = 0;
     sc.arrayEnd = 0;
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, &sc, sizeof(sc));
+    rsScriptForEach((RsContext)con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, NULL, 0, &sc, sizeof(sc));
 }
 
 static void
-nScriptForEachClippedV(JNIEnv *_env, jobject _this, RsContext con,
+nScriptForEachClippedV(JNIEnv *_env, jobject _this, jlong con,
                        jint script, jint slot, jint ain, jint aout,
                        jbyteArray params, jint xstart, jint xend,
                        jint ystart, jint yend, jint zstart, jint zend)
@@ -1121,14 +1121,14 @@
     sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE;
     sc.arrayStart = 0;
     sc.arrayEnd = 0;
-    rsScriptForEach(con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, &sc, sizeof(sc));
+    rsScriptForEach((RsContext)con, (RsScript)script, slot, (RsAllocation)ain, (RsAllocation)aout, ptr, len, &sc, sizeof(sc));
     _env->ReleaseByteArrayElements(params, ptr, JNI_ABORT);
 }
 
 // -----------------------------------
 
 static jint
-nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con,
+nScriptCCreate(JNIEnv *_env, jobject _this, jlong con,
                jstring resName, jstring cacheDir,
                jbyteArray scriptRef, jint length)
 {
@@ -1160,9 +1160,9 @@
     script_ptr = (jbyte *)
         _env->GetPrimitiveArrayCritical(scriptRef, (jboolean *)0);
 
-    //rsScriptCSetText(con, (const char *)script_ptr, length);
+    //rsScriptCSetText((RsContext)con, (const char *)script_ptr, length);
 
-    ret = (jint)rsScriptCCreate(con,
+    ret = (jint)rsScriptCCreate((RsContext)con,
                                 resNameUTF.c_str(), resNameUTF.length(),
                                 cacheDirUTF.c_str(), cacheDirUTF.length(),
                                 (const char *)script_ptr, length);
@@ -1177,28 +1177,28 @@
 }
 
 static jint
-nScriptIntrinsicCreate(JNIEnv *_env, jobject _this, RsContext con, jint id, jint eid)
+nScriptIntrinsicCreate(JNIEnv *_env, jobject _this, jlong con, jint id, jint eid)
 {
     LOG_API("nScriptIntrinsicCreate, con(%p) id(%i) element(%p)", con, id, (void *)eid);
-    return (jint)rsScriptIntrinsicCreate(con, id, (RsElement)eid);
+    return (jint)rsScriptIntrinsicCreate((RsContext)con, id, (RsElement)eid);
 }
 
 static jint
-nScriptKernelIDCreate(JNIEnv *_env, jobject _this, RsContext con, jint sid, jint slot, jint sig)
+nScriptKernelIDCreate(JNIEnv *_env, jobject _this, jlong con, jint sid, jint slot, jint sig)
 {
     LOG_API("nScriptKernelIDCreate, con(%p) script(%p), slot(%i), sig(%i)", con, (void *)sid, slot, sig);
-    return (jint)rsScriptKernelIDCreate(con, (RsScript)sid, slot, sig);
+    return (jint)rsScriptKernelIDCreate((RsContext)con, (RsScript)sid, slot, sig);
 }
 
 static jint
-nScriptFieldIDCreate(JNIEnv *_env, jobject _this, RsContext con, jint sid, jint slot)
+nScriptFieldIDCreate(JNIEnv *_env, jobject _this, jlong con, jint sid, jint slot)
 {
     LOG_API("nScriptFieldIDCreate, con(%p) script(%p), slot(%i)", con, (void *)sid, slot);
-    return (jint)rsScriptFieldIDCreate(con, (RsScript)sid, slot);
+    return (jint)rsScriptFieldIDCreate((RsContext)con, (RsScript)sid, slot);
 }
 
 static jint
-nScriptGroupCreate(JNIEnv *_env, jobject _this, RsContext con, jintArray _kernels, jintArray _src,
+nScriptGroupCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _kernels, jintArray _src,
     jintArray _dstk, jintArray _dstf, jintArray _types)
 {
     LOG_API("nScriptGroupCreate, con(%p)", con);
@@ -1214,7 +1214,7 @@
     jint typesLen = _env->GetArrayLength(_types) * sizeof(int);
     jint *typesPtr = _env->GetIntArrayElements(_types, NULL);
 
-    int id = (int)rsScriptGroupCreate(con,
+    int id = (int)rsScriptGroupCreate((RsContext)con,
                                (RsScriptKernelID *)kernelsPtr, kernelsLen,
                                (RsScriptKernelID *)srcPtr, srcLen,
                                (RsScriptKernelID *)dstkPtr, dstkLen,
@@ -1230,39 +1230,39 @@
 }
 
 static void
-nScriptGroupSetInput(JNIEnv *_env, jobject _this, RsContext con, jint gid, jint kid, jint alloc)
+nScriptGroupSetInput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid, jint alloc)
 {
     LOG_API("nScriptGroupSetInput, con(%p) group(%p), kernelId(%p), alloc(%p)", con,
         (void *)gid, (void *)kid, (void *)alloc);
-    rsScriptGroupSetInput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
+    rsScriptGroupSetInput((RsContext)con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
 }
 
 static void
-nScriptGroupSetOutput(JNIEnv *_env, jobject _this, RsContext con, jint gid, jint kid, jint alloc)
+nScriptGroupSetOutput(JNIEnv *_env, jobject _this, jlong con, jint gid, jint kid, jint alloc)
 {
     LOG_API("nScriptGroupSetOutput, con(%p) group(%p), kernelId(%p), alloc(%p)", con,
         (void *)gid, (void *)kid, (void *)alloc);
-    rsScriptGroupSetOutput(con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
+    rsScriptGroupSetOutput((RsContext)con, (RsScriptGroup)gid, (RsScriptKernelID)kid, (RsAllocation)alloc);
 }
 
 static void
-nScriptGroupExecute(JNIEnv *_env, jobject _this, RsContext con, jint gid)
+nScriptGroupExecute(JNIEnv *_env, jobject _this, jlong con, jint gid)
 {
     LOG_API("nScriptGroupSetOutput, con(%p) group(%p)", con, (void *)gid);
-    rsScriptGroupExecute(con, (RsScriptGroup)gid);
+    rsScriptGroupExecute((RsContext)con, (RsScriptGroup)gid);
 }
 
 // ---------------------------------------------------------------------------
 
 static jint
-nProgramStoreCreate(JNIEnv *_env, jobject _this, RsContext con,
+nProgramStoreCreate(JNIEnv *_env, jobject _this, jlong con,
                     jboolean colorMaskR, jboolean colorMaskG, jboolean colorMaskB, jboolean colorMaskA,
                     jboolean depthMask, jboolean ditherEnable,
                     jint srcFunc, jint destFunc,
                     jint depthFunc)
 {
     LOG_API("nProgramStoreCreate, con(%p)", con);
-    return (jint)rsProgramStoreCreate(con, colorMaskR, colorMaskG, colorMaskB, colorMaskA,
+    return (jint)rsProgramStoreCreate((RsContext)con, colorMaskR, colorMaskG, colorMaskB, colorMaskA,
                                       depthMask, ditherEnable, (RsBlendSrcFunc)srcFunc,
                                       (RsBlendDstFunc)destFunc, (RsDepthFunc)depthFunc);
 }
@@ -1270,30 +1270,30 @@
 // ---------------------------------------------------------------------------
 
 static void
-nProgramBindConstants(JNIEnv *_env, jobject _this, RsContext con, jint vpv, jint slot, jint a)
+nProgramBindConstants(JNIEnv *_env, jobject _this, jlong con, jint vpv, jint slot, jint a)
 {
     LOG_API("nProgramBindConstants, con(%p), vpf(%p), sloat(%i), a(%p)", con, (RsProgramVertex)vpv, slot, (RsAllocation)a);
-    rsProgramBindConstants(con, (RsProgram)vpv, slot, (RsAllocation)a);
+    rsProgramBindConstants((RsContext)con, (RsProgram)vpv, slot, (RsAllocation)a);
 }
 
 static void
-nProgramBindTexture(JNIEnv *_env, jobject _this, RsContext con, jint vpf, jint slot, jint a)
+nProgramBindTexture(JNIEnv *_env, jobject _this, jlong con, jint vpf, jint slot, jint a)
 {
     LOG_API("nProgramBindTexture, con(%p), vpf(%p), slot(%i), a(%p)", con, (RsProgramFragment)vpf, slot, (RsAllocation)a);
-    rsProgramBindTexture(con, (RsProgramFragment)vpf, slot, (RsAllocation)a);
+    rsProgramBindTexture((RsContext)con, (RsProgramFragment)vpf, slot, (RsAllocation)a);
 }
 
 static void
-nProgramBindSampler(JNIEnv *_env, jobject _this, RsContext con, jint vpf, jint slot, jint a)
+nProgramBindSampler(JNIEnv *_env, jobject _this, jlong con, jint vpf, jint slot, jint a)
 {
     LOG_API("nProgramBindSampler, con(%p), vpf(%p), slot(%i), a(%p)", con, (RsProgramFragment)vpf, slot, (RsSampler)a);
-    rsProgramBindSampler(con, (RsProgramFragment)vpf, slot, (RsSampler)a);
+    rsProgramBindSampler((RsContext)con, (RsProgramFragment)vpf, slot, (RsSampler)a);
 }
 
 // ---------------------------------------------------------------------------
 
 static jint
-nProgramFragmentCreate(JNIEnv *_env, jobject _this, RsContext con, jstring shader,
+nProgramFragmentCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader,
                        jobjectArray texNames, jintArray params)
 {
     AutoJavaStringToUTF8 shaderUTF(_env, shader);
@@ -1307,7 +1307,7 @@
 
     LOG_API("nProgramFragmentCreate, con(%p), paramLen(%i)", con, paramLen);
 
-    jint ret = (jint)rsProgramFragmentCreate(con, shaderUTF.c_str(), shaderUTF.length(),
+    jint ret = (jint)rsProgramFragmentCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(),
                                              nameArray, texCount, sizeArray,
                                              (uint32_t *)paramPtr, paramLen);
 
@@ -1319,7 +1319,7 @@
 // ---------------------------------------------------------------------------
 
 static jint
-nProgramVertexCreate(JNIEnv *_env, jobject _this, RsContext con, jstring shader,
+nProgramVertexCreate(JNIEnv *_env, jobject _this, jlong con, jstring shader,
                      jobjectArray texNames, jintArray params)
 {
     AutoJavaStringToUTF8 shaderUTF(_env, shader);
@@ -1333,7 +1333,7 @@
     const char ** nameArray = names.c_str();
     size_t* sizeArray = names.c_str_len();
 
-    jint ret = (jint)rsProgramVertexCreate(con, shaderUTF.c_str(), shaderUTF.length(),
+    jint ret = (jint)rsProgramVertexCreate((RsContext)con, shaderUTF.c_str(), shaderUTF.length(),
                                            nameArray, texCount, sizeArray,
                                            (uint32_t *)paramPtr, paramLen);
 
@@ -1344,59 +1344,59 @@
 // ---------------------------------------------------------------------------
 
 static jint
-nProgramRasterCreate(JNIEnv *_env, jobject _this, RsContext con, jboolean pointSprite, jint cull)
+nProgramRasterCreate(JNIEnv *_env, jobject _this, jlong con, jboolean pointSprite, jint cull)
 {
     LOG_API("nProgramRasterCreate, con(%p), pointSprite(%i), cull(%i)", con, pointSprite, cull);
-    return (jint)rsProgramRasterCreate(con, pointSprite, (RsCullMode)cull);
+    return (jint)rsProgramRasterCreate((RsContext)con, pointSprite, (RsCullMode)cull);
 }
 
 
 // ---------------------------------------------------------------------------
 
 static void
-nContextBindRootScript(JNIEnv *_env, jobject _this, RsContext con, jint script)
+nContextBindRootScript(JNIEnv *_env, jobject _this, jlong con, jint script)
 {
     LOG_API("nContextBindRootScript, con(%p), script(%p)", con, (RsScript)script);
-    rsContextBindRootScript(con, (RsScript)script);
+    rsContextBindRootScript((RsContext)con, (RsScript)script);
 }
 
 static void
-nContextBindProgramStore(JNIEnv *_env, jobject _this, RsContext con, jint pfs)
+nContextBindProgramStore(JNIEnv *_env, jobject _this, jlong con, jint pfs)
 {
     LOG_API("nContextBindProgramStore, con(%p), pfs(%p)", con, (RsProgramStore)pfs);
-    rsContextBindProgramStore(con, (RsProgramStore)pfs);
+    rsContextBindProgramStore((RsContext)con, (RsProgramStore)pfs);
 }
 
 static void
-nContextBindProgramFragment(JNIEnv *_env, jobject _this, RsContext con, jint pf)
+nContextBindProgramFragment(JNIEnv *_env, jobject _this, jlong con, jint pf)
 {
     LOG_API("nContextBindProgramFragment, con(%p), pf(%p)", con, (RsProgramFragment)pf);
-    rsContextBindProgramFragment(con, (RsProgramFragment)pf);
+    rsContextBindProgramFragment((RsContext)con, (RsProgramFragment)pf);
 }
 
 static void
-nContextBindProgramVertex(JNIEnv *_env, jobject _this, RsContext con, jint pf)
+nContextBindProgramVertex(JNIEnv *_env, jobject _this, jlong con, jint pf)
 {
     LOG_API("nContextBindProgramVertex, con(%p), pf(%p)", con, (RsProgramVertex)pf);
-    rsContextBindProgramVertex(con, (RsProgramVertex)pf);
+    rsContextBindProgramVertex((RsContext)con, (RsProgramVertex)pf);
 }
 
 static void
-nContextBindProgramRaster(JNIEnv *_env, jobject _this, RsContext con, jint pf)
+nContextBindProgramRaster(JNIEnv *_env, jobject _this, jlong con, jint pf)
 {
     LOG_API("nContextBindProgramRaster, con(%p), pf(%p)", con, (RsProgramRaster)pf);
-    rsContextBindProgramRaster(con, (RsProgramRaster)pf);
+    rsContextBindProgramRaster((RsContext)con, (RsProgramRaster)pf);
 }
 
 
 // ---------------------------------------------------------------------------
 
 static jint
-nSamplerCreate(JNIEnv *_env, jobject _this, RsContext con, jint magFilter, jint minFilter,
+nSamplerCreate(JNIEnv *_env, jobject _this, jlong con, jint magFilter, jint minFilter,
                jint wrapS, jint wrapT, jint wrapR, jfloat aniso)
 {
     LOG_API("nSamplerCreate, con(%p)", con);
-    return (jint)rsSamplerCreate(con,
+    return (jint)rsSamplerCreate((RsContext)con,
                                  (RsSamplerValue)magFilter,
                                  (RsSamplerValue)minFilter,
                                  (RsSamplerValue)wrapS,
@@ -1409,17 +1409,17 @@
 
 //native int  rsnPathCreate(int con, int prim, boolean isStatic, int vtx, int loop, float q);
 static jint
-nPathCreate(JNIEnv *_env, jobject _this, RsContext con, jint prim, jboolean isStatic, jint _vtx, jint _loop, jfloat q) {
+nPathCreate(JNIEnv *_env, jobject _this, jlong con, jint prim, jboolean isStatic, jint _vtx, jint _loop, jfloat q) {
     LOG_API("nPathCreate, con(%p)", con);
 
-    int id = (int)rsPathCreate(con, (RsPathPrimitive)prim, isStatic,
+    int id = (int)rsPathCreate((RsContext)con, (RsPathPrimitive)prim, isStatic,
                                (RsAllocation)_vtx,
                                (RsAllocation)_loop, q);
     return id;
 }
 
 static jint
-nMeshCreate(JNIEnv *_env, jobject _this, RsContext con, jintArray _vtx, jintArray _idx, jintArray _prim)
+nMeshCreate(JNIEnv *_env, jobject _this, jlong con, jintArray _vtx, jintArray _idx, jintArray _prim)
 {
     LOG_API("nMeshCreate, con(%p)", con);
 
@@ -1430,7 +1430,7 @@
     jint primLen = _env->GetArrayLength(_prim);
     jint *primPtr = _env->GetIntArrayElements(_prim, NULL);
 
-    int id = (int)rsMeshCreate(con,
+    int id = (int)rsMeshCreate((RsContext)con,
                                (RsAllocation *)vtxPtr, vtxLen,
                                (RsAllocation *)idxPtr, idxLen,
                                (uint32_t *)primPtr, primLen);
@@ -1442,30 +1442,30 @@
 }
 
 static jint
-nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, RsContext con, jint mesh)
+nMeshGetVertexBufferCount(JNIEnv *_env, jobject _this, jlong con, jint mesh)
 {
     LOG_API("nMeshGetVertexBufferCount, con(%p), Mesh(%p)", con, (RsMesh)mesh);
     jint vtxCount = 0;
-    rsaMeshGetVertexBufferCount(con, (RsMesh)mesh, &vtxCount);
+    rsaMeshGetVertexBufferCount((RsContext)con, (RsMesh)mesh, &vtxCount);
     return vtxCount;
 }
 
 static jint
-nMeshGetIndexCount(JNIEnv *_env, jobject _this, RsContext con, jint mesh)
+nMeshGetIndexCount(JNIEnv *_env, jobject _this, jlong con, jint mesh)
 {
     LOG_API("nMeshGetIndexCount, con(%p), Mesh(%p)", con, (RsMesh)mesh);
     jint idxCount = 0;
-    rsaMeshGetIndexCount(con, (RsMesh)mesh, &idxCount);
+    rsaMeshGetIndexCount((RsContext)con, (RsMesh)mesh, &idxCount);
     return idxCount;
 }
 
 static void
-nMeshGetVertices(JNIEnv *_env, jobject _this, RsContext con, jint mesh, jintArray _ids, int numVtxIDs)
+nMeshGetVertices(JNIEnv *_env, jobject _this, jlong con, jint mesh, jintArray _ids, int numVtxIDs)
 {
     LOG_API("nMeshGetVertices, con(%p), Mesh(%p)", con, (RsMesh)mesh);
 
     RsAllocation *allocs = (RsAllocation*)malloc((uint32_t)numVtxIDs * sizeof(RsAllocation));
-    rsaMeshGetVertices(con, (RsMesh)mesh, allocs, (uint32_t)numVtxIDs);
+    rsaMeshGetVertices((RsContext)con, (RsMesh)mesh, allocs, (uint32_t)numVtxIDs);
 
     for(jint i = 0; i < numVtxIDs; i ++) {
         _env->SetIntArrayRegion(_ids, i, 1, (const jint*)&allocs[i]);
@@ -1475,14 +1475,14 @@
 }
 
 static void
-nMeshGetIndices(JNIEnv *_env, jobject _this, RsContext con, jint mesh, jintArray _idxIds, jintArray _primitives, int numIndices)
+nMeshGetIndices(JNIEnv *_env, jobject _this, jlong con, jint mesh, jintArray _idxIds, jintArray _primitives, int numIndices)
 {
     LOG_API("nMeshGetVertices, con(%p), Mesh(%p)", con, (RsMesh)mesh);
 
     RsAllocation *allocs = (RsAllocation*)malloc((uint32_t)numIndices * sizeof(RsAllocation));
     uint32_t *prims= (uint32_t*)malloc((uint32_t)numIndices * sizeof(uint32_t));
 
-    rsaMeshGetIndices(con, (RsMesh)mesh, allocs, prims, (uint32_t)numIndices);
+    rsaMeshGetIndices((RsContext)con, (RsMesh)mesh, allocs, prims, (uint32_t)numIndices);
 
     for(jint i = 0; i < numIndices; i ++) {
         _env->SetIntArrayRegion(_idxIds, i, 1, (const jint*)&allocs[i]);
@@ -1501,132 +1501,132 @@
 static JNINativeMethod methods[] = {
 {"_nInit",                         "()V",                                     (void*)_nInit },
 
-{"nDeviceCreate",                  "()I",                                     (void*)nDeviceCreate },
-{"nDeviceDestroy",                 "(I)V",                                    (void*)nDeviceDestroy },
-{"nDeviceSetConfig",               "(III)V",                                  (void*)nDeviceSetConfig },
-{"nContextGetUserMessage",         "(I[I)I",                                  (void*)nContextGetUserMessage },
-{"nContextGetErrorMessage",        "(I)Ljava/lang/String;",                   (void*)nContextGetErrorMessage },
-{"nContextPeekMessage",            "(I[I)I",                                  (void*)nContextPeekMessage },
+{"nDeviceCreate",                  "()J",                                     (void*)nDeviceCreate },
+{"nDeviceDestroy",                 "(J)V",                                    (void*)nDeviceDestroy },
+{"nDeviceSetConfig",               "(JII)V",                                  (void*)nDeviceSetConfig },
+{"nContextGetUserMessage",         "(J[I)I",                                  (void*)nContextGetUserMessage },
+{"nContextGetErrorMessage",        "(J)Ljava/lang/String;",                   (void*)nContextGetErrorMessage },
+{"nContextPeekMessage",            "(J[I)I",                                  (void*)nContextPeekMessage },
 
-{"nContextInitToClient",           "(I)V",                                    (void*)nContextInitToClient },
-{"nContextDeinitToClient",         "(I)V",                                    (void*)nContextDeinitToClient },
+{"nContextInitToClient",           "(J)V",                                    (void*)nContextInitToClient },
+{"nContextDeinitToClient",         "(J)V",                                    (void*)nContextDeinitToClient },
 
 
 // All methods below are thread protected in java.
-{"rsnContextCreate",                 "(IIII)I",                               (void*)nContextCreate },
-{"rsnContextCreateGL",               "(IIIIIIIIIIIIIFI)I",                    (void*)nContextCreateGL },
-{"rsnContextFinish",                 "(I)V",                                  (void*)nContextFinish },
-{"rsnContextSetPriority",            "(II)V",                                 (void*)nContextSetPriority },
-{"rsnContextSetSurface",             "(IIILandroid/view/Surface;)V",          (void*)nContextSetSurface },
-{"rsnContextDestroy",                "(I)V",                                  (void*)nContextDestroy },
-{"rsnContextDump",                   "(II)V",                                 (void*)nContextDump },
-{"rsnContextPause",                  "(I)V",                                  (void*)nContextPause },
-{"rsnContextResume",                 "(I)V",                                  (void*)nContextResume },
-{"rsnContextSendMessage",            "(II[I)V",                               (void*)nContextSendMessage },
-{"rsnAssignName",                    "(II[B)V",                               (void*)nAssignName },
-{"rsnGetName",                       "(II)Ljava/lang/String;",                (void*)nGetName },
-{"rsnObjDestroy",                    "(II)V",                                 (void*)nObjDestroy },
+{"rsnContextCreate",                 "(JIII)J",                               (void*)nContextCreate },
+{"rsnContextCreateGL",               "(JIIIIIIIIIIIIFI)J",                    (void*)nContextCreateGL },
+{"rsnContextFinish",                 "(J)V",                                  (void*)nContextFinish },
+{"rsnContextSetPriority",            "(JI)V",                                 (void*)nContextSetPriority },
+{"rsnContextSetSurface",             "(JIILandroid/view/Surface;)V",          (void*)nContextSetSurface },
+{"rsnContextDestroy",                "(J)V",                                  (void*)nContextDestroy },
+{"rsnContextDump",                   "(JI)V",                                 (void*)nContextDump },
+{"rsnContextPause",                  "(J)V",                                  (void*)nContextPause },
+{"rsnContextResume",                 "(J)V",                                  (void*)nContextResume },
+{"rsnContextSendMessage",            "(JI[I)V",                               (void*)nContextSendMessage },
+{"rsnAssignName",                    "(JI[B)V",                               (void*)nAssignName },
+{"rsnGetName",                       "(JI)Ljava/lang/String;",                (void*)nGetName },
+{"rsnObjDestroy",                    "(JI)V",                                 (void*)nObjDestroy },
 
-{"rsnFileA3DCreateFromFile",         "(ILjava/lang/String;)I",                (void*)nFileA3DCreateFromFile },
-{"rsnFileA3DCreateFromAssetStream",  "(II)I",                                 (void*)nFileA3DCreateFromAssetStream },
-{"rsnFileA3DCreateFromAsset",        "(ILandroid/content/res/AssetManager;Ljava/lang/String;)I",            (void*)nFileA3DCreateFromAsset },
-{"rsnFileA3DGetNumIndexEntries",     "(II)I",                                 (void*)nFileA3DGetNumIndexEntries },
-{"rsnFileA3DGetIndexEntries",        "(III[I[Ljava/lang/String;)V",           (void*)nFileA3DGetIndexEntries },
-{"rsnFileA3DGetEntryByIndex",        "(III)I",                                (void*)nFileA3DGetEntryByIndex },
+{"rsnFileA3DCreateFromFile",         "(JLjava/lang/String;)I",                (void*)nFileA3DCreateFromFile },
+{"rsnFileA3DCreateFromAssetStream",  "(JI)I",                                 (void*)nFileA3DCreateFromAssetStream },
+{"rsnFileA3DCreateFromAsset",        "(JLandroid/content/res/AssetManager;Ljava/lang/String;)I",            (void*)nFileA3DCreateFromAsset },
+{"rsnFileA3DGetNumIndexEntries",     "(JI)I",                                 (void*)nFileA3DGetNumIndexEntries },
+{"rsnFileA3DGetIndexEntries",        "(JII[I[Ljava/lang/String;)V",           (void*)nFileA3DGetIndexEntries },
+{"rsnFileA3DGetEntryByIndex",        "(JII)I",                                (void*)nFileA3DGetEntryByIndex },
 
-{"rsnFontCreateFromFile",            "(ILjava/lang/String;FI)I",              (void*)nFontCreateFromFile },
-{"rsnFontCreateFromAssetStream",     "(ILjava/lang/String;FII)I",             (void*)nFontCreateFromAssetStream },
-{"rsnFontCreateFromAsset",        "(ILandroid/content/res/AssetManager;Ljava/lang/String;FI)I",            (void*)nFontCreateFromAsset },
+{"rsnFontCreateFromFile",            "(JLjava/lang/String;FI)I",              (void*)nFontCreateFromFile },
+{"rsnFontCreateFromAssetStream",     "(JLjava/lang/String;FII)I",             (void*)nFontCreateFromAssetStream },
+{"rsnFontCreateFromAsset",        "(JLandroid/content/res/AssetManager;Ljava/lang/String;FI)I",            (void*)nFontCreateFromAsset },
 
-{"rsnElementCreate",                 "(IIIZI)I",                              (void*)nElementCreate },
-{"rsnElementCreate2",                "(I[I[Ljava/lang/String;[I)I",           (void*)nElementCreate2 },
-{"rsnElementGetNativeData",          "(II[I)V",                               (void*)nElementGetNativeData },
-{"rsnElementGetSubElements",         "(II[I[Ljava/lang/String;[I)V",          (void*)nElementGetSubElements },
+{"rsnElementCreate",                 "(JIIZI)I",                              (void*)nElementCreate },
+{"rsnElementCreate2",                "(J[I[Ljava/lang/String;[I)I",           (void*)nElementCreate2 },
+{"rsnElementGetNativeData",          "(JI[I)V",                               (void*)nElementGetNativeData },
+{"rsnElementGetSubElements",         "(JI[I[Ljava/lang/String;[I)V",          (void*)nElementGetSubElements },
 
-{"rsnTypeCreate",                    "(IIIIIZZI)I",                           (void*)nTypeCreate },
-{"rsnTypeGetNativeData",             "(II[I)V",                               (void*)nTypeGetNativeData },
+{"rsnTypeCreate",                    "(JIIIIZZI)I",                           (void*)nTypeCreate },
+{"rsnTypeGetNativeData",             "(JI[I)V",                               (void*)nTypeGetNativeData },
 
-{"rsnAllocationCreateTyped",         "(IIIII)I",                               (void*)nAllocationCreateTyped },
-{"rsnAllocationCreateFromBitmap",    "(IIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCreateFromBitmap },
-{"rsnAllocationCreateBitmapBackedAllocation",    "(IIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCreateBitmapBackedAllocation },
-{"rsnAllocationCubeCreateFromBitmap","(IIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCubeCreateFromBitmap },
+{"rsnAllocationCreateTyped",         "(JIIII)I",                               (void*)nAllocationCreateTyped },
+{"rsnAllocationCreateFromBitmap",    "(JIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCreateFromBitmap },
+{"rsnAllocationCreateBitmapBackedAllocation",    "(JIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCreateBitmapBackedAllocation },
+{"rsnAllocationCubeCreateFromBitmap","(JIILandroid/graphics/Bitmap;I)I",      (void*)nAllocationCubeCreateFromBitmap },
 
-{"rsnAllocationCopyFromBitmap",      "(IILandroid/graphics/Bitmap;)V",        (void*)nAllocationCopyFromBitmap },
-{"rsnAllocationCopyToBitmap",        "(IILandroid/graphics/Bitmap;)V",        (void*)nAllocationCopyToBitmap },
+{"rsnAllocationCopyFromBitmap",      "(JILandroid/graphics/Bitmap;)V",        (void*)nAllocationCopyFromBitmap },
+{"rsnAllocationCopyToBitmap",        "(JILandroid/graphics/Bitmap;)V",        (void*)nAllocationCopyToBitmap },
 
-{"rsnAllocationSyncAll",             "(III)V",                                (void*)nAllocationSyncAll },
-{"rsnAllocationGetSurface",          "(II)Landroid/view/Surface;",            (void*)nAllocationGetSurface },
-{"rsnAllocationSetSurface",          "(IILandroid/view/Surface;)V",           (void*)nAllocationSetSurface },
-{"rsnAllocationIoSend",              "(II)V",                                 (void*)nAllocationIoSend },
-{"rsnAllocationIoReceive",           "(II)V",                                 (void*)nAllocationIoReceive },
-{"rsnAllocationData1D",              "(IIIIILjava/lang/Object;II)V",          (void*)nAllocationData1D },
-{"rsnAllocationElementData1D",       "(IIIII[BI)V",                           (void*)nAllocationElementData1D },
-{"rsnAllocationData2D",              "(IIIIIIIILjava/lang/Object;II)V",       (void*)nAllocationData2D },
-{"rsnAllocationData2D",              "(IIIIIIIIIIIII)V",                      (void*)nAllocationData2D_alloc },
-{"rsnAllocationData3D",              "(IIIIIIIIILjava/lang/Object;II)V",      (void*)nAllocationData3D },
-{"rsnAllocationData3D",              "(IIIIIIIIIIIIII)V",                     (void*)nAllocationData3D_alloc },
-{"rsnAllocationRead",                "(IILjava/lang/Object;I)V",              (void*)nAllocationRead },
-{"rsnAllocationRead1D",              "(IIIIILjava/lang/Object;II)V",          (void*)nAllocationRead1D },
-{"rsnAllocationRead2D",              "(IIIIIIIILjava/lang/Object;II)V",       (void*)nAllocationRead2D },
-{"rsnAllocationGetType",             "(II)I",                                 (void*)nAllocationGetType},
-{"rsnAllocationResize1D",            "(III)V",                                (void*)nAllocationResize1D },
-{"rsnAllocationGenerateMipmaps",     "(II)V",                                 (void*)nAllocationGenerateMipmaps },
+{"rsnAllocationSyncAll",             "(JII)V",                                (void*)nAllocationSyncAll },
+{"rsnAllocationGetSurface",          "(JI)Landroid/view/Surface;",            (void*)nAllocationGetSurface },
+{"rsnAllocationSetSurface",          "(JILandroid/view/Surface;)V",           (void*)nAllocationSetSurface },
+{"rsnAllocationIoSend",              "(JI)V",                                 (void*)nAllocationIoSend },
+{"rsnAllocationIoReceive",           "(JI)V",                                 (void*)nAllocationIoReceive },
+{"rsnAllocationData1D",              "(JIIIILjava/lang/Object;II)V",          (void*)nAllocationData1D },
+{"rsnAllocationElementData1D",       "(JIIII[BI)V",                           (void*)nAllocationElementData1D },
+{"rsnAllocationData2D",              "(JIIIIIIILjava/lang/Object;II)V",       (void*)nAllocationData2D },
+{"rsnAllocationData2D",              "(JIIIIIIIIIIII)V",                      (void*)nAllocationData2D_alloc },
+{"rsnAllocationData3D",              "(JIIIIIIIILjava/lang/Object;II)V",      (void*)nAllocationData3D },
+{"rsnAllocationData3D",              "(JIIIIIIIIIIIII)V",                     (void*)nAllocationData3D_alloc },
+{"rsnAllocationRead",                "(JILjava/lang/Object;I)V",              (void*)nAllocationRead },
+{"rsnAllocationRead1D",              "(JIIIILjava/lang/Object;II)V",          (void*)nAllocationRead1D },
+{"rsnAllocationRead2D",              "(JIIIIIIILjava/lang/Object;II)V",       (void*)nAllocationRead2D },
+{"rsnAllocationGetType",             "(JI)I",                                 (void*)nAllocationGetType},
+{"rsnAllocationResize1D",            "(JII)V",                                (void*)nAllocationResize1D },
+{"rsnAllocationGenerateMipmaps",     "(JI)V",                                 (void*)nAllocationGenerateMipmaps },
 
-{"rsnScriptBindAllocation",          "(IIII)V",                               (void*)nScriptBindAllocation },
-{"rsnScriptSetTimeZone",             "(II[B)V",                               (void*)nScriptSetTimeZone },
-{"rsnScriptInvoke",                  "(III)V",                                (void*)nScriptInvoke },
-{"rsnScriptInvokeV",                 "(III[B)V",                              (void*)nScriptInvokeV },
-{"rsnScriptForEach",                 "(IIIII)V",                              (void*)nScriptForEach },
-{"rsnScriptForEach",                 "(IIIII[B)V",                            (void*)nScriptForEachV },
-{"rsnScriptForEachClipped",          "(IIIIIIIIIII)V",                        (void*)nScriptForEachClipped },
-{"rsnScriptForEachClipped",          "(IIIII[BIIIIII)V",                      (void*)nScriptForEachClippedV },
-{"rsnScriptSetVarI",                 "(IIII)V",                               (void*)nScriptSetVarI },
-{"rsnScriptGetVarI",                 "(III)I",                                (void*)nScriptGetVarI },
-{"rsnScriptSetVarJ",                 "(IIIJ)V",                               (void*)nScriptSetVarJ },
-{"rsnScriptGetVarJ",                 "(III)J",                                (void*)nScriptGetVarJ },
-{"rsnScriptSetVarF",                 "(IIIF)V",                               (void*)nScriptSetVarF },
-{"rsnScriptGetVarF",                 "(III)F",                                (void*)nScriptGetVarF },
-{"rsnScriptSetVarD",                 "(IIID)V",                               (void*)nScriptSetVarD },
-{"rsnScriptGetVarD",                 "(III)D",                                (void*)nScriptGetVarD },
-{"rsnScriptSetVarV",                 "(III[B)V",                              (void*)nScriptSetVarV },
-{"rsnScriptGetVarV",                 "(III[B)V",                              (void*)nScriptGetVarV },
-{"rsnScriptSetVarVE",                "(III[BI[I)V",                           (void*)nScriptSetVarVE },
-{"rsnScriptSetVarObj",               "(IIII)V",                               (void*)nScriptSetVarObj },
+{"rsnScriptBindAllocation",          "(JIII)V",                               (void*)nScriptBindAllocation },
+{"rsnScriptSetTimeZone",             "(JI[B)V",                               (void*)nScriptSetTimeZone },
+{"rsnScriptInvoke",                  "(JII)V",                                (void*)nScriptInvoke },
+{"rsnScriptInvokeV",                 "(JII[B)V",                              (void*)nScriptInvokeV },
+{"rsnScriptForEach",                 "(JIIII)V",                              (void*)nScriptForEach },
+{"rsnScriptForEach",                 "(JIIII[B)V",                            (void*)nScriptForEachV },
+{"rsnScriptForEachClipped",          "(JIIIIIIIIII)V",                        (void*)nScriptForEachClipped },
+{"rsnScriptForEachClipped",          "(JIIII[BIIIIII)V",                      (void*)nScriptForEachClippedV },
+{"rsnScriptSetVarI",                 "(JIII)V",                               (void*)nScriptSetVarI },
+{"rsnScriptGetVarI",                 "(JII)I",                                (void*)nScriptGetVarI },
+{"rsnScriptSetVarJ",                 "(JIIJ)V",                               (void*)nScriptSetVarJ },
+{"rsnScriptGetVarJ",                 "(JII)J",                                (void*)nScriptGetVarJ },
+{"rsnScriptSetVarF",                 "(JIIF)V",                               (void*)nScriptSetVarF },
+{"rsnScriptGetVarF",                 "(JII)F",                                (void*)nScriptGetVarF },
+{"rsnScriptSetVarD",                 "(JIID)V",                               (void*)nScriptSetVarD },
+{"rsnScriptGetVarD",                 "(JII)D",                                (void*)nScriptGetVarD },
+{"rsnScriptSetVarV",                 "(JII[B)V",                              (void*)nScriptSetVarV },
+{"rsnScriptGetVarV",                 "(JII[B)V",                              (void*)nScriptGetVarV },
+{"rsnScriptSetVarVE",                "(JII[BI[I)V",                           (void*)nScriptSetVarVE },
+{"rsnScriptSetVarObj",               "(JIII)V",                               (void*)nScriptSetVarObj },
 
-{"rsnScriptCCreate",                 "(ILjava/lang/String;Ljava/lang/String;[BI)I",  (void*)nScriptCCreate },
-{"rsnScriptIntrinsicCreate",         "(III)I",                                (void*)nScriptIntrinsicCreate },
-{"rsnScriptKernelIDCreate",          "(IIII)I",                               (void*)nScriptKernelIDCreate },
-{"rsnScriptFieldIDCreate",           "(III)I",                                (void*)nScriptFieldIDCreate },
-{"rsnScriptGroupCreate",             "(I[I[I[I[I[I)I",                        (void*)nScriptGroupCreate },
-{"rsnScriptGroupSetInput",           "(IIII)V",                               (void*)nScriptGroupSetInput },
-{"rsnScriptGroupSetOutput",          "(IIII)V",                               (void*)nScriptGroupSetOutput },
-{"rsnScriptGroupExecute",            "(II)V",                                 (void*)nScriptGroupExecute },
+{"rsnScriptCCreate",                 "(JLjava/lang/String;Ljava/lang/String;[BI)I",  (void*)nScriptCCreate },
+{"rsnScriptIntrinsicCreate",         "(JII)I",                                (void*)nScriptIntrinsicCreate },
+{"rsnScriptKernelIDCreate",          "(JIII)I",                               (void*)nScriptKernelIDCreate },
+{"rsnScriptFieldIDCreate",           "(JII)I",                                (void*)nScriptFieldIDCreate },
+{"rsnScriptGroupCreate",             "(J[I[I[I[I[I)I",                        (void*)nScriptGroupCreate },
+{"rsnScriptGroupSetInput",           "(JIII)V",                               (void*)nScriptGroupSetInput },
+{"rsnScriptGroupSetOutput",          "(JIII)V",                               (void*)nScriptGroupSetOutput },
+{"rsnScriptGroupExecute",            "(JI)V",                                 (void*)nScriptGroupExecute },
 
-{"rsnProgramStoreCreate",            "(IZZZZZZIII)I",                         (void*)nProgramStoreCreate },
+{"rsnProgramStoreCreate",            "(JZZZZZZIII)I",                         (void*)nProgramStoreCreate },
 
-{"rsnProgramBindConstants",          "(IIII)V",                               (void*)nProgramBindConstants },
-{"rsnProgramBindTexture",            "(IIII)V",                               (void*)nProgramBindTexture },
-{"rsnProgramBindSampler",            "(IIII)V",                               (void*)nProgramBindSampler },
+{"rsnProgramBindConstants",          "(JIII)V",                               (void*)nProgramBindConstants },
+{"rsnProgramBindTexture",            "(JIII)V",                               (void*)nProgramBindTexture },
+{"rsnProgramBindSampler",            "(JIII)V",                               (void*)nProgramBindSampler },
 
-{"rsnProgramFragmentCreate",         "(ILjava/lang/String;[Ljava/lang/String;[I)I",              (void*)nProgramFragmentCreate },
-{"rsnProgramRasterCreate",           "(IZI)I",                                (void*)nProgramRasterCreate },
-{"rsnProgramVertexCreate",           "(ILjava/lang/String;[Ljava/lang/String;[I)I",              (void*)nProgramVertexCreate },
+{"rsnProgramFragmentCreate",         "(JLjava/lang/String;[Ljava/lang/String;[I)I",              (void*)nProgramFragmentCreate },
+{"rsnProgramRasterCreate",           "(JZI)I",                                (void*)nProgramRasterCreate },
+{"rsnProgramVertexCreate",           "(JLjava/lang/String;[Ljava/lang/String;[I)I",              (void*)nProgramVertexCreate },
 
-{"rsnContextBindRootScript",         "(II)V",                                 (void*)nContextBindRootScript },
-{"rsnContextBindProgramStore",       "(II)V",                                 (void*)nContextBindProgramStore },
-{"rsnContextBindProgramFragment",    "(II)V",                                 (void*)nContextBindProgramFragment },
-{"rsnContextBindProgramVertex",      "(II)V",                                 (void*)nContextBindProgramVertex },
-{"rsnContextBindProgramRaster",      "(II)V",                                 (void*)nContextBindProgramRaster },
+{"rsnContextBindRootScript",         "(JI)V",                                 (void*)nContextBindRootScript },
+{"rsnContextBindProgramStore",       "(JI)V",                                 (void*)nContextBindProgramStore },
+{"rsnContextBindProgramFragment",    "(JI)V",                                 (void*)nContextBindProgramFragment },
+{"rsnContextBindProgramVertex",      "(JI)V",                                 (void*)nContextBindProgramVertex },
+{"rsnContextBindProgramRaster",      "(JI)V",                                 (void*)nContextBindProgramRaster },
 
-{"rsnSamplerCreate",                 "(IIIIIIF)I",                            (void*)nSamplerCreate },
+{"rsnSamplerCreate",                 "(JIIIIIF)I",                            (void*)nSamplerCreate },
 
-{"rsnPathCreate",                    "(IIZIIF)I",                             (void*)nPathCreate },
-{"rsnMeshCreate",                    "(I[I[I[I)I",                            (void*)nMeshCreate },
+{"rsnPathCreate",                    "(JIZIIF)I",                             (void*)nPathCreate },
+{"rsnMeshCreate",                    "(J[I[I[I)I",                            (void*)nMeshCreate },
 
-{"rsnMeshGetVertexBufferCount",      "(II)I",                                 (void*)nMeshGetVertexBufferCount },
-{"rsnMeshGetIndexCount",             "(II)I",                                 (void*)nMeshGetIndexCount },
-{"rsnMeshGetVertices",               "(II[II)V",                              (void*)nMeshGetVertices },
-{"rsnMeshGetIndices",                "(II[I[II)V",                            (void*)nMeshGetIndices },
+{"rsnMeshGetVertexBufferCount",      "(JI)I",                                 (void*)nMeshGetVertexBufferCount },
+{"rsnMeshGetIndexCount",             "(JI)I",                                 (void*)nMeshGetIndexCount },
+{"rsnMeshGetVertices",               "(JI[II)V",                              (void*)nMeshGetVertices },
+{"rsnMeshGetIndices",                "(JI[I[II)V",                            (void*)nMeshGetIndices },
 
 };
 
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 1f0a546..aeacc66 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -205,7 +205,7 @@
     <string name="quick_settings_wifi_not_connected" msgid="7171904845345573431">"Няма падключэння"</string>
     <string name="quick_settings_wifi_no_network" msgid="2221993077220856376">"Няма сеткi"</string>
     <string name="quick_settings_wifi_off_label" msgid="7558778100843885864">"Wi-Fi адключаны"</string>
-    <!-- no translation found for quick_settings_remote_display_no_connection_label (3319785626703585888) -->
+    <!-- no translation found for quick_settings_remote_display_no_connection_label (372107699274391290) -->
     <skip />
     <string name="quick_settings_brightness_dialog_title" msgid="8599674057673605368">"Яркасць"</string>
     <string name="quick_settings_brightness_dialog_auto_brightness_label" msgid="5064982743784071218">"АЎТА"</string>
diff --git a/services/java/com/android/server/print/PrintManagerService.java b/services/java/com/android/server/print/PrintManagerService.java
index 98acc27..a475639 100644
--- a/services/java/com/android/server/print/PrintManagerService.java
+++ b/services/java/com/android/server/print/PrintManagerService.java
@@ -399,7 +399,7 @@
     private void registerBoradcastReceivers() {
         PackageMonitor monitor = new PackageMonitor() {
             @Override
-            public boolean onPackageChanged(String packageName, int uid, String[] components) {
+            public void onPackageModified(String packageName) {
                 synchronized (mLock) {
                     UserState userState = getOrCreateUserStateLocked(getChangingUserId());
                     Iterator<ComponentName> iterator = userState.getEnabledServices().iterator();
@@ -407,11 +407,9 @@
                         ComponentName componentName = iterator.next();
                         if (packageName.equals(componentName.getPackageName())) {
                             userState.updateIfNeededLocked();
-                            return true;
                         }
                     }
                 }
-                return false;
             }
 
             @Override
diff --git a/services/java/com/android/server/print/UserState.java b/services/java/com/android/server/print/UserState.java
index f23a992..43757f9 100644
--- a/services/java/com/android/server/print/UserState.java
+++ b/services/java/com/android/server/print/UserState.java
@@ -657,7 +657,33 @@
             tempPrintServices.add(PrintServiceInfo.create(installedService, mContext));
         }
 
-        if (!tempPrintServices.equals(mInstalledServices)) {
+        boolean someServiceChanged = false;
+
+        if (tempPrintServices.size() != mInstalledServices.size()) {
+            someServiceChanged = true;
+        } else {
+            for (PrintServiceInfo newService: tempPrintServices) {
+                final int oldServiceIndex = mInstalledServices.indexOf(newService);
+                if (oldServiceIndex < 0) {
+                    someServiceChanged = true;
+                    break;
+                }
+                // PrintServiceInfo#equals compares only the id not all members,
+                // so we are also comparing the members coming from meta-data.
+                PrintServiceInfo oldService = mInstalledServices.get(oldServiceIndex);
+                if (!TextUtils.equals(oldService.getAddPrintersActivityName(),
+                            newService.getAddPrintersActivityName())
+                        || !TextUtils.equals(oldService.getAdvancedOptionsActivityName(),
+                                newService.getAdvancedOptionsActivityName())
+                        || !TextUtils.equals(oldService.getSettingsActivityName(),
+                                newService.getSettingsActivityName())) {
+                    someServiceChanged = true;
+                    break;
+                }
+            }
+        }
+
+        if (someServiceChanged) {
             mInstalledServices.clear();
             mInstalledServices.addAll(tempPrintServices);
             return true;