Merge "Fix LongArray.addAll() to use correct arraycopy argument order"
diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java
index a03e5b6..29885e7 100644
--- a/core/java/android/app/PendingIntent.java
+++ b/core/java/android/app/PendingIntent.java
@@ -122,8 +122,8 @@
     public static final int FLAG_ONE_SHOT = 1<<30;
     /**
      * Flag for use with {@link #getActivity}, {@link #getBroadcast}, and
-     * {@link #getService}: if the described PendingIntent does not already
-     * exist, then simply return null instead of creating it.
+     * {@link #getService}: if the described PendingIntent already exists,
+     * then simply return null instead of creating it.
      */
     public static final int FLAG_NO_CREATE = 1<<29;
     /**
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java
index b931313..8c23129 100644
--- a/core/java/android/hardware/SensorManager.java
+++ b/core/java/android/hardware/SensorManager.java
@@ -1056,8 +1056,8 @@
      *        is mapped.
      *
      * @param outR
-     *        the transformed rotation matrix. inR and outR can be the same
-     *        array, but it is not recommended for performance reason.
+     *        the transformed rotation matrix. inR and outR should not be the same
+     *        array.
      *
      * @return <code>true</code> on success. <code>false</code> if the input
      *         parameters are incorrect, for instance if X and Y define the same
diff --git a/core/java/android/widget/ShareActionProvider.java b/core/java/android/widget/ShareActionProvider.java
index 62afd2e..bdaaa01 100644
--- a/core/java/android/widget/ShareActionProvider.java
+++ b/core/java/android/widget/ShareActionProvider.java
@@ -266,7 +266,7 @@
      * Intent shareIntent = new Intent(Intent.ACTION_SEND);
      * shareIntent.setType("image/*");
      * Uri uri = Uri.fromFile(new File(getFilesDir(), "foo.jpg"));
-     * shareIntent.putExtra(Intent.EXTRA_STREAM, uri.toString());</pre>
+     * shareIntent.putExtra(Intent.EXTRA_STREAM, uri));</pre>
      *
      * @param shareIntent The share intent.
      *
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index cdb8113..0b48252 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -271,10 +271,10 @@
     <string name="permdesc_sendRespondViaMessageRequest" msgid="7107648548468778734">"መተግበሪያው ሌሎች የመልዕክት መላኪያ መተግበሪያዎች ለመጪ ጥሪዎች በመልዕክት-በኩል-ምላሽ-መስጠት ስራን እንዲይዙ ጥያቄዎች እንዲልክላቸው ያስችለዋል።"</string>
     <string name="permlab_readSms" msgid="8745086572213270480">"የጽሑፍ መልዕክቶችዎን ያንብቡ (ኤስ.ኤም.ኤስ. ወይም ኤም.ኤም.ኤስ.)"</string>
     <string name="permdesc_readSms" product="tablet" msgid="2467981548684735522">"መገለጫው በጡባዊ ቱኮህ ወይም በSIM ካርድህ የተከማቹ የኤስ.ኤም.ኤስ. መልእክቶችን እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው ይዘት ወይም ሚስጥራዊነትን ከግምት ሳያስገባ ሁሉንም የኤስ.ኤም.ኤስ. መልእክቶች እንዲያነብ ይፈቅድለታል።"</string>
-    <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"መገለጫው በስልክህ ወይም በSIM ካርድህ የተከማቹ የኤስ.ኤም.ኤስ. መልእክቶችን እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው ይዘት ወይም ሚስጥራዊነትን ከግምት ሳያስገባ ሁሉንም የኤስ.ኤም.ኤስ. መልእክቶች እንዲያነብ ይፈቅድለታል።"</string>
+    <string name="permdesc_readSms" product="default" msgid="3695967533457240550">"መገለጫው በስልክዎ ወይም በSIM ካርድዎ የተከማቹ የኤስ.ኤም.ኤስ. መልዕክቶችን እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው ይዘት ወይም ሚስጥራዊነትን ከግምት ሳያስገባ ሁሉንም የኤስ.ኤም.ኤስ. መልዕክቶች እንዲያነብ ይፈቅድለታል።"</string>
     <string name="permlab_writeSms" msgid="3216950472636214774">"የጽሑፍ መልዕክቶችህን አርትዕ (ኤስ.ኤም.ኤስ. ወይም ኤም.ኤም.ኤስ.)"</string>
     <string name="permdesc_writeSms" product="tablet" msgid="5160413947794501538">"በጡባዊ ተኮህ ወይም ሲም ካርድህ ላይ ኤስ ኤም ኤስ መልዕክቶችን ለመፃፍ ለመተግበሪያው ይፈቅዳሉ፡፡መልዕክቶችህን ተንኮል አዘል መተግበሪያዎች ሊሰርዙ ይችላሉ፡፡"</string>
-    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"በስልክህ ወይም ሲም ካርድህ ላይ ኤስ ኤም ኤስ መልዕክቶችን ለመፃፍ ለመተግበሪያው ይፈቅዳሉ፡፡መልዕክቶችህን ተንኮል አዘል መተግበሪያዎች ሊሰርዙ ይችላሉ፡፡"</string>
+    <string name="permdesc_writeSms" product="default" msgid="7268668709052328567">"በስልክዎ ወይም ሲም ካርድዎ ላይ ኤስ ኤም ኤስ መልዕክቶችን ለመፃፍ ለመተግበሪያው ይፈቅዳሉ። መልዕክቶችዎን ተንኮል አዘል መተግበሪያዎች ሊሰርዙ ይችላሉ።"</string>
     <string name="permlab_receiveWapPush" msgid="5991398711936590410">"የፅሁፍ መልዕክቶችን ተቀበል (WAP)"</string>
     <string name="permdesc_receiveWapPush" msgid="748232190220583385">"መተግበሪያው የWAP መልእክቶችን እንዲያነብ እና እንዲያካሂድ ይፈቅዳል። ይህ ፈቃድ የተላኩልህን መልእክቶች ላንተ ሳያሳይህ የመቆጣጠር ወይም የመሰረዝ ብቃትን ያጠቃልላል።"</string>
     <string name="permlab_getTasks" msgid="6466095396623933906">"አሂድ መተግበሪያዎችን ሰርስረው ያውጡ"</string>
@@ -446,10 +446,10 @@
     <string name="permdesc_broadcastSticky" product="default" msgid="2825803764232445091">"መተግበሪያው ስርጭቱ ከተጠናቀቀ በኋላ የሚቀሩ አጣባቂ ስርጭቶችን እንዲልክ ይፈቅድለታል። ከልክ በላይ መጠቀም ስልኩ ብዙ ማህደረ ትውስታን እንዲጠቀም በማድረግ ቀርፋፋ ወይም ያልተረጋጋ ሊያደርገው ይችላል።"</string>
     <string name="permlab_readContacts" msgid="8348481131899886131">"እውቂያዎችዎን ያንብቡ"</string>
     <string name="permdesc_readContacts" product="tablet" msgid="5294866856941149639">"መተግበሪያው በጡባዊ ተኮህ ስለተከማቹ ዕውቂያዎች ያሉትን ውሂቦች በሙሉ፤ ጥሪ ያደረግክበትን፣ ኢሜይል የላክበትን ወይም ከተወሰኑ ግለሰቦች ጋር በሌላ መንገድ የተገናኘህበትን ድግምግሞሽ ጨምሮ፣ እንዲያነብ ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብህን እንዲያስቀምጡ የሚፈቅድላቸው ሲሆን ተንኮል አዘል መተግበሪያዎች የእውቂያህን ውሂብ ሳታውቀው ሊያጋሩት ይችላሉ።"</string>
-    <string name="permdesc_readContacts" product="default" msgid="8440654152457300662">"መተግበሪያው በስልክህ ስለተከማቹ ዕውቂያዎች ያሉትን ውሂቦች በሙሉ፤ ጥሪ ያደረግክበትን፣ ኢሜይል የላክበትን ወይም ከተወሰኑ ግለሰቦች ጋር በሌላ መንገድ የተገናኘህበትን ድግምግሞሽ ጨምሮ፣ እንዲያነብ ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብህን እንዲያስቀምጡ የሚፈቅድላቸው ሲሆን ተንኮል አዘል መተግበሪያዎች የእውቂያህን ውሂብ ሳታውቀው ሊያጋሩት ይችላሉ።"</string>
+    <string name="permdesc_readContacts" product="default" msgid="8440654152457300662">"መተግበሪያው በስልክዎ ስለተከማቹ ዕውቂያዎች ያሉትን ውሂቦች በሙሉ፤ ጥሪ ያደረጉበትን፣ ኢሜይል የላኩበትን ወይም ከተወሰኑ ግለሰቦች ጋር በሌላ መንገድ የተገናኙበትን ድግምግሞሽ ጨምሮ፣ እንዲያነብ ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብዎን እንዲያስቀምጡ የሚፈቅድላቸው ሲሆን ተንኮል አዘል መተግበሪያዎች የእውቂያዎን ውሂብ ሳያውቁት ሊያጋሩት ይችላሉ።"</string>
     <string name="permlab_writeContacts" msgid="5107492086416793544">"ዕውቂያዎችዎን ያስተካክሉ"</string>
     <string name="permdesc_writeContacts" product="tablet" msgid="897243932521953602">"መተግበሪያው በጡባዊ ቱኮህ ስለተከማቹ የዕውቂያዎችህ ውሂብ በሙሉ፤ ጥሪ ያደረግክበትን፣ ኢሜይል የላክበትን ወይም ከተወሰኑ እውቂያዎች ጋር በሌላ መንገድ የተገናኘህበትን ድግምግሞሽ ጨምሮ፣ እንዲያስተካክል ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብ እንዲሰርዙ ይፈቅድላቸዋል።"</string>
-    <string name="permdesc_writeContacts" product="default" msgid="589869224625163558">"መተግበሪያው በስልክህ ስለተከማቹ የዕውቂያዎችህ ውሂብ በሙሉ፤ ጥሪ ያደረግክበትን፣ ኢሜይል የላክበትን ወይም ከተወሰኑ እውቂያዎች ጋር በሌላ መንገድ የተገናኘህበትን ድግምግሞሽ ጨምሮ፣ እንዲያስተካክል ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብ እንዲሰርዙ ይፈቅድላቸዋል።"</string>
+    <string name="permdesc_writeContacts" product="default" msgid="589869224625163558">"መተግበሪያው በስልክዎ ስለተከማቹ የዕውቂያዎችዎ ውሂብ በሙሉ፤ ጥሪ ያደረጉበትን፣ ኢሜይል የላኩበትን ወይም ከተወሰኑ እውቂያዎች ጋር በሌላ መንገድ የተገናኙበትን ድግምግሞሽ ጨምሮ፣ እንዲያስተካክል ይፈቅድለታል። ይህ ፈቃድ መተግበሪያዎች የእውቂያ ውሂብ እንዲሰርዙ ይፈቅድላቸዋል።"</string>
     <string name="permlab_readCallLog" msgid="3478133184624102739">"የጥሪ ምዝግብ ማስታወሻን አንብብ"</string>
     <string name="permdesc_readCallLog" product="tablet" msgid="3700645184870760285">"መተግበሪያው ስለገቢና ወጪ ጥሪዎች ያለ ውሂብን ጨምሮ የጡባዊ ተኮህን የጥሪ ምዝግብ ማስታወሻ እንዲያነብ ይፈቅድለታል። ይህ ፈቃድ መተግበሪያው የጥሪ ምዝግብ ማስታወሻ ውሂብህን እንዲያስቀምጥ የሚፈቅድለት ሲሆን ተንኮል አዘል መተግበሪያዎች ሳታውቀው የጥሪ ምዝግብ ማስታወሻ ውሂብህን ሊያጋሩት ይችላሉ።"</string>
     <string name="permdesc_readCallLog" product="default" msgid="5777725796813217244">"መተግበሪያው ስለገቢና ወጪ ጥሪዎች ያለ ውሂብን ጨምሮ የስልክህን የጥሪ ምዝግብ ማስታወሻ እንዲያነብ ይፈቅድለታል። ይህ ፈቃድ መተግበሪያው የጥሪ ምዝግብ ማስታወሻ ውሂብህን እንዲያስቀምጥ የሚፈቅድለት ሲሆን ተንኮል አዘል መተግበሪያዎች ሳታውቀው የጥሪ ምዝግብ ማስታወሻ ውሂብህን ሊያጋሩት ይችላሉ።"</string>
@@ -466,10 +466,10 @@
     <string name="permdesc_writeSocialStream" product="default" msgid="3086557552204114849">"መተግበሪያው ከጓኞችህን ማህበራዊ ዝማኔዎችን እንዲያሳይ ይፈቅድለታል። መረጃ ስታጋራ ተጠንቀቅ -- ይህ መተግበሪያው ከጓደኛ የመጡ የሚመስሉ መልእክቶችን እንዲያዘጋጅ ይፈቅድለታል። ማስታወሻ፦ ይህ ፈቃድ በሁሉም ማህበራዊ አውታረ መረቦች ላይ ላይፈጸም ይችላል።"</string>
     <string name="permlab_readCalendar" msgid="5972727560257612398">"የቀን መቁጠሪያ ክስተቶች ተጨማሪ ሚስጥራዊ መረጃ አንብብ"</string>
     <string name="permdesc_readCalendar" product="tablet" msgid="4216462049057658723">"መተግበሪያው የጓደኞችን ወይም የስራ ባልደረቦችን ጨምሮ ሁሉንም በጡባዊ ቱኮህ ላይ የተከማቹ የቀን መቁጠሪያ ክስተቶች እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው የቀን መቁጠሪያ ውሂብህን ሚስጥራዊቱን ከግምት ሳያስገባ እንዲያጋራ ወይም እንዲያስቀምጥ ሊፈቅድለት ይችላል።"</string>
-    <string name="permdesc_readCalendar" product="default" msgid="7434548682470851583">"መተግበሪያው የጓደኞችን ወይም የስራ ባልደረቦችን ጨምሮ ሁሉንም በስልክህ ላይ የተከማቹ የቀን መቁጠሪያ ክስተቶች እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው የቀን መቁጠሪያ ውሂብህን ሚስጥራዊቱን ከግምት ሳያስገባ እንዲያጋራ ወይም እንዲያስቀምጥ ሊፈቅድለት ይችላል።"</string>
+    <string name="permdesc_readCalendar" product="default" msgid="7434548682470851583">"መተግበሪያው የጓደኞችን ወይም የስራ ባልደረቦችን ጨምሮ ሁሉንም በስልክዎ ላይ የተከማቹ የቀን መቁጠሪያ ክስተቶች እንዲያነብ ይፈቅድለታል። ይህ መተግበሪያው የቀን መቁጠሪያ ውሂብዎን ሚስጥራዊነቱን ከግምት ሳያስገባ እንዲያጋራ ወይም እንዲያስቀምጥ ሊፈቅድለት ይችላል።"</string>
     <string name="permlab_writeCalendar" msgid="8438874755193825647">"የቀን መቁጠሪያ ክስተቶችን ቀይር ወይም አክል እና ለእንግዶች ከባለቤቱ ዕውቅና ውጪ ላክ።"</string>
     <string name="permdesc_writeCalendar" product="tablet" msgid="6679035520113668528">"መተግበሪያው የጓደኞችህን እና የስራ ባልደረቦችህን ጨምሮ በጡባዊ ተኮህ ላይ ልታስተካክላቸው የምትችላቸውን ክስተቶች እንዲያክል፣ እንዲያስወግድ፣ እንዲለውጥ ይፈቅድለታል። ይህ መተግበሪያው ከቀን መቁጠሪያ ባለቤቶች የመጡ የሚመስሉ መልእክቶችን እንዲልክ ወይም ያለባለቤቱ እውቀት ክስተቶችን እንዲያስተካክል ሊፈቅድለት ይችላል።"</string>
-    <string name="permdesc_writeCalendar" product="default" msgid="2324469496327249376">"መተግበሪያው የጓደኞችህን እና የስራ ባልደረቦችህን ጨምሮ በስልክህ ላይ ልታስተካክላቸው የምትችላቸውን ክስተቶች እንዲያክል፣ እንዲያስወግድ፣ እንዲለውጥ ይፈቅድለታል። ይህ መተግበሪያው ከቀን መቁጠሪያ ባለቤቶች የመጡ የሚመስሉ መልእክቶችን እንዲልክ ወይም ያለባለቤቱ እውቀት ክስተቶችን እንዲያስተካክል ሊፈቅድለት ይችላል።"</string>
+    <string name="permdesc_writeCalendar" product="default" msgid="2324469496327249376">"መተግበሪያው የጓደኞችዎን እና የስራ ባልደረቦችዎን ጨምሮ በስልክዎ ላይ ሊያስተካክሏቸው የሚችሏቸውን ክስተቶች እንዲያክል፣ እንዲያስወግድ፣ እንዲለውጥ ይፈቅድለታል። ይህ መተግበሪያው ከቀን መቁጠሪያ ባለቤቶች የመጡ የሚመስሉ መልዕክቶችን እንዲልክ ወይም ያለባለቤቱ እውቀት ክስተቶችን እንዲያስተካክል ሊፈቅድለት ይችላል።"</string>
     <string name="permlab_accessMockLocation" msgid="8688334974036823330">"ለሙከራ ጊዜያዊ ሥፍራ ፍጠር።"</string>
     <string name="permdesc_accessMockLocation" msgid="5808711039482051824">"ለሙከራ የማስመሰል የመነሻ ምንጮችን ፍጠር ወይም አዲስ የአካባቢ አቅራቢ ጫን። ይህ መተግበሪያው አካባቢውን እና/ወይም እንደ GPS ወይም የአካባቢ አቅራቢዎች ባሉ ሌላ የመነሻ ምንጮች የተመለሱ ሁኔታዎችን ችላ እንዲል ይፈቅድለታል።"</string>
     <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"ተጨማሪ ሥፍራ አቅራቢ ትዕዛዞችን ድረስ።"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index ab7c230..a4d1b2a 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -235,13 +235,13 @@
     <string name="permgrouplab_storage" msgid="1971118770546336966">"Lagring"</string>
     <string name="permgroupdesc_storage" product="nosdcard" msgid="7442318502446874999">"Få adgang til USB-lager."</string>
     <string name="permgroupdesc_storage" product="default" msgid="9203302214915355774">"Få adgang til SD-kortet."</string>
-    <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Tilgængelighedsfunktioner"</string>
+    <string name="permgrouplab_accessibilityFeatures" msgid="7919025602283593907">"Hjælpefunktioner"</string>
     <string name="permgroupdesc_accessibilityFeatures" msgid="4205196881678144335">"Funktioner, som hjælpeteknologier kan anmode om."</string>
     <string name="capability_title_canRetrieveWindowContent" msgid="3901717936930170320">"hente indholdet i vinduet"</string>
     <string name="capability_desc_canRetrieveWindowContent" msgid="3772225008605310672">"undersøge indholdet i et vindue, du interagerer med."</string>
     <string name="capability_title_canRequestTouchExploration" msgid="3108723364676667320">"aktivere Udforsk ved berøring"</string>
     <string name="capability_desc_canRequestTouchExploration" msgid="5800552516779249356">"De emner, der trykkes på, læses højt, og skærmen kan udforskes ved hjælp af bevægelser."</string>
-    <string name="capability_title_canRequestEnhancedWebAccessibility" msgid="1739881766522594073">"aktivere forbedret webtilgængelighed"</string>
+    <string name="capability_title_canRequestEnhancedWebAccessibility" msgid="1739881766522594073">"aktivere forbedret webhjælpefunktioner"</string>
     <string name="capability_desc_canRequestEnhancedWebAccessibility" msgid="7881063961507511765">"Der installeres muligvis scripts for at gøre appindhold mere tilgængeligt."</string>
     <string name="capability_title_canRequestFilterKeyEvents" msgid="2103440391902412174">"observere tekst, du skriver"</string>
     <string name="capability_desc_canRequestFilterKeyEvents" msgid="7463135292204152818">"Dette omfatter personlige data såsom kreditkortnumre og adgangskoder."</string>
@@ -313,8 +313,8 @@
     <string name="permdesc_dump" msgid="1778299088692290329">"Tillader, at appen kan hente systemets interne tilstand. Ondsindede apps kan hente en lang række fortrolige og beskyttede oplysninger, som de normalt aldrig ville have brug for."</string>
     <string name="permlab_retrieve_window_content" msgid="8022588608994589938">"hente skærmindhold"</string>
     <string name="permdesc_retrieve_window_content" msgid="3193269069469700265">"Tillader, at appen kan hente indholdet i det aktive vindue. Ondsindede apps kan hente al indholdet i vinduet og undersøge al dens tekst med undtagelse af adgangskoder."</string>
-    <string name="permlab_temporary_enable_accessibility" msgid="2312612135127310254">"aktivér tilgængelighed midlertidigt"</string>
-    <string name="permdesc_temporary_enable_accessibility" msgid="8079456293182975464">"Tillader, at en applikation midlertidigt kan aktivere tilgængelighed på enheden. Skadelige apps kan muligvis aktivere tilgængelighed uden brugerens samtykke."</string>
+    <string name="permlab_temporary_enable_accessibility" msgid="2312612135127310254">"aktivere hjælpefunktioner midlertidigt"</string>
+    <string name="permdesc_temporary_enable_accessibility" msgid="8079456293182975464">"Tillader, at en app midlertidigt kan aktivere hjælpefunktioner på enheden. Skadelige apps kan muligvis aktivere hjælpefunktioner uden brugerens samtykke."</string>
     <string name="permlab_retrieve_window_info" msgid="8532295199112519378">"hent oplysninger om vinduer"</string>
     <string name="permdesc_retrieve_window_info" msgid="4998836370424186849">"Tillader, at en applikation henter oplysninger om vinduerne i vinduesadministratoren. Skadelige apps kan muligvis hente oplysninger, der er beregnet til intern systembrug."</string>
     <string name="permlab_filter_events" msgid="8675535648807427389">"filtrer begivenheder"</string>
@@ -368,8 +368,8 @@
     <string name="permdesc_readInputState" msgid="8387754901688728043">"Tillader, at appen kan se de taster, som du trykker på, selv i en anden app (såsom indtastning af adgangskode). Dette bør aldrig være nødvendigt for normale apps."</string>
     <string name="permlab_bindInputMethod" msgid="3360064620230515776">"forpligt til en inputmetode"</string>
     <string name="permdesc_bindInputMethod" msgid="3250440322807286331">"Tillader, at brugeren kan forpligter sig til en inputmetodes grænseflade på øverste niveau. Bør aldrig være nødvendigt til almindelige apps."</string>
-    <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"bind dig til en tilgængelighedstjeneste"</string>
-    <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Tillader, at brugeren binder sig til en grænseflade for en tilgængelighedstjeneste på øverste niveau. Bør aldrig være nødvendigt til almindelige apps."</string>
+    <string name="permlab_bindAccessibilityService" msgid="5357733942556031593">"binde dig til en hjælpetjeneste"</string>
+    <string name="permdesc_bindAccessibilityService" msgid="7034615928609331368">"Tillader, at appen kan binde sig til en grænseflade for en hjælpetjeneste på øverste niveau. Bør aldrig være nødvendigt til almindelige apps."</string>
     <string name="permlab_bindPrintService" msgid="8462815179572748761">"forbinde til en udskriftstjeneste"</string>
     <string name="permdesc_bindPrintService" msgid="7960067623209111135">"Tillader, at brugeren forbinder til grænsefladen for en udskriftstjeneste på øverste niveau. Dette bør aldrig være nødvendigt for almindelige apps."</string>
     <string name="permlab_bindPrintSpoolerService" msgid="6807762783744125954">"forbinde til en udskriftsspoolertjeneste"</string>
@@ -688,11 +688,11 @@
     <string name="policylab_watchLogin" msgid="914130646942199503">"Overvåg forsøg på oplåsning af skærm"</string>
     <string name="policydesc_watchLogin" product="tablet" msgid="3215729294215070072">"Overvåg antallet af forkert indtastede adgangskoder, når du låser skærmen op, og lås din tablet, eller slet alle data i den, hvis der er indtastet for mange forkerte adgangskoder."</string>
     <string name="policydesc_watchLogin" product="default" msgid="5712323091846761073">"Overvåg antallet af forkerte adgangskoder ved oplåsning af skærmen, og lås telefonen eller slet alle data på telefonen, hvis der er indtastet for mange forkerte adgangskoder."</string>
-    <string name="policylab_resetPassword" msgid="2620077191242688955">"Skift adgangskode til oplåsning af skærm"</string>
-    <string name="policydesc_resetPassword" msgid="605963962301904458">"Skift adgangskode til oplåsning af skærmen."</string>
+    <string name="policylab_resetPassword" msgid="2620077191242688955">"Skifte adgangskode til oplåsning af skærm"</string>
+    <string name="policydesc_resetPassword" msgid="605963962301904458">"Skifter adgangskode til oplåsning af skærmen."</string>
     <string name="policylab_forceLock" msgid="2274085384704248431">"Lås skærmen"</string>
-    <string name="policydesc_forceLock" msgid="1141797588403827138">"Kontroller, hvordan og hvornår skærmen låses."</string>
-    <string name="policylab_wipeData" msgid="3910545446758639713">"Slet alle data"</string>
+    <string name="policydesc_forceLock" msgid="1141797588403827138">"Kontrollerer, hvordan og hvornår skærmen låses."</string>
+    <string name="policylab_wipeData" msgid="3910545446758639713">"Slette alle data"</string>
     <string name="policydesc_wipeData" product="tablet" msgid="4306184096067756876">"Slet din tablets data uden varsel ved at gendanne fabriksindstillingerne."</string>
     <string name="policydesc_wipeData" product="default" msgid="5096895604574188391">"Slet telefonens data uden varsel ved at gendanne fabriksindstillingerne."</string>
     <string name="policylab_setGlobalProxy" msgid="2784828293747791446">"Angiv enhedens globale proxy"</string>
@@ -1334,7 +1334,7 @@
     <string name="permission_request_notification_with_subtitle" msgid="8530393139639560189">"Der er anmodet om tilladelse\nfor kontoen <xliff:g id="ACCOUNT">%s</xliff:g>."</string>
     <string name="input_method_binding_label" msgid="1283557179944992649">"Inputmetode"</string>
     <string name="sync_binding_label" msgid="3687969138375092423">"Synkroniser"</string>
-    <string name="accessibility_binding_label" msgid="4148120742096474641">"Tilgængelighed"</string>
+    <string name="accessibility_binding_label" msgid="4148120742096474641">"Hjælpefunktioner"</string>
     <string name="wallpaper_binding_label" msgid="1240087844304687662">"Tapet"</string>
     <string name="chooser_wallpaper" msgid="7873476199295190279">"Skift tapet"</string>
     <string name="notification_listener_binding_label" msgid="2014162835481906429">"Underretningslytter"</string>
@@ -1553,9 +1553,9 @@
     <string name="kg_text_message_separator" product="default" msgid="4160700433287233771">" – "</string>
     <string name="kg_reordering_delete_drop_target_text" msgid="7899202978204438708">"Fjern"</string>
     <string name="safe_media_volume_warning" product="default" msgid="7324161939475478066">"Skal lydstyrken være over det anbefalede niveau?\nDu kan skade din hørelse ved at lytte ved høj lydstyrke i længere tid."</string>
-    <string name="continue_to_enable_accessibility" msgid="1626427372316070258">"Hold fortsat to fingre nede for at aktivere tilgængelighed."</string>
-    <string name="accessibility_enabled" msgid="1381972048564547685">"Tilgængelighed aktiveret."</string>
-    <string name="enable_accessibility_canceled" msgid="3833923257966635673">"Tilgængelighed er annulleret."</string>
+    <string name="continue_to_enable_accessibility" msgid="1626427372316070258">"Bliv ved med at holde to fingre nede for at aktivere hjælpefunktioner."</string>
+    <string name="accessibility_enabled" msgid="1381972048564547685">"Hjælpefunktioner er aktiveret."</string>
+    <string name="enable_accessibility_canceled" msgid="3833923257966635673">"Hjælpefunktioner er annulleret."</string>
     <string name="user_switched" msgid="3768006783166984410">"Nuværende bruger <xliff:g id="NAME">%1$s</xliff:g>."</string>
     <string name="owner_name" msgid="2716755460376028154">"Ejer"</string>
     <string name="error_message_title" msgid="4510373083082500195">"Fejl"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index b86f7b1..a24bcf0 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -1227,7 +1227,7 @@
     <string name="sms_short_code_confirm_never_allow" msgid="446992765774269673">"Aldri tillat"</string>
     <string name="sim_removed_title" msgid="6227712319223226185">"SIM-kort er fjernet"</string>
     <string name="sim_removed_message" msgid="2333164559970958645">"Det mobile nettverket forblir utilgjengelig inntil du starter på nytt med et gyldig SIM-kort."</string>
-    <string name="sim_done_button" msgid="827949989369963775">"Fullført"</string>
+    <string name="sim_done_button" msgid="827949989369963775">"Ferdig"</string>
     <string name="sim_added_title" msgid="3719670512889674693">"SIM-kort er lagt til"</string>
     <string name="sim_added_message" msgid="6599945301141050216">"Start enheten på nytt for å få tilgang til det mobile nettverket."</string>
     <string name="sim_restart_button" msgid="4722407842815232347">"Start på nytt"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 3b29784..aaf1b0d 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -263,8 +263,8 @@
     <string name="permdesc_receiveMms" msgid="533019437263212260">"Pozwala aplikacji na odbieranie i przetwarzanie MMS-ów. To oznacza, że aplikacja będzie mogła bez Twojej wiedzy monitorować i usuwać wiadomości wysyłane do Twojego urządzenia."</string>
     <string name="permlab_receiveEmergencyBroadcast" msgid="1803477660846288089">"odbiór emisji alarmowych"</string>
     <string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Pozwala aplikacji na odbieranie i przetwarzanie komunikatów transmisji alarmowych. To pozwolenie jest dostępne tylko dla aplikacji systemowych."</string>
-    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"odczyt wiadomości z sieci komórkowej"</string>
-    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Zezwala aplikacji na odczyt wiadomości z sieci komórkowej odebranych na urządzeniu. Alerty sieci komórkowej są dostarczane w niektórych lokalizacjach w celu ostrzeżenia Cię o sytuacjach alarmowych. Złośliwe aplikacje mogą wpływać na wydajność lub zakłócać działanie urządzenia po odebraniu wiadomości alarmowej z sieci komórkowej."</string>
+    <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"odczyt komunikatów z sieci komórkowej"</string>
+    <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Zezwala aplikacji na odczyt komunikatów z sieci komórkowej odebranych na urządzeniu. Komunikaty alarmowe z sieci komórkowej są dostarczane w niektórych lokalizacjach w celu ostrzeżenia Cię o sytuacjach zagrożenia. Złośliwe aplikacje mogą wpływać na wydajność lub zakłócać działanie urządzenia po odebraniu komunikatu alarmowego z sieci komórkowej."</string>
     <string name="permlab_sendSms" msgid="5600830612147671529">"wysyłanie wiadomości SMS"</string>
     <string name="permdesc_sendSms" msgid="7094729298204937667">"Pozwala aplikacji na wysyłanie SMS-ów. Może to skutkować nieoczekiwanymi opłatami. Złośliwe aplikacje mogą generować koszty, wysyłając wiadomości bez Twojego potwierdzenia."</string>
     <string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"wysyłanie zdarzeń odpowiedzi przez SMS"</string>
diff --git a/docs/html/training/system-ui/immersive.jd b/docs/html/training/system-ui/immersive.jd
index 21672c8..0a1516c 100644
--- a/docs/html/training/system-ui/immersive.jd
+++ b/docs/html/training/system-ui/immersive.jd
@@ -11,8 +11,8 @@
 <h2>This lesson teaches you to</h2>
 <ol>
   <li><a href="#compare">Choose an Approach</a></li>
-  <li><a href="#nonsticky">Use IMMERSIVE</a></li>
-  <li><a href="#sticky">Use IMMERSIVE_STICKY</a></li>
+  <li><a href="#nonsticky">Use Non-Sticky Immersion</a></li>
+  <li><a href="#sticky">Use Sticky Immersion</a></li>
 </ol>
 
 
@@ -72,14 +72,6 @@
 shown in this mode are in a transient state.
 </p>
 
- <p>When you use {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE IMMERSIVE} or
- {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY IMMERSIVE_STICKY},
- the system UI stays hidden, even while users are interacting with your
-app or game. You can capture touch events from anywhere across the screen, even areas that
-would otherwise be occupied by the system bars. This gives you a great way to create a
-larger, richer, more <a href="{@docRoot}design/patterns/fullscreen.html">
-immersive</a> UI in your app or game and reduce visual distraction at the same time.</p>
-
 <p>Figure 1 illustrates the different "immersive mode" states:</p>
 
  <img src="{@docRoot}images/training/imm-states.png"
@@ -137,12 +129,8 @@
 
  <p>The flags  {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE} and
  {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY} both provide an immersive
- experience. But whereas the
- {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY IMMERSIVE_STICKY}
- flag causes semi-transparent system bars to briefly show and then hide again in response to
- a swipe gesture, the same swipe gesture causes the system bars to reappear and remain
- visible if you instead use the {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE IMMERSIVE}
- flag. Here are examples of when you would use one vs. the other:</p>
+ experience, but with the differences in behavior described above. Here are
+ examples of when you would use one flag vs. the other:</p>
 
 <ul>
 <li>If you're building a book reader, news reader, or a magazine, use
@@ -171,7 +159,7 @@
 sufficient. Don't use the "immersive" flags in this case.</li>
 </ul>
 
-<h2 id="nonsticky">Use IMMERSIVE</h2>
+<h2 id="nonsticky">Use Non-Sticky Immersion</h2>
 
  <p>When you use the {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE} flag, it hides
  the system bars based on what other UI flags you have set
@@ -242,7 +230,7 @@
 <a class ="external-link" href="http://www.youtube.com/embed/cBi8fjv90E4">DevBytes:
  Android 4.4 Immersive Mode</a>.</p>
 
-<h2 id="sticky">Use IMMERSIVE_STICKY</h2>
+<h2 id="sticky">Use Sticky Immersion</h2>
 
 <p>When you use the {@link android.view.View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY} flag,
 an inward swipe in the system bars areas causes the bars to temporarily appear in a
diff --git a/graphics/java/android/graphics/ColorMatrix.java b/graphics/java/android/graphics/ColorMatrix.java
index 0ef037d..1242eb5 100644
--- a/graphics/java/android/graphics/ColorMatrix.java
+++ b/graphics/java/android/graphics/ColorMatrix.java
@@ -21,8 +21,8 @@
 import java.util.Arrays;
 
 /**
- * 5x4 matrix for transforming the color+alpha components of a Bitmap.
- * The matrix is stored in a single array, and its treated as follows:
+ *  4x5 matrix for transforming the color+alpha components of a Bitmap.
+ *  The matrix is stored in a single array, and its treated as follows:
  * <pre>
  *  [ a, b, c, d, e,
  *    f, g, h, i, j,
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index eb09131..45dd25a 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -654,7 +654,7 @@
      * android.renderscript.Element} does not match the array's
      * primitive type.
      *
-     * @param d the source data array
+     * @param array The source data array
      */
     public void copyFrom(Object array) {
         Trace.traceBegin(RenderScript.TRACE_TAG, "copyFrom");
@@ -1032,7 +1032,7 @@
      * @param yoff Y offset of the region to update in this Allocation
      * @param w Width of the region to update
      * @param h Height of the region to update
-     * @param data to be placed into the Allocation
+     * @param array Data to be placed into the Allocation
      */
     public void copy2DRangeFrom(int xoff, int yoff, int w, int h, Object array) {
         Trace.traceBegin(RenderScript.TRACE_TAG, "copy2DRangeFrom");
@@ -1863,4 +1863,3 @@
     }
 
 }
-
diff --git a/graphics/java/android/renderscript/Byte2.java b/graphics/java/android/renderscript/Byte2.java
index ef7c770..3ad79e4 100644
--- a/graphics/java/android/renderscript/Byte2.java
+++ b/graphics/java/android/renderscript/Byte2.java
@@ -22,6 +22,9 @@
  *
  **/
 public class Byte2 {
+    public byte x;
+    public byte y;
+
     public Byte2() {
     }
 
@@ -30,8 +33,357 @@
         y = initY;
     }
 
-    public byte x;
-    public byte y;
+    /** @hide */
+    public Byte2(Byte2 source) {
+        this.x = source.x;
+        this.y = source.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Byte2 a) {
+        this.x += a.x;
+        this.y += a.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 add(Byte2 a, Byte2 b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x + b.x);
+        result.y = (byte)(a.y + b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(byte value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 add(Byte2 a, byte b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x + b);
+        result.y = (byte)(a.y + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Byte2 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 sub(Byte2 a, Byte2 b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x - b.x);
+        result.y = (byte)(a.y - b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(byte value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 sub(Byte2 a, byte b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x - b);
+        result.y = (byte)(a.y - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Byte2 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 mul(Byte2 a, Byte2 b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x * b.x);
+        result.y = (byte)(a.y * b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(byte value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 mul(Byte2 a, byte b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x * b);
+        result.y = (byte)(a.y * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Byte2 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 div(Byte2 a, Byte2 b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x / b.x);
+        result.y = (byte)(a.y / b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(byte value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte2 div(Byte2 a, byte b) {
+        Byte2 result = new Byte2();
+        result.x = (byte)(a.x / b);
+        result.y = (byte)(a.y / b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public byte length() {
+        return 2;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (byte)(-x);
+        this.y = (byte)(-y);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public byte dotProduct(Byte2 a) {
+        return (byte)((x * a.x) + (y * a.y));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static byte dotProduct(Byte2 a, Byte2 b) {
+        return (byte)((b.x * a.x) + (b.y * a.y));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Byte2 a, byte factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * set vector value by Byte2
+     *
+     * @param a
+     */
+    public void set(Byte2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * set the vector field value by Char
+     *
+     * @param a
+     * @param b
+     */
+    public void setValues(byte a, byte b) {
+        this.x = a;
+        this.y = b;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public byte elementSum() {
+        return (byte)(x + y);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public byte get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to Char array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(byte[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+    }
+
 }
 
 
diff --git a/graphics/java/android/renderscript/Byte3.java b/graphics/java/android/renderscript/Byte3.java
index 025e8de..a138313 100644
--- a/graphics/java/android/renderscript/Byte3.java
+++ b/graphics/java/android/renderscript/Byte3.java
@@ -22,6 +22,10 @@
  *
  **/
 public class Byte3 {
+    public byte x;
+    public byte y;
+    public byte z;
+
     public Byte3() {
     }
 
@@ -31,9 +35,387 @@
         z = initZ;
     }
 
-    public byte x;
-    public byte y;
-    public byte z;
+    /** @hide */
+    public Byte3(Byte3 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Byte3 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 add(Byte3 a, Byte3 b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x + b.x);
+        result.y = (byte)(a.y + b.y);
+        result.z = (byte)(a.z + b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(byte value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 add(Byte3 a, byte b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x + b);
+        result.y = (byte)(a.y + b);
+        result.z = (byte)(a.z + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Byte3 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 sub(Byte3 a, Byte3 b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x - b.x);
+        result.y = (byte)(a.y - b.y);
+        result.z = (byte)(a.z - b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(byte value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 sub(Byte3 a, byte b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x - b);
+        result.y = (byte)(a.y - b);
+        result.z = (byte)(a.z - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Byte3 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 mul(Byte3 a, Byte3 b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x * b.x);
+        result.y = (byte)(a.y * b.y);
+        result.z = (byte)(a.z * b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(byte value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 mul(Byte3 a, byte b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x * b);
+        result.y = (byte)(a.y * b);
+        result.z = (byte)(a.z * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Byte3 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 div(Byte3 a, Byte3 b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x / b.x);
+        result.y = (byte)(a.y / b.y);
+        result.z = (byte)(a.z / b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(byte value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte3 div(Byte3 a, byte b) {
+        Byte3 result = new Byte3();
+        result.x = (byte)(a.x / b);
+        result.y = (byte)(a.y / b);
+        result.z = (byte)(a.z / b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public byte length() {
+        return 3;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (byte)(-x);
+        this.y = (byte)(-y);
+        this.z = (byte)(-z);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public byte dotProduct(Byte3 a) {
+        return (byte)((byte)((byte)(x * a.x) + (byte)(y * a.y)) + (byte)(z * a.z));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static byte dotProduct(Byte3 a, Byte3 b) {
+        return (byte)((byte)((byte)(b.x * a.x) + (byte)(b.y * a.y)) + (byte)(b.z * a.z));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Byte3 a, byte factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * set vector value by Byte3
+     *
+     * @param a
+     */
+    public void set(Byte3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * set the vector field value by Char
+     *
+     * @param a
+     * @param b
+     * @param c
+     */
+    public void setValues(byte a, byte b, byte c) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public byte elementSum() {
+        return (byte)(x + y + z);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public byte get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to Char array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(byte[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+    }
 }
 
 
diff --git a/graphics/java/android/renderscript/Byte4.java b/graphics/java/android/renderscript/Byte4.java
index 7df2104..fa4c13d 100644
--- a/graphics/java/android/renderscript/Byte4.java
+++ b/graphics/java/android/renderscript/Byte4.java
@@ -22,6 +22,11 @@
  *
  **/
 public class Byte4 {
+    public byte x;
+    public byte y;
+    public byte z;
+    public byte w;
+
     public Byte4() {
     }
 
@@ -31,11 +36,418 @@
         z = initZ;
         w = initW;
     }
+    /** @hide */
+    public Byte4(Byte4 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+        this.w = source.w;
+    }
 
-    public byte x;
-    public byte y;
-    public byte z;
-    public byte w;
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Byte4 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+        this.w += a.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 add(Byte4 a, Byte4 b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x + b.x);
+        result.y = (byte)(a.y + b.y);
+        result.z = (byte)(a.z + b.z);
+        result.w = (byte)(a.w + b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(byte value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 add(Byte4 a, byte b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x + b);
+        result.y = (byte)(a.y + b);
+        result.z = (byte)(a.z + b);
+        result.w = (byte)(a.w + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Byte4 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+        this.w -= a.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 sub(Byte4 a, Byte4 b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x - b.x);
+        result.y = (byte)(a.y - b.y);
+        result.z = (byte)(a.z - b.z);
+        result.w = (byte)(a.w - b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(byte value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 sub(Byte4 a, byte b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x - b);
+        result.y = (byte)(a.y - b);
+        result.z = (byte)(a.z - b);
+        result.w = (byte)(a.w - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Byte4 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+        this.w *= a.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 mul(Byte4 a, Byte4 b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x * b.x);
+        result.y = (byte)(a.y * b.y);
+        result.z = (byte)(a.z * b.z);
+        result.w = (byte)(a.w * b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(byte value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 mul(Byte4 a, byte b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x * b);
+        result.y = (byte)(a.y * b);
+        result.z = (byte)(a.z * b);
+        result.w = (byte)(a.w * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Byte4 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+        this.w /= a.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 div(Byte4 a, Byte4 b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x / b.x);
+        result.y = (byte)(a.y / b.y);
+        result.z = (byte)(a.z / b.z);
+        result.w = (byte)(a.w / b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(byte value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Byte4 div(Byte4 a, byte b) {
+        Byte4 result = new Byte4();
+        result.x = (byte)(a.x / b);
+        result.y = (byte)(a.y / b);
+        result.z = (byte)(a.z / b);
+        result.w = (byte)(a.w / b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public byte length() {
+        return 4;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (byte)(-x);
+        this.y = (byte)(-y);
+        this.z = (byte)(-z);
+        this.w = (byte)(-w);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public byte dotProduct(Byte4 a) {
+        return (byte)((x * a.x) + (y * a.y) + (z * a.z) + (w * a.w));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static byte dotProduct(Byte4 a, Byte4 b) {
+        return (byte)((b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Byte4 a, byte factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * set vector value by Byte4
+     *
+     * @param a
+     */
+    public void set(Byte4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * set the vector field values
+     *
+     * @param a
+     * @param b
+     * @param c
+     * @param d
+     */
+    public void setValues(byte a, byte b, byte c, byte d) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+        this.w = d;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public byte elementSum() {
+        return (byte)(x + y + z + w);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public byte get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        case 3:
+            return w;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, byte value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to Char array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(byte[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+        data[offset + 3] = w;
+    }
 }
 
 
diff --git a/graphics/java/android/renderscript/Double2.java b/graphics/java/android/renderscript/Double2.java
index 6e1afe6..4c7319d 100644
--- a/graphics/java/android/renderscript/Double2.java
+++ b/graphics/java/android/renderscript/Double2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * 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.
@@ -16,25 +16,370 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript double2 type back
- * to the Android system.
- *
- **/
+ * Vector version of the basic double type.
+ * Provides two double fields packed.
+ */
 public class Double2 {
+    public double x;
+    public double y;
+
     public Double2() {
     }
 
-    public Double2(double initX, double initY) {
-        x = initX;
-        y = initY;
+    /** @hide */
+    public Double2(Double2 data) {
+        this.x = data.x;
+        this.y = data.y;
     }
 
-    public double x;
-    public double y;
+    public Double2(double x, double y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 add(Double2 a, Double2 b) {
+        Double2 res = new Double2();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Double2 value) {
+        x += value.x;
+        y += value.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(double value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 add(Double2 a, double b) {
+        Double2 res = new Double2();
+        res.x = a.x + b;
+        res.y = a.y + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Double2 value) {
+        x -= value.x;
+        y -= value.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 sub(Double2 a, Double2 b) {
+        Double2 res = new Double2();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(double value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 sub(Double2 a, double b) {
+        Double2 res = new Double2();
+        res.x = a.x - b;
+        res.y = a.y - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Double2 value) {
+        x *= value.x;
+        y *= value.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 mul(Double2 a, Double2 b) {
+        Double2 res = new Double2();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(double value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 mul(Double2 a, double b) {
+        Double2 res = new Double2();
+        res.x = a.x * b;
+        res.y = a.y * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Double2 value) {
+        x /= value.x;
+        y /= value.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 div(Double2 a, Double2 b) {
+        Double2 res = new Double2();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(double value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double2 div(Double2 a, double b) {
+        Double2 res = new Double2();
+        res.x = a.x / b;
+        res.y = a.y / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public double dotProduct(Double2 a) {
+        return (x * a.x) + (y * a.y);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double dotProduct(Double2 a, Double2 b) {
+        return (b.x * a.x) + (b.y * a.y);
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Double2 a, double factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * Set vector value by double2
+     *
+     * @param a
+     */
+    public void set(Double2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * Set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+    }
+
+    /** @hide
+     * Get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 2;
+    }
+
+    /** @hide
+     * Return the element sum of vector
+     *
+     * @return
+     */
+    public double elementSum() {
+        return x + y;
+    }
+
+    /** @hide
+     * Get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public double get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value
+     *
+     * @param x
+     * @param y
+     */
+    public void setValues(double x, double y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide
+     * Copy the vector to double array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(double[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Double3.java b/graphics/java/android/renderscript/Double3.java
index 7c0979d..b819716 100644
--- a/graphics/java/android/renderscript/Double3.java
+++ b/graphics/java/android/renderscript/Double3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * 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.
@@ -16,27 +16,402 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript double3 type back
- * to the Android system.
- *
- **/
+ * Vector version of the basic double type.
+ * Provides three double fields packed.
+ */
 public class Double3 {
-    public Double3() {
-    }
-
-    public Double3(double initX, double initY, double initZ) {
-        x = initX;
-        y = initY;
-        z = initZ;
-    }
-
     public double x;
     public double y;
     public double z;
+
+    public Double3() {
+    }
+    /** @hide */
+    public Double3(Double3 data) {
+        this.x = data.x;
+        this.y = data.y;
+        this.z = data.z;
+    }
+
+    public Double3(double x, double y, double z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 add(Double3 a, Double3 b) {
+        Double3 res = new Double3();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+        res.z = a.z + b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Double3 value) {
+        x += value.x;
+        y += value.y;
+        z += value.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(double value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 add(Double3 a, double b) {
+        Double3 res = new Double3();
+        res.x = a.x + b;
+        res.y = a.y + b;
+        res.z = a.z + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Double3 value) {
+        x -= value.x;
+        y -= value.y;
+        z -= value.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 sub(Double3 a, Double3 b) {
+        Double3 res = new Double3();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+        res.z = a.z - b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(double value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 sub(Double3 a, double b) {
+        Double3 res = new Double3();
+        res.x = a.x - b;
+        res.y = a.y - b;
+        res.z = a.z - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Double3 value) {
+        x *= value.x;
+        y *= value.y;
+        z *= value.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 mul(Double3 a, Double3 b) {
+        Double3 res = new Double3();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+        res.z = a.z * b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(double value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 mul(Double3 a, double b) {
+        Double3 res = new Double3();
+        res.x = a.x * b;
+        res.y = a.y * b;
+        res.z = a.z * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Double3 value) {
+        x /= value.x;
+        y /= value.y;
+        z /= value.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 div(Double3 a, Double3 b) {
+        Double3 res = new Double3();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+        res.z = a.z / b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(double value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double3 div(Double3 a, double b) {
+        Double3 res = new Double3();
+        res.x = a.x / b;
+        res.y = a.y / b;
+        res.z = a.z / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public double dotProduct(Double3 a) {
+        return (x * a.x) + (y * a.y) + (z * a.z);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static double dotProduct(Double3 a, Double3 b) {
+        return (b.x * a.x) + (b.y * a.y) + (b.z * a.z);
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Double3 a, double factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * Set vector value by double3
+     *
+     * @param a
+     */
+    public void set(Double3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * Set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+        z = -z;
+    }
+
+    /** @hide
+     * Get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 3;
+    }
+
+    /** @hide
+     * Return the element sum of vector
+     *
+     * @return
+     */
+    public double elementSum() {
+        return x + y + z;
+    }
+
+    /** @hide
+     * Get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public double get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value
+     *
+     * @param x
+     * @param y
+     * @param z
+     */
+    public void setValues(double x, double y, double z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide
+     * Copy the vector to double array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(double[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Double4.java b/graphics/java/android/renderscript/Double4.java
index 9e82611..e4829f7 100644
--- a/graphics/java/android/renderscript/Double4.java
+++ b/graphics/java/android/renderscript/Double4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 The Android Open Source Project
+ * 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.
@@ -16,28 +16,435 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript double4 type back
- * to the Android system.
- *
- **/
+ * Vector version of the basic double type.
+ * Provides four double fields packed.
+ */
 public class Double4 {
-    public Double4() {
-    }
-
-    public Double4(double initX, double initY, double initZ, double initW) {
-        x = initX;
-        y = initY;
-        z = initZ;
-        w = initW;
-    }
-
     public double x;
     public double y;
     public double z;
     public double w;
+
+    public Double4() {
+    }
+    /** @hide */
+    public Double4(Double4 data) {
+        this.x = data.x;
+        this.y = data.y;
+        this.z = data.z;
+        this.w = data.w;
+    }
+
+    public Double4(double x, double y, double z, double w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 add(Double4 a, Double4 b) {
+        Double4 res = new Double4();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+        res.z = a.z + b.z;
+        res.w = a.w + b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Double4 value) {
+        x += value.x;
+        y += value.y;
+        z += value.z;
+        w += value.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(double value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 add(Double4 a, double b) {
+        Double4 res = new Double4();
+        res.x = a.x + b;
+        res.y = a.y + b;
+        res.z = a.z + b;
+        res.w = a.w + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Double4 value) {
+        x -= value.x;
+        y -= value.y;
+        z -= value.z;
+        w -= value.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(double value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 sub(Double4 a, double b) {
+        Double4 res = new Double4();
+        res.x = a.x - b;
+        res.y = a.y - b;
+        res.z = a.z - b;
+        res.w = a.w - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 sub(Double4 a, Double4 b) {
+        Double4 res = new Double4();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+        res.z = a.z - b.z;
+        res.w = a.w - b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Double4 value) {
+        x *= value.x;
+        y *= value.y;
+        z *= value.z;
+        w *= value.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(double value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 mul(Double4 a, Double4 b) {
+        Double4 res = new Double4();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+        res.z = a.z * b.z;
+        res.w = a.w * b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 mul(Double4 a, double b) {
+        Double4 res = new Double4();
+        res.x = a.x * b;
+        res.y = a.y * b;
+        res.z = a.z * b;
+        res.w = a.w * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Double4 value) {
+        x /= value.x;
+        y /= value.y;
+        z /= value.z;
+        w /= value.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(double value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 div(Double4 a, double b) {
+        Double4 res = new Double4();
+        res.x = a.x / b;
+        res.y = a.y / b;
+        res.z = a.z / b;
+        res.w = a.w / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Double4 div(Double4 a, Double4 b) {
+        Double4 res = new Double4();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+        res.z = a.z / b.z;
+        res.w = a.w / b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public double dotProduct(Double4 a) {
+        return (x * a.x) + (y * a.y) + (z * a.z) + (w * a.w);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static double dotProduct(Double4 a, Double4 b) {
+        return (b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w);
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Double4 a, double factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * Set vector value by double4
+     *
+     * @param a
+     */
+    public void set(Double4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * Set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+        z = -z;
+        w = -w;
+    }
+
+    /** @hide
+     * Get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 4;
+    }
+
+    /** @hide
+     * Return the element sum of vector
+     *
+     * @return
+     */
+    public double elementSum() {
+        return x + y + z + w;
+    }
+
+    /** @hide
+     * Get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public double get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        case 3:
+            return w;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, double value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * Set the vector field value
+     *
+     * @param x
+     * @param y
+     * @param z
+     * @param w
+     */
+    public void setValues(double x, double y, double z, double w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide
+     * Copy the vector to double array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(double[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+        data[offset + 3] = w;
+    }
 }
-
-
-
diff --git a/graphics/java/android/renderscript/Float2.java b/graphics/java/android/renderscript/Float2.java
index 427f038..e9f8ca7 100644
--- a/graphics/java/android/renderscript/Float2.java
+++ b/graphics/java/android/renderscript/Float2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,24 +16,369 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript float2 type back to the Android system.
- *
- **/
-public class Float2 {
-    public Float2() {
-    }
-
-    public Float2(float initX, float initY) {
-        x = initX;
-        y = initY;
-    }
-
+ * Vector version of the basic float type.
+ * Provides two float fields packed.
+ */
+public  class Float2 {
     public float x;
     public float y;
+
+    public Float2() {
+    }
+    /** @hide */
+    public Float2(Float2 data) {
+        this.x = data.x;
+        this.y = data.y;
+    }
+
+    public Float2(float x, float y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 add(Float2 a, Float2 b) {
+        Float2 res = new Float2();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Float2 value) {
+        x += value.x;
+        y += value.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(float value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 add(Float2 a, float b) {
+        Float2 res = new Float2();
+        res.x = a.x + b;
+        res.y = a.y + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Float2 value) {
+        x -= value.x;
+        y -= value.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 sub(Float2 a, Float2 b) {
+        Float2 res = new Float2();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(float value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 sub(Float2 a, float b) {
+        Float2 res = new Float2();
+        res.x = a.x - b;
+        res.y = a.y - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Float2 value) {
+        x *= value.x;
+        y *= value.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 mul(Float2 a, Float2 b) {
+        Float2 res = new Float2();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(float value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 mul(Float2 a, float b) {
+        Float2 res = new Float2();
+        res.x = a.x * b;
+        res.y = a.y * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Float2 value) {
+        x /= value.x;
+        y /= value.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 div(Float2 a, Float2 b) {
+        Float2 res = new Float2();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(float value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float2 div(Float2 a, float b) {
+        Float2 res = new Float2();
+        res.x = a.x / b;
+        res.y = a.y / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public float dotProduct(Float2 a) {
+        return (x * a.x) + (y * a.y);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static float dotProduct(Float2 a, Float2 b) {
+        return (b.x * a.x) + (b.y * a.y);
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Float2 a, float factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * set vector value by float2
+     *
+     * @param a
+     */
+    public void set(Float2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 2;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public float elementSum() {
+        return x + y;
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public float get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value
+     *
+     * @param x
+     * @param y
+     */
+    public void setValues(float x, float y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide
+     * copy the vector to float array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(float[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Float3.java b/graphics/java/android/renderscript/Float3.java
index bfe143a..555bdf6 100644
--- a/graphics/java/android/renderscript/Float3.java
+++ b/graphics/java/android/renderscript/Float3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,25 +16,402 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript float2 type back to the Android system.
- *
- **/
+ * Vector version of the basic float type.
+ * Provides three float fields packed.
+ */
 public class Float3 {
-    public Float3() {
-    }
-    public Float3(float initX, float initY, float initZ) {
-        x = initX;
-        y = initY;
-        z = initZ;
-    }
-
     public float x;
     public float y;
     public float z;
+
+    public Float3() {
+    }
+    /** @hide */
+    public Float3(Float3 data) {
+        this.x = data.x;
+        this.y = data.y;
+        this.z = data.z;
+    }
+
+    public Float3(float x, float y, float z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 add(Float3 a, Float3 b) {
+        Float3 res = new Float3();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+        res.z = a.z + b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Float3 value) {
+        x += value.x;
+        y += value.y;
+        z += value.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(float value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 add(Float3 a, float b) {
+        Float3 res = new Float3();
+        res.x = a.x + b;
+        res.y = a.y + b;
+        res.z = a.z + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Float3 value) {
+        x -= value.x;
+        y -= value.y;
+        z -= value.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 sub(Float3 a, Float3 b) {
+        Float3 res = new Float3();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+        res.z = a.z - b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(float value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 sub(Float3 a, float b) {
+        Float3 res = new Float3();
+        res.x = a.x - b;
+        res.y = a.y - b;
+        res.z = a.z - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Float3 value) {
+        x *= value.x;
+        y *= value.y;
+        z *= value.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 mul(Float3 a, Float3 b) {
+        Float3 res = new Float3();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+        res.z = a.z * b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(float value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 mul(Float3 a, float b) {
+        Float3 res = new Float3();
+        res.x = a.x * b;
+        res.y = a.y * b;
+        res.z = a.z * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Float3 value) {
+        x /= value.x;
+        y /= value.y;
+        z /= value.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 div(Float3 a, Float3 b) {
+        Float3 res = new Float3();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+        res.z = a.z / b.z;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(float value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float3 div(Float3 a, float b) {
+        Float3 res = new Float3();
+        res.x = a.x / b;
+        res.y = a.y / b;
+        res.z = a.z / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public Float dotProduct(Float3 a) {
+        return new Float((x * a.x) + (y * a.y) + (z * a.z));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float dotProduct(Float3 a, Float3 b) {
+        return new Float((b.x * a.x) + (b.y * a.y) + (b.z * a.z));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Float3 a, float factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * set vector value by float3
+     *
+     * @param a
+     */
+    public void set(Float3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+        z = -z;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 3;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public Float elementSum() {
+        return new Float(x + y + z);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public float get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value
+     *
+     * @param x
+     * @param y
+     * @param z
+     */
+    public void setValues(float x, float y, float z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide
+     * copy the vector to float array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(float[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Float4.java b/graphics/java/android/renderscript/Float4.java
index 67c7afc..6541b2ec 100644
--- a/graphics/java/android/renderscript/Float4.java
+++ b/graphics/java/android/renderscript/Float4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,27 +16,435 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript float2 type back to the Android system.
- *
- **/
+ * Vector version of the basic float type.
+ * Provides four float fields packed.
+ */
 public class Float4 {
-    public Float4() {
-    }
-
-    public Float4(float initX, float initY, float initZ, float initW) {
-        x = initX;
-        y = initY;
-        z = initZ;
-        w = initW;
-    }
-
     public float x;
     public float y;
     public float z;
     public float w;
+
+    public Float4() {
+    }
+    /** @hide */
+    public Float4(Float4 data) {
+        this.x = data.x;
+        this.y = data.y;
+        this.z = data.z;
+        this.w = data.w;
+    }
+
+    public Float4(float x, float y, float z, float w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 add(Float4 a, Float4 b) {
+        Float4 res = new Float4();
+        res.x = a.x + b.x;
+        res.y = a.y + b.y;
+        res.z = a.z + b.z;
+        res.w = a.w + b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(Float4 value) {
+        x += value.x;
+        y += value.y;
+        z += value.z;
+        w += value.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(float value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 add(Float4 a, float b) {
+        Float4 res = new Float4();
+        res.x = a.x + b;
+        res.y = a.y + b;
+        res.z = a.z + b;
+        res.w = a.w + b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(Float4 value) {
+        x -= value.x;
+        y -= value.y;
+        z -= value.z;
+        w -= value.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(float value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 sub(Float4 a, float b) {
+        Float4 res = new Float4();
+        res.x = a.x - b;
+        res.y = a.y - b;
+        res.z = a.z - b;
+        res.w = a.w - b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 sub(Float4 a, Float4 b) {
+        Float4 res = new Float4();
+        res.x = a.x - b.x;
+        res.y = a.y - b.y;
+        res.z = a.z - b.z;
+        res.w = a.w - b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(Float4 value) {
+        x *= value.x;
+        y *= value.y;
+        z *= value.z;
+        w *= value.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(float value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 mul(Float4 a, Float4 b) {
+        Float4 res = new Float4();
+        res.x = a.x * b.x;
+        res.y = a.y * b.y;
+        res.z = a.z * b.z;
+        res.w = a.w * b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 mul(Float4 a, float b) {
+        Float4 res = new Float4();
+        res.x = a.x * b;
+        res.y = a.y * b;
+        res.z = a.z * b;
+        res.w = a.w * b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(Float4 value) {
+        x /= value.x;
+        y /= value.y;
+        z /= value.z;
+        w /= value.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(float value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 div(Float4 a, float b) {
+        Float4 res = new Float4();
+        res.x = a.x / b;
+        res.y = a.y / b;
+        res.z = a.z / b;
+        res.w = a.w / b;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Float4 div(Float4 a, Float4 b) {
+        Float4 res = new Float4();
+        res.x = a.x / b.x;
+        res.y = a.y / b.y;
+        res.z = a.z / b.z;
+        res.w = a.w / b.w;
+
+        return res;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public float dotProduct(Float4 a) {
+        return (x * a.x) + (y * a.y) + (z * a.z) + (w * a.w);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static float dotProduct(Float4 a, Float4 b) {
+        return (b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w);
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Float4 a, float factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * set vector value by float4
+     *
+     * @param a
+     */
+    public void set(Float4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        x = -x;
+        y = -y;
+        z = -z;
+        w = -w;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 4;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public float elementSum() {
+        return x + y + z + w;
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public float get(int i) {
+        switch (i) {
+        case 0:
+            return x;
+        case 1:
+            return y;
+        case 2:
+            return z;
+        case 3:
+            return w;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, float value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value
+     *
+     * @param x
+     * @param y
+     * @param z
+     * @param w
+     */
+    public void setValues(float x, float y, float z, float w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide
+     * copy the vector to float array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(float[] data, int offset) {
+        data[offset] = x;
+        data[offset + 1] = y;
+        data[offset + 2] = z;
+        data[offset + 3] = w;
+    }
 }
-
-
-
diff --git a/graphics/java/android/renderscript/Int2.java b/graphics/java/android/renderscript/Int2.java
index 524e361..120957b 100644
--- a/graphics/java/android/renderscript/Int2.java
+++ b/graphics/java/android/renderscript/Int2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,24 +16,425 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript int2 type back to the Android system.
- *
- **/
+ * Vector version of the basic int type.
+ * Provides two int fields packed.
+ */
 public class Int2 {
+    public int x;
+    public int y;
+
     public Int2() {
     }
 
-    public Int2(int initX, int initY) {
-        x = initX;
-        y = initY;
+    /** @hide */
+    public Int2(int i) {
+        this.x = this.y = i;
     }
 
-    public int x;
-    public int y;
+    public Int2(int x, int y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide */
+    public Int2(Int2 source) {
+        this.x = source.x;
+        this.y = source.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Int2 a) {
+        this.x += a.x;
+        this.y += a.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 add(Int2 a, Int2 b) {
+        Int2 result = new Int2();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+
+        return result;
+    }
+
+    /**  @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(int value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 add(Int2 a, int b) {
+        Int2 result = new Int2();
+        result.x = a.x + b;
+        result.y = a.y + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Int2 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 sub(Int2 a, Int2 b) {
+        Int2 result = new Int2();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(int value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 sub(Int2 a, int b) {
+        Int2 result = new Int2();
+        result.x = a.x - b;
+        result.y = a.y - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Int2 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 mul(Int2 a, Int2 b) {
+        Int2 result = new Int2();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(int value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 mul(Int2 a, int b) {
+        Int2 result = new Int2();
+        result.x = a.x * b;
+        result.y = a.y * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Int2 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 div(Int2 a, Int2 b) {
+        Int2 result = new Int2();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(int value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 div(Int2 a, int b) {
+        Int2 result = new Int2();
+        result.x = a.x / b;
+        result.y = a.y / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Int2 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 mod(Int2 a, Int2 b) {
+        Int2 result = new Int2();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(int value) {
+        x %= value;
+        y %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int2 mod(Int2 a, int b) {
+        Int2 result = new Int2();
+        result.x = a.x % b;
+        result.y = a.y % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 2;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public int dotProduct(Int2 a) {
+        return (int)((x * a.x) + (y * a.y));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static int dotProduct(Int2 a, Int2 b) {
+        return (int)((b.x * a.x) + (b.y * a.y));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Int2 a, int factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * set vector value by Int2
+     *
+     * @param a
+     */
+    public void set(Int2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * set the vector field value by Int
+     *
+     * @param a
+     * @param b
+     */
+    public void setValues(int a, int b) {
+        this.x = a;
+        this.y = b;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public int elementSum() {
+        return (int)(x + y);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public int get(int i) {
+        switch (i) {
+        case 0:
+            return (int)(x);
+        case 1:
+            return (int)(y);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to int array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(int[] data, int offset) {
+        data[offset] = (int)(x);
+        data[offset + 1] = (int)(y);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Int3.java b/graphics/java/android/renderscript/Int3.java
index df42e28e..5431b9a7 100644
--- a/graphics/java/android/renderscript/Int3.java
+++ b/graphics/java/android/renderscript/Int3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,26 +16,462 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript int3 type back to the Android system.
- *
- **/
+ * Vector version of the basic int type.
+ * Provides three int fields packed.
+ */
 public class Int3 {
-    public Int3() {
-    }
-
-    public Int3(int initX, int initY, int initZ) {
-        x = initX;
-        y = initY;
-        z = initZ;
-    }
-
     public int x;
     public int y;
     public int z;
+
+    public Int3() {
+    }
+
+    /** @hide */
+    public Int3(int i) {
+        this.x = this.y = this.z = i;
+    }
+
+    public Int3(int x, int y, int z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide */
+    public Int3(Int3 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Int3 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 add(Int3 a, Int3 b) {
+        Int3 result = new Int3();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+        result.z = a.z + b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(int value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 add(Int3 a, int b) {
+        Int3 result = new Int3();
+        result.x = a.x + b;
+        result.y = a.y + b;
+        result.z = a.z + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Int3 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 sub(Int3 a, Int3 b) {
+        Int3 result = new Int3();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+        result.z = a.z - b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(int value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 sub(Int3 a, int b) {
+        Int3 result = new Int3();
+        result.x = a.x - b;
+        result.y = a.y - b;
+        result.z = a.z - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Int3 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 mul(Int3 a, Int3 b) {
+        Int3 result = new Int3();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+        result.z = a.z * b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(int value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 mul(Int3 a, int b) {
+        Int3 result = new Int3();
+        result.x = a.x * b;
+        result.y = a.y * b;
+        result.z = a.z * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Int3 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 div(Int3 a, Int3 b) {
+        Int3 result = new Int3();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+        result.z = a.z / b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(int value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 div(Int3 a, int b) {
+        Int3 result = new Int3();
+        result.x = a.x / b;
+        result.y = a.y / b;
+        result.z = a.z / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Int3 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 mod(Int3 a, Int3 b) {
+        Int3 result = new Int3();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+        result.z = a.z % b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(int value) {
+        x %= value;
+        y %= value;
+        z %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int3 mod(Int3 a, int b) {
+        Int3 result = new Int3();
+        result.x = a.x % b;
+        result.y = a.y % b;
+        result.z = a.z % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 3;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+        this.z = -z;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public int dotProduct(Int3 a) {
+        return (int)((x * a.x) + (y * a.y) + (z * a.z));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static int dotProduct(Int3 a, Int3 b) {
+        return (int)((b.x * a.x) + (b.y * a.y) + (b.z * a.z));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Int3 a, int factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * set vector value by Int3
+     *
+     * @param a
+     */
+    public void set(Int3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * set the vector field value by Int
+     *
+     * @param a
+     * @param b
+     * @param c
+     */
+    public void setValues(int a, int b, int c) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public int elementSum() {
+        return (int)(x + y + z);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public int get(int i) {
+        switch (i) {
+        case 0:
+            return (int)(x);
+        case 1:
+            return (int)(y);
+        case 2:
+            return (int)(z);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to int array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(int[] data, int offset) {
+        data[offset] = (int)(x);
+        data[offset + 1] = (int)(y);
+        data[offset + 2] = (int)(z);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Int4.java b/graphics/java/android/renderscript/Int4.java
index 408fb0d..1c0e2e2 100644
--- a/graphics/java/android/renderscript/Int4.java
+++ b/graphics/java/android/renderscript/Int4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,27 +16,499 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript int4 type back to the Android system.
- *
- **/
+ * Vector version of the basic int type.
+ * Provides four int fields packed.
+ */
 public class Int4 {
-    public Int4() {
-    }
-
-    public Int4(int initX, int initY, int initZ, int initW) {
-        x = initX;
-        y = initY;
-        z = initZ;
-        w = initW;
-    }
-
     public int x;
     public int y;
     public int z;
     public int w;
+
+    public Int4() {
+    }
+
+    /** @hide */
+    public Int4(int i) {
+        this.x = this.y = this.z = this.w = i;
+    }
+
+    public Int4(int x, int y, int z, int w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide */
+    public Int4(Int4 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+        this.w = source.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Int4 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+        this.w += a.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 add(Int4 a, Int4 b) {
+        Int4 result = new Int4();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+        result.z = a.z + b.z;
+        result.w = a.w + b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(int value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 add(Int4 a, int b) {
+        Int4 result = new Int4();
+        result.x = a.x + b;
+        result.y = a.y + b;
+        result.z = a.z + b;
+        result.w = a.w + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Int4 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+        this.w -= a.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 sub(Int4 a, Int4 b) {
+        Int4 result = new Int4();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+        result.z = a.z - b.z;
+        result.w = a.w - b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(int value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 sub(Int4 a, int b) {
+        Int4 result = new Int4();
+        result.x = a.x - b;
+        result.y = a.y - b;
+        result.z = a.z - b;
+        result.w = a.w - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Int4 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+        this.w *= a.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 mul(Int4 a, Int4 b) {
+        Int4 result = new Int4();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+        result.z = a.z * b.z;
+        result.w = a.w * b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(int value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 mul(Int4 a, int b) {
+        Int4 result = new Int4();
+        result.x = a.x * b;
+        result.y = a.y * b;
+        result.z = a.z * b;
+        result.w = a.w * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Int4 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+        this.w /= a.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 div(Int4 a, Int4 b) {
+        Int4 result = new Int4();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+        result.z = a.z / b.z;
+        result.w = a.w / b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(int value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 div(Int4 a, int b) {
+        Int4 result = new Int4();
+        result.x = a.x / b;
+        result.y = a.y / b;
+        result.z = a.z / b;
+        result.w = a.w / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Int4 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+        this.w %= a.w;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 mod(Int4 a, Int4 b) {
+        Int4 result = new Int4();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+        result.z = a.z % b.z;
+        result.w = a.w % b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(int value) {
+        x %= value;
+        y %= value;
+        z %= value;
+        w %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Int4 mod(Int4 a, int b) {
+        Int4 result = new Int4();
+        result.x = a.x % b;
+        result.y = a.y % b;
+        result.z = a.z % b;
+        result.w = a.w % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public int length() {
+        return 4;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+        this.z = -z;
+        this.w = -w;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public int dotProduct(Int4 a) {
+        return (int)((x * a.x) + (y * a.y) + (z * a.z) + (w * a.w));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static int dotProduct(Int4 a, Int4 b) {
+        return (int)((b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Int4 a, int factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * set vector value by Int4
+     *
+     * @param a
+     */
+    public void set(Int4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * set the vector field value by Int
+     *
+     * @param a
+     * @param b
+     * @param c
+     * @param d
+     */
+    public void setValues(int a, int b, int c, int d) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+        this.w = d;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public int elementSum() {
+        return (int)(x + y + z + w);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public int get(int i) {
+        switch (i) {
+        case 0:
+            return (int)(x);
+        case 1:
+            return (int)(y);
+        case 2:
+            return (int)(z);
+        case 3:
+            return (int)(w);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, int value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to int array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(int[] data, int offset) {
+        data[offset] = (int)(x);
+        data[offset + 1] = (int)(y);
+        data[offset + 2] = (int)(z);
+        data[offset + 3] = (int)(w);
+    }
 }
-
-
-
diff --git a/graphics/java/android/renderscript/Long2.java b/graphics/java/android/renderscript/Long2.java
index 70fc374..fabf204 100644
--- a/graphics/java/android/renderscript/Long2.java
+++ b/graphics/java/android/renderscript/Long2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,23 +16,425 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript long2 type back to the Android system.
- **/
+ * Vector version of the basic long type.
+ * Provides two long fields packed.
+ */
 public class Long2 {
+    public long x;
+    public long y;
+
     public Long2() {
     }
 
-    public Long2(long initX, long initY) {
-        x = initX;
-        y = initY;
+    /** @hide */
+    public Long2(long i) {
+        this.x = this.y = i;
     }
 
-    public long x;
-    public long y;
+    public Long2(long x, long y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide */
+    public Long2(Long2 source) {
+        this.x = source.x;
+        this.y = source.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Long2 a) {
+        this.x += a.x;
+        this.y += a.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 add(Long2 a, Long2 b) {
+        Long2 result = new Long2();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(long value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 add(Long2 a, long b) {
+        Long2 result = new Long2();
+        result.x = a.x + b;
+        result.y = a.y + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Long2 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 sub(Long2 a, Long2 b) {
+        Long2 result = new Long2();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(long value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 sub(Long2 a, long b) {
+        Long2 result = new Long2();
+        result.x = a.x - b;
+        result.y = a.y - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Long2 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 mul(Long2 a, Long2 b) {
+        Long2 result = new Long2();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(long value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 mul(Long2 a, long b) {
+        Long2 result = new Long2();
+        result.x = a.x * b;
+        result.y = a.y * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Long2 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 div(Long2 a, Long2 b) {
+        Long2 result = new Long2();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(long value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 div(Long2 a, long b) {
+        Long2 result = new Long2();
+        result.x = a.x / b;
+        result.y = a.y / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Long2 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 mod(Long2 a, Long2 b) {
+        Long2 result = new Long2();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(long value) {
+        x %= value;
+        y %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long2 mod(Long2 a, long b) {
+        Long2 result = new Long2();
+        result.x = a.x % b;
+        result.y = a.y % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public long length() {
+        return 2;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public long dotProduct(Long2 a) {
+        return (long)((x * a.x) + (y * a.y));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static long dotProduct(Long2 a, Long2 b) {
+        return (long)((b.x * a.x) + (b.y * a.y));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Long2 a, long factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * set vector value by Long2
+     *
+     * @param a
+     */
+    public void set(Long2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * set the vector field value by Long
+     *
+     * @param a
+     * @param b
+     */
+    public void setValues(long a, long b) {
+        this.x = a;
+        this.y = b;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public long elementSum() {
+        return (long)(x + y);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public long get(int i) {
+        switch (i) {
+        case 0:
+            return (long)(x);
+        case 1:
+            return (long)(y);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to long array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(long[] data, int offset) {
+        data[offset] = (long)(x);
+        data[offset + 1] = (long)(y);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Long3.java b/graphics/java/android/renderscript/Long3.java
index d81826b..8e243cc 100644
--- a/graphics/java/android/renderscript/Long3.java
+++ b/graphics/java/android/renderscript/Long3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,25 +16,462 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript long3 type back to the Android system.
- **/
+ * Vector version of the basic long type.
+ * Provides three long fields packed.
+ */
 public class Long3 {
-    public Long3() {
-    }
-
-    public Long3(long initX, long initY, long initZ) {
-        x = initX;
-        y = initY;
-        z = initZ;
-    }
-
     public long x;
     public long y;
     public long z;
+
+    public Long3() {
+    }
+
+    /** @hide */
+    public Long3(long i) {
+        this.x = this.y = this.z = i;
+    }
+
+    public Long3(long x, long y, long z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide */
+    public Long3(Long3 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Long3 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 add(Long3 a, Long3 b) {
+        Long3 result = new Long3();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+        result.z = a.z + b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(long value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 add(Long3 a, long b) {
+        Long3 result = new Long3();
+        result.x = a.x + b;
+        result.y = a.y + b;
+        result.z = a.z + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Long3 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 sub(Long3 a, Long3 b) {
+        Long3 result = new Long3();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+        result.z = a.z - b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(long value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 sub(Long3 a, long b) {
+        Long3 result = new Long3();
+        result.x = a.x - b;
+        result.y = a.y - b;
+        result.z = a.z - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Long3 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 mul(Long3 a, Long3 b) {
+        Long3 result = new Long3();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+        result.z = a.z * b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(long value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 mul(Long3 a, long b) {
+        Long3 result = new Long3();
+        result.x = a.x * b;
+        result.y = a.y * b;
+        result.z = a.z * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Long3 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 div(Long3 a, Long3 b) {
+        Long3 result = new Long3();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+        result.z = a.z / b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(long value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 div(Long3 a, long b) {
+        Long3 result = new Long3();
+        result.x = a.x / b;
+        result.y = a.y / b;
+        result.z = a.z / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Long3 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 mod(Long3 a, Long3 b) {
+        Long3 result = new Long3();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+        result.z = a.z % b.z;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(long value) {
+        x %= value;
+        y %= value;
+        z %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long3 mod(Long3 a, long b) {
+        Long3 result = new Long3();
+        result.x = a.x % b;
+        result.y = a.y % b;
+        result.z = a.z % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public long length() {
+        return 3;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+        this.z = -z;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public long dotProduct(Long3 a) {
+        return (long)((x * a.x) + (y * a.y) + (z * a.z));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static long dotProduct(Long3 a, Long3 b) {
+        return (long)((b.x * a.x) + (b.y * a.y) + (b.z * a.z));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Long3 a, long factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * set vector value by Long3
+     *
+     * @param a
+     */
+    public void set(Long3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * set the vector field value by Long
+     *
+     * @param a
+     * @param b
+     * @param c
+     */
+    public void setValues(long a, long b, long c) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public long elementSum() {
+        return (long)(x + y + z);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public long get(int i) {
+        switch (i) {
+        case 0:
+            return (long)(x);
+        case 1:
+            return (long)(y);
+        case 2:
+            return (long)(z);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to long array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(long[] data, int offset) {
+        data[offset] = (long)(x);
+        data[offset + 1] = (long)(y);
+        data[offset + 2] = (long)(z);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Long4.java b/graphics/java/android/renderscript/Long4.java
index 47ef437..757b910 100644
--- a/graphics/java/android/renderscript/Long4.java
+++ b/graphics/java/android/renderscript/Long4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,26 +16,499 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript long4 type back to the Android system.
- **/
+ * Vector version of the basic long type.
+ * Provides four long fields packed.
+ */
 public class Long4 {
-    public Long4() {
-    }
-
-    public Long4(long initX, long initY, long initZ, long initW) {
-        x = initX;
-        y = initY;
-        z = initZ;
-        w = initW;
-    }
-
     public long x;
     public long y;
     public long z;
     public long w;
+
+    public Long4() {
+    }
+
+    /** @hide */
+    public Long4(long i) {
+        this.x = this.y = this.z = this.w = i;
+    }
+
+    public Long4(long x, long y, long z, long w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide */
+    public Long4(Long4 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+        this.w = source.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Long4 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+        this.w += a.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 add(Long4 a, Long4 b) {
+        Long4 result = new Long4();
+        result.x = a.x + b.x;
+        result.y = a.y + b.y;
+        result.z = a.z + b.z;
+        result.w = a.w + b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(long value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 add(Long4 a, long b) {
+        Long4 result = new Long4();
+        result.x = a.x + b;
+        result.y = a.y + b;
+        result.z = a.z + b;
+        result.w = a.w + b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Long4 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+        this.w -= a.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 sub(Long4 a, Long4 b) {
+        Long4 result = new Long4();
+        result.x = a.x - b.x;
+        result.y = a.y - b.y;
+        result.z = a.z - b.z;
+        result.w = a.w - b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(long value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 sub(Long4 a, long b) {
+        Long4 result = new Long4();
+        result.x = a.x - b;
+        result.y = a.y - b;
+        result.z = a.z - b;
+        result.w = a.w - b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Long4 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+        this.w *= a.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 mul(Long4 a, Long4 b) {
+        Long4 result = new Long4();
+        result.x = a.x * b.x;
+        result.y = a.y * b.y;
+        result.z = a.z * b.z;
+        result.w = a.w * b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(long value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 mul(Long4 a, long b) {
+        Long4 result = new Long4();
+        result.x = a.x * b;
+        result.y = a.y * b;
+        result.z = a.z * b;
+        result.w = a.w * b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Long4 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+        this.w /= a.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 div(Long4 a, Long4 b) {
+        Long4 result = new Long4();
+        result.x = a.x / b.x;
+        result.y = a.y / b.y;
+        result.z = a.z / b.z;
+        result.w = a.w / b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(long value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 div(Long4 a, long b) {
+        Long4 result = new Long4();
+        result.x = a.x / b;
+        result.y = a.y / b;
+        result.z = a.z / b;
+        result.w = a.w / b;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Long4 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+        this.w %= a.w;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 mod(Long4 a, Long4 b) {
+        Long4 result = new Long4();
+        result.x = a.x % b.x;
+        result.y = a.y % b.y;
+        result.z = a.z % b.z;
+        result.w = a.w % b.w;
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(long value) {
+        x %= value;
+        y %= value;
+        z %= value;
+        w %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Long4 mod(Long4 a, long b) {
+        Long4 result = new Long4();
+        result.x = a.x % b;
+        result.y = a.y % b;
+        result.z = a.z % b;
+        result.w = a.w % b;
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public long length() {
+        return 4;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = -x;
+        this.y = -y;
+        this.z = -z;
+        this.w = -w;
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public long dotProduct(Long4 a) {
+        return (long)((x * a.x) + (y * a.y) + (z * a.z) + (w * a.w));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static long dotProduct(Long4 a, Long4 b) {
+        return (long)((b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Long4 a, long factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * set vector value by Long4
+     *
+     * @param a
+     */
+    public void set(Long4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * set the vector field value by Long
+     *
+     * @param a
+     * @param b
+     * @param c
+     * @param d
+     */
+    public void setValues(long a, long b, long c, long d) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+        this.w = d;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public long elementSum() {
+        return (long)(x + y + z + w);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public long get(int i) {
+        switch (i) {
+        case 0:
+            return (long)(x);
+        case 1:
+            return (long)(y);
+        case 2:
+            return (long)(z);
+        case 3:
+            return (long)(w);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, long value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to long array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(Long[] data, int offset) {
+        data[offset] = (long)(x);
+        data[offset + 1] = (long)(y);
+        data[offset + 2] = (long)(z);
+        data[offset + 3] = (long)(w);
+    }
 }
-
-
-
diff --git a/graphics/java/android/renderscript/Short2.java b/graphics/java/android/renderscript/Short2.java
index 2c6c334..24809f7 100644
--- a/graphics/java/android/renderscript/Short2.java
+++ b/graphics/java/android/renderscript/Short2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -20,20 +20,424 @@
 /**
  * Class for exposing the native RenderScript Short2 type back to the Android system.
  *
- **/
+ * Vector version of the basic short type.
+ * Provides two short fields packed.
+ */
 public class Short2 {
+    public short x;
+    public short y;
+
     public Short2() {
     }
 
-    public Short2(short initX, short initY) {
-        x = initX;
-        y = initY;
+    /** @hide */
+    public Short2(short i) {
+        this.x = this.y = i;
     }
 
-    public short x;
-    public short y;
+    public Short2(short x, short y) {
+        this.x = x;
+        this.y = y;
+    }
+
+    /** @hide */
+    public Short2(Short2 source) {
+        this.x = source.x;
+        this.y = source.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Short2 a) {
+        this.x += a.x;
+        this.y += a.y;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 add(Short2 a, Short2 b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x + b.x);
+        result.y = (short)(a.y + b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(short value) {
+        x += value;
+        y += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 add(Short2 a, short b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x + b);
+        result.y = (short)(a.y + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Short2 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 sub(Short2 a, Short2 b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x - b.x);
+        result.y = (short)(a.y - b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(short value) {
+        x -= value;
+        y -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 sub(Short2 a, short b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x - b);
+        result.y = (short)(a.y - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Short2 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 mul(Short2 a, Short2 b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x * b.x);
+        result.y = (short)(a.y * b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(short value) {
+        x *= value;
+        y *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 mul(Short2 a, short b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x * b);
+        result.y = (short)(a.y * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Short2 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 div(Short2 a, Short2 b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x / b.x);
+        result.y = (short)(a.y / b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(short value) {
+        x /= value;
+        y /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 div(Short2 a, short b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x / b);
+        result.y = (short)(a.y / b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Short2 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 mod(Short2 a, Short2 b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x % b.x);
+        result.y = (short)(a.y % b.y);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(short value) {
+        x %= value;
+        y %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short2 mod(Short2 a, short b) {
+        Short2 result = new Short2();
+        result.x = (short)(a.x % b);
+        result.y = (short)(a.y % b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public short length() {
+        return 2;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (short)(-x);
+        this.y = (short)(-y);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public short dotProduct(Short2 a) {
+        return (short)((x * a.x) + (y * a.y));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static short dotProduct(Short2 a, Short2 b) {
+        return (short)((b.x * a.x) + (b.y * a.y));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Short2 a, short factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+    }
+
+    /** @hide
+     * set vector value by Short2
+     *
+     * @param a
+     */
+    public void set(Short2 a) {
+        this.x = a.x;
+        this.y = a.y;
+    }
+
+    /** @hide
+     * set the vector field value by Short
+     *
+     * @param a
+     * @param b
+     */
+    public void setValues(short a, short b) {
+        this.x = a;
+        this.y = b;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public short elementSum() {
+        return (short)(x + y);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public short get(int i) {
+        switch (i) {
+        case 0:
+            return (short)(x);
+        case 1:
+            return (short)(y);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to short array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(short[] data, int offset) {
+        data[offset] = (short)(x);
+        data[offset + 1] = (short)(y);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Short3.java b/graphics/java/android/renderscript/Short3.java
index aafd27b..661db0a 100644
--- a/graphics/java/android/renderscript/Short3.java
+++ b/graphics/java/android/renderscript/Short3.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,26 +16,462 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript short3 type back to the Android system.
- *
- **/
+ * Vector version of the basic short type.
+ * Provides three short fields packed.
+ */
 public class Short3 {
-    public Short3() {
-    }
-
-    public Short3(short initX, short initY, short initZ) {
-        x = initX;
-        y = initY;
-        z = initZ;
-    }
-
     public short x;
     public short y;
     public short z;
+
+    public Short3() {
+    }
+
+    /** @hide */
+    public Short3(short i) {
+        this.x = this.y = this.z = i;
+    }
+
+    public Short3(short x, short y, short z) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+    }
+
+    /** @hide */
+    public Short3(Short3 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Short3 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 add(Short3 a, Short3 b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x + b.x);
+        result.y = (short)(a.y + b.y);
+        result.z = (short)(a.z + b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(short value) {
+        x += value;
+        y += value;
+        z += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 add(Short3 a, short b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x + b);
+        result.y = (short)(a.y + b);
+        result.z = (short)(a.z + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Short3 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 sub(Short3 a, Short3 b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x - b.x);
+        result.y = (short)(a.y - b.y);
+        result.z = (short)(a.z - b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(short value) {
+        x -= value;
+        y -= value;
+        z -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 sub(Short3 a, short b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x - b);
+        result.y = (short)(a.y - b);
+        result.z = (short)(a.z - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Short3 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 mul(Short3 a, Short3 b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x * b.x);
+        result.y = (short)(a.y * b.y);
+        result.z = (short)(a.z * b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(short value) {
+        x *= value;
+        y *= value;
+        z *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 mul(Short3 a, short b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x * b);
+        result.y = (short)(a.y * b);
+        result.z = (short)(a.z * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Short3 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 div(Short3 a, Short3 b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x / b.x);
+        result.y = (short)(a.y / b.y);
+        result.z = (short)(a.z / b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(short value) {
+        x /= value;
+        y /= value;
+        z /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 div(Short3 a, short b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x / b);
+        result.y = (short)(a.y / b);
+        result.z = (short)(a.z / b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Short3 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 mod(Short3 a, Short3 b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x % b.x);
+        result.y = (short)(a.y % b.y);
+        result.z = (short)(a.z % b.z);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(short value) {
+        x %= value;
+        y %= value;
+        z %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short3 mod(Short3 a, short b) {
+        Short3 result = new Short3();
+        result.x = (short)(a.x % b);
+        result.y = (short)(a.y % b);
+        result.z = (short)(a.z % b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public short length() {
+        return 3;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (short)(-x);
+        this.y = (short)(-y);
+        this.z = (short)(-z);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public short dotProduct(Short3 a) {
+        return (short)((x * a.x) + (y * a.y) + (z * a.z));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static short dotProduct(Short3 a, Short3 b) {
+        return (short)((b.x * a.x) + (b.y * a.y) + (b.z * a.z));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Short3 a, short factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+    }
+
+    /** @hide
+     * set vector value by Short3
+     *
+     * @param a
+     */
+    public void set(Short3 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+    }
+
+    /** @hide
+     * set the vector field value by Short
+     *
+     * @param a
+     * @param b
+     * @param c
+     */
+    public void setValues(short a, short b, short c) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public short elementSum() {
+        return (short)(x + y + z);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public short get(int i) {
+        switch (i) {
+        case 0:
+            return (short)(x);
+        case 1:
+            return (short)(y);
+        case 2:
+            return (short)(z);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to short array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(short[] data, int offset) {
+        data[offset] = (short)(x);
+        data[offset + 1] = (short)(y);
+        data[offset + 2] = (short)(z);
+    }
 }
-
-
-
-
diff --git a/graphics/java/android/renderscript/Short4.java b/graphics/java/android/renderscript/Short4.java
index 176bde9..a2d74f2 100644
--- a/graphics/java/android/renderscript/Short4.java
+++ b/graphics/java/android/renderscript/Short4.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 The Android Open Source Project
+ * 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.
@@ -16,27 +16,499 @@
 
 package android.renderscript;
 
-
 /**
- * Class for exposing the native RenderScript short4 type back to the Android system.
- *
- **/
+ * Vector version of the basic short type.
+ * Provides four short fields packed.
+ */
 public class Short4 {
-    public Short4() {
-    }
-
-    public Short4(short initX, short initY, short initZ, short initW) {
-        x = initX;
-        y = initY;
-        z = initZ;
-        w = initW;
-    }
-
     public short x;
     public short y;
     public short z;
     public short w;
+
+    public Short4() {
+    }
+
+    /** @hide */
+    public Short4(short i) {
+        this.x = this.y = this.z = this.w = i;
+    }
+
+    public Short4(short x, short y, short z, short w) {
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.w = w;
+    }
+
+    /** @hide */
+    public Short4(Short4 source) {
+        this.x = source.x;
+        this.y = source.y;
+        this.z = source.z;
+        this.w = source.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     */
+    public void add(Short4 a) {
+        this.x += a.x;
+        this.y += a.y;
+        this.z += a.z;
+        this.w += a.w;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 add(Short4 a, Short4 b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x + b.x);
+        result.y = (short)(a.y + b.y);
+        result.z = (short)(a.z + b.z);
+        result.w = (short)(a.w + b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param value
+     */
+    public void add(short value) {
+        x += value;
+        y += value;
+        z += value;
+        w += value;
+    }
+
+    /** @hide
+     * Vector add
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 add(Short4 a, short b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x + b);
+        result.y = (short)(a.y + b);
+        result.z = (short)(a.z + b);
+        result.w = (short)(a.w + b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     */
+    public void sub(Short4 a) {
+        this.x -= a.x;
+        this.y -= a.y;
+        this.z -= a.z;
+        this.w -= a.w;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 sub(Short4 a, Short4 b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x - b.x);
+        result.y = (short)(a.y - b.y);
+        result.z = (short)(a.z - b.z);
+        result.w = (short)(a.w - b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param value
+     */
+    public void sub(short value) {
+        x -= value;
+        y -= value;
+        z -= value;
+        w -= value;
+    }
+
+    /** @hide
+     * Vector subtraction
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 sub(Short4 a, short b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x - b);
+        result.y = (short)(a.y - b);
+        result.z = (short)(a.z - b);
+        result.w = (short)(a.w - b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     */
+    public void mul(Short4 a) {
+        this.x *= a.x;
+        this.y *= a.y;
+        this.z *= a.z;
+        this.w *= a.w;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 mul(Short4 a, Short4 b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x * b.x);
+        result.y = (short)(a.y * b.y);
+        result.z = (short)(a.z * b.z);
+        result.w = (short)(a.w * b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param value
+     */
+    public void mul(short value) {
+        x *= value;
+        y *= value;
+        z *= value;
+        w *= value;
+    }
+
+    /** @hide
+     * Vector multiplication
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 mul(Short4 a, short b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x * b);
+        result.y = (short)(a.y * b);
+        result.z = (short)(a.z * b);
+        result.w = (short)(a.w * b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     */
+    public void div(Short4 a) {
+        this.x /= a.x;
+        this.y /= a.y;
+        this.z /= a.z;
+        this.w /= a.w;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 div(Short4 a, Short4 b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x / b.x);
+        result.y = (short)(a.y / b.y);
+        result.z = (short)(a.z / b.z);
+        result.w = (short)(a.w / b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param value
+     */
+    public void div(short value) {
+        x /= value;
+        y /= value;
+        z /= value;
+        w /= value;
+    }
+
+    /** @hide
+     * Vector division
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 div(Short4 a, short b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x / b);
+        result.y = (short)(a.y / b);
+        result.z = (short)(a.z / b);
+        result.w = (short)(a.w / b);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     */
+    public void mod(Short4 a) {
+        this.x %= a.x;
+        this.y %= a.y;
+        this.z %= a.z;
+        this.w %= a.w;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 mod(Short4 a, Short4 b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x % b.x);
+        result.y = (short)(a.y % b.y);
+        result.z = (short)(a.z % b.z);
+        result.w = (short)(a.w % b.w);
+
+        return result;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param value
+     */
+    public void mod(short value) {
+        x %= value;
+        y %= value;
+        z %= value;
+        w %= value;
+    }
+
+    /** @hide
+     * Vector Modulo
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static Short4 mod(Short4 a, short b) {
+        Short4 result = new Short4();
+        result.x = (short)(a.x % b);
+        result.y = (short)(a.y % b);
+        result.z = (short)(a.z % b);
+        result.w = (short)(a.w % b);
+
+        return result;
+    }
+
+    /** @hide
+     * get vector length
+     *
+     * @return
+     */
+    public short length() {
+        return 4;
+    }
+
+    /** @hide
+     * set vector negate
+     */
+    public void negate() {
+        this.x = (short)(-x);
+        this.y = (short)(-y);
+        this.z = (short)(-z);
+        this.w = (short)(-w);
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @return
+     */
+    public short dotProduct(Short4 a) {
+        return (short)((x * a.x) + (y * a.y) + (z * a.z) + (w * a.w));
+    }
+
+    /** @hide
+     * Vector dot Product
+     *
+     * @param a
+     * @param b
+     * @return
+     */
+    public static short dotProduct(Short4 a, Short4 b) {
+        return (short)((b.x * a.x) + (b.y * a.y) + (b.z * a.z) + (b.w * a.w));
+    }
+
+    /** @hide
+     * Vector add Multiple
+     *
+     * @param a
+     * @param factor
+     */
+    public void addMultiple(Short4 a, short factor) {
+        x += a.x * factor;
+        y += a.y * factor;
+        z += a.z * factor;
+        w += a.w * factor;
+    }
+
+    /** @hide
+     * set vector value by Short4
+     *
+     * @param a
+     */
+    public void set(Short4 a) {
+        this.x = a.x;
+        this.y = a.y;
+        this.z = a.z;
+        this.w = a.w;
+    }
+
+    /** @hide
+     * set the vector field value by Short
+     *
+     * @param a
+     * @param b
+     * @param c
+     * @param d
+     */
+    public void setValues(short a, short b, short c, short d) {
+        this.x = a;
+        this.y = b;
+        this.z = c;
+        this.w = d;
+    }
+
+    /** @hide
+     * return the element sum of vector
+     *
+     * @return
+     */
+    public short elementSum() {
+        return (short)(x + y + z + w);
+    }
+
+    /** @hide
+     * get the vector field value by index
+     *
+     * @param i
+     * @return
+     */
+    public short get(int i) {
+        switch (i) {
+        case 0:
+            return (short)(x);
+        case 1:
+            return (short)(y);
+        case 2:
+            return (short)(z);
+        case 3:
+            return (short)(w);
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * set the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void setAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x = value;
+            return;
+        case 1:
+            y = value;
+            return;
+        case 2:
+            z = value;
+            return;
+        case 3:
+            w = value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * add the vector field value by index
+     *
+     * @param i
+     * @param value
+     */
+    public void addAt(int i, short value) {
+        switch (i) {
+        case 0:
+            x += value;
+            return;
+        case 1:
+            y += value;
+            return;
+        case 2:
+            z += value;
+            return;
+        case 3:
+            w += value;
+            return;
+        default:
+            throw new IndexOutOfBoundsException("Index: i");
+        }
+    }
+
+    /** @hide
+     * copy the vector to short array
+     *
+     * @param data
+     * @param offset
+     */
+    public void copyTo(short[] data, int offset) {
+        data[offset] = (short)(x);
+        data[offset + 1] = (short)(y);
+        data[offset + 2] = (short)(z);
+        data[offset + 3] = (short)(w);
+    }
 }
-
-
-
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index f49ef2e..34169e2 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -800,7 +800,7 @@
     //--------------------
 
     private native final int native_setup(Object audiorecord_this,
-            int recordSource, int sampleRate, int nbChannels, int audioFormat,
+            int recordSource, int sampleRate, int channelMask, int audioFormat,
             int buffSizeInBytes, int[] sessionId);
 
     private native final void native_finalize();
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index 78a37c5..8756806 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1319,7 +1319,7 @@
     //--------------------
 
     private native final int native_setup(Object audiotrack_this,
-            int streamType, int sampleRate, int nbChannels, int audioFormat,
+            int streamType, int sampleRate, int channelMask, int audioFormat,
             int buffSizeInBytes, int mode, int[] sessionId);
 
     private native final void native_finalize();
diff --git a/packages/InputDevices/res/values-mn-rMN/strings.xml b/packages/InputDevices/res/values-mn-rMN/strings.xml
index 0cfb085..ec6cccb 100644
--- a/packages/InputDevices/res/values-mn-rMN/strings.xml
+++ b/packages/InputDevices/res/values-mn-rMN/strings.xml
@@ -25,7 +25,7 @@
     <string name="keyboard_layout_finnish" msgid="5585659438924315466">"Финлянд"</string>
     <string name="keyboard_layout_croatian" msgid="4172229471079281138">"Хорват"</string>
     <string name="keyboard_layout_czech" msgid="1349256901452975343">"Чех"</string>
-    <string name="keyboard_layout_estonian" msgid="8775830985185665274">"Эстони"</string>
+    <string name="keyboard_layout_estonian" msgid="8775830985185665274">"Эстон"</string>
     <string name="keyboard_layout_hungarian" msgid="4154963661406035109">"Унгар"</string>
     <string name="keyboard_layout_icelandic" msgid="5836645650912489642">"Исланд"</string>
     <string name="keyboard_layout_brazilian" msgid="5117896443147781939">"Бразил"</string>
diff --git a/packages/Keyguard/res/values-nb/strings.xml b/packages/Keyguard/res/values-nb/strings.xml
index c25a772..71138a5 100644
--- a/packages/Keyguard/res/values-nb/strings.xml
+++ b/packages/Keyguard/res/values-nb/strings.xml
@@ -117,7 +117,7 @@
     <string name="kg_invalid_puk" msgid="3638289409676051243">"Skriv inn den korrekte PUK-koden på nytt. Gjentatte forsøk kommer til å deaktivere SIM-kortet."</string>
     <string name="kg_invalid_confirm_pin_hint" product="default" msgid="7003469261464593516">"PIN-kodene stemmer ikke overens"</string>
     <string name="kg_login_too_many_attempts" msgid="6486842094005698475">"For mange forsøk på tegning av mønster"</string>
-    <string name="kg_login_instructions" msgid="1100551261265506448">"Logg deg på med Google-kontoen din for å låse opp."</string>
+    <string name="kg_login_instructions" msgid="1100551261265506448">"Logg på med Google-kontoen din for å låse opp."</string>
     <string name="kg_login_username_hint" msgid="5718534272070920364">"Brukernavn (e-postadresse)"</string>
     <string name="kg_login_password_hint" msgid="9057289103827298549">"Passord"</string>
     <string name="kg_login_submit_button" msgid="5355904582674054702">"Logg på"</string>