am 050972b1: am 2d0d6541: Change setScrollVertically to protected to make scroll work in subclasses.

* commit '050972b1231819fd2c854ef9bba10d6f6f8b5f00':
  Change setScrollVertically to protected to make scroll work in subclasses.
diff --git a/apps/Development/res/layout/connectivity.xml b/apps/Development/res/layout/connectivity.xml
index 53f1ed7..2aaf6c6 100644
--- a/apps/Development/res/layout/connectivity.xml
+++ b/apps/Development/res/layout/connectivity.xml
@@ -219,6 +219,15 @@
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:text="@string/start_tdls" />
+        <Button android:id="@+id/stopTdls"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/stop_tdls" />
+    </LinearLayout>
+    <LinearLayout
+      android:orientation="horizontal"
+      android:layout_width="match_parent"
+      android:layout_height="wrap_content">
         <TextView
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
@@ -227,10 +236,6 @@
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:minEms="10" />
-        <Button android:id="@+id/stopTdls"
-          android:layout_width="wrap_content"
-          android:layout_height="wrap_content"
-          android:text="@string/stop_tdls" />
     </LinearLayout>
 
     <!-- divider line -->
@@ -279,6 +284,14 @@
       android:orientation="horizontal"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">
+        <TextView
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="@string/netid" />
+        <EditText android:id="@+id/netid"
+          android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:minEms="5" />
         <Button android:id="@+id/add_default_route"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
diff --git a/apps/Development/res/values/strings.xml b/apps/Development/res/values/strings.xml
index ced7b72..0c13987 100644
--- a/apps/Development/res/values/strings.xml
+++ b/apps/Development/res/values/strings.xml
@@ -43,6 +43,7 @@
     <string name="start_hipri">Start HiPri</string>
     <string name="stop_hipri">Stop HiPri</string>
     <string name="crash">CRASH</string>
+    <string name="netid">NetId</string>
     <string name="add_default_route">Add Default Route</string>
     <string name="remove_default_route">Remove Default Route</string>
     <string name="default_request">Make a http request</string>
diff --git a/apps/Development/src/com/android/development/Connectivity.java b/apps/Development/src/com/android/development/Connectivity.java
index 7d4491b..93d199b 100644
--- a/apps/Development/src/com/android/development/Connectivity.java
+++ b/apps/Development/src/com/android/development/Connectivity.java
@@ -28,6 +28,7 @@
 import android.content.SharedPreferences;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.net.ConnectivityManager;
+import android.net.LinkAddress;
 import android.net.NetworkUtils;
 import android.net.RouteInfo;
 import android.net.wifi.ScanResult;
@@ -224,10 +225,13 @@
                     mStartTime = -1;
                 }
                 Log.d(TAG, "Scan: READY " + mScanCur);
+                mScanResults.setVisibility(View.INVISIBLE);
 
                 List<ScanResult> wifiScanResults = mWm.getScanResults();
                 if (wifiScanResults != null) {
                     mTotalScanCount += wifiScanResults.size();
+                    mScanResults.setText("Current scan = " + Long.toString(wifiScanResults.size()));
+                    mScanResults.setVisibility(View.VISIBLE);
                     Log.d(TAG, "Scan: Results = " + wifiScanResults.size());
                 }
 
@@ -236,6 +240,7 @@
                 if (mScanCur == 0) {
                     unregisterReceiver(mScanRecv);
                     mScanButton.setText(GET_SCAN_RES);
+                    mScanResults.setVisibility(View.INVISIBLE);
                 } else {
                     Log.d(TAG, "Scan: START " + mScanCur);
                     mStartTime = SystemClock.elapsedRealtime();
@@ -524,7 +529,8 @@
 
     private void onAddDefaultRoute() {
         try {
-            mNetd.addRoute("eth0", new RouteInfo(null,
+            int netId = Integer.valueOf(((TextView) findViewById(R.id.netid)).getText().toString());
+            mNetd.addRoute(netId, new RouteInfo((LinkAddress) null,
                     NetworkUtils.numericToInetAddress("8.8.8.8")));
         } catch (Exception e) {
             Log.e(TAG, "onAddDefaultRoute got exception: " + e.toString());
@@ -533,7 +539,8 @@
 
     private void onRemoveDefaultRoute() {
         try {
-            mNetd.removeRoute("eth0", new RouteInfo(null,
+            int netId = Integer.valueOf(((TextView) findViewById(R.id.netid)).getText().toString());
+            mNetd.removeRoute(netId, new RouteInfo((LinkAddress) null,
                     NetworkUtils.numericToInetAddress("8.8.8.8")));
         } catch (Exception e) {
             Log.e(TAG, "onRemoveDefaultRoute got exception: " + e.toString());
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-az-rAZ/strings.xml
similarity index 74%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-az-rAZ/strings.xml
index c699f25..8e1956a 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-az-rAZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Son çarə"</string>
+    <string name="title" msgid="8156274565006125136">"Dəstəklənməyən fəaliyyət"</string>
+    <string name="error" msgid="6539615832923362301">"Bu fəaliyyət hazırda dəstəklənmir."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-bn-rBD/strings.xml
similarity index 69%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-bn-rBD/strings.xml
index c699f25..67979ad 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-bn-rBD/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"ফলব্যাক"</string>
+    <string name="title" msgid="8156274565006125136">"অসমর্থিত ক্রিয়া"</string>
+    <string name="error" msgid="6539615832923362301">"এই ক্রিয়াটি বর্তমানে সমর্থিত নয়৷"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-en-rIN/strings.xml
similarity index 81%
rename from apps/Fallback/res/values-rm/strings.xml
rename to apps/Fallback/res/values-en-rIN/strings.xml
index c699f25..a7c82cb 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-en-rIN/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"Unsupported action"</string>
+    <string name="error" msgid="6539615832923362301">"That action is not currently supported."</string>
 </resources>
diff --git a/apps/Fallback/res/values-et/strings.xml b/apps/Fallback/res/values-et-rEE/strings.xml
similarity index 100%
rename from apps/Fallback/res/values-et/strings.xml
rename to apps/Fallback/res/values-et-rEE/strings.xml
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-eu-rES/strings.xml
similarity index 75%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-eu-rES/strings.xml
index c699f25..7cd09f4 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-eu-rES/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Ordezkoa"</string>
+    <string name="title" msgid="8156274565006125136">"Ekintza onartezina"</string>
+    <string name="error" msgid="6539615832923362301">"Une honetan ez da ekintza hori onartzen."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-fr-rCA/strings.xml
similarity index 73%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-fr-rCA/strings.xml
index c699f25..a751b97 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-fr-rCA/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Application de secours"</string>
+    <string name="title" msgid="8156274565006125136">"Action non prise en charge"</string>
+    <string name="error" msgid="6539615832923362301">"Cette action n\'est actuellement pas prise en charge."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-gl-rES/strings.xml
similarity index 81%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-gl-rES/strings.xml
index c699f25..4887636 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-gl-rES/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"Acción non admitida"</string>
+    <string name="error" msgid="6539615832923362301">"Actualmente non se admite esa acción."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-hy-rAM/strings.xml
similarity index 78%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-hy-rAM/strings.xml
index c699f25..1547741 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-hy-rAM/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"Չաջակցվող գործողություն"</string>
+    <string name="error" msgid="6539615832923362301">"Այդ գործողությունն այժմ չի աջակցվում:"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-is-rIS/strings.xml
similarity index 81%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-is-rIS/strings.xml
index c699f25..852d12a 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-is-rIS/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"Aðgerð ekki studd"</string>
+    <string name="error" msgid="6539615832923362301">"Þessi aðgerð er ekki studd sem stendur."</string>
 </resources>
diff --git a/apps/Fallback/res/values-be/strings.xml b/apps/Fallback/res/values-ka-rGE/strings.xml
similarity index 65%
rename from apps/Fallback/res/values-be/strings.xml
rename to apps/Fallback/res/values-ka-rGE/strings.xml
index d59ae53..469a135 100644
--- a/apps/Fallback/res/values-be/strings.xml
+++ b/apps/Fallback/res/values-ka-rGE/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Дапаможны"</string>
-    <string name="title" msgid="8156274565006125136">"Дзеянні, якія не падрымліваюцца"</string>
-    <string name="error" msgid="6539615832923362301">"Гэтае дзеянне зараз не падтрымліваецца."</string>
+    <string name="appTitle" msgid="161410001913116606">"შემოვლით რეჟიმში გადასვლა"</string>
+    <string name="title" msgid="8156274565006125136">"მოქმედება მხარდაჭერილი არ არის"</string>
+    <string name="error" msgid="6539615832923362301">"ეს მოქმედება ამჟამად მხარდაუჭერელია."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-kk-rKZ/strings.xml
similarity index 69%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-kk-rKZ/strings.xml
index c699f25..1560741 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-kk-rKZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Резервтік күй"</string>
+    <string name="title" msgid="8156274565006125136">"Әрекетке қолдау көрсетілмейді"</string>
+    <string name="error" msgid="6539615832923362301">"Бұл әрекетке қазірше қолдау көрсетілмейді."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-km-rKH/strings.xml
similarity index 72%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-km-rKH/strings.xml
index c699f25..a442335 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-km-rKH/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"សកម្មភាព​មិន​បាន​គាំទ្រ"</string>
+    <string name="error" msgid="6539615832923362301">"បច្ចុប្បន្ន​សកម្មភាព​នោះ​មិន​ត្រូវ​បាន​គាំទ្រ​ទេ។"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-kn-rIN/strings.xml
similarity index 75%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-kn-rIN/strings.xml
index c699f25..f4f8e1c 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-kn-rIN/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"ಬೆಂಬಲವಿಲ್ಲದಿರುವ ಕ್ರಮ"</string>
+    <string name="error" msgid="6539615832923362301">"ಆ ಕ್ರಮವನ್ನು ಪ್ರಸ್ತುತ ಬೆಂಬಲಿಸುತ್ತಿಲ್ಲ."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-lo-rLA/strings.xml
similarity index 75%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-lo-rLA/strings.xml
index c699f25..948b60f 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-lo-rLA/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"ການເຮັດວຽກທີ່ບໍ່ຮອງຮັບ"</string>
+    <string name="error" msgid="6539615832923362301">"ການເຮັດວຽກນັ້ນຍັງບໍ່ຮອງຮັບເທື່ອ"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-mk-rMK/strings.xml
similarity index 71%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-mk-rMK/strings.xml
index c699f25..c8046b5 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-mk-rMK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Резервен план"</string>
+    <string name="title" msgid="8156274565006125136">"Неподдржано дејство"</string>
+    <string name="error" msgid="6539615832923362301">"Тоа дејство не е поддржано во моментов."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-ml-rIN/strings.xml
similarity index 65%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-ml-rIN/strings.xml
index c699f25..0161ee5 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-ml-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"ഫാൾബാക്ക്"</string>
+    <string name="title" msgid="8156274565006125136">"പിന്തുണയ്‌ക്കാത്ത പ്രവർത്തനം"</string>
+    <string name="error" msgid="6539615832923362301">"ആ പ്രവർത്തനം നിലവിൽ പിന്തുണയ്‌ക്കുന്നില്ല."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-mn-rMN/strings.xml
similarity index 79%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-mn-rMN/strings.xml
index c699f25..8cb3870 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-mn-rMN/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"Дэмжигдээгүй үйлдэл"</string>
+    <string name="error" msgid="6539615832923362301">"Энэ үйлдэл одоогоор дэмжигдээгүй."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-mr-rIN/strings.xml
similarity index 70%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-mr-rIN/strings.xml
index c699f25..525a71d 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-mr-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"फॉलबॅक"</string>
+    <string name="title" msgid="8156274565006125136">"असमर्थित क्रिया"</string>
+    <string name="error" msgid="6539615832923362301">"ती क्रिया सध्या समर्थित नाही."</string>
 </resources>
diff --git a/apps/Fallback/res/values-ms/strings.xml b/apps/Fallback/res/values-ms-rMY/strings.xml
similarity index 100%
rename from apps/Fallback/res/values-ms/strings.xml
rename to apps/Fallback/res/values-ms-rMY/strings.xml
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-my-rMM/strings.xml
similarity index 66%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-my-rMM/strings.xml
index c699f25..ce22ef5 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-my-rMM/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"နောက်ပြန်ဆုတ်"</string>
+    <string name="title" msgid="8156274565006125136">"ပံ့ပိုးမထားသော လုပ်ဆောင်ချက်"</string>
+    <string name="error" msgid="6539615832923362301">"ထို လုပ်ဆောင်ချက်ကို ပံ့ပိုးမထား"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-ne-rNP/strings.xml
similarity index 78%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-ne-rNP/strings.xml
index c699f25..7d27eff 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-ne-rNP/strings.xml
@@ -17,6 +17,6 @@
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="title" msgid="8156274565006125136">"असमर्थित कार्य"</string>
+    <string name="error" msgid="6539615832923362301">"यस कारवाही हाल समर्थित छैन।"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-si-rLK/strings.xml
similarity index 69%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-si-rLK/strings.xml
index c699f25..8a7e7a5 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-si-rLK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"පසු බැසීම"</string>
+    <string name="title" msgid="8156274565006125136">"සහය නොදක්වන ක්‍රියාව"</string>
+    <string name="error" msgid="6539615832923362301">"එම ක්‍රියාවට දැන් සහය නොදක්වයි."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-ta-rIN/strings.xml
similarity index 67%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-ta-rIN/strings.xml
index c699f25..f46c13b 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-ta-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"ஃபால்பேக்"</string>
+    <string name="title" msgid="8156274565006125136">"ஆதரிக்கப்படாத செயல்"</string>
+    <string name="error" msgid="6539615832923362301">"கோரப்பட்ட செயல் தற்போது ஆதரிக்கப்படவில்லை."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-te-rIN/strings.xml
similarity index 69%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-te-rIN/strings.xml
index c699f25..843bf8f 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-te-rIN/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"ఫాల్‌బ్యాక్"</string>
+    <string name="title" msgid="8156274565006125136">"మద్దతు లేని చర్య"</string>
+    <string name="error" msgid="6539615832923362301">"ఆ చర్యకు ప్రస్తుతం మద్దతు లేదు."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-ur-rPK/strings.xml
similarity index 71%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-ur-rPK/strings.xml
index c699f25..d193c94 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-ur-rPK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"فال بیک"</string>
+    <string name="title" msgid="8156274565006125136">"غیر تعاون یافتہ کارروائی"</string>
+    <string name="error" msgid="6539615832923362301">"وہ کارروائی فی الحال تعاون یافتہ نہیں ہے۔"</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-uz-rUZ/strings.xml
similarity index 73%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-uz-rUZ/strings.xml
index c699f25..198acd8 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-uz-rUZ/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"Zaxiradagi rejim"</string>
+    <string name="title" msgid="8156274565006125136">"Qo‘llab-quvvatlanmaydigan harakat"</string>
+    <string name="error" msgid="6539615832923362301">"Ushbu harakat hozirda qo‘llab-quvvatlanmaydi."</string>
 </resources>
diff --git a/apps/Fallback/res/values-rm/strings.xml b/apps/Fallback/res/values-zh-rHK/strings.xml
similarity index 74%
copy from apps/Fallback/res/values-rm/strings.xml
copy to apps/Fallback/res/values-zh-rHK/strings.xml
index c699f25..ce01c92 100644
--- a/apps/Fallback/res/values-rm/strings.xml
+++ b/apps/Fallback/res/values-zh-rHK/strings.xml
@@ -16,7 +16,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="appTitle" msgid="161410001913116606">"Fallback"</string>
-    <string name="title" msgid="8156274565006125136">"Acziun betg sustegnida"</string>
-    <string name="error" msgid="6539615832923362301">"Questa acziun na vegn actualmain betg sustegnida."</string>
+    <string name="appTitle" msgid="161410001913116606">"後備"</string>
+    <string name="title" msgid="8156274565006125136">"不支援的操作"</string>
+    <string name="error" msgid="6539615832923362301">"目前不支援該操作。"</string>
 </resources>
diff --git a/build/Android.mk b/build/Android.mk
index 117e3e0..04d4dca 100644
--- a/build/Android.mk
+++ b/build/Android.mk
@@ -1,3 +1,5 @@
+LOCAL_PATH := $(call my-dir)
+
 # ===== SDK source.property files =====
 
 # Add all files to be generated from the source.prop templates to the SDK pre-requisites
@@ -52,53 +54,11 @@
 		$< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
 
 
-# ===== Android Support/Compatibility Library =====
-
-LOCAL_PATH := $(call my-dir)
-
-# The source files for this library are _all_ generated, something we don't do
-# anywhere else, and the rules don't support.  Aditionally, the depenencies on
-# these files don't really matter, because they are all generated as part of
-# building the docs.  So for the dependency, we just use the
-# api-stubs-timestamp file, which is the $@ of the droiddoc rule.
-# We also need to depend on framework-res.apk, in order to pull the
-# resource files out of there for aapt.
-#
-# Normally the package rule runs aapt, which includes the resource,
-# but we're not running that in our package rule so just copy in the
-# resource files here.
-intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_stubs_current_intermediates
-full_target := $(intermediates)/classes.jar
-src_dir := $(intermediates)/src
-classes_dir := $(intermediates)/classes
-framework_res_package := $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
-
-$(full_target): PRIVATE_SRC_DIR := $(src_dir)
-$(full_target): PRIVATE_INTERMEDIATES_DIR := $(intermediates)
-$(full_target): PRIVATE_CLASS_INTERMEDIATES_DIR := $(classes_dir)
-$(full_target): PRIVATE_FRAMEWORK_RES_PACKAGE := $(framework_res_package)
-
-$(full_target): $(OUT_DOCS)/api-stubs-timestamp $(framework_res_package)
-	@echo Compiling SDK Stubs: $@
-	$(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) find $(PRIVATE_SRC_DIR) -name "*.java" > \
-        $(PRIVATE_INTERMEDIATES_DIR)/java-source-list
-	$(hide) $(TARGET_JAVAC) -encoding ascii -bootclasspath "" \
-			-g $(xlint_unchecked) \
-			-extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \
-			\@$(PRIVATE_INTERMEDIATES_DIR)/java-source-list \
-		|| ( rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) ; exit 41 )
-	$(hide) if [ ! -f $(PRIVATE_FRAMEWORK_RES_PACKAGE) ]; then \
-		echo Missing file $(PRIVATE_FRAMEWORK_RES_PACKAGE); \
-		rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR); \
-		exit 1; \
-	fi;
-	$(hide) unzip -qo $(PRIVATE_FRAMEWORK_RES_PACKAGE) -d $(PRIVATE_CLASS_INTERMEDIATES_DIR)
-	$(hide) (cd $(PRIVATE_CLASS_INTERMEDIATES_DIR) && rm -rf classes.dex META-INF)
-	$(hide) mkdir -p $(dir $@)
-	$(hide) jar -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .
-	$(hide) jar -u0f $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) resources.arsc
+# ===== SDK jar file of stubs =====
+# A.k.a the "current" version of the public SDK (android.jar inside the SDK package).
+sdk_stub_name := android_stubs_current
+stub_timestamp := $(OUT_DOCS)/api-stubs-timestamp
+include $(LOCAL_PATH)/build_android_stubs.mk
 
 .PHONY: android_stubs
 android_stubs: $(full_target)
@@ -110,7 +70,7 @@
 $(dir $(full_target))javalib.jar: $(full_target)
 	$(hide)$(ACP) $< $@
 
-
+# android.jar is what we put in the SDK package.
 android_jar_intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/android_jar_intermediates
 android_jar_full_target := $(android_jar_intermediates)/android.jar
 
@@ -121,6 +81,8 @@
 
 ALL_SDK_FILES += $(android_jar_full_target)
 
+# ====================================================
+
 # The uiautomator stubs
 ALL_SDK_FILES += $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/android_uiautomator_intermediates/javalib.jar
 
@@ -141,12 +103,16 @@
 ANDROID_SUPPORT_LIBRARIES := \
     android-support-annotations \
     android-support-v4 \
-    android-support-v7-gridlayout \
     android-support-v7-appcompat \
+    android-support-v7-cardview \
+    android-support-v7-gridlayout \
     android-support-v7-mediarouter \
+    android-support-v7-palette \
     android-support-v7-recyclerview \
     android-support-v13 \
-    android-support-v17-leanback
+    android-support-v17-leanback \
+    android-support-multidex \
+    android-support-multidex-instrumentation
 
 $(foreach lib, $(ANDROID_SUPPORT_LIBRARIES), $(eval $(call _package_sdk_library,$(lib))))
 
@@ -171,3 +137,13 @@
 	  $@
 
 
+# ============ System SDK ============
+sdk_stub_name := android_system_stubs_current
+stub_timestamp := $(OUT_DOCS)/system-api-stubs-timestamp
+include $(LOCAL_PATH)/build_android_stubs.mk
+
+.PHONY: android_system_stubs
+android_system_stubs: $(full_target)
+
+# Build and store the android_system.jar.
+$(call dist-for-goals,sdk win_sdk,$(full_target):android_system.jar)
diff --git a/build/build_android_stubs.mk b/build/build_android_stubs.mk
new file mode 100644
index 0000000..a028900
--- /dev/null
+++ b/build/build_android_stubs.mk
@@ -0,0 +1,51 @@
+# Build an SDK jar file out of the generated stubs
+# Input variable:
+#   sdk_stub_name: the name of the SDK stubs; the stub source code should have been generated to
+#                  $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(sdk_stub_name)_intermediates.
+#   stub_timestamp: the timestamp file we use as dependency of the generated source.
+# Output variable:
+#   full_target: the built classes.jar
+
+# The source files for this library are _all_ generated, something we don't do
+# anywhere else, and the rules don't support.  Aditionally, the depenencies on
+# these files don't really matter, because they are all generated as part of
+# building the docs.  So for the dependency, we just use the
+# api-stubs-timestamp file, which is the $@ of the droiddoc rule.
+# We also need to depend on framework-res.apk, in order to pull the
+# resource files out of there for aapt.
+#
+# Normally the package rule runs aapt, which includes the resource,
+# but we're not running that in our package rule so just copy in the
+# resource files here.
+intermediates := $(TARGET_OUT_COMMON_INTERMEDIATES)/JAVA_LIBRARIES/$(sdk_stub_name)_intermediates
+full_target := $(intermediates)/classes.jar
+src_dir := $(intermediates)/src
+classes_dir := $(intermediates)/classes
+framework_res_package := $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
+
+$(full_target): PRIVATE_SRC_DIR := $(src_dir)
+$(full_target): PRIVATE_INTERMEDIATES_DIR := $(intermediates)
+$(full_target): PRIVATE_CLASS_INTERMEDIATES_DIR := $(classes_dir)
+$(full_target): PRIVATE_FRAMEWORK_RES_PACKAGE := $(framework_res_package)
+
+$(full_target): $(stub_timestamp) $(framework_res_package)
+	@echo Compiling SDK Stubs: $@
+	$(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR)
+	$(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR)
+	$(hide) find $(PRIVATE_SRC_DIR) -name "*.java" > \
+        $(PRIVATE_INTERMEDIATES_DIR)/java-source-list
+	$(hide) $(TARGET_JAVAC) -encoding ascii -bootclasspath "" \
+			-g $(xlint_unchecked) \
+			-extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \
+			\@$(PRIVATE_INTERMEDIATES_DIR)/java-source-list \
+		|| ( rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) ; exit 41 )
+	$(hide) if [ ! -f $(PRIVATE_FRAMEWORK_RES_PACKAGE) ]; then \
+		echo Missing file $(PRIVATE_FRAMEWORK_RES_PACKAGE); \
+		rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR); \
+		exit 1; \
+	fi;
+	$(hide) unzip -qo $(PRIVATE_FRAMEWORK_RES_PACKAGE) -d $(PRIVATE_CLASS_INTERMEDIATES_DIR)
+	$(hide) (cd $(PRIVATE_CLASS_INTERMEDIATES_DIR) && rm -rf classes.dex META-INF)
+	$(hide) mkdir -p $(dir $@)
+	$(hide) jar -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .
+	$(hide) jar -u0f $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) resources.arsc
diff --git a/build/product_sdk.mk b/build/product_sdk.mk
index 66e1eee..7aba4ee 100644
--- a/build/product_sdk.mk
+++ b/build/product_sdk.mk
@@ -43,4 +43,5 @@
 	layoutlib \
 	layoutlib-tests \
 	llvm-rs-cc \
+	sqlite3 \
 	vgabios-cirrus.bin
diff --git a/build/sdk-android-armeabi-v7a.atree b/build/sdk-android-armeabi-v7a.atree
index 97dceda..24ea06a 100644
--- a/build/sdk-android-armeabi-v7a.atree
+++ b/build/sdk-android-armeabi-v7a.atree
@@ -19,3 +19,6 @@
 
 # version files for the SDK updater, from development.git
 ${HOST_OUT}/development/sys-img-${TARGET_CPU_ABI}/images_armeabi-v7a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
+
+# custom hardware.ini for 32 bit images
+development/sys-img/images_armeabi-v7a_hardware.ini    system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/hardware.ini
diff --git a/build/sdk-windows-x86.atree b/build/sdk-windows-x86.atree
index f2ab985..a040723 100644
--- a/build/sdk-windows-x86.atree
+++ b/build/sdk-windows-x86.atree
@@ -37,6 +37,19 @@
 bin/AdbWinUsbApi.dll                          platform-tools/AdbWinUsbApi.dll
 bin/AdbWinApi.dll                             platform-tools/AdbWinApi.dll
 
+rm platform-tools/sqlite3
+bin/sqlite3.exe                        strip platform-tools/sqlite3.exe
+
+rm platform-tools/dmtracedump
+bin/dmtracedump.exe                    strip platform-tools/dmtracedump.exe
+
+rm platform-tools/hprof-conv
+bin/hprof-conv.exe                     strip platform-tools/hprof-conv.exe
+
+rm platform-tools/etc1tool
+bin/etc1tool.exe                       strip platform-tools/etc1tool.exe
+
+
 
 ##############################################################################
 # Build Tools Component
@@ -59,27 +72,40 @@
 rm build-tools/${PLATFORM_NAME}/dexdump
 bin/dexdump.exe                         strip build-tools/${PLATFORM_NAME}/dexdump.exe
 
+# delete linux rs/bcc files
+rm build-tools/${PLATFORM_NAME}/llvm-rs-cc
+rm build-tools/${PLATFORM_NAME}/libLLVM.so
+rm build-tools/${PLATFORM_NAME}/libclang.so
+rm build-tools/${PLATFORM_NAME}/libbcc.so
+rm build-tools/${PLATFORM_NAME}/libbcinfo.so
+rm build-tools/${PLATFORM_NAME}/bcc_compat
+
 ###RM(2014-05-02) Temporarily disable rs/bcc for the Windows SDK as we fix cross-compilation issues
-###rm build-tools/${PLATFORM_NAME}/llvm-rs-cc
 ###bin/llvm-rs-cc.exe                      strip build-tools/${PLATFORM_NAME}/llvm-rs-cc.exe
 ###
-###rm build-tools/${PLATFORM_NAME}/libLLVM.so
 ###lib/libLLVM.dll                         strip build-tools/${PLATFORM_NAME}/libLLVM.dll
 ###
-###rm build-tools/${PLATFORM_NAME}/libclang.so
 ###lib/libclang.dll                        strip build-tools/${PLATFORM_NAME}/libclang.dll
 ###
 ####bcc not yet compiled on windows
 ###
-###rm build-tools/${PLATFORM_NAME}/libbcc.so
 ###lib/libbcc.dll                          strip build-tools/${PLATFORM_NAME}/libbcc.dll
 ###
-###rm build-tools/${PLATFORM_NAME}/libbcinfo.so
 ###lib/libbcinfo.dll                       strip build-tools/${PLATFORM_NAME}/libbcinfo.dll
 ###
-###rm build-tools/${PLATFORM_NAME}/bcc_compat
 ###bin/bcc_compat.exe                      strip build-tools/${PLATFORM_NAME}/bcc_compat.exe
 
+
+###XAV(2014-06-17) Temporarily get rs/bcc from a prebuilt.
+prebuilts/misc/windows/renderscript/llvm-rs-cc.exe     build-tools/${PLATFORM_NAME}/llvm-rs-cc.exe
+prebuilts/misc/windows/renderscript/libLLVM.dll        build-tools/${PLATFORM_NAME}/libLLVM.dll
+prebuilts/misc/windows/renderscript/libclang.dll       build-tools/${PLATFORM_NAME}/libclang.dll
+prebuilts/misc/windows/renderscript/libbcc.dll         build-tools/${PLATFORM_NAME}/libbcc.dll
+prebuilts/misc/windows/renderscript/libbcinfo.dll      build-tools/${PLATFORM_NAME}/libbcinfo.dll
+prebuilts/misc/windows/renderscript/bcc_compat.exe     build-tools/${PLATFORM_NAME}/bcc_compat.exe
+###
+
+
 rm build-tools/${PLATFORM_NAME}/arm-linux-androideabi-ld
 prebuilts/sdk/tools/windows/arm-linux-androideabi-ld.exe   strip build-tools/${PLATFORM_NAME}/arm-linux-androideabi-ld.exe
 
diff --git a/build/sdk.atree b/build/sdk.atree
index eb0d51b..0cab31f 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -44,6 +44,11 @@
 # host tools from out/host/$(HOST_OS)-$(HOST_ARCH)/
 bin/adb                                 strip platform-tools/adb
 bin/fastboot                            strip platform-tools/fastboot
+bin/sqlite3                             strip platform-tools/sqlite3
+bin/dmtracedump                         strip platform-tools/dmtracedump
+bin/etc1tool                            strip platform-tools/etc1tool
+bin/hprof-conv                          strip platform-tools/hprof-conv
+
 
 # API database for tools such as lint
 development/sdk/generated-api-versions.xml    platform-tools/api/api-versions.xml
@@ -170,7 +175,7 @@
 docs/features.txt                         platforms/${PLATFORM_NAME}/data/features.txt
 
 # fonts for layoutlib.
-${FONT_OUT}                               platforms/${PLATFORM_NAME}/data/fonts
+${FONT_OUT}                       platforms/${PLATFORM_NAME}/data/fonts
 
 # NOTICE files are copied by build/core/Makefile from sdk.git
 development/sdk/sdk_files_NOTICE.txt      platforms/${PLATFORM_NAME}/templates/NOTICE.txt
@@ -269,6 +274,17 @@
 developers/build/prebuilts/gradle/SwipeRefreshListFragment                   samples/${PLATFORM_NAME}/ui/SwipeRefreshListFragment
 developers/build/prebuilts/gradle/SwipeRefreshMultipleViews                  samples/${PLATFORM_NAME}/ui/SwipeRefreshMultipleViews
 developers/build/prebuilts/gradle/MediaRouter                                samples/${PLATFORM_NAME}/media/MediaRouter
+developers/build/prebuilts/gradle/BasicManagedProfile                        samples/${PLATFORM_NAME}/admin/BasicManagedProfile
+developers/build/prebuilts/gradle/Camera2Basic                               samples/${PLATFORM_NAME}/media/Camera2Basic
+developers/build/prebuilts/gradle/Camera2Video                               samples/${PLATFORM_NAME}/media/Camera2Video
+developers/build/prebuilts/gradle/ActivitySceneTransitionBasic               samples/${PLATFORM_NAME}/ui/activityscenetransition/ActivitySceneTransitionBasic
+developers/build/prebuilts/gradle/NavigationDrawer                           samples/${PLATFORM_NAME}/ui/views/NavigationDrawer
+developers/build/prebuilts/gradle/ElevationBasic                             samples/${PLATFORM_NAME}/ui/views/Elevation/ElevationBasic
+developers/build/prebuilts/gradle/ElevationDrag                              samples/${PLATFORM_NAME}/ui/views/Elevation/ElevationDrag
+developers/build/prebuilts/gradle/ClippingBasic                              samples/${PLATFORM_NAME}/ui/views/Clipping/ClippingBasic
+developers/build/prebuilts/gradle/JobScheduler                               samples/${PLATFORM_NAME}/ui/views/Clipping/ClippingBasic
+
+developers/build/prebuilts/androidtv                                         samples/${PLATFORM_NAME}/androidtv
 
 # Wearable sample tree
 development/samples/wearable/AgendaData                    samples/${PLATFORM_NAME}/wearable/AgendaData
@@ -388,6 +404,25 @@
 ${OUT_DIR}/target/common/obj/PACKAGING/android-support-v7-appcompat_intermediates/android-support-v7-appcompat.jar    extras/android/support/v7/appcompat/libs/android-support-v7-appcompat.jar
 ${OUT_DIR}/target/common/obj/PACKAGING/android-support-v4_intermediates/android-support-v4.jar                        extras/android/support/v7/appcompat/libs/android-support-v4.jar
 
+frameworks/multidex/library/README.txt                                                            extras/android/support/multidex/library/README.txt
+frameworks/multidex/library/.project                                                              extras/android/support/multidex/library/.project
+frameworks/multidex/library/.classpath                                                            extras/android/support/multidex/library/.classpath
+frameworks/multidex/library/AndroidManifest.xml                                                   extras/android/support/multidex/library/AndroidManifest.xml
+frameworks/multidex/library/project.properties                                                    extras/android/support/multidex/library/project.properties
+frameworks/multidex/library/src/.readme                                                           extras/android/support/multidex/library/src/.readme
+frameworks/multidex/library/res/.readme                                                           extras/android/support/multidex/library/res/.readme
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-multidex_intermediates/android-support-multidex.jar              extras/android/support/multidex/library/libs/android-support-multidex.jar
+
+frameworks/multidex/instrumentation/README.txt                                                         extras/android/support/multidex/instrumentation/README.txt
+frameworks/multidex/instrumentation/.project                                                           extras/android/support/multidex/instrumentation/.project
+frameworks/multidex/instrumentation/.classpath                                                         extras/android/support/multidex/instrumentation/.classpath
+frameworks/multidex/instrumentation/AndroidManifest.xml                                                extras/android/support/multidex/instrumentation/AndroidManifest.xml
+frameworks/multidex/instrumentation/project.properties                                                 extras/android/support/multidex/instrumentation/project.properties
+frameworks/multidex/instrumentation/src/.readme                                                        extras/android/support/multidex/instrumentation/src/.readme
+frameworks/multidex/instrumentation/res/.readme                                                        extras/android/support/multidex/instrumentation/res/.readme
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-multidex-instrumentation_intermediates/android-support-multidex-instrumentation.jar      extras/android/support/multidex/instrumentation/libs/android-support-multidex-instrumentation.jar
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-multidex_intermediates/android-support-multidex.jar                                      extras/android/support/multidex/instrumentation/libs/android-support-multidex.jar
+
 frameworks/support/v7/mediarouter/README.txt                                                       extras/android/support/v7/mediarouter/README.txt
 frameworks/support/v7/mediarouter/.project                                                         extras/android/support/v7/mediarouter/.project
 frameworks/support/v7/mediarouter/.classpath                                                       extras/android/support/v7/mediarouter/.classpath
@@ -399,10 +434,36 @@
 
 development/samples/Support7Demos                                                                 extras/android/support/samples/Support7Demos
 
+frameworks/support/v7/palette/README.txt                                                          extras/android/support/v7/palette/README.txt
+frameworks/support/v7/palette/.project                                                            extras/android/support/v7/palette/.project
+frameworks/support/v7/palette/.classpath                                                          extras/android/support/v7/palette/.classpath
+frameworks/support/v7/palette/AndroidManifest.xml                                                 extras/android/support/v7/palette/AndroidManifest.xml
+frameworks/support/v7/palette/project.properties                                                  extras/android/support/v7/palette/project.properties
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-v7-palette_intermediates/android-support-v7-palette.jar    extras/android/support/v7/palette/libs/android-support-v7-palette.jar
+
+frameworks/support/v7/cardview/AndroidManifest.xml                                              extras/android/support/v7/cardview/AndroidManifest.xml
+frameworks/support/v7/cardview/res                                                              extras/android/support/v7/cardview/res
+frameworks/support/v7/cardview/src/.readme                                                      extras/android/support/v7/cardview/src/.readme
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-v7-cardview_intermediates/android-support-v7-cardview.jar    extras/android/support/v7/cardview/libs/android-support-v7-cardview.jar
+
+
+# TODO: add .project, .classpath, etc.
+frameworks/support/v7/recyclerview/README.txt                                                     extras/android/support/v7/recyclerview/README.txt
+frameworks/support/v7/recyclerview/AndroidManifest.xml                                            extras/android/support/v7/recyclerview/AndroidManifest.xml
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-v7-recyclerview_intermediates/android-support-v7-recyclerview.jar    extras/android/support/v7/recyclerview/libs/android-support-v7-recyclerview.jar
+
+frameworks/support/v17/leanback/README.txt                                                        extras/android/support/v17/leanback/README.txt
+frameworks/support/v17/leanback/.project                                                          extras/android/support/v17/leanback/.project
+frameworks/support/v17/leanback/.classpath                                                        extras/android/support/v17/leanback/.classpath
+frameworks/support/v17/leanback/AndroidManifest.xml                                               extras/android/support/v17/leanback/AndroidManifest.xml
+frameworks/support/v17/leanback/project.properties                                                extras/android/support/v17/leanback/project.properties
+frameworks/support/v17/leanback/res                                                               extras/android/support/v17/leanback/res
+frameworks/support/v17/leanback/src/.readme                                                       extras/android/support/v17/leanback/src/.readme
+${OUT_DIR}/target/common/obj/PACKAGING/android-support-v17-leanback_intermediates/android-support-v17-leanback.jar    extras/android/support/v17/leanback/libs/android-support-v17-leanback.jar
+
 ##############################################################################
 # Tests Component
 ##############################################################################
 framework/layoutlib-tests.jar tests/libtests/layoutlib-tests.jar
-system/app/ConnectivityTest.apk tests/emulator-test-apps/ConnectivityTest.apk
-system/app/GpsLocationTest.apk tests/emulator-test-apps/GpsLocationTest.apk
+system/app/EmulatorSmokeTests/EmulatorSmokeTests.apk tests/emulator-test-apps/EmulatorSmokeTests.apk
 
diff --git a/build/windows_sdk_whitelist.mk b/build/windows_sdk_whitelist.mk
index e175fad..dfeaf3a 100644
--- a/build/windows_sdk_whitelist.mk
+++ b/build/windows_sdk_whitelist.mk
@@ -47,10 +47,12 @@
 	external/llvm \
 	external/sqlite/dist \
 	external/zlib \
+	external/zopfli \
 	frameworks/base \
 	frameworks/compile \
 	frameworks/native \
 	frameworks/rs \
+	frameworks/tools \
 	system/core/adb \
 	system/core/fastboot \
 	system/core/libcutils \
diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
index a2655e1..dfcb4b0 100644
--- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java
+++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
@@ -1150,6 +1150,7 @@
             if (ev != null) {
                 int injectCode = ev.injectEvent(mWm, mAm, mVerbose);
                 if (injectCode == MonkeyEvent.INJECT_FAIL) {
+                    System.out.println("    // Injection Failed");
                     if (ev instanceof MonkeyKeyEvent) {
                         mDroppedKeyEvents++;
                     } else if (ev instanceof MonkeyMotionEvent) {
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
index a7f538d..af6a231 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
@@ -436,6 +436,7 @@
 
             if (lastKey != KeyEvent.KEYCODE_POWER
                     && lastKey != KeyEvent.KEYCODE_ENDCALL
+                    && lastKey != KeyEvent.KEYCODE_SLEEP
                     && PHYSICAL_KEY_EXISTS[lastKey]) {
                 break;
             }
diff --git a/ide/eclipse/.classpath b/ide/eclipse/.classpath
index 0b21bb2..2c5a688 100644
--- a/ide/eclipse/.classpath
+++ b/ide/eclipse/.classpath
@@ -8,39 +8,30 @@
 	<classpathentry kind="src" path="packages/apps/CertInstaller/src"/>
 	<classpathentry kind="src" path="packages/apps/Contacts/src"/>
 	<classpathentry kind="src" path="packages/apps/ContactsCommon/src"/>
-	<classpathentry kind="src" path="packages/apps/DeskClock/src"/>
 	<classpathentry kind="src" path="packages/apps/Dialer/src"/>
 	<classpathentry kind="src" path="packages/apps/Email/src"/>
 	<classpathentry kind="src" path="packages/apps/Email/emailcommon/src"/>
-	<classpathentry kind="src" path="packages/apps/Gallery2/src"/>
-	<classpathentry kind="src" path="packages/apps/Gallery2/src_pd"/>
-	<classpathentry kind="src" path="packages/apps/Gallery2/gallerycommon/src"/>
 	<classpathentry kind="src" path="packages/apps/HTMLViewer/src"/>
 	<classpathentry kind="src" path="packages/apps/InCallUI/src"/>
 	<classpathentry kind="src" path="packages/apps/Launcher2/src"/>
 	<classpathentry kind="src" path="packages/apps/Mms/src"/>
-	<classpathentry kind="src" path="packages/apps/Nfc/src"/>
-	<classpathentry kind="src" path="packages/apps/Nfc/nci/src"/>
 	<classpathentry kind="src" path="packages/apps/PackageInstaller/src"/>
-	<classpathentry kind="src" path="packages/apps/Phone/src"/>
 	<classpathentry kind="src" path="packages/apps/PhoneCommon/src"/>
 	<classpathentry kind="src" path="packages/apps/QuickSearchBox/src"/>
 	<classpathentry kind="src" path="packages/apps/Provision/src"/>
 	<classpathentry kind="src" path="packages/apps/Settings/src"/>
-	<classpathentry kind="src" path="packages/apps/SoundRecorder/src"/>
-	<classpathentry kind="src" path="packages/apps/Stk/src"/>
+	<classpathentry kind="src" path="packages/apps/UnifiedEmail/src"/>
 	<classpathentry kind="src" path="packages/apps/VoiceDialer/src"/>
 	<classpathentry kind="src" path="packages/providers/CalendarProvider/src"/>
 	<classpathentry kind="src" path="packages/providers/ContactsProvider/src"/>
 	<classpathentry kind="src" path="packages/providers/DownloadProvider/src"/>
-	<classpathentry kind="src" path="packages/providers/DrmProvider/src"/>
 	<classpathentry kind="src" path="packages/providers/MediaProvider/src"/>
 	<classpathentry kind="src" path="packages/providers/TelephonyProvider/src"/>
-	<classpathentry kind="src" path="packages/screensavers/Basic/src"/>
-	<classpathentry kind="src" path="packages/screensavers/PhotoTable/src"/>
-	<classpathentry kind="src" path="packages/screensavers/WebView/src"/>
+	<classpathentry kind="src" path="packages/services/Telecomm/src"/>
+	<classpathentry kind="src" path="packages/services/Telecomm/tests/src"/>
 	<classpathentry kind="src" path="packages/services/Telephony/src"/>
 	<classpathentry kind="src" path="packages/services/Telephony/common/src"/>
+	<classpathentry kind="src" path="packages/services/Telephony/tests/src"/>
 	<classpathentry kind="src" path="frameworks/base/cmds/am/src"/>
 	<classpathentry kind="src" path="frameworks/base/cmds/input/src"/>
 	<classpathentry kind="src" path="frameworks/base/cmds/pm/src"/>
@@ -48,7 +39,6 @@
 	<classpathentry kind="src" path="frameworks/base/core/java"/>
 	<classpathentry kind="src" path="frameworks/base/drm/java"/>
 	<classpathentry kind="src" path="frameworks/base/graphics/java"/>
-	<classpathentry kind="src" path="frameworks/base/icu4j/java"/>
 	<classpathentry kind="src" path="frameworks/base/keystore/java"/>
 	<classpathentry kind="src" path="frameworks/base/location/java"/>
 	<classpathentry kind="src" path="frameworks/base/location/lib/java"/>
@@ -61,50 +51,46 @@
 	<classpathentry kind="src" path="frameworks/base/obex"/>
 	<classpathentry kind="src" path="frameworks/base/opengl/java"/>
 	<classpathentry kind="src" path="frameworks/base/packages/FusedLocation/src"/>
+	<classpathentry kind="src" path="frameworks/base/packages/Keyguard/src"/>
 	<classpathentry kind="src" path="frameworks/base/packages/SettingsProvider/src"/>
 	<classpathentry kind="src" path="frameworks/base/packages/SystemUI/src"/>
+	<classpathentry kind="src" path="frameworks/base/phone/java"/>
 	<classpathentry kind="src" path="frameworks/base/policy/src"/>
+	<classpathentry kind="src" path="frameworks/base/rs/java"/>
 	<classpathentry kind="src" path="frameworks/base/sax/java"/>
 	<classpathentry kind="src" path="frameworks/base/services/core/java"/>
-        <classpathentry kind="src" path="frameworks/base/services/accessibility/java"/>
-        <classpathentry kind="src" path="frameworks/base/services/print/java"/>
-        <classpathentry kind="src" path="frameworks/base/services/backup/java"/>
-        <classpathentry kind="src" path="frameworks/base/services/devicepolicy/java"/>
-        <classpathentry kind="src" path="frameworks/base/services/appwidget/java"/>
+	<classpathentry kind="src" path="frameworks/base/services/accessibility/java"/>
+	<classpathentry kind="src" path="frameworks/base/services/print/java"/>
+	<classpathentry kind="src" path="frameworks/base/services/backup/java"/>
+	<classpathentry kind="src" path="frameworks/base/services/devicepolicy/java"/>
+	<classpathentry kind="src" path="frameworks/base/services/appwidget/java"/>
+	<classpathentry kind="src" path="frameworks/base/telecomm/java"/>
 	<classpathentry kind="src" path="frameworks/base/telephony/java"/>
 	<classpathentry kind="src" path="frameworks/base/test-runner/src"/>
 	<classpathentry kind="src" path="frameworks/base/wifi/java"/>
-	<classpathentry kind="src" path="frameworks/ex/carousel/java"/>
 	<classpathentry kind="src" path="frameworks/ex/camera2/public/src"/>
-	<classpathentry kind="src" path="frameworks/ex/chips/src"/>
 	<classpathentry kind="src" path="frameworks/ex/common/java"/>
-	<classpathentry kind="src" path="frameworks/ex/photoviewer/src"/>
 	<classpathentry kind="src" path="frameworks/ex/variablespeed/src"/>
 	<classpathentry kind="src" path="frameworks/opt/calendar/src"/>
-	<classpathentry kind="src" path="frameworks/opt/telephony/src/java"/>
+	<classpathentry kind="src" path="frameworks/opt/chips/src"/>
+	<classpathentry kind="src" path="frameworks/opt/colorpicker/src"/>
+	<classpathentry kind="src" path="frameworks/opt/datetimepicker/src"/>
 	<classpathentry kind="src" path="frameworks/opt/mms/src/java"/>
+	<classpathentry kind="src" path="frameworks/opt/net/ims/src/java"/>
 	<classpathentry kind="src" path="frameworks/opt/net/voip/src/java"/>
+	<classpathentry kind="src" path="frameworks/opt/net/wifi/service/java"/>
+	<classpathentry kind="src" path="frameworks/opt/photoviewer/activity/src"/>
+	<classpathentry kind="src" path="frameworks/opt/photoviewer/src"/>
+	<classpathentry kind="src" path="frameworks/opt/setupwizard/navigationbar/src"/>
+	<classpathentry kind="src" path="frameworks/opt/telephony/src/java"/>
+	<classpathentry kind="src" path="frameworks/opt/timezonepicker/src"/>
 	<classpathentry kind="src" path="frameworks/opt/vcard/java"/>
-	<classpathentry kind="src" path="frameworks/support/renderscript/v8/java/src"/>
 	<classpathentry kind="src" path="frameworks/support/v13/java"/>
 	<classpathentry kind="src" path="frameworks/support/v13/ics"/>
 	<classpathentry kind="src" path="frameworks/support/v13/ics-mr1"/>
-	<classpathentry kind="src" path="development/samples/ApiDemos/src"/>
-	<classpathentry kind="src" path="development/samples/ApiDemos/tests/src"/>
-	<classpathentry kind="src" path="development/samples/Compass/src"/>
-	<classpathentry kind="src" path="development/samples/HelloActivity/src"/>
-	<classpathentry kind="src" path="development/samples/HelloActivity/tests/src"/>
-	<classpathentry kind="src" path="development/samples/Home/src"/>
-	<classpathentry kind="src" path="development/samples/LunarLander/src"/>
-	<classpathentry kind="src" path="development/samples/LunarLander/tests/src"/>
-	<classpathentry kind="src" path="development/samples/NotePad/src"/>
-	<classpathentry kind="src" path="development/samples/NotePad/tests/src"/>
-	<classpathentry kind="src" path="development/samples/RSSReader/src"/>
-	<classpathentry kind="src" path="development/samples/SkeletonApp/src"/>
-	<classpathentry kind="src" path="development/samples/SkeletonApp/tests/src"/>
-	<classpathentry kind="src" path="development/samples/Snake/src"/>
-	<classpathentry kind="src" path="development/samples/Snake/tests/src"/>
+	<classpathentry kind="src" path="frameworks/support/v7/palette/src"/>
 	<classpathentry kind="src" path="libcore/dalvik/src/main/java"/>
+	<classpathentry kind="src" path="libcore/dex/src/main/java"/>
 	<classpathentry kind="src" path="libcore/json/src/main/java"/>
 	<classpathentry kind="src" path="libcore/libart/src/main/java"/>
 	<classpathentry kind="src" path="libcore/luni/src/main/java"/>
@@ -113,43 +99,56 @@
 	<classpathentry kind="src" path="out/target/common/obj/APPS/Browser_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/CalendarProvider_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/ContactsProvider_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/APPS/Gallery2_intermediates/src/renderscript/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/MediaProvider_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/APPS/Music_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/APPS/Phone_intermediates/src/src"/>
+	<classpathentry kind="src" path="out/target/common/obj/APPS/PackageInstaller_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/QuickSearchBox_intermediates/src/src"/>
+	<classpathentry kind="src" path="out/target/common/obj/APPS/Settings_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/SystemUI_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/android-common-carousel_intermediates/src/renderscript/src"/>
+	<classpathentry kind="src" path="out/target/common/obj/APPS/TeleService_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/com.android.emailcommon_intermediates/src/src"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/com.android.services.telephony.common_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/core/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/keystore/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/location/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/media/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/packages/services/PacProcessor"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/packages/services/Proxy"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/telecomm/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/telephony/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework-base_intermediates/src/wifi/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/ims-common_intermediates/src/src/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/NfcLogTags_intermediates/src/src"/>
-	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/services_intermediates/src"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/services.core_intermediates/src/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/src/src/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/src/src/java"/>
 	<classpathentry kind="src" path="out/target/common/R"/>
-	<classpathentry kind="src" path="pdk/apps/TestingCamera2/src"/>
 	<classpathentry kind="src" path="external/apache-http/src"/>
 	<classpathentry kind="src" path="external/bouncycastle/bcprov/src/main/java"/>
+	<classpathentry kind="src" path="external/easymock/src"/>
 	<classpathentry kind="src" path="external/guava/guava/src"/>
 	<classpathentry kind="src" path="external/hamcrest/src"/>
 	<classpathentry kind="src" path="external/junit/src"/>
+	<classpathentry kind="src" path="external/ksoap2/kobjects"/>
+	<classpathentry kind="src" path="external/ksoap2/ksoap2-base/src/main/java"/>
+	<classpathentry kind="src" path="external/ksoap2/ksoap2-j2se/src/main/java"/>
 	<classpathentry kind="src" path="external/libphonenumber/java/src"/>
-	<classpathentry kind="src" path="external/mockito/src"/>
 	<classpathentry kind="src" path="external/mp4parser/isoparser/src/main/java"/>
 	<classpathentry kind="src" path="external/nist-sip/java"/>
+	<classpathentry kind="src" path="external/objenesis/main/src"/>
+	<classpathentry kind="src" path="external/owasp/sanitizer/src/main"/>
 	<classpathentry kind="src" path="external/tagsoup/src"/>
 	<classpathentry kind="src" path="external/xmp_toolkit/XMPCore/src"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/classes-jarjar.jar"/>
+	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/classes-jarjar.jar"/>
+	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes-jarjar.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar"/>
+	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/mockito-api_intermediates/javalib.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/android-support-v13_intermediates/javalib.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/android-common_intermediates/javalib.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.jar"/>
+	<classpathentry kind="lib" path="packages/apps/ContactsCommon/libs/geocoder-2.9.jar"/>
+	<classpathentry kind="lib" path="packages/apps/ContactsCommon/libs/libphonenumber-5.8.jar"/>
 	<classpathentry kind="lib" path="packages/apps/Calculator/arity-2.1.2.jar"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/junit-runner_intermediates/javalib.jar"/>
 	<classpathentry kind="output" path="out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes"/>
diff --git a/ide/eclipse/android-formatting.xml b/ide/eclipse/android-formatting.xml
index 9b43767..9c2af85 100644
--- a/ide/eclipse/android-formatting.xml
+++ b/ide/eclipse/android-formatting.xml
@@ -52,7 +52,7 @@
 <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
 <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
 <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
 <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
 <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
 <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
diff --git a/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-arm/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-arm64/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-mips/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-mips64/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-x86/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.functions.txt b/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.functions.txt
new file mode 100644
index 0000000..c6f0959
--- /dev/null
+++ b/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.functions.txt
@@ -0,0 +1,91 @@
+AMediaCodecCryptoInfo_delete
+AMediaCodecCryptoInfo_getClearBytes
+AMediaCodecCryptoInfo_getEncryptedBytes
+AMediaCodecCryptoInfo_getIV
+AMediaCodecCryptoInfo_getKey
+AMediaCodecCryptoInfo_getMode
+AMediaCodecCryptoInfo_getNumSubSamples
+AMediaCodecCryptoInfo_new
+AMediaCodec_configure
+AMediaCodec_createCodecByName
+AMediaCodec_createDecoderByType
+AMediaCodec_createEncoderByType
+AMediaCodec_delete
+AMediaCodec_dequeueInputBuffer
+AMediaCodec_dequeueOutputBuffer
+AMediaCodec_flush
+AMediaCodec_getInputBuffer
+AMediaCodec_getOutputBuffer
+AMediaCodec_getOutputFormat
+AMediaCodec_queueInputBuffer
+AMediaCodec_queueSecureInputBuffer
+AMediaCodec_releaseOutputBuffer
+AMediaCodec_releaseOutputBufferAtTime
+AMediaCodec_start
+AMediaCodec_stop
+AMediaCrypto_delete
+AMediaCrypto_isCryptoSchemeSupported
+AMediaCrypto_new
+AMediaCrypto_requiresSecureDecoderComponent
+AMediaDrm_closeSession
+AMediaDrm_createByUUID
+AMediaDrm_decrypt
+AMediaDrm_encrypt
+AMediaDrm_getKeyRequest
+AMediaDrm_getPropertyByteArray
+AMediaDrm_getPropertyString
+AMediaDrm_getProvisionRequest
+AMediaDrm_getSecureStops
+AMediaDrm_isCryptoSchemeSupported
+AMediaDrm_openSession
+AMediaDrm_provideKeyResponse
+AMediaDrm_provideProvisionResponse
+AMediaDrm_queryKeyStatus
+AMediaDrm_release
+AMediaDrm_releaseSecureStops
+AMediaDrm_removeKeys
+AMediaDrm_restoreKeys
+AMediaDrm_setOnEventListener
+AMediaDrm_setPropertyByteArray
+AMediaDrm_setPropertyString
+AMediaDrm_sign
+AMediaDrm_verify
+AMediaExtractor_advance
+AMediaExtractor_delete
+AMediaExtractor_getPsshInfo
+AMediaExtractor_getSampleCryptoInfo
+AMediaExtractor_getSampleFlags
+AMediaExtractor_getSampleTime
+AMediaExtractor_getSampleTrackIndex
+AMediaExtractor_getTrackCount
+AMediaExtractor_getTrackFormat
+AMediaExtractor_new
+AMediaExtractor_readSampleData
+AMediaExtractor_seekTo
+AMediaExtractor_selectTrack
+AMediaExtractor_setDataSource
+AMediaExtractor_setDataSourceFd
+AMediaExtractor_unselectTrack
+AMediaFormat_delete
+AMediaFormat_getBuffer
+AMediaFormat_getFloat
+AMediaFormat_getInt32
+AMediaFormat_getInt64
+AMediaFormat_getSize
+AMediaFormat_getString
+AMediaFormat_new
+AMediaFormat_setBuffer
+AMediaFormat_setFloat
+AMediaFormat_setInt32
+AMediaFormat_setInt64
+AMediaFormat_setString
+AMediaFormat_toString
+AMediaMuxer_addTrack
+AMediaMuxer_delete
+AMediaMuxer_new
+AMediaMuxer_setLocation
+AMediaMuxer_setOrientationHint
+AMediaMuxer_start
+AMediaMuxer_stop
+AMediaMuxer_writeSampleData
+__popcountdi2
diff --git a/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.variables.txt b/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.variables.txt
new file mode 100644
index 0000000..6f59e1f
--- /dev/null
+++ b/ndk/platforms/android-20/arch-x86_64/symbols/libmediandk.so.variables.txt
@@ -0,0 +1,24 @@
+AMEDIAFORMAT_KEY_AAC_PROFILE
+AMEDIAFORMAT_KEY_BIT_RATE
+AMEDIAFORMAT_KEY_CHANNEL_COUNT
+AMEDIAFORMAT_KEY_CHANNEL_MASK
+AMEDIAFORMAT_KEY_COLOR_FORMAT
+AMEDIAFORMAT_KEY_DURATION
+AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL
+AMEDIAFORMAT_KEY_FRAME_RATE
+AMEDIAFORMAT_KEY_HEIGHT
+AMEDIAFORMAT_KEY_IS_ADTS
+AMEDIAFORMAT_KEY_IS_AUTOSELECT
+AMEDIAFORMAT_KEY_IS_DEFAULT
+AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE
+AMEDIAFORMAT_KEY_I_FRAME_INTERVAL
+AMEDIAFORMAT_KEY_LANGUAGE
+AMEDIAFORMAT_KEY_MAX_HEIGHT
+AMEDIAFORMAT_KEY_MAX_INPUT_SIZE
+AMEDIAFORMAT_KEY_MAX_WIDTH
+AMEDIAFORMAT_KEY_MIME
+AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP
+AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER
+AMEDIAFORMAT_KEY_SAMPLE_RATE
+AMEDIAFORMAT_KEY_STRIDE
+AMEDIAFORMAT_KEY_WIDTH
diff --git a/ndk/platforms/android-20/include/SLES/OpenSLES.h b/ndk/platforms/android-20/include/SLES/OpenSLES.h
new file mode 100644
index 0000000..8686997
--- /dev/null
+++ b/ndk/platforms/android-20/include/SLES/OpenSLES.h
@@ -0,0 +1,2774 @@
+/*
+ * Copyright (c) 2007-2009 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and /or associated documentation files (the "Materials "), to
+ * deal in the Materials without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Materials, and to permit persons to whom the Materials are
+ * furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
+ * MATERIALS.
+ *
+ * OpenSLES.h - OpenSL ES version 1.0.1
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file is a standard OpenSL ES header file and should not be    */
+/* modified in any way.                                                     */
+/****************************************************************************/
+
+#ifndef OPENSL_ES_H_
+#define OPENSL_ES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "OpenSLES_Platform.h"
+
+
+/*****************************************************************************/
+/* Common types, structures, and defines                                */
+/*****************************************************************************/
+
+#ifndef _KHRONOS_KEYS_
+#define _KHRONOS_KEYS_
+
+#define KHRONOS_TITLE "KhronosTitle"
+#define KHRONOS_ALBUM "KhronosAlbum"
+#define KHRONOS_TRACK_NUMBER "KhronosTrackNumber"
+#define KHRONOS_ARTIST "KhronosArtist"
+#define KHRONOS_GENRE "KhronosGenre"
+#define KHRONOS_YEAR "KhronosYear"
+#define KHRONOS_COMMENT "KhronosComment"
+#define KHRONOS_ARTIST_URL "KhronosArtistURL"
+#define KHRONOS_CONTENT_URL "KhronosContentURL"
+#define KHRONOS_RATING "KhronosRating"
+#define KHRONOS_ALBUM_ART "KhronosAlbumArt"
+#define KHRONOS_COPYRIGHT "KhronosCopyright"
+
+#endif
+
+
+/* remap common types to SL types for clarity */
+typedef sl_int8_t              SLint8;          /* 8 bit signed integer  */
+typedef sl_uint8_t             SLuint8;         /* 8 bit unsigned integer */
+typedef sl_int16_t             SLint16;         /* 16 bit signed integer */
+typedef sl_uint16_t            SLuint16;        /* 16 bit unsigned integer */
+typedef sl_int32_t             SLint32;           /* 32 bit signed integer */
+typedef sl_uint32_t            SLuint32;          /* 32 bit unsigned integer */
+
+typedef SLuint32                    SLboolean;
+#define SL_BOOLEAN_FALSE            ((SLboolean) 0x00000000)
+#define SL_BOOLEAN_TRUE             ((SLboolean) 0x00000001)
+
+typedef SLuint8						SLchar;			/* UTF-8 is to be used */
+typedef SLint16						SLmillibel;
+typedef SLuint32					SLmillisecond;
+typedef SLuint32					SLmilliHertz;
+typedef SLint32						SLmillimeter;
+typedef SLint32						SLmillidegree;
+typedef SLint16						SLpermille;
+typedef SLuint32					SLmicrosecond;
+typedef SLuint32					SLresult;
+
+#define SL_MILLIBEL_MAX 	((SLmillibel) 0x7FFF)
+#define SL_MILLIBEL_MIN 	((SLmillibel) (-SL_MILLIBEL_MAX-1))
+
+#define SL_MILLIHERTZ_MAX	((SLmilliHertz) 0xFFFFFFFF)
+#define SL_MILLIMETER_MAX	((SLmillimeter) 0x7FFFFFFF)
+
+/** Interface ID defined as a UUID */
+typedef const struct SLInterfaceID_ {
+    SLuint32 time_low;
+    SLuint16 time_mid;
+    SLuint16 time_hi_and_version;
+    SLuint16 clock_seq;
+    SLuint8  node[6];
+} * SLInterfaceID;
+
+/* Forward declaration for the object interface */
+struct SLObjectItf_;
+
+typedef const struct SLObjectItf_ * const * SLObjectItf;
+
+/* Objects ID's */
+
+#define SL_OBJECTID_ENGINE			((SLuint32) 0x00001001)
+#define SL_OBJECTID_LEDDEVICE		((SLuint32) 0x00001002)
+#define SL_OBJECTID_VIBRADEVICE		((SLuint32) 0x00001003)
+#define SL_OBJECTID_AUDIOPLAYER		((SLuint32) 0x00001004)
+#define SL_OBJECTID_AUDIORECORDER	((SLuint32) 0x00001005)
+#define SL_OBJECTID_MIDIPLAYER		((SLuint32) 0x00001006)
+#define SL_OBJECTID_LISTENER		((SLuint32) 0x00001007)
+#define SL_OBJECTID_3DGROUP			((SLuint32) 0x00001008)
+#define SL_OBJECTID_OUTPUTMIX		((SLuint32) 0x00001009)
+#define SL_OBJECTID_METADATAEXTRACTOR	((SLuint32) 0x0000100A)
+
+
+/* SL Profiles */
+
+#define SL_PROFILES_PHONE	((SLuint16) 0x0001)
+#define SL_PROFILES_MUSIC	((SLuint16) 0x0002)
+#define SL_PROFILES_GAME	((SLuint16) 0x0004)
+
+/* Types of voices supported by the system */
+
+#define SL_VOICETYPE_2D_AUDIO		((SLuint16) 0x0001)
+#define SL_VOICETYPE_MIDI			((SLuint16) 0x0002)
+#define SL_VOICETYPE_3D_AUDIO 		((SLuint16) 0x0004)
+#define SL_VOICETYPE_3D_MIDIOUTPUT 	((SLuint16) 0x0008)
+
+/* Convenient macros representing various different priority levels, for use with the SetPriority method */
+
+#define SL_PRIORITY_LOWEST		((SLint32) (-0x7FFFFFFF-1))
+#define SL_PRIORITY_VERYLOW		((SLint32) -0x60000000)
+#define SL_PRIORITY_LOW			((SLint32) -0x40000000)
+#define SL_PRIORITY_BELOWNORMAL	((SLint32) -0x20000000)
+#define SL_PRIORITY_NORMAL		((SLint32) 0x00000000)
+#define SL_PRIORITY_ABOVENORMAL	((SLint32) 0x20000000)
+#define SL_PRIORITY_HIGH		((SLint32) 0x40000000)
+#define SL_PRIORITY_VERYHIGH	((SLint32) 0x60000000)
+#define SL_PRIORITY_HIGHEST	((SLint32) 0x7FFFFFFF)
+
+
+/** These macros list the various sample formats that are possible on audio input and output devices. */
+
+#define SL_PCMSAMPLEFORMAT_FIXED_8	((SLuint16) 0x0008)
+#define SL_PCMSAMPLEFORMAT_FIXED_16	((SLuint16) 0x0010)
+#define SL_PCMSAMPLEFORMAT_FIXED_20 	((SLuint16) 0x0014)
+#define SL_PCMSAMPLEFORMAT_FIXED_24	((SLuint16) 0x0018)
+#define SL_PCMSAMPLEFORMAT_FIXED_28 	((SLuint16) 0x001C)
+#define SL_PCMSAMPLEFORMAT_FIXED_32	((SLuint16) 0x0020)
+
+
+/** These macros specify the commonly used sampling rates (in milliHertz) supported by most audio I/O devices. */
+
+#define SL_SAMPLINGRATE_8		((SLuint32) 8000000)
+#define SL_SAMPLINGRATE_11_025	((SLuint32) 11025000)
+#define SL_SAMPLINGRATE_12		((SLuint32) 12000000)
+#define SL_SAMPLINGRATE_16		((SLuint32) 16000000)
+#define SL_SAMPLINGRATE_22_05	((SLuint32) 22050000)
+#define SL_SAMPLINGRATE_24		((SLuint32) 24000000)
+#define SL_SAMPLINGRATE_32		((SLuint32) 32000000)
+#define SL_SAMPLINGRATE_44_1	((SLuint32) 44100000)
+#define SL_SAMPLINGRATE_48		((SLuint32) 48000000)
+#define SL_SAMPLINGRATE_64		((SLuint32) 64000000)
+#define SL_SAMPLINGRATE_88_2	((SLuint32) 88200000)
+#define SL_SAMPLINGRATE_96		((SLuint32) 96000000)
+#define SL_SAMPLINGRATE_192	((SLuint32) 192000000)
+
+#define SL_SPEAKER_FRONT_LEFT			((SLuint32) 0x00000001)
+#define SL_SPEAKER_FRONT_RIGHT			((SLuint32) 0x00000002)
+#define SL_SPEAKER_FRONT_CENTER			((SLuint32) 0x00000004)
+#define SL_SPEAKER_LOW_FREQUENCY			((SLuint32) 0x00000008)
+#define SL_SPEAKER_BACK_LEFT			((SLuint32) 0x00000010)
+#define SL_SPEAKER_BACK_RIGHT			((SLuint32) 0x00000020)
+#define SL_SPEAKER_FRONT_LEFT_OF_CENTER	((SLuint32) 0x00000040)
+#define SL_SPEAKER_FRONT_RIGHT_OF_CENTER	((SLuint32) 0x00000080)
+#define SL_SPEAKER_BACK_CENTER			((SLuint32) 0x00000100)
+#define SL_SPEAKER_SIDE_LEFT			((SLuint32) 0x00000200)
+#define SL_SPEAKER_SIDE_RIGHT			((SLuint32) 0x00000400)
+#define SL_SPEAKER_TOP_CENTER			((SLuint32) 0x00000800)
+#define SL_SPEAKER_TOP_FRONT_LEFT		((SLuint32) 0x00001000)
+#define SL_SPEAKER_TOP_FRONT_CENTER		((SLuint32) 0x00002000)
+#define SL_SPEAKER_TOP_FRONT_RIGHT		((SLuint32) 0x00004000)
+#define SL_SPEAKER_TOP_BACK_LEFT			((SLuint32) 0x00008000)
+#define SL_SPEAKER_TOP_BACK_CENTER		((SLuint32) 0x00010000)
+#define SL_SPEAKER_TOP_BACK_RIGHT		((SLuint32) 0x00020000)
+
+
+/*****************************************************************************/
+/* Errors                                                                    */
+/*                                                                           */
+/*****************************************************************************/
+
+#define SL_RESULT_SUCCESS				((SLuint32) 0x00000000)
+#define SL_RESULT_PRECONDITIONS_VIOLATED	((SLuint32) 0x00000001)
+#define SL_RESULT_PARAMETER_INVALID		((SLuint32) 0x00000002)
+#define SL_RESULT_MEMORY_FAILURE			((SLuint32) 0x00000003)
+#define SL_RESULT_RESOURCE_ERROR			((SLuint32) 0x00000004)
+#define SL_RESULT_RESOURCE_LOST			((SLuint32) 0x00000005)
+#define SL_RESULT_IO_ERROR				((SLuint32) 0x00000006)
+#define SL_RESULT_BUFFER_INSUFFICIENT		((SLuint32) 0x00000007)
+#define SL_RESULT_CONTENT_CORRUPTED		((SLuint32) 0x00000008)
+#define SL_RESULT_CONTENT_UNSUPPORTED		((SLuint32) 0x00000009)
+#define SL_RESULT_CONTENT_NOT_FOUND		((SLuint32) 0x0000000A)
+#define SL_RESULT_PERMISSION_DENIED		((SLuint32) 0x0000000B)
+#define SL_RESULT_FEATURE_UNSUPPORTED		((SLuint32) 0x0000000C)
+#define SL_RESULT_INTERNAL_ERROR			((SLuint32) 0x0000000D)
+#define SL_RESULT_UNKNOWN_ERROR			((SLuint32) 0x0000000E)
+#define SL_RESULT_OPERATION_ABORTED		((SLuint32) 0x0000000F)
+#define SL_RESULT_CONTROL_LOST			((SLuint32) 0x00000010)
+
+
+/* Object state definitions */
+
+#define SL_OBJECT_STATE_UNREALIZED	((SLuint32) 0x00000001)
+#define SL_OBJECT_STATE_REALIZED		((SLuint32) 0x00000002)
+#define SL_OBJECT_STATE_SUSPENDED	((SLuint32) 0x00000003)
+
+/* Object event definitions */
+
+#define SL_OBJECT_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
+#define SL_OBJECT_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
+#define SL_OBJECT_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
+#define SL_OBJECT_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000004)
+#define SL_OBJECT_EVENT_ITF_CONTROL_TAKEN		((SLuint32) 0x00000005)
+#define SL_OBJECT_EVENT_ITF_CONTROL_RETURNED		((SLuint32) 0x00000006)
+#define SL_OBJECT_EVENT_ITF_PARAMETERS_CHANGED	((SLuint32) 0x00000007)
+
+
+/*****************************************************************************/
+/* Interface definitions                                                     */
+/*****************************************************************************/
+
+/** NULL Interface */
+
+extern SL_API const SLInterfaceID SL_IID_NULL;
+
+/*---------------------------------------------------------------------------*/
+/* Data Source and Data Sink Structures                                      */
+/*---------------------------------------------------------------------------*/
+
+/** Data locator macros  */
+#define SL_DATALOCATOR_URI			((SLuint32) 0x00000001)
+#define SL_DATALOCATOR_ADDRESS		((SLuint32) 0x00000002)
+#define SL_DATALOCATOR_IODEVICE		((SLuint32) 0x00000003)
+#define SL_DATALOCATOR_OUTPUTMIX		((SLuint32) 0x00000004)
+#define SL_DATALOCATOR_RESERVED5		((SLuint32) 0x00000005)
+#define SL_DATALOCATOR_BUFFERQUEUE	((SLuint32) 0x00000006)
+#define SL_DATALOCATOR_MIDIBUFFERQUEUE	((SLuint32) 0x00000007)
+#define SL_DATALOCATOR_RESERVED8		((SLuint32) 0x00000008)
+
+
+
+/** URI-based data locator definition where locatorType must be SL_DATALOCATOR_URI*/
+typedef struct SLDataLocator_URI_ {
+	SLuint32 		locatorType;
+	SLchar *		URI;
+} SLDataLocator_URI;
+
+/** Address-based data locator definition where locatorType must be SL_DATALOCATOR_ADDRESS*/
+typedef struct SLDataLocator_Address_ {
+	SLuint32 	locatorType;
+	void 		*pAddress;
+	SLuint32	length;
+} SLDataLocator_Address;
+
+/** IODevice-types */
+#define SL_IODEVICE_AUDIOINPUT	((SLuint32) 0x00000001)
+#define SL_IODEVICE_LEDARRAY	((SLuint32) 0x00000002)
+#define SL_IODEVICE_VIBRA		((SLuint32) 0x00000003)
+#define SL_IODEVICE_RESERVED4	((SLuint32) 0x00000004)
+#define SL_IODEVICE_RESERVED5	((SLuint32) 0x00000005)
+
+/** IODevice-based data locator definition where locatorType must be SL_DATALOCATOR_IODEVICE*/
+typedef struct SLDataLocator_IODevice_ {
+	SLuint32	locatorType;
+	SLuint32	deviceType;
+	SLuint32	deviceID;
+	SLObjectItf	device;
+} SLDataLocator_IODevice;
+
+/** OutputMix-based data locator definition where locatorType must be SL_DATALOCATOR_OUTPUTMIX*/
+typedef struct SLDataLocator_OutputMix {
+	SLuint32 		locatorType;
+	SLObjectItf		outputMix;
+} SLDataLocator_OutputMix;
+
+
+/** BufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_BUFFERQUEUE*/
+typedef struct SLDataLocator_BufferQueue {
+	SLuint32	locatorType;
+	SLuint32	numBuffers;
+} SLDataLocator_BufferQueue;
+
+/** MidiBufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_MIDIBUFFERQUEUE*/
+typedef struct SLDataLocator_MIDIBufferQueue {
+	SLuint32	locatorType;
+	SLuint32	tpqn;
+	SLuint32	numBuffers;
+} SLDataLocator_MIDIBufferQueue;
+
+/** Data format defines */
+#define SL_DATAFORMAT_MIME		((SLuint32) 0x00000001)
+#define SL_DATAFORMAT_PCM		((SLuint32) 0x00000002)
+#define SL_DATAFORMAT_RESERVED3	((SLuint32) 0x00000003)
+
+
+/** MIME-type-based data format definition where formatType must be SL_DATAFORMAT_MIME*/
+typedef struct SLDataFormat_MIME_ {
+	SLuint32 		formatType;
+	SLchar * 		mimeType;
+	SLuint32		containerType;
+} SLDataFormat_MIME;
+
+/* Byte order of a block of 16- or 32-bit data */
+#define SL_BYTEORDER_BIGENDIAN				((SLuint32) 0x00000001)
+#define SL_BYTEORDER_LITTLEENDIAN			((SLuint32) 0x00000002)
+
+/* Container type */
+#define SL_CONTAINERTYPE_UNSPECIFIED	((SLuint32) 0x00000001)
+#define SL_CONTAINERTYPE_RAW		((SLuint32) 0x00000002)
+#define SL_CONTAINERTYPE_ASF		((SLuint32) 0x00000003)
+#define SL_CONTAINERTYPE_AVI		((SLuint32) 0x00000004)
+#define SL_CONTAINERTYPE_BMP		((SLuint32) 0x00000005)
+#define SL_CONTAINERTYPE_JPG		((SLuint32) 0x00000006)
+#define SL_CONTAINERTYPE_JPG2000		((SLuint32) 0x00000007)
+#define SL_CONTAINERTYPE_M4A		((SLuint32) 0x00000008)
+#define SL_CONTAINERTYPE_MP3		((SLuint32) 0x00000009)
+#define SL_CONTAINERTYPE_MP4		((SLuint32) 0x0000000A)
+#define SL_CONTAINERTYPE_MPEG_ES		((SLuint32) 0x0000000B)
+#define SL_CONTAINERTYPE_MPEG_PS		((SLuint32) 0x0000000C)
+#define SL_CONTAINERTYPE_MPEG_TS		((SLuint32) 0x0000000D)
+#define SL_CONTAINERTYPE_QT		((SLuint32) 0x0000000E)
+#define SL_CONTAINERTYPE_WAV		((SLuint32) 0x0000000F)
+#define SL_CONTAINERTYPE_XMF_0		((SLuint32) 0x00000010)
+#define SL_CONTAINERTYPE_XMF_1		((SLuint32) 0x00000011)
+#define SL_CONTAINERTYPE_XMF_2		((SLuint32) 0x00000012)
+#define SL_CONTAINERTYPE_XMF_3		((SLuint32) 0x00000013)
+#define SL_CONTAINERTYPE_XMF_GENERIC	((SLuint32) 0x00000014)
+#define SL_CONTAINERTYPE_AMR  		((SLuint32) 0x00000015)
+#define SL_CONTAINERTYPE_AAC		((SLuint32) 0x00000016)
+#define SL_CONTAINERTYPE_3GPP		((SLuint32) 0x00000017)
+#define SL_CONTAINERTYPE_3GA		((SLuint32) 0x00000018)
+#define SL_CONTAINERTYPE_RM		((SLuint32) 0x00000019)
+#define SL_CONTAINERTYPE_DMF		((SLuint32) 0x0000001A)
+#define SL_CONTAINERTYPE_SMF		((SLuint32) 0x0000001B)
+#define SL_CONTAINERTYPE_MOBILE_DLS	((SLuint32) 0x0000001C)
+#define SL_CONTAINERTYPE_OGG	((SLuint32) 0x0000001D)
+
+
+/** PCM-type-based data format definition where formatType must be SL_DATAFORMAT_PCM*/
+typedef struct SLDataFormat_PCM_ {
+	SLuint32 		formatType;
+	SLuint32 		numChannels;
+	SLuint32 		samplesPerSec;
+	SLuint32 		bitsPerSample;
+	SLuint32 		containerSize;
+	SLuint32 		channelMask;
+	SLuint32		endianness;
+} SLDataFormat_PCM;
+
+typedef struct SLDataSource_ {
+	void *pLocator;
+	void *pFormat;
+} SLDataSource;
+
+
+typedef struct SLDataSink_ {
+	void *pLocator;
+	void *pFormat;
+} SLDataSink;
+
+
+
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Standard Object Interface                                                 */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_OBJECT;
+
+/** Object callback */
+
+
+typedef void (SLAPIENTRY *slObjectCallback) (
+	SLObjectItf caller,
+	const void * pContext,
+	SLuint32 event,
+	SLresult result,
+    SLuint32 param,
+    void *pInterface
+);
+
+
+struct SLObjectItf_ {
+	SLresult (*Realize) (
+		SLObjectItf self,
+		SLboolean async
+	);
+	SLresult (*Resume) (
+		SLObjectItf self,
+		SLboolean async
+	);
+	SLresult (*GetState) (
+		SLObjectItf self,
+		SLuint32 * pState
+	);
+	SLresult (*GetInterface) (
+		SLObjectItf self,
+		const SLInterfaceID iid,
+		void * pInterface
+	);
+	SLresult (*RegisterCallback) (
+		SLObjectItf self,
+		slObjectCallback callback,
+		void * pContext
+	);
+	void (*AbortAsyncOperation) (
+		SLObjectItf self
+	);
+	void (*Destroy) (
+		SLObjectItf self
+	);
+	SLresult (*SetPriority) (
+		SLObjectItf self,
+		SLint32 priority,
+		SLboolean preemptable
+	);
+	SLresult (*GetPriority) (
+		SLObjectItf self,
+		SLint32 *pPriority,
+		SLboolean *pPreemptable
+	);
+	SLresult (*SetLossOfControlInterfaces) (
+		SLObjectItf self,
+		SLint16 numInterfaces,
+		SLInterfaceID * pInterfaceIDs,
+		SLboolean enabled
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio IO Device capabilities interface                                    */
+/*---------------------------------------------------------------------------*/
+
+#define SL_DEFAULTDEVICEID_AUDIOINPUT 	((SLuint32) 0xFFFFFFFF)
+#define SL_DEFAULTDEVICEID_AUDIOOUTPUT 	((SLuint32) 0xFFFFFFFE)
+#define SL_DEFAULTDEVICEID_LED          ((SLuint32) 0xFFFFFFFD)
+#define SL_DEFAULTDEVICEID_VIBRA        ((SLuint32) 0xFFFFFFFC)
+#define SL_DEFAULTDEVICEID_RESERVED1    ((SLuint32) 0xFFFFFFFB)
+
+
+#define SL_DEVCONNECTION_INTEGRATED         ((SLint16) 0x0001)
+#define SL_DEVCONNECTION_ATTACHED_WIRED     ((SLint16) 0x0100)
+#define SL_DEVCONNECTION_ATTACHED_WIRELESS  ((SLint16) 0x0200)
+#define SL_DEVCONNECTION_NETWORK 		    ((SLint16) 0x0400)
+
+
+#define SL_DEVLOCATION_HANDSET 	((SLuint16) 0x0001)
+#define SL_DEVLOCATION_HEADSET 	((SLuint16) 0x0002)
+#define SL_DEVLOCATION_CARKIT 	((SLuint16) 0x0003)
+#define SL_DEVLOCATION_DOCK 	((SLuint16) 0x0004)
+#define SL_DEVLOCATION_REMOTE 	((SLuint16) 0x0005)
+/* Note: SL_DEVLOCATION_RESLTE is deprecated, use SL_DEVLOCATION_REMOTE instead. */
+#define SL_DEVLOCATION_RESLTE 	((SLuint16) 0x0005)
+
+
+#define SL_DEVSCOPE_UNKNOWN     ((SLuint16) 0x0001)
+#define SL_DEVSCOPE_ENVIRONMENT ((SLuint16) 0x0002)
+#define SL_DEVSCOPE_USER        ((SLuint16) 0x0003)
+
+
+typedef struct SLAudioInputDescriptor_ {
+	SLchar *deviceName;
+	SLint16 deviceConnection;
+	SLint16 deviceScope;
+	SLint16 deviceLocation;
+	SLboolean isForTelephony;
+	SLmilliHertz minSampleRate;
+	SLmilliHertz maxSampleRate;
+	SLboolean isFreqRangeContinuous;
+	SLmilliHertz *samplingRatesSupported;
+	SLint16 numOfSamplingRatesSupported;
+	SLint16 maxChannels;
+} SLAudioInputDescriptor;
+
+
+typedef struct SLAudioOutputDescriptor_ {
+	SLchar *pDeviceName;
+	SLint16 deviceConnection;
+	SLint16 deviceScope;
+	SLint16 deviceLocation;
+	SLboolean isForTelephony;
+	SLmilliHertz minSampleRate;
+	SLmilliHertz maxSampleRate;
+	SLboolean isFreqRangeContinuous;
+	SLmilliHertz *samplingRatesSupported;
+	SLint16 numOfSamplingRatesSupported;
+	SLint16 maxChannels;
+} SLAudioOutputDescriptor;
+
+
+
+extern SL_API const SLInterfaceID SL_IID_AUDIOIODEVICECAPABILITIES;
+
+struct SLAudioIODeviceCapabilitiesItf_;
+typedef const struct SLAudioIODeviceCapabilitiesItf_ * const * SLAudioIODeviceCapabilitiesItf;
+
+
+typedef void (SLAPIENTRY *slAvailableAudioInputsChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLuint32 deviceID,
+	SLint32 numInputs,
+	SLboolean isNew
+);
+
+
+typedef void (SLAPIENTRY *slAvailableAudioOutputsChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLuint32 deviceID,
+	SLint32 numOutputs,
+	SLboolean isNew
+);
+
+typedef void (SLAPIENTRY *slDefaultDeviceIDMapChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLboolean isOutput,
+	SLint32 numDevices
+);
+
+
+struct SLAudioIODeviceCapabilitiesItf_ {
+	SLresult (*GetAvailableAudioInputs)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLint32  *pNumInputs,
+		SLuint32 *pInputDeviceIDs
+	);
+	SLresult (*QueryAudioInputCapabilities)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLAudioInputDescriptor *pDescriptor
+	);
+	SLresult (*RegisterAvailableAudioInputsChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slAvailableAudioInputsChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*GetAvailableAudioOutputs)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLint32 *pNumOutputs,
+		SLuint32 *pOutputDeviceIDs
+	);
+	SLresult (*QueryAudioOutputCapabilities)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLAudioOutputDescriptor *pDescriptor
+	);
+	SLresult (*RegisterAvailableAudioOutputsChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slAvailableAudioOutputsChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*RegisterDefaultDeviceIDMapChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slDefaultDeviceIDMapChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*GetAssociatedAudioInputs) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLint32 *pNumAudioInputs,
+		SLuint32 *pAudioInputDeviceIDs
+	);
+	SLresult (*GetAssociatedAudioOutputs) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLint32 *pNumAudioOutputs,
+		SLuint32 *pAudioOutputDeviceIDs
+	);
+	SLresult (*GetDefaultAudioDevices) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 defaultDeviceID,
+		SLint32 *pNumAudioDevices,
+		SLuint32 *pAudioDeviceIDs
+	);
+	SLresult (*QuerySampleFormatsSupported)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLmilliHertz samplingRate,
+		SLint32 *pSampleFormats,
+		SLint32 *pNumOfSampleFormats
+	);
+};
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Capabilities of the LED array IODevice                                    */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLLEDDescriptor_ {
+	SLuint8   ledCount;
+	SLuint8   primaryLED;
+	SLuint32  colorMask;
+} SLLEDDescriptor;
+
+
+/*---------------------------------------------------------------------------*/
+/* LED Array interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLHSL_ {
+    SLmillidegree  hue;
+    SLpermille     saturation;
+    SLpermille     lightness;
+} SLHSL;
+
+
+extern SL_API const SLInterfaceID SL_IID_LED;
+
+struct SLLEDArrayItf_;
+typedef const struct SLLEDArrayItf_ * const * SLLEDArrayItf;
+
+struct SLLEDArrayItf_ {
+	SLresult (*ActivateLEDArray) (
+		SLLEDArrayItf self,
+		SLuint32 lightMask
+	);
+	SLresult (*IsLEDArrayActivated) (
+		SLLEDArrayItf self,
+		SLuint32 *lightMask
+	);
+	SLresult (*SetColor) (
+		SLLEDArrayItf self,
+		SLuint8 index,
+		const SLHSL *color
+	);
+	SLresult (*GetColor) (
+		SLLEDArrayItf self,
+		SLuint8 index,
+		SLHSL *color
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Capabilities of the Vibra IODevice                                        */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLVibraDescriptor_ {
+	SLboolean supportsFrequency;
+	SLboolean supportsIntensity;
+	SLmilliHertz  minFrequency;
+	SLmilliHertz  maxFrequency;
+} SLVibraDescriptor;
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Vibra interface                                                           */
+/*---------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_VIBRA;
+
+
+struct SLVibraItf_;
+typedef const struct SLVibraItf_ * const * SLVibraItf;
+
+struct SLVibraItf_ {
+	SLresult (*Vibrate) (
+		SLVibraItf self,
+		SLboolean vibrate
+	);
+	SLresult (*IsVibrating) (
+		SLVibraItf self,
+		SLboolean *pVibrating
+	);
+	SLresult (*SetFrequency) (
+		SLVibraItf self,
+		SLmilliHertz frequency
+	);
+	SLresult (*GetFrequency) (
+		SLVibraItf self,
+		SLmilliHertz *pFrequency
+	);
+	SLresult (*SetIntensity) (
+		SLVibraItf self,
+		SLpermille intensity
+	);
+	SLresult (*GetIntensity) (
+		SLVibraItf self,
+		SLpermille *pIntensity
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Meta data extraction related types and interface                          */
+/*---------------------------------------------------------------------------*/
+
+#define SL_CHARACTERENCODING_UNKNOWN			((SLuint32) 0x00000000)
+#define SL_CHARACTERENCODING_BINARY       ((SLuint32) 0x00000001)
+#define SL_CHARACTERENCODING_ASCII        ((SLuint32) 0x00000002)
+#define SL_CHARACTERENCODING_BIG5         ((SLuint32) 0x00000003)
+#define SL_CHARACTERENCODING_CODEPAGE1252		((SLuint32) 0x00000004)
+#define SL_CHARACTERENCODING_GB2312			((SLuint32) 0x00000005)
+#define SL_CHARACTERENCODING_HZGB2312			((SLuint32) 0x00000006)
+#define SL_CHARACTERENCODING_GB12345			((SLuint32) 0x00000007)
+#define SL_CHARACTERENCODING_GB18030			((SLuint32) 0x00000008)
+#define SL_CHARACTERENCODING_GBK				((SLuint32) 0x00000009)
+#define SL_CHARACTERENCODING_IMAPUTF7			((SLuint32) 0x0000000A)
+#define SL_CHARACTERENCODING_ISO2022JP			((SLuint32) 0x0000000B)
+#define SL_CHARACTERENCODING_ISO2022JP1		((SLuint32) 0x0000000B)
+#define SL_CHARACTERENCODING_ISO88591			((SLuint32) 0x0000000C)
+#define SL_CHARACTERENCODING_ISO885910			((SLuint32) 0x0000000D)
+#define SL_CHARACTERENCODING_ISO885913			((SLuint32) 0x0000000E)
+#define SL_CHARACTERENCODING_ISO885914			((SLuint32) 0x0000000F)
+#define SL_CHARACTERENCODING_ISO885915			((SLuint32) 0x00000010)
+#define SL_CHARACTERENCODING_ISO88592			((SLuint32) 0x00000011)
+#define SL_CHARACTERENCODING_ISO88593			((SLuint32) 0x00000012)
+#define SL_CHARACTERENCODING_ISO88594			((SLuint32) 0x00000013)
+#define SL_CHARACTERENCODING_ISO88595			((SLuint32) 0x00000014)
+#define SL_CHARACTERENCODING_ISO88596			((SLuint32) 0x00000015)
+#define SL_CHARACTERENCODING_ISO88597			((SLuint32) 0x00000016)
+#define SL_CHARACTERENCODING_ISO88598			((SLuint32) 0x00000017)
+#define SL_CHARACTERENCODING_ISO88599			((SLuint32) 0x00000018)
+#define SL_CHARACTERENCODING_ISOEUCJP			((SLuint32) 0x00000019)
+#define SL_CHARACTERENCODING_SHIFTJIS			((SLuint32) 0x0000001A)
+#define SL_CHARACTERENCODING_SMS7BIT			((SLuint32) 0x0000001B)
+#define SL_CHARACTERENCODING_UTF7			((SLuint32) 0x0000001C)
+#define SL_CHARACTERENCODING_UTF8			((SLuint32) 0x0000001D)
+#define SL_CHARACTERENCODING_JAVACONFORMANTUTF8	((SLuint32) 0x0000001E)
+#define SL_CHARACTERENCODING_UTF16BE			((SLuint32) 0x0000001F)
+#define SL_CHARACTERENCODING_UTF16LE			((SLuint32) 0x00000020)
+
+
+#define SL_METADATA_FILTER_KEY		((SLuint8) 0x01)
+#define SL_METADATA_FILTER_LANG		((SLuint8) 0x02)
+#define SL_METADATA_FILTER_ENCODING	((SLuint8) 0x04)
+
+
+typedef struct SLMetadataInfo_ {
+    SLuint32     size;
+    SLuint32     encoding;
+    SLchar       langCountry[16];
+    SLuint8      data[1];
+} SLMetadataInfo;
+
+extern SL_API const SLInterfaceID SL_IID_METADATAEXTRACTION;
+
+struct SLMetadataExtractionItf_;
+typedef const struct SLMetadataExtractionItf_ * const * SLMetadataExtractionItf;
+
+
+struct SLMetadataExtractionItf_ {
+	SLresult (*GetItemCount) (
+		SLMetadataExtractionItf self,
+		SLuint32 *pItemCount
+	);
+	SLresult (*GetKeySize) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 *pKeySize
+	);
+	SLresult (*GetKey) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 keySize,
+		SLMetadataInfo *pKey
+	);
+	SLresult (*GetValueSize) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 *pValueSize
+	);
+	SLresult (*GetValue) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 valueSize,
+		SLMetadataInfo *pValue
+	);
+	SLresult (*AddKeyFilter) (
+		SLMetadataExtractionItf self,
+		SLuint32 keySize,
+		const void *pKey,
+		SLuint32 keyEncoding,
+		const SLchar *pValueLangCountry,
+		SLuint32 valueEncoding,
+		SLuint8 filterMask
+	);
+	SLresult (*ClearKeyFilter) (
+		SLMetadataExtractionItf self
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Meta data traversal related types and interface                          */
+/*---------------------------------------------------------------------------*/
+
+#define SL_METADATATRAVERSALMODE_ALL	((SLuint32) 0x00000001)
+#define SL_METADATATRAVERSALMODE_NODE	((SLuint32) 0x00000002)
+
+
+#define SL_NODETYPE_UNSPECIFIED	((SLuint32) 0x00000001)
+#define SL_NODETYPE_AUDIO		((SLuint32) 0x00000002)
+#define SL_NODETYPE_VIDEO		((SLuint32) 0x00000003)
+#define SL_NODETYPE_IMAGE		((SLuint32) 0x00000004)
+
+#define SL_NODE_PARENT 0xFFFFFFFF
+
+extern SL_API const SLInterfaceID SL_IID_METADATATRAVERSAL;
+
+struct SLMetadataTraversalItf_;
+typedef const struct SLMetadataTraversalItf_ * const * SLMetadataTraversalItf;
+
+struct SLMetadataTraversalItf_ {
+	SLresult (*SetMode) (
+		SLMetadataTraversalItf self,
+		SLuint32 mode
+	);
+	SLresult (*GetChildCount) (
+		SLMetadataTraversalItf self,
+		SLuint32 *pCount
+	);
+	SLresult (*GetChildMIMETypeSize) (
+		SLMetadataTraversalItf self,
+		SLuint32 index,
+		SLuint32 *pSize
+	);
+	SLresult (*GetChildInfo) (
+		SLMetadataTraversalItf self,
+		SLuint32 index,
+		SLint32 *pNodeID,
+		SLuint32 *pType,
+		SLuint32 size,
+		SLchar *pMimeType
+	);
+	SLresult (*SetActiveNode) (
+		SLMetadataTraversalItf self,
+		SLuint32 index
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Dynamic Source types and interface                                        */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_DYNAMICSOURCE;
+
+struct SLDynamicSourceItf_;
+typedef const struct SLDynamicSourceItf_ * const * SLDynamicSourceItf;
+
+struct SLDynamicSourceItf_ {
+	SLresult (*SetSource) (
+		SLDynamicSourceItf self,
+		SLDataSource *pDataSource
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Output Mix interface                                                      */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_OUTPUTMIX;
+
+struct SLOutputMixItf_;
+typedef const struct SLOutputMixItf_ * const * SLOutputMixItf;
+
+typedef void (SLAPIENTRY *slMixDeviceChangeCallback) (
+	SLOutputMixItf caller,
+    void *pContext
+);
+
+
+struct SLOutputMixItf_ {
+	SLresult (*GetDestinationOutputDeviceIDs) (
+		SLOutputMixItf self,
+		SLint32 *pNumDevices,
+		SLuint32 *pDeviceIDs
+	);
+	SLresult (*RegisterDeviceChangeCallback) (
+		SLOutputMixItf self,
+		slMixDeviceChangeCallback callback,
+		void *pContext
+    );
+    SLresult (*ReRoute)(
+        SLOutputMixItf self,
+        SLint32 numOutputDevices,
+        SLuint32 *pOutputDeviceIDs
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Playback interface                                                        */
+/*---------------------------------------------------------------------------*/
+
+/** Playback states */
+#define SL_PLAYSTATE_STOPPED	((SLuint32) 0x00000001)
+#define SL_PLAYSTATE_PAUSED	((SLuint32) 0x00000002)
+#define SL_PLAYSTATE_PLAYING	((SLuint32) 0x00000003)
+
+/** Play events **/
+#define SL_PLAYEVENT_HEADATEND		((SLuint32) 0x00000001)
+#define SL_PLAYEVENT_HEADATMARKER	((SLuint32) 0x00000002)
+#define SL_PLAYEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
+#define SL_PLAYEVENT_HEADMOVING		((SLuint32) 0x00000008)
+#define SL_PLAYEVENT_HEADSTALLED	((SLuint32) 0x00000010)
+
+#define SL_TIME_UNKNOWN	((SLuint32) 0xFFFFFFFF)
+
+
+extern SL_API const SLInterfaceID SL_IID_PLAY;
+
+/** Playback interface methods */
+
+struct SLPlayItf_;
+typedef const struct SLPlayItf_ * const * SLPlayItf;
+
+typedef void (SLAPIENTRY *slPlayCallback) (
+	SLPlayItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+struct SLPlayItf_ {
+	SLresult (*SetPlayState) (
+		SLPlayItf self,
+		SLuint32 state
+	);
+	SLresult (*GetPlayState) (
+		SLPlayItf self,
+		SLuint32 *pState
+	);
+	SLresult (*GetDuration) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*GetPosition) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*RegisterCallback) (
+		SLPlayItf self,
+		slPlayCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLPlayItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLPlayItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetMarkerPosition) (
+		SLPlayItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*ClearMarkerPosition) (
+		SLPlayItf self
+	);
+	SLresult (*GetMarkerPosition) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*SetPositionUpdatePeriod) (
+		SLPlayItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*GetPositionUpdatePeriod) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Prefetch status interface                                                 */
+/*---------------------------------------------------------------------------*/
+
+#define SL_PREFETCHEVENT_STATUSCHANGE		((SLuint32) 0x00000001)
+#define SL_PREFETCHEVENT_FILLLEVELCHANGE	((SLuint32) 0x00000002)
+
+#define SL_PREFETCHSTATUS_UNDERFLOW		((SLuint32) 0x00000001)
+#define SL_PREFETCHSTATUS_SUFFICIENTDATA	((SLuint32) 0x00000002)
+#define SL_PREFETCHSTATUS_OVERFLOW		((SLuint32) 0x00000003)
+
+
+extern SL_API const SLInterfaceID SL_IID_PREFETCHSTATUS;
+
+
+/** Prefetch status interface methods */
+
+struct SLPrefetchStatusItf_;
+typedef const struct SLPrefetchStatusItf_ * const * SLPrefetchStatusItf;
+
+typedef void (SLAPIENTRY *slPrefetchCallback) (
+	SLPrefetchStatusItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+struct SLPrefetchStatusItf_ {
+	SLresult (*GetPrefetchStatus) (
+		SLPrefetchStatusItf self,
+		SLuint32 *pStatus
+	);
+	SLresult (*GetFillLevel) (
+		SLPrefetchStatusItf self,
+		SLpermille *pLevel
+	);
+	SLresult (*RegisterCallback) (
+		SLPrefetchStatusItf self,
+		slPrefetchCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLPrefetchStatusItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLPrefetchStatusItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetFillUpdatePeriod) (
+		SLPrefetchStatusItf self,
+		SLpermille period
+	);
+	SLresult (*GetFillUpdatePeriod) (
+		SLPrefetchStatusItf self,
+		SLpermille *pPeriod
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Playback Rate interface                                                   */
+/*---------------------------------------------------------------------------*/
+
+#define SL_RATEPROP_RESERVED1		  		((SLuint32) 0x00000001)
+#define SL_RATEPROP_RESERVED2		  		((SLuint32) 0x00000002)
+#define SL_RATEPROP_SILENTAUDIO				((SLuint32) 0x00000100)
+#define SL_RATEPROP_STAGGEREDAUDIO	((SLuint32) 0x00000200)
+#define SL_RATEPROP_NOPITCHCORAUDIO	((SLuint32) 0x00000400)
+#define SL_RATEPROP_PITCHCORAUDIO	((SLuint32) 0x00000800)
+
+
+extern SL_API const SLInterfaceID SL_IID_PLAYBACKRATE;
+
+struct SLPlaybackRateItf_;
+typedef const struct SLPlaybackRateItf_ * const * SLPlaybackRateItf;
+
+struct SLPlaybackRateItf_ {
+	SLresult (*SetRate)(
+		SLPlaybackRateItf self,
+		SLpermille rate
+	);
+	SLresult (*GetRate)(
+		SLPlaybackRateItf self,
+		SLpermille *pRate
+	);
+	SLresult (*SetPropertyConstraints)(
+		SLPlaybackRateItf self,
+		SLuint32 constraints
+	);
+	SLresult (*GetProperties)(
+		SLPlaybackRateItf self,
+		SLuint32 *pProperties
+	);
+	SLresult (*GetCapabilitiesOfRate)(
+		SLPlaybackRateItf self,
+		SLpermille rate,
+		SLuint32 *pCapabilities
+	);
+	SLresult (*GetRateRange) (
+		SLPlaybackRateItf self,
+		SLuint8 index,
+		SLpermille *pMinRate,
+		SLpermille *pMaxRate,
+		SLpermille *pStepSize,
+		SLuint32 *pCapabilities
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Seek Interface                                                            */
+/*---------------------------------------------------------------------------*/
+
+#define SL_SEEKMODE_FAST		((SLuint32) 0x0001)
+#define SL_SEEKMODE_ACCURATE	((SLuint32) 0x0002)
+
+extern SL_API const SLInterfaceID SL_IID_SEEK;
+
+struct SLSeekItf_;
+typedef const struct SLSeekItf_ * const * SLSeekItf;
+
+struct SLSeekItf_ {
+	SLresult (*SetPosition)(
+		SLSeekItf self,
+		SLmillisecond pos,
+		SLuint32 seekMode
+	);
+	SLresult (*SetLoop)(
+		SLSeekItf self,
+		SLboolean loopEnable,
+		SLmillisecond startPos,
+		SLmillisecond endPos
+	);
+	SLresult (*GetLoop)(
+		SLSeekItf self,
+		SLboolean *pLoopEnabled,
+		SLmillisecond *pStartPos,
+		SLmillisecond *pEndPos
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Standard Recording Interface                                              */
+/*---------------------------------------------------------------------------*/
+
+/** Recording states */
+#define SL_RECORDSTATE_STOPPED 	((SLuint32) 0x00000001)
+#define SL_RECORDSTATE_PAUSED	((SLuint32) 0x00000002)
+#define SL_RECORDSTATE_RECORDING	((SLuint32) 0x00000003)
+
+
+/** Record event **/
+#define SL_RECORDEVENT_HEADATLIMIT	((SLuint32) 0x00000001)
+#define SL_RECORDEVENT_HEADATMARKER	((SLuint32) 0x00000002)
+#define SL_RECORDEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
+#define SL_RECORDEVENT_HEADMOVING	((SLuint32) 0x00000008)
+#define SL_RECORDEVENT_HEADSTALLED 	((SLuint32) 0x00000010)
+/* Note: SL_RECORDEVENT_BUFFER_INSUFFICIENT is deprecated, use SL_RECORDEVENT_BUFFER_FULL instead. */
+#define SL_RECORDEVENT_BUFFER_INSUFFICIENT      ((SLuint32) 0x00000020)
+#define SL_RECORDEVENT_BUFFER_FULL	((SLuint32) 0x00000020)
+
+
+extern SL_API const SLInterfaceID SL_IID_RECORD;
+
+struct SLRecordItf_;
+typedef const struct SLRecordItf_ * const * SLRecordItf;
+
+typedef void (SLAPIENTRY *slRecordCallback) (
+	SLRecordItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+/** Recording interface methods */
+struct SLRecordItf_ {
+	SLresult (*SetRecordState) (
+		SLRecordItf self,
+		SLuint32 state
+	);
+	SLresult (*GetRecordState) (
+		SLRecordItf self,
+		SLuint32 *pState
+	);
+	SLresult (*SetDurationLimit) (
+		SLRecordItf self,
+		SLmillisecond msec
+	);
+	SLresult (*GetPosition) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*RegisterCallback) (
+		SLRecordItf self,
+		slRecordCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLRecordItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLRecordItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetMarkerPosition) (
+		SLRecordItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*ClearMarkerPosition) (
+		SLRecordItf self
+	);
+	SLresult (*GetMarkerPosition) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*SetPositionUpdatePeriod) (
+		SLRecordItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*GetPositionUpdatePeriod) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Equalizer interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+#define SL_EQUALIZER_UNDEFINED				((SLuint16) 0xFFFF)
+
+extern SL_API const SLInterfaceID SL_IID_EQUALIZER;
+
+struct SLEqualizerItf_;
+typedef const struct SLEqualizerItf_ * const * SLEqualizerItf;
+
+struct SLEqualizerItf_ {
+	SLresult (*SetEnabled)(
+		SLEqualizerItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLEqualizerItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*GetNumberOfBands)(
+		SLEqualizerItf self,
+		SLuint16 *pAmount
+	);
+	SLresult (*GetBandLevelRange)(
+		SLEqualizerItf self,
+		SLmillibel *pMin,
+		SLmillibel *pMax
+	);
+	SLresult (*SetBandLevel)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmillibel level
+	);
+	SLresult (*GetBandLevel)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmillibel *pLevel
+	);
+	SLresult (*GetCenterFreq)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmilliHertz *pCenter
+	);
+	SLresult (*GetBandFreqRange)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmilliHertz *pMin,
+		SLmilliHertz *pMax
+	);
+	SLresult (*GetBand)(
+		SLEqualizerItf self,
+		SLmilliHertz frequency,
+		SLuint16 *pBand
+	);
+	SLresult (*GetCurrentPreset)(
+		SLEqualizerItf self,
+		SLuint16 *pPreset
+	);
+	SLresult (*UsePreset)(
+		SLEqualizerItf self,
+		SLuint16 index
+	);
+	SLresult (*GetNumberOfPresets)(
+		SLEqualizerItf self,
+		SLuint16 *pNumPresets
+	);
+	SLresult (*GetPresetName)(
+		SLEqualizerItf self,
+		SLuint16 index,
+		const SLchar ** ppName
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Volume Interface                                                           */
+/* --------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_VOLUME;
+
+struct SLVolumeItf_;
+typedef const struct SLVolumeItf_ * const * SLVolumeItf;
+
+struct SLVolumeItf_ {
+	SLresult (*SetVolumeLevel) (
+		SLVolumeItf self,
+		SLmillibel level
+	);
+	SLresult (*GetVolumeLevel) (
+		SLVolumeItf self,
+		SLmillibel *pLevel
+	);
+	SLresult (*GetMaxVolumeLevel) (
+		SLVolumeItf  self,
+		SLmillibel *pMaxLevel
+	);
+	SLresult (*SetMute) (
+		SLVolumeItf self,
+		SLboolean mute
+	);
+	SLresult (*GetMute) (
+		SLVolumeItf self,
+		SLboolean *pMute
+	);
+	SLresult (*EnableStereoPosition) (
+		SLVolumeItf self,
+		SLboolean enable
+	);
+	SLresult (*IsEnabledStereoPosition) (
+		SLVolumeItf self,
+		SLboolean *pEnable
+	);
+	SLresult (*SetStereoPosition) (
+		SLVolumeItf self,
+		SLpermille stereoPosition
+	);
+	SLresult (*GetStereoPosition) (
+		SLVolumeItf self,
+		SLpermille *pStereoPosition
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Device Volume Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_DEVICEVOLUME;
+
+struct SLDeviceVolumeItf_;
+typedef const struct SLDeviceVolumeItf_ * const * SLDeviceVolumeItf;
+
+struct SLDeviceVolumeItf_ {
+	SLresult (*GetVolumeScale) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 *pMinValue,
+		SLint32 *pMaxValue,
+		SLboolean *pIsMillibelScale
+	);
+	SLresult (*SetVolume) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 volume
+	);
+	SLresult (*GetVolume) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 *pVolume
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Buffer Queue Interface                                                    */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_BUFFERQUEUE;
+
+struct SLBufferQueueItf_;
+typedef const struct SLBufferQueueItf_ * const * SLBufferQueueItf;
+
+typedef void (SLAPIENTRY *slBufferQueueCallback)(
+	SLBufferQueueItf caller,
+	void *pContext
+);
+
+/** Buffer queue state **/
+
+typedef struct SLBufferQueueState_ {
+	SLuint32	count;
+	SLuint32	playIndex;
+} SLBufferQueueState;
+
+
+struct SLBufferQueueItf_ {
+	SLresult (*Enqueue) (
+		SLBufferQueueItf self,
+		const void *pBuffer,
+		SLuint32 size
+	);
+	SLresult (*Clear) (
+		SLBufferQueueItf self
+	);
+	SLresult (*GetState) (
+		SLBufferQueueItf self,
+		SLBufferQueueState *pState
+	);
+	SLresult (*RegisterCallback) (
+		SLBufferQueueItf self,
+		slBufferQueueCallback callback,
+		void* pContext
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* PresetReverb                                                              */
+/*---------------------------------------------------------------------------*/
+
+#define SL_REVERBPRESET_NONE		((SLuint16) 0x0000)
+#define SL_REVERBPRESET_SMALLROOM	((SLuint16) 0x0001)
+#define SL_REVERBPRESET_MEDIUMROOM	((SLuint16) 0x0002)
+#define SL_REVERBPRESET_LARGEROOM	((SLuint16) 0x0003)
+#define SL_REVERBPRESET_MEDIUMHALL	((SLuint16) 0x0004)
+#define SL_REVERBPRESET_LARGEHALL	((SLuint16) 0x0005)
+#define SL_REVERBPRESET_PLATE 		((SLuint16) 0x0006)
+
+
+extern SL_API const SLInterfaceID SL_IID_PRESETREVERB;
+
+struct SLPresetReverbItf_;
+typedef const struct SLPresetReverbItf_ * const * SLPresetReverbItf;
+
+struct SLPresetReverbItf_ {
+	SLresult (*SetPreset) (
+		SLPresetReverbItf self,
+		SLuint16 preset
+	);
+	SLresult (*GetPreset) (
+		SLPresetReverbItf self,
+		SLuint16 *pPreset
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* EnvironmentalReverb                                                       */
+/*---------------------------------------------------------------------------*/
+
+#define SL_I3DL2_ENVIRONMENT_PRESET_DEFAULT \
+	{ SL_MILLIBEL_MIN,    0,  1000,   500, SL_MILLIBEL_MIN,  20, SL_MILLIBEL_MIN,  40, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_GENERIC \
+	{ -1000, -100, 1490,  830, -2602,   7,   200,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL \
+	{ -1000,-6000,  170,  100, -1204,   1,   207,   2, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ROOM \
+	{ -1000, -454,  400,  830, -1646,   2,    53,   3, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_BATHROOM \
+	{ -1000,-1200, 1490,  540,  -370,   7,  1030,  11, 1000, 600 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM \
+	{ -1000,-6000,  500,  100, -1376,   3, -1104,   4, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_STONEROOM \
+	{ -1000, -300, 2310,  640,  -711,  12,    83,  17, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM \
+	{ -1000, -476, 4320,  590,  -789,  20,  -289,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL \
+	{ -1000, -500, 3920,  700, -1230,  20,    -2,  29, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CAVE \
+	{ -1000,    0, 2910, 1300,  -602,  15,  -302,  22, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ARENA \
+	{ -1000, -698, 7240,  330, -1166,  20,    16,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_HANGAR \
+	{ -1000,-1000, 10050,  230,  -602,  20,   198,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY \
+	{ -1000,-4000,  300,  100, -1831,   2, -1630,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_HALLWAY \
+	{ -1000, -300, 1490,  590, -1219,   7,   441,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR \
+	{ -1000, -237, 2700,  790, -1214,  13,   395,  20, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ALLEY \
+	{ -1000, -270, 1490,  860, -1204,   7,    -4,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_FOREST \
+	{ -1000,-3300, 1490,  540, -2560, 162,  -613,  88,  790,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CITY \
+	{ -1000, -800, 1490,  670, -2273,   7, -2217,  11,  500,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS \
+	{ -1000,-2500, 1490,  210, -2780, 300, -2014, 100,  270,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_QUARRY \
+	{ -1000,-1000, 1490,  830, SL_MILLIBEL_MIN,  61,   500,  25, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PLAIN \
+	{ -1000,-2000, 1490,  500, -2466, 179, -2514, 100,  210,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT \
+	{ -1000,    0, 1650, 1500, -1363,   8, -1153,  12, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE \
+	{ -1000,-1000, 2810,  140,   429,  14,   648,  21,  800, 600 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_UNDERWATER \
+	{ -1000,-4000, 1490,  100,  -449,   7,  1700,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_SMALLROOM \
+	{ -1000,-600, 1100, 830, -400, 5, 500, 10, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM \
+	{ -1000,-600, 1300, 830, -1000, 20, -200, 20, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LARGEROOM \
+	{ -1000,-600, 1500, 830, -1600, 5, -1000, 40, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL \
+	{ -1000,-600, 1800, 700, -1300, 15, -800, 30, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LARGEHALL \
+	{ -1000,-600, 1800, 700, -2000, 30, -1400, 60, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PLATE \
+	{ -1000,-200, 1300, 900, 0, 2, 0, 10, 1000, 750 }
+
+
+typedef struct SLEnvironmentalReverbSettings_ {
+	SLmillibel    roomLevel;
+	SLmillibel    roomHFLevel;
+	SLmillisecond decayTime;
+	SLpermille    decayHFRatio;
+	SLmillibel    reflectionsLevel;
+	SLmillisecond reflectionsDelay;
+	SLmillibel    reverbLevel;
+	SLmillisecond reverbDelay;
+	SLpermille    diffusion;
+	SLpermille    density;
+} SLEnvironmentalReverbSettings;
+
+
+
+
+extern SL_API const SLInterfaceID SL_IID_ENVIRONMENTALREVERB;
+
+
+struct SLEnvironmentalReverbItf_;
+typedef const struct SLEnvironmentalReverbItf_ * const * SLEnvironmentalReverbItf;
+
+struct SLEnvironmentalReverbItf_ {
+	SLresult (*SetRoomLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel room
+	);
+	SLresult (*GetRoomLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pRoom
+	);
+	SLresult (*SetRoomHFLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel roomHF
+	);
+	SLresult (*GetRoomHFLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pRoomHF
+	);
+	SLresult (*SetDecayTime) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond decayTime
+	);
+	SLresult (*GetDecayTime) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pDecayTime
+	);
+	SLresult (*SetDecayHFRatio) (
+		SLEnvironmentalReverbItf self,
+		SLpermille decayHFRatio
+	);
+	SLresult (*GetDecayHFRatio) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDecayHFRatio
+	);
+	SLresult (*SetReflectionsLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel reflectionsLevel
+	);
+	SLresult (*GetReflectionsLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pReflectionsLevel
+	);
+	SLresult (*SetReflectionsDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond reflectionsDelay
+	);
+	SLresult (*GetReflectionsDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pReflectionsDelay
+	);
+	SLresult (*SetReverbLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel reverbLevel
+	);
+	SLresult (*GetReverbLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pReverbLevel
+	);
+	SLresult (*SetReverbDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond reverbDelay
+	);
+	SLresult (*GetReverbDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pReverbDelay
+	);
+	SLresult (*SetDiffusion) (
+		SLEnvironmentalReverbItf self,
+		SLpermille diffusion
+	);
+	SLresult (*GetDiffusion) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDiffusion
+	);
+	SLresult (*SetDensity) (
+		SLEnvironmentalReverbItf self,
+		SLpermille density
+	);
+	SLresult (*GetDensity) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDensity
+	);
+	SLresult (*SetEnvironmentalReverbProperties) (
+		SLEnvironmentalReverbItf self,
+		const SLEnvironmentalReverbSettings *pProperties
+	);
+	SLresult (*GetEnvironmentalReverbProperties) (
+		SLEnvironmentalReverbItf self,
+		SLEnvironmentalReverbSettings *pProperties
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Effects Send Interface                                                    */
+/*---------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_EFFECTSEND;
+
+struct SLEffectSendItf_;
+typedef const struct SLEffectSendItf_ * const * SLEffectSendItf;
+
+struct SLEffectSendItf_ {
+	SLresult (*EnableEffectSend) (
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLboolean enable,
+		SLmillibel initialLevel
+	);
+	SLresult (*IsEnabled) (
+		SLEffectSendItf self,
+		const void * pAuxEffect,
+		SLboolean *pEnable
+	);
+	SLresult (*SetDirectLevel) (
+		SLEffectSendItf self,
+		SLmillibel directLevel
+	);
+	SLresult (*GetDirectLevel) (
+		SLEffectSendItf self,
+		SLmillibel *pDirectLevel
+	);
+	SLresult (*SetSendLevel) (
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLmillibel sendLevel
+	);
+	SLresult (*GetSendLevel)(
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLmillibel *pSendLevel
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Grouping Interface                                                     */
+/*---------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_3DGROUPING;
+
+
+struct SL3DGroupingItf_ ;
+typedef const struct SL3DGroupingItf_ * const * SL3DGroupingItf;
+
+struct SL3DGroupingItf_ {
+	SLresult (*Set3DGroup) (
+		SL3DGroupingItf self,
+		SLObjectItf group
+	);
+	SLresult (*Get3DGroup) (
+		SL3DGroupingItf self,
+		SLObjectItf *pGroup
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Commit Interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_3DCOMMIT;
+
+struct SL3DCommitItf_;
+typedef const struct SL3DCommitItf_* const * SL3DCommitItf;
+
+struct SL3DCommitItf_ {
+	SLresult (*Commit) (
+		SL3DCommitItf self
+	);
+	SLresult (*SetDeferred) (
+		SL3DCommitItf self,
+		SLboolean deferred
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Location Interface                                                     */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLVec3D_ {
+	SLint32	x;
+	SLint32	y;
+	SLint32	z;
+} SLVec3D;
+
+extern SL_API const SLInterfaceID SL_IID_3DLOCATION;
+
+struct SL3DLocationItf_;
+typedef const struct SL3DLocationItf_ * const * SL3DLocationItf;
+
+struct SL3DLocationItf_ {
+	SLresult (*SetLocationCartesian) (
+		SL3DLocationItf self,
+		const SLVec3D *pLocation
+	);
+	SLresult (*SetLocationSpherical) (
+		SL3DLocationItf self,
+		SLmillidegree azimuth,
+		SLmillidegree elevation,
+		SLmillimeter distance
+	);
+	SLresult (*Move) (
+		SL3DLocationItf self,
+		const SLVec3D *pMovement
+	);
+	SLresult (*GetLocationCartesian) (
+		SL3DLocationItf self,
+		SLVec3D *pLocation
+	);
+	SLresult (*SetOrientationVectors) (
+		SL3DLocationItf self,
+		const SLVec3D *pFront,
+		const SLVec3D *pAbove
+	);
+	SLresult (*SetOrientationAngles) (
+		SL3DLocationItf self,
+		SLmillidegree heading,
+		SLmillidegree pitch,
+		SLmillidegree roll
+	);
+	SLresult (*Rotate) (
+		SL3DLocationItf self,
+		SLmillidegree theta,
+		const SLVec3D *pAxis
+	);
+	SLresult (*GetOrientationVectors) (
+		SL3DLocationItf self,
+		SLVec3D *pFront,
+		SLVec3D *pUp
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Doppler Interface                                                      */
+/*---------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_3DDOPPLER;
+
+struct SL3DDopplerItf_;
+typedef const struct SL3DDopplerItf_ * const * SL3DDopplerItf;
+
+struct SL3DDopplerItf_ {
+	SLresult (*SetVelocityCartesian) (
+		SL3DDopplerItf self,
+		const SLVec3D *pVelocity
+	);
+	SLresult (*SetVelocitySpherical) (
+		SL3DDopplerItf self,
+		SLmillidegree azimuth,
+		SLmillidegree elevation,
+		SLmillimeter speed
+	);
+	SLresult (*GetVelocityCartesian) (
+		SL3DDopplerItf self,
+		SLVec3D *pVelocity
+	);
+	SLresult (*SetDopplerFactor) (
+		SL3DDopplerItf self,
+		SLpermille dopplerFactor
+	);
+	SLresult (*GetDopplerFactor) (
+		SL3DDopplerItf self,
+		SLpermille *pDopplerFactor
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* 3D Source Interface and associated defines                                */
+/* --------------------------------------------------------------------------*/
+
+#define SL_ROLLOFFMODEL_EXPONENTIAL	((SLuint32) 0x00000000)
+#define SL_ROLLOFFMODEL_LINEAR		((SLuint32) 0x00000001)
+
+
+extern SL_API const SLInterfaceID SL_IID_3DSOURCE;
+
+struct SL3DSourceItf_;
+typedef const struct SL3DSourceItf_ * const * SL3DSourceItf;
+
+struct SL3DSourceItf_ {
+	SLresult (*SetHeadRelative) (
+		SL3DSourceItf self,
+		SLboolean headRelative
+	);
+	SLresult (*GetHeadRelative) (
+		SL3DSourceItf self,
+		SLboolean *pHeadRelative
+	);
+	SLresult (*SetRolloffDistances) (
+		SL3DSourceItf self,
+		SLmillimeter minDistance,
+		SLmillimeter maxDistance
+	);
+	SLresult (*GetRolloffDistances) (
+		SL3DSourceItf self,
+		SLmillimeter *pMinDistance,
+		SLmillimeter *pMaxDistance
+	);
+	SLresult (*SetRolloffMaxDistanceMute) (
+		SL3DSourceItf self,
+		SLboolean mute
+	);
+	SLresult (*GetRolloffMaxDistanceMute) (
+		SL3DSourceItf self,
+		SLboolean *pMute
+	);
+	SLresult (*SetRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille rolloffFactor
+	);
+	SLresult (*GetRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille *pRolloffFactor
+	);
+	SLresult (*SetRoomRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille roomRolloffFactor
+	);
+	SLresult (*GetRoomRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille *pRoomRolloffFactor
+	);
+	SLresult (*SetRolloffModel) (
+		SL3DSourceItf self,
+		SLuint8 model
+	);
+	SLresult (*GetRolloffModel) (
+		SL3DSourceItf self,
+		SLuint8 *pModel
+	);
+	SLresult (*SetCone) (
+		SL3DSourceItf self,
+		SLmillidegree innerAngle,
+		SLmillidegree outerAngle,
+		SLmillibel outerLevel
+	);
+	SLresult (*GetCone) (
+		SL3DSourceItf self,
+		SLmillidegree *pInnerAngle,
+		SLmillidegree *pOuterAngle,
+		SLmillibel *pOuterLevel
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* 3D Macroscopic Interface                                                  */
+/* --------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_3DMACROSCOPIC;
+
+struct SL3DMacroscopicItf_;
+typedef const struct SL3DMacroscopicItf_ * const * SL3DMacroscopicItf;
+
+struct SL3DMacroscopicItf_ {
+	SLresult (*SetSize) (
+		SL3DMacroscopicItf self,
+		SLmillimeter width,
+		SLmillimeter height,
+		SLmillimeter depth
+	);
+	SLresult (*GetSize) (
+		SL3DMacroscopicItf self,
+		SLmillimeter *pWidth,
+		SLmillimeter *pHeight,
+		SLmillimeter *pDepth
+	);
+	SLresult (*SetOrientationAngles) (
+		SL3DMacroscopicItf self,
+		SLmillidegree heading,
+		SLmillidegree pitch,
+		SLmillidegree roll
+	);
+	SLresult (*SetOrientationVectors) (
+		SL3DMacroscopicItf self,
+		const SLVec3D *pFront,
+		const SLVec3D *pAbove
+	);
+	SLresult (*Rotate) (
+		SL3DMacroscopicItf self,
+		SLmillidegree theta,
+		const SLVec3D *pAxis
+	);
+	SLresult (*GetOrientationVectors) (
+		SL3DMacroscopicItf self,
+		SLVec3D *pFront,
+		SLVec3D *pUp
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Mute Solo Interface                                                       */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_MUTESOLO;
+
+struct SLMuteSoloItf_;
+typedef const struct SLMuteSoloItf_ * const * SLMuteSoloItf;
+
+struct SLMuteSoloItf_ {
+	SLresult (*SetChannelMute) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean mute
+	);
+	SLresult (*GetChannelMute) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean *pMute
+	);
+	SLresult (*SetChannelSolo) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean solo
+	);
+	SLresult (*GetChannelSolo) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean *pSolo
+	);
+	SLresult (*GetNumChannels) (
+		SLMuteSoloItf self,
+		SLuint8 *pNumChannels
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Dynamic Interface Management Interface and associated types and macros    */
+/* --------------------------------------------------------------------------*/
+
+#define SL_DYNAMIC_ITF_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
+#define SL_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST_PERMANENTLY	((SLuint32) 0x00000004)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000005)
+
+
+
+
+extern SL_API const SLInterfaceID SL_IID_DYNAMICINTERFACEMANAGEMENT;
+
+struct SLDynamicInterfaceManagementItf_;
+typedef const struct SLDynamicInterfaceManagementItf_ * const * SLDynamicInterfaceManagementItf;
+
+typedef void (SLAPIENTRY *slDynamicInterfaceManagementCallback) (
+	SLDynamicInterfaceManagementItf caller,
+	void * pContext,
+	SLuint32 event,
+	SLresult result,
+    const SLInterfaceID iid
+);
+
+
+struct SLDynamicInterfaceManagementItf_ {
+	SLresult (*AddInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid,
+		SLboolean async
+	);
+	SLresult (*RemoveInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid
+	);
+	SLresult (*ResumeInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid,
+		SLboolean async
+	);
+	SLresult (*RegisterCallback) (
+		SLDynamicInterfaceManagementItf self,
+		slDynamicInterfaceManagementCallback callback,
+		void * pContext
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Midi Message Interface and associated types                               */
+/* --------------------------------------------------------------------------*/
+
+#define SL_MIDIMESSAGETYPE_NOTE_ON_OFF		((SLuint32) 0x00000001)
+#define SL_MIDIMESSAGETYPE_POLY_PRESSURE	((SLuint32) 0x00000002)
+#define SL_MIDIMESSAGETYPE_CONTROL_CHANGE	((SLuint32) 0x00000003)
+#define SL_MIDIMESSAGETYPE_PROGRAM_CHANGE	((SLuint32) 0x00000004)
+#define SL_MIDIMESSAGETYPE_CHANNEL_PRESSURE	((SLuint32) 0x00000005)
+#define SL_MIDIMESSAGETYPE_PITCH_BEND		((SLuint32) 0x00000006)
+#define SL_MIDIMESSAGETYPE_SYSTEM_MESSAGE	((SLuint32) 0x00000007)
+
+
+extern SL_API const SLInterfaceID SL_IID_MIDIMESSAGE;
+
+struct SLMIDIMessageItf_;
+typedef const struct SLMIDIMessageItf_ * const * SLMIDIMessageItf;
+
+typedef void (SLAPIENTRY *slMetaEventCallback) (
+	SLMIDIMessageItf caller,
+	void *pContext,
+	SLuint8 type,
+    SLuint32 length,
+	const SLuint8 *pData,
+	SLuint32 tick,
+	SLuint16 track
+);
+
+typedef void (SLAPIENTRY *slMIDIMessageCallback) (
+	SLMIDIMessageItf caller,
+	void *pContext,
+	SLuint8 statusByte,
+	SLuint32 length,
+	const SLuint8 *pData,
+	SLuint32 tick,
+	SLuint16 track
+);
+
+struct SLMIDIMessageItf_ {
+	SLresult (*SendMessage) (
+		SLMIDIMessageItf self,
+		const SLuint8 *data,
+		SLuint32 length
+	);
+	SLresult (*RegisterMetaEventCallback) (
+		SLMIDIMessageItf self,
+		slMetaEventCallback callback,
+		void *pContext
+	);
+	SLresult (*RegisterMIDIMessageCallback) (
+		SLMIDIMessageItf self,
+		slMIDIMessageCallback callback,
+		void *pContext
+	);
+	SLresult (*AddMIDIMessageCallbackFilter) (
+		SLMIDIMessageItf self,
+		SLuint32 messageType
+	);
+	SLresult (*ClearMIDIMessageCallbackFilter) (
+		SLMIDIMessageItf self
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Mute Solo interface                                                  */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_MIDIMUTESOLO;
+
+struct SLMIDIMuteSoloItf_;
+typedef const struct SLMIDIMuteSoloItf_ * const * SLMIDIMuteSoloItf;
+
+struct SLMIDIMuteSoloItf_ {
+	SLresult (*SetChannelMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean mute
+	);
+	SLresult (*GetChannelMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean *pMute
+	);
+	SLresult (*SetChannelSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean solo
+	);
+	SLresult (*GetChannelSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean *pSolo
+	);
+	SLresult (*GetTrackCount) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 *pCount
+	);
+	SLresult (*SetTrackMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean mute
+	);
+	SLresult (*GetTrackMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean *pMute
+	);
+	SLresult (*SetTrackSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean solo
+	);
+	SLresult (*GetTrackSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean *pSolo
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Tempo interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_MIDITEMPO;
+
+struct SLMIDITempoItf_;
+typedef const struct SLMIDITempoItf_ * const * SLMIDITempoItf;
+
+struct SLMIDITempoItf_ {
+	SLresult (*SetTicksPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLuint32 tpqn
+	);
+	SLresult (*GetTicksPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLuint32 *pTpqn
+	);
+	SLresult (*SetMicrosecondsPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLmicrosecond uspqn
+	);
+	SLresult (*GetMicrosecondsPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLmicrosecond *uspqn
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Time interface                                                       */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_MIDITIME;
+
+struct SLMIDITimeItf_;
+typedef const struct SLMIDITimeItf_ * const * SLMIDITimeItf;
+
+struct SLMIDITimeItf_ {
+	SLresult (*GetDuration) (
+		SLMIDITimeItf self,
+		SLuint32 *pDuration
+	);
+	SLresult (*SetPosition) (
+		SLMIDITimeItf self,
+		SLuint32 position
+	);
+	SLresult (*GetPosition) (
+		SLMIDITimeItf self,
+		SLuint32 *pPosition
+	);
+	SLresult (*SetLoopPoints) (
+		SLMIDITimeItf self,
+		SLuint32 startTick,
+		SLuint32 numTicks
+	);
+	SLresult (*GetLoopPoints) (
+		SLMIDITimeItf self,
+		SLuint32 *pStartTick,
+		SLuint32 *pNumTicks
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Decoder Capabilities Interface                                      */
+/* --------------------------------------------------------------------------*/
+
+/*Audio Codec related defines*/
+
+#define SL_RATECONTROLMODE_CONSTANTBITRATE	((SLuint32) 0x00000001)
+#define SL_RATECONTROLMODE_VARIABLEBITRATE	((SLuint32) 0x00000002)
+
+#define SL_AUDIOCODEC_PCM         ((SLuint32) 0x00000001)
+#define SL_AUDIOCODEC_MP3         ((SLuint32) 0x00000002)
+#define SL_AUDIOCODEC_AMR         ((SLuint32) 0x00000003)
+#define SL_AUDIOCODEC_AMRWB       ((SLuint32) 0x00000004)
+#define SL_AUDIOCODEC_AMRWBPLUS   ((SLuint32) 0x00000005)
+#define SL_AUDIOCODEC_AAC         ((SLuint32) 0x00000006)
+#define SL_AUDIOCODEC_WMA         ((SLuint32) 0x00000007)
+#define SL_AUDIOCODEC_REAL        ((SLuint32) 0x00000008)
+
+#define SL_AUDIOPROFILE_PCM                   ((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_MPEG1_L3              ((SLuint32) 0x00000001)
+#define SL_AUDIOPROFILE_MPEG2_L3              ((SLuint32) 0x00000002)
+#define SL_AUDIOPROFILE_MPEG25_L3             ((SLuint32) 0x00000003)
+
+#define SL_AUDIOCHANMODE_MP3_MONO             ((SLuint32) 0x00000001)
+#define SL_AUDIOCHANMODE_MP3_STEREO           ((SLuint32) 0x00000002)
+#define SL_AUDIOCHANMODE_MP3_JOINTSTEREO      ((SLuint32) 0x00000003)
+#define SL_AUDIOCHANMODE_MP3_DUAL             ((SLuint32) 0x00000004)
+
+#define SL_AUDIOPROFILE_AMR			((SLuint32) 0x00000001)
+
+#define SL_AUDIOSTREAMFORMAT_CONFORMANCE	((SLuint32) 0x00000001)
+#define SL_AUDIOSTREAMFORMAT_IF1			((SLuint32) 0x00000002)
+#define SL_AUDIOSTREAMFORMAT_IF2			((SLuint32) 0x00000003)
+#define SL_AUDIOSTREAMFORMAT_FSF			((SLuint32) 0x00000004)
+#define SL_AUDIOSTREAMFORMAT_RTPPAYLOAD	((SLuint32) 0x00000005)
+#define SL_AUDIOSTREAMFORMAT_ITU			((SLuint32) 0x00000006)
+
+#define SL_AUDIOPROFILE_AMRWB			((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_AMRWBPLUS		((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_AAC_AAC			((SLuint32) 0x00000001)
+
+#define SL_AUDIOMODE_AAC_MAIN			((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_AAC_LC			((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_AAC_SSR			((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_AAC_LTP			((SLuint32) 0x00000004)
+#define SL_AUDIOMODE_AAC_HE			((SLuint32) 0x00000005)
+#define SL_AUDIOMODE_AAC_SCALABLE		((SLuint32) 0x00000006)
+#define SL_AUDIOMODE_AAC_ERLC			((SLuint32) 0x00000007)
+#define SL_AUDIOMODE_AAC_LD			((SLuint32) 0x00000008)
+#define SL_AUDIOMODE_AAC_HE_PS			((SLuint32) 0x00000009)
+#define SL_AUDIOMODE_AAC_HE_MPS			((SLuint32) 0x0000000A)
+
+#define SL_AUDIOSTREAMFORMAT_MP2ADTS		((SLuint32) 0x00000001)
+#define SL_AUDIOSTREAMFORMAT_MP4ADTS		((SLuint32) 0x00000002)
+#define SL_AUDIOSTREAMFORMAT_MP4LOAS		((SLuint32) 0x00000003)
+#define SL_AUDIOSTREAMFORMAT_MP4LATM		((SLuint32) 0x00000004)
+#define SL_AUDIOSTREAMFORMAT_ADIF		((SLuint32) 0x00000005)
+#define SL_AUDIOSTREAMFORMAT_MP4FF		((SLuint32) 0x00000006)
+#define SL_AUDIOSTREAMFORMAT_RAW			((SLuint32) 0x00000007)
+
+#define SL_AUDIOPROFILE_WMA7		((SLuint32) 0x00000001)
+#define SL_AUDIOPROFILE_WMA8		((SLuint32) 0x00000002)
+#define SL_AUDIOPROFILE_WMA9		((SLuint32) 0x00000003)
+#define SL_AUDIOPROFILE_WMA10		((SLuint32) 0x00000004)
+
+#define SL_AUDIOMODE_WMA_LEVEL1		((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_WMA_LEVEL2		((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_WMA_LEVEL3		((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_WMA_LEVEL4		((SLuint32) 0x00000004)
+#define SL_AUDIOMODE_WMAPRO_LEVELM0	((SLuint32) 0x00000005)
+#define SL_AUDIOMODE_WMAPRO_LEVELM1	((SLuint32) 0x00000006)
+#define SL_AUDIOMODE_WMAPRO_LEVELM2	((SLuint32) 0x00000007)
+#define SL_AUDIOMODE_WMAPRO_LEVELM3	((SLuint32) 0x00000008)
+
+#define SL_AUDIOPROFILE_REALAUDIO		((SLuint32) 0x00000001)
+
+#define SL_AUDIOMODE_REALAUDIO_G2		((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_REALAUDIO_8			((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_REALAUDIO_10		((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_REALAUDIO_SURROUND	((SLuint32) 0x00000004)
+
+typedef struct SLAudioCodecDescriptor_ {
+    SLuint32      maxChannels;
+    SLuint32      minBitsPerSample;
+    SLuint32      maxBitsPerSample;
+    SLmilliHertz  minSampleRate;
+    SLmilliHertz  maxSampleRate;
+    SLboolean     isFreqRangeContinuous;
+    SLmilliHertz *pSampleRatesSupported;
+    SLuint32      numSampleRatesSupported;
+    SLuint32      minBitRate;
+    SLuint32      maxBitRate;
+    SLboolean     isBitrateRangeContinuous;
+    SLuint32     *pBitratesSupported;
+    SLuint32      numBitratesSupported;
+    SLuint32	  profileSetting;
+    SLuint32      modeSetting;
+} SLAudioCodecDescriptor;
+
+/*Structure used to retrieve the profile and level settings supported by an audio encoder */
+
+typedef struct SLAudioCodecProfileMode_ {
+    SLuint32 profileSetting;
+    SLuint32 modeSetting;
+} SLAudioCodecProfileMode;
+
+extern SL_API const SLInterfaceID SL_IID_AUDIODECODERCAPABILITIES;
+
+struct SLAudioDecoderCapabilitiesItf_;
+typedef const struct SLAudioDecoderCapabilitiesItf_ * const * SLAudioDecoderCapabilitiesItf;
+
+struct SLAudioDecoderCapabilitiesItf_ {
+    SLresult (*GetAudioDecoders) (
+        SLAudioDecoderCapabilitiesItf self,
+        SLuint32 * pNumDecoders ,
+        SLuint32 *pDecoderIds
+    );
+    SLresult (*GetAudioDecoderCapabilities) (
+        SLAudioDecoderCapabilitiesItf self,
+        SLuint32 decoderId,
+        SLuint32 *pIndex,
+        SLAudioCodecDescriptor *pDescriptor
+    );
+};
+
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Encoder Capabilities Interface                                      */
+/* --------------------------------------------------------------------------*/
+
+/* Structure used when setting audio encoding parameters */
+
+typedef struct SLAudioEncoderSettings_ {
+    SLuint32 encoderId;
+    SLuint32 channelsIn;
+    SLuint32 channelsOut;
+    SLmilliHertz sampleRate;
+    SLuint32 bitRate;
+    SLuint32 bitsPerSample;
+    SLuint32 rateControl;
+    SLuint32 profileSetting;
+    SLuint32 levelSetting;
+    SLuint32 channelMode;
+    SLuint32 streamFormat;
+    SLuint32 encodeOptions;
+    SLuint32 blockAlignment;
+} SLAudioEncoderSettings;
+
+extern SL_API const SLInterfaceID SL_IID_AUDIOENCODERCAPABILITIES;
+
+struct SLAudioEncoderCapabilitiesItf_;
+typedef const struct SLAudioEncoderCapabilitiesItf_ * const * SLAudioEncoderCapabilitiesItf;
+
+struct SLAudioEncoderCapabilitiesItf_ {
+    SLresult (*GetAudioEncoders) (
+        SLAudioEncoderCapabilitiesItf self,
+        SLuint32 *pNumEncoders ,
+        SLuint32 *pEncoderIds
+    );
+    SLresult (*GetAudioEncoderCapabilities) (
+        SLAudioEncoderCapabilitiesItf self,
+        SLuint32 encoderId,
+        SLuint32 *pIndex,
+        SLAudioCodecDescriptor * pDescriptor
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Encoder Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_AUDIOENCODER;
+
+struct SLAudioEncoderItf_;
+typedef const struct SLAudioEncoderItf_ * const * SLAudioEncoderItf;
+
+struct SLAudioEncoderItf_ {
+    SLresult (*SetEncoderSettings) (
+        SLAudioEncoderItf		self,
+        SLAudioEncoderSettings 	*pSettings
+    );
+    SLresult (*GetEncoderSettings) (
+        SLAudioEncoderItf		self,
+        SLAudioEncoderSettings	*pSettings
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Bass Boost Interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_BASSBOOST;
+
+struct SLBassBoostItf_;
+typedef const struct SLBassBoostItf_ * const * SLBassBoostItf;
+
+struct SLBassBoostItf_ {
+	SLresult (*SetEnabled)(
+		SLBassBoostItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLBassBoostItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*SetStrength)(
+		SLBassBoostItf self,
+		SLpermille strength
+	);
+	SLresult (*GetRoundedStrength)(
+		SLBassBoostItf self,
+		SLpermille *pStrength
+	);
+	SLresult (*IsStrengthSupported)(
+		SLBassBoostItf self,
+		SLboolean *pSupported
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Pitch Interface                                                           */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_PITCH;
+
+struct SLPitchItf_;
+typedef const struct SLPitchItf_ * const * SLPitchItf;
+
+struct SLPitchItf_ {
+	SLresult (*SetPitch) (
+		SLPitchItf self,
+		SLpermille pitch
+	);
+	SLresult (*GetPitch) (
+		SLPitchItf self,
+		SLpermille *pPitch
+	);
+	SLresult (*GetPitchCapabilities) (
+		SLPitchItf self,
+		SLpermille *pMinPitch,
+		SLpermille *pMaxPitch
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Rate Pitch Interface                                                      */
+/* RatePitchItf is an interface for controlling the rate a sound is played   */
+/* back. A change in rate will cause a change in pitch.                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_RATEPITCH;
+
+struct SLRatePitchItf_;
+typedef const struct SLRatePitchItf_ * const * SLRatePitchItf;
+
+struct SLRatePitchItf_ {
+	SLresult (*SetRate) (
+		SLRatePitchItf self,
+		SLpermille rate
+	);
+	SLresult (*GetRate) (
+		SLRatePitchItf self,
+		SLpermille *pRate
+	);
+	SLresult (*GetRatePitchCapabilities) (
+		SLRatePitchItf self,
+		SLpermille *pMinRate,
+		SLpermille *pMaxRate
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Virtualizer Interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_VIRTUALIZER;
+
+struct SLVirtualizerItf_;
+typedef const struct SLVirtualizerItf_ * const * SLVirtualizerItf;
+
+struct SLVirtualizerItf_ {
+	SLresult (*SetEnabled)(
+		SLVirtualizerItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLVirtualizerItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*SetStrength)(
+		SLVirtualizerItf self,
+		SLpermille strength
+	);
+	SLresult (*GetRoundedStrength)(
+		SLVirtualizerItf self,
+		SLpermille *pStrength
+	);
+	SLresult (*IsStrengthSupported)(
+		SLVirtualizerItf self,
+		SLboolean *pSupported
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Visualization Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_VISUALIZATION;
+
+struct SLVisualizationItf_;
+typedef const struct SLVisualizationItf_ * const * SLVisualizationItf;
+
+typedef void (SLAPIENTRY *slVisualizationCallback) (
+	void *pContext,
+	const SLuint8 waveform[],
+	const SLuint8 fft[],
+	SLmilliHertz samplerate
+);
+
+struct SLVisualizationItf_{
+	SLresult (*RegisterVisualizationCallback)(
+		SLVisualizationItf self,
+		slVisualizationCallback callback,
+		void *pContext,
+		SLmilliHertz rate
+	);
+	SLresult (*GetMaxRate)(
+		SLVisualizationItf self,
+		SLmilliHertz* pRate
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Engine Interface                                                          */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_ENGINE;
+
+struct SLEngineItf_;
+typedef const struct SLEngineItf_ * const * SLEngineItf;
+
+
+struct SLEngineItf_ {
+
+	SLresult (*CreateLEDDevice) (
+		SLEngineItf self,
+		SLObjectItf * pDevice,
+		SLuint32 deviceID,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateVibraDevice) (
+		SLEngineItf self,
+		SLObjectItf * pDevice,
+		SLuint32 deviceID,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateAudioPlayer) (
+		SLEngineItf self,
+		SLObjectItf * pPlayer,
+		SLDataSource *pAudioSrc,
+		SLDataSink *pAudioSnk,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateAudioRecorder) (
+		SLEngineItf self,
+		SLObjectItf * pRecorder,
+		SLDataSource *pAudioSrc,
+		SLDataSink *pAudioSnk,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateMidiPlayer) (
+		SLEngineItf self,
+		SLObjectItf * pPlayer,
+		SLDataSource *pMIDISrc,
+		SLDataSource *pBankSrc,
+		SLDataSink *pAudioOutput,
+		SLDataSink *pVibra,
+		SLDataSink *pLEDArray,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateListener) (
+		SLEngineItf self,
+		SLObjectItf * pListener,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*Create3DGroup) (
+		SLEngineItf self,
+		SLObjectItf * pGroup,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateOutputMix) (
+		SLEngineItf self,
+		SLObjectItf * pMix,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateMetadataExtractor) (
+		SLEngineItf self,
+		SLObjectItf * pMetadataExtractor,
+		SLDataSource * pDataSource,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+    SLresult (*CreateExtensionObject) (
+        SLEngineItf self,
+        SLObjectItf * pObject,
+        void * pParameters,
+        SLuint32 objectID,
+        SLuint32 numInterfaces,
+        const SLInterfaceID * pInterfaceIds,
+        const SLboolean * pInterfaceRequired
+    );
+	SLresult (*QueryNumSupportedInterfaces) (
+		SLEngineItf self,
+		SLuint32 objectID,
+		SLuint32 * pNumSupportedInterfaces
+	);
+	SLresult (*QuerySupportedInterfaces) (
+		SLEngineItf self,
+		SLuint32 objectID,
+		SLuint32 index,
+		SLInterfaceID * pInterfaceId
+	);
+    SLresult (*QueryNumSupportedExtensions) (
+        SLEngineItf self,
+        SLuint32 * pNumExtensions
+    );
+    SLresult (*QuerySupportedExtension) (
+        SLEngineItf self,
+        SLuint32 index,
+        SLchar * pExtensionName,
+        SLint16 * pNameLength
+    );
+    SLresult (*IsExtensionSupported) (
+        SLEngineItf self,
+        const SLchar * pExtensionName,
+        SLboolean * pSupported
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Engine Capabilities Interface                                             */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_ENGINECAPABILITIES;
+
+struct SLEngineCapabilitiesItf_;
+typedef const struct SLEngineCapabilitiesItf_ * const * SLEngineCapabilitiesItf;
+
+struct SLEngineCapabilitiesItf_ {
+	SLresult (*QuerySupportedProfiles) (
+		SLEngineCapabilitiesItf self,
+		SLuint16 *pProfilesSupported
+	);
+	SLresult (*QueryAvailableVoices) (
+		SLEngineCapabilitiesItf self,
+		SLuint16 voiceType,
+		SLint16 *pNumMaxVoices,
+		SLboolean *pIsAbsoluteMax,
+		SLint16 *pNumFreeVoices
+	);
+	SLresult (*QueryNumberOfMIDISynthesizers) (
+		SLEngineCapabilitiesItf self,
+		SLint16 *pNumMIDIsynthesizers
+	);
+	SLresult (*QueryAPIVersion) (
+		SLEngineCapabilitiesItf self,
+		SLint16 *pMajor,
+		SLint16 *pMinor,
+		SLint16 *pStep
+	);
+	SLresult (*QueryLEDCapabilities) (
+		SLEngineCapabilitiesItf self,
+        SLuint32 *pIndex,
+		SLuint32 *pLEDDeviceID,
+		SLLEDDescriptor *pDescriptor
+	);
+	SLresult (*QueryVibraCapabilities) (
+		SLEngineCapabilitiesItf self,
+        SLuint32 *pIndex,
+		SLuint32 *pVibraDeviceID,
+		SLVibraDescriptor *pDescriptor
+	);
+	SLresult (*IsThreadSafe) (
+		SLEngineCapabilitiesItf self,
+		SLboolean *pIsThreadSafe
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Thread Sync Interface                                                     */
+/* --------------------------------------------------------------------------*/
+
+
+extern SL_API const SLInterfaceID SL_IID_THREADSYNC;
+
+struct SLThreadSyncItf_;
+typedef const struct SLThreadSyncItf_ * const * SLThreadSyncItf;
+
+
+struct SLThreadSyncItf_ {
+	SLresult (*EnterCriticalSection) (
+		SLThreadSyncItf self
+	);
+	SLresult (*ExitCriticalSection) (
+		SLThreadSyncItf self
+	);
+};
+
+
+/*****************************************************************************/
+/* SL engine constructor                                                     */
+/*****************************************************************************/
+
+#define SL_ENGINEOPTION_THREADSAFE	((SLuint32) 0x00000001)
+#define SL_ENGINEOPTION_LOSSOFCONTROL	((SLuint32) 0x00000002)
+
+typedef struct SLEngineOption_ {
+	SLuint32 feature;
+	SLuint32 data;
+} SLEngineOption;
+
+
+SL_API SLresult SLAPIENTRY slCreateEngine(
+	SLObjectItf             *pEngine,
+	SLuint32                numOptions,
+	const SLEngineOption    *pEngineOptions,
+	SLuint32                numInterfaces,
+	const SLInterfaceID     *pInterfaceIds,
+	const SLboolean         * pInterfaceRequired
+);
+
+SL_API SLresult SLAPIENTRY slQueryNumSupportedEngineInterfaces(
+	SLuint32 * pNumSupportedInterfaces
+);
+
+SL_API SLresult SLAPIENTRY slQuerySupportedEngineInterfaces(
+	SLuint32 index,
+	SLInterfaceID * pInterfaceId
+);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* OPENSL_ES_H_ */
diff --git a/ndk/platforms/android-20/include/SLES/OpenSLES_Android.h b/ndk/platforms/android-20/include/SLES/OpenSLES_Android.h
new file mode 100644
index 0000000..dcf3432
--- /dev/null
+++ b/ndk/platforms/android-20/include/SLES/OpenSLES_Android.h
@@ -0,0 +1,373 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENSL_ES_ANDROID_H_
+#define OPENSL_ES_ANDROID_H_
+
+#include "OpenSLES_AndroidConfiguration.h"
+#include "OpenSLES_AndroidMetadata.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "OpenSLES.h"
+
+/*---------------------------------------------------------------------------*/
+/* Android common types                                                      */
+/*---------------------------------------------------------------------------*/
+
+typedef sl_int64_t             SLAint64;          /* 64 bit signed integer   */
+
+typedef sl_uint64_t            SLAuint64;         /* 64 bit unsigned integer */
+
+/*---------------------------------------------------------------------------*/
+/* Android PCM Data Format                                                   */
+/*---------------------------------------------------------------------------*/
+
+/* The following pcm representations and data formats map to those in OpenSLES 1.1 */
+#define SL_ANDROID_PCM_REPRESENTATION_SIGNED_INT       ((SLuint32) 0x00000001)
+#define SL_ANDROID_PCM_REPRESENTATION_UNSIGNED_INT     ((SLuint32) 0x00000002)
+#define SL_ANDROID_PCM_REPRESENTATION_FLOAT            ((SLuint32) 0x00000003)
+
+#define SL_ANDROID_DATAFORMAT_PCM_EX    ((SLuint32) 0x00000004)
+
+typedef struct SLAndroidDataFormat_PCM_EX_ {
+    SLuint32         formatType;
+    SLuint32         numChannels;
+    SLuint32         sampleRate;
+    SLuint32         bitsPerSample;
+    SLuint32         containerSize;
+    SLuint32         channelMask;
+    SLuint32         endianness;
+    SLuint32         representation;
+} SLAndroidDataFormat_PCM_EX;
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect interface                                                  */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_ANDROIDEFFECT;
+
+/** Android Effect interface methods */
+
+struct SLAndroidEffectItf_;
+typedef const struct SLAndroidEffectItf_ * const * SLAndroidEffectItf;
+
+struct SLAndroidEffectItf_ {
+
+    SLresult (*CreateEffect) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId);
+
+    SLresult (*ReleaseEffect) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId);
+
+    SLresult (*SetEnabled) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLboolean enabled);
+
+    SLresult (*IsEnabled) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLboolean *pEnabled);
+
+    SLresult (*SendCommand) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLuint32 command,
+            SLuint32 commandSize,
+            void *pCommandData,
+            SLuint32 *replySize,
+            void *pReplyData);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect Send interface                                             */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_ANDROIDEFFECTSEND;
+
+/** Android Effect Send interface methods */
+
+struct SLAndroidEffectSendItf_;
+typedef const struct SLAndroidEffectSendItf_ * const * SLAndroidEffectSendItf;
+
+struct SLAndroidEffectSendItf_ {
+    SLresult (*EnableEffectSend) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLboolean enable,
+        SLmillibel initialLevel
+    );
+    SLresult (*IsEnabled) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLboolean *pEnable
+    );
+    SLresult (*SetDirectLevel) (
+        SLAndroidEffectSendItf self,
+        SLmillibel directLevel
+    );
+    SLresult (*GetDirectLevel) (
+        SLAndroidEffectSendItf self,
+        SLmillibel *pDirectLevel
+    );
+    SLresult (*SetSendLevel) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLmillibel sendLevel
+    );
+    SLresult (*GetSendLevel)(
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLmillibel *pSendLevel
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect Capabilities interface                                     */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_ANDROIDEFFECTCAPABILITIES;
+
+/** Android Effect Capabilities interface methods */
+
+struct SLAndroidEffectCapabilitiesItf_;
+typedef const struct SLAndroidEffectCapabilitiesItf_ * const * SLAndroidEffectCapabilitiesItf;
+
+struct SLAndroidEffectCapabilitiesItf_ {
+
+    SLresult (*QueryNumEffects) (SLAndroidEffectCapabilitiesItf self,
+            SLuint32 *pNumSupportedEffects);
+
+
+    SLresult (*QueryEffect) (SLAndroidEffectCapabilitiesItf self,
+            SLuint32 index,
+            SLInterfaceID *pEffectType,
+            SLInterfaceID *pEffectImplementation,
+            SLchar *pName,
+            SLuint16 *pNameSize);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Configuration interface                                           */
+/*---------------------------------------------------------------------------*/
+extern SL_API const SLInterfaceID SL_IID_ANDROIDCONFIGURATION;
+
+/** Android Configuration interface methods */
+
+struct SLAndroidConfigurationItf_;
+typedef const struct SLAndroidConfigurationItf_ * const * SLAndroidConfigurationItf;
+
+struct SLAndroidConfigurationItf_ {
+
+    SLresult (*SetConfiguration) (SLAndroidConfigurationItf self,
+            const SLchar *configKey,
+            const void *pConfigValue,
+            SLuint32 valueSize);
+
+    SLresult (*GetConfiguration) (SLAndroidConfigurationItf self,
+           const SLchar *configKey,
+           SLuint32 *pValueSize,
+           void *pConfigValue
+       );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Simple Buffer Queue Interface                                     */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE;
+
+struct SLAndroidSimpleBufferQueueItf_;
+typedef const struct SLAndroidSimpleBufferQueueItf_ * const * SLAndroidSimpleBufferQueueItf;
+
+typedef void (SLAPIENTRY *slAndroidSimpleBufferQueueCallback)(
+	SLAndroidSimpleBufferQueueItf caller,
+	void *pContext
+);
+
+/** Android simple buffer queue state **/
+
+typedef struct SLAndroidSimpleBufferQueueState_ {
+	SLuint32	count;
+	SLuint32	index;
+} SLAndroidSimpleBufferQueueState;
+
+
+struct SLAndroidSimpleBufferQueueItf_ {
+	SLresult (*Enqueue) (
+		SLAndroidSimpleBufferQueueItf self,
+		const void *pBuffer,
+		SLuint32 size
+	);
+	SLresult (*Clear) (
+		SLAndroidSimpleBufferQueueItf self
+	);
+	SLresult (*GetState) (
+		SLAndroidSimpleBufferQueueItf self,
+		SLAndroidSimpleBufferQueueState *pState
+	);
+	SLresult (*RegisterCallback) (
+		SLAndroidSimpleBufferQueueItf self,
+		slAndroidSimpleBufferQueueCallback callback,
+		void* pContext
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Buffer Queue Interface                                            */
+/*---------------------------------------------------------------------------*/
+
+extern SL_API const SLInterfaceID SL_IID_ANDROIDBUFFERQUEUESOURCE;
+
+struct SLAndroidBufferQueueItf_;
+typedef const struct SLAndroidBufferQueueItf_ * const * SLAndroidBufferQueueItf;
+
+#define SL_ANDROID_ITEMKEY_NONE             ((SLuint32) 0x00000000)
+#define SL_ANDROID_ITEMKEY_EOS              ((SLuint32) 0x00000001)
+#define SL_ANDROID_ITEMKEY_DISCONTINUITY    ((SLuint32) 0x00000002)
+#define SL_ANDROID_ITEMKEY_BUFFERQUEUEEVENT ((SLuint32) 0x00000003)
+#define SL_ANDROID_ITEMKEY_FORMAT_CHANGE    ((SLuint32) 0x00000004)
+
+#define SL_ANDROIDBUFFERQUEUEEVENT_NONE        ((SLuint32) 0x00000000)
+#define SL_ANDROIDBUFFERQUEUEEVENT_PROCESSED   ((SLuint32) 0x00000001)
+#if 0   // reserved for future use
+#define SL_ANDROIDBUFFERQUEUEEVENT_UNREALIZED  ((SLuint32) 0x00000002)
+#define SL_ANDROIDBUFFERQUEUEEVENT_CLEARED     ((SLuint32) 0x00000004)
+#define SL_ANDROIDBUFFERQUEUEEVENT_STOPPED     ((SLuint32) 0x00000008)
+#define SL_ANDROIDBUFFERQUEUEEVENT_ERROR       ((SLuint32) 0x00000010)
+#define SL_ANDROIDBUFFERQUEUEEVENT_CONTENT_END ((SLuint32) 0x00000020)
+#endif
+
+typedef struct SLAndroidBufferItem_ {
+    SLuint32 itemKey;  // identifies the item
+    SLuint32 itemSize;
+    SLuint8  itemData[0];
+} SLAndroidBufferItem;
+
+typedef SLresult (SLAPIENTRY *slAndroidBufferQueueCallback)(
+    SLAndroidBufferQueueItf caller,/* input */
+    void *pCallbackContext,        /* input */
+    void *pBufferContext,          /* input */
+    void *pBufferData,             /* input */
+    SLuint32 dataSize,             /* input */
+    SLuint32 dataUsed,             /* input */
+    const SLAndroidBufferItem *pItems,/* input */
+    SLuint32 itemsLength           /* input */
+);
+
+typedef struct SLAndroidBufferQueueState_ {
+    SLuint32    count;
+    SLuint32    index;
+} SLAndroidBufferQueueState;
+
+struct SLAndroidBufferQueueItf_ {
+    SLresult (*RegisterCallback) (
+        SLAndroidBufferQueueItf self,
+        slAndroidBufferQueueCallback callback,
+        void* pCallbackContext
+    );
+
+    SLresult (*Clear) (
+        SLAndroidBufferQueueItf self
+    );
+
+    SLresult (*Enqueue) (
+        SLAndroidBufferQueueItf self,
+        void *pBufferContext,
+        void *pData,
+        SLuint32 dataLength,
+        const SLAndroidBufferItem *pItems,
+        SLuint32 itemsLength
+    );
+
+    SLresult (*GetState) (
+        SLAndroidBufferQueueItf self,
+        SLAndroidBufferQueueState *pState
+    );
+
+    SLresult (*SetCallbackEventsMask) (
+            SLAndroidBufferQueueItf self,
+            SLuint32 eventFlags
+    );
+
+    SLresult (*GetCallbackEventsMask) (
+            SLAndroidBufferQueueItf self,
+            SLuint32 *pEventFlags
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android File Descriptor Data Locator                                      */
+/*---------------------------------------------------------------------------*/
+
+/** Addendum to Data locator macros  */
+#define SL_DATALOCATOR_ANDROIDFD                ((SLuint32) 0x800007BC)
+
+#define SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE ((SLAint64) 0xFFFFFFFFFFFFFFFFll)
+
+/** File Descriptor-based data locator definition, locatorType must be SL_DATALOCATOR_ANDROIDFD */
+typedef struct SLDataLocator_AndroidFD_ {
+    SLuint32        locatorType;
+    SLint32         fd;
+    SLAint64        offset;
+    SLAint64        length;
+} SLDataLocator_AndroidFD;
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Android Simple Buffer Queue Data Locator                          */
+/*---------------------------------------------------------------------------*/
+
+/** Addendum to Data locator macros  */
+#define SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE ((SLuint32) 0x800007BD)
+
+/** BufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE*/
+typedef struct SLDataLocator_AndroidSimpleBufferQueue {
+	SLuint32	locatorType;
+	SLuint32	numBuffers;
+} SLDataLocator_AndroidSimpleBufferQueue;
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Buffer Queue Data Locator                                         */
+/*---------------------------------------------------------------------------*/
+
+/** Addendum to Data locator macros  */
+#define SL_DATALOCATOR_ANDROIDBUFFERQUEUE       ((SLuint32) 0x800007BE)
+
+/** Android Buffer Queue-based data locator definition,
+ *  locatorType must be SL_DATALOCATOR_ANDROIDBUFFERQUEUE */
+typedef struct SLDataLocator_AndroidBufferQueue_ {
+    SLuint32    locatorType;
+    SLuint32    numBuffers;
+} SLDataLocator_AndroidBufferQueue;
+
+/**
+ * MIME types required for data in Android Buffer Queues
+ */
+#define SL_ANDROID_MIME_AACADTS            ((SLchar *) "audio/vnd.android.aac-adts")
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OPENSL_ES_ANDROID_H_ */
diff --git a/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidConfiguration.h b/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidConfiguration.h
new file mode 100644
index 0000000..01f460d
--- /dev/null
+++ b/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidConfiguration.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENSL_ES_ANDROIDCONFIGURATION_H_
+#define OPENSL_ES_ANDROIDCONFIGURATION_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------*/
+/* Android AudioRecorder configuration                                       */
+/*---------------------------------------------------------------------------*/
+
+/** Audio recording preset */
+/** Audio recording preset key */
+#define SL_ANDROID_KEY_RECORDING_PRESET ((const SLchar*) "androidRecordingPreset")
+/** Audio recording preset values */
+/**   preset "none" cannot be set, it is used to indicate the current settings
+ *     do not match any of the presets. */
+#define SL_ANDROID_RECORDING_PRESET_NONE                ((SLuint32) 0x00000000)
+/**   generic recording configuration on the platform */
+#define SL_ANDROID_RECORDING_PRESET_GENERIC             ((SLuint32) 0x00000001)
+/**   uses the microphone audio source with the same orientation as the camera
+ *     if available, the main device microphone otherwise */
+#define SL_ANDROID_RECORDING_PRESET_CAMCORDER           ((SLuint32) 0x00000002)
+/**   uses the main microphone tuned for voice recognition */
+#define SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION   ((SLuint32) 0x00000003)
+/**   uses the main microphone tuned for audio communications */
+#define SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION ((SLuint32) 0x00000004)
+
+/*---------------------------------------------------------------------------*/
+/* Android AudioPlayer configuration                                         */
+/*---------------------------------------------------------------------------*/
+
+/** Audio playback stream type */
+/** Audio playback stream type key */
+#define SL_ANDROID_KEY_STREAM_TYPE ((const SLchar*) "androidPlaybackStreamType")
+
+/** Audio playback stream type  values */
+/*      same as android.media.AudioManager.STREAM_VOICE_CALL */
+#define SL_ANDROID_STREAM_VOICE        ((SLint32) 0x00000000)
+/*      same as android.media.AudioManager.STREAM_SYSTEM */
+#define SL_ANDROID_STREAM_SYSTEM       ((SLint32) 0x00000001)
+/*      same as android.media.AudioManager.STREAM_RING */
+#define SL_ANDROID_STREAM_RING         ((SLint32) 0x00000002)
+/*      same as android.media.AudioManager.STREAM_MUSIC */
+#define SL_ANDROID_STREAM_MEDIA        ((SLint32) 0x00000003)
+/*      same as android.media.AudioManager.STREAM_ALARM */
+#define SL_ANDROID_STREAM_ALARM        ((SLint32) 0x00000004)
+/*      same as android.media.AudioManager.STREAM_NOTIFICATION */
+#define SL_ANDROID_STREAM_NOTIFICATION ((SLint32) 0x00000005)
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OPENSL_ES_ANDROIDCONFIGURATION_H_ */
diff --git a/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidMetadata.h b/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidMetadata.h
new file mode 100644
index 0000000..01e33b8
--- /dev/null
+++ b/ndk/platforms/android-20/include/SLES/OpenSLES_AndroidMetadata.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENSL_ES_ANDROIDMETADATA_H_
+#define OPENSL_ES_ANDROIDMETADATA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------*/
+/* Android metadata keys                                                     */
+/*---------------------------------------------------------------------------*/
+
+/**
+ * Additional metadata keys to be used in SLMetadataExtractionItf:
+ *   the ANDROID_KEY_PCMFORMAT_* keys follow the fields of the SLDataFormat_PCM struct, and as such
+ *   all values corresponding to these keys are of SLuint32 type, and are defined as the fields
+ *   of the same name in SLDataFormat_PCM.  The exception is that sample rate is expressed here
+ *   in Hz units, rather than in milliHz units.
+ */
+#define ANDROID_KEY_PCMFORMAT_NUMCHANNELS   "AndroidPcmFormatNumChannels"
+#define ANDROID_KEY_PCMFORMAT_SAMPLERATE    "AndroidPcmFormatSampleRate"
+#define ANDROID_KEY_PCMFORMAT_BITSPERSAMPLE "AndroidPcmFormatBitsPerSample"
+#define ANDROID_KEY_PCMFORMAT_CONTAINERSIZE "AndroidPcmFormatContainerSize"
+#define ANDROID_KEY_PCMFORMAT_CHANNELMASK   "AndroidPcmFormatChannelMask"
+#define ANDROID_KEY_PCMFORMAT_ENDIANNESS    "AndroidPcmFormatEndianness"
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OPENSL_ES_ANDROIDMETADATA_H_ */
diff --git a/ndk/platforms/android-20/include/SLES/OpenSLES_Platform.h b/ndk/platforms/android-20/include/SLES/OpenSLES_Platform.h
new file mode 100644
index 0000000..527693d
--- /dev/null
+++ b/ndk/platforms/android-20/include/SLES/OpenSLES_Platform.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2007-2009 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and /or associated documentation files (the "Materials "), to
+ * deal in the Materials without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Materials, and to permit persons to whom the Materials are
+ * furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
+ * MATERIALS.
+ *
+ * OpenSLES_Platform.h - OpenSL ES version 1.0
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file contains definitions for the base types and the          */
+/* SLAPIENTRY macro. This file **WILL NEED TO BE EDITED** to provide        */
+/* the correct definitions specific to the platform being used.             */
+/****************************************************************************/
+
+#ifndef _OPENSLES_PLATFORM_H_
+#define _OPENSLES_PLATFORM_H_
+
+typedef unsigned char               sl_uint8_t;
+typedef signed char                 sl_int8_t;
+typedef unsigned short              sl_uint16_t;
+typedef signed short                sl_int16_t;
+typedef unsigned int /*long*/       sl_uint32_t;
+typedef signed int /*long*/         sl_int32_t;
+typedef long long                   sl_int64_t;
+typedef unsigned long long          sl_uint64_t;
+
+#ifndef SL_API
+#ifdef __GNUC__
+#define SL_API                 /* override per-platform */
+#else
+#define SL_API __declspec(dllimport)
+#endif
+#endif
+
+#ifndef SLAPIENTRY
+#define SLAPIENTRY
+#endif
+
+#endif /* _OPENSLES_PLATFORM_H_ */
diff --git a/ndk/platforms/android-20/include/media/NdkMediaCodec.h b/ndk/platforms/android-20/include/media/NdkMediaCodec.h
new file mode 100644
index 0000000..c07f4c9
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaCodec.h
@@ -0,0 +1,235 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_CODEC_H
+#define _NDK_MEDIA_CODEC_H
+
+#include <android/native_window.h>
+
+#include "NdkMediaCrypto.h"
+#include "NdkMediaError.h"
+#include "NdkMediaFormat.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+struct AMediaCodec;
+typedef struct AMediaCodec AMediaCodec;
+
+struct AMediaCodecBufferInfo {
+    int32_t offset;
+    int32_t size;
+    int64_t presentationTimeUs;
+    uint32_t flags;
+};
+typedef struct AMediaCodecBufferInfo AMediaCodecBufferInfo;
+typedef struct AMediaCodecCryptoInfo AMediaCodecCryptoInfo;
+
+enum {
+    AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM = 4,
+    AMEDIACODEC_CONFIGURE_FLAG_ENCODE = 1,
+    AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED = -3,
+    AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED = -2,
+    AMEDIACODEC_INFO_TRY_AGAIN_LATER = -1
+};
+
+/**
+ * Create codec by name. Use this if you know the exact codec you want to use.
+ * When configuring, you will need to specify whether to use the codec as an
+ * encoder or decoder.
+ */
+AMediaCodec* AMediaCodec_createCodecByName(const char *name);
+
+/**
+ * Create codec by mime type. Most applications will use this, specifying a
+ * mime type obtained from media extractor.
+ */
+AMediaCodec* AMediaCodec_createDecoderByType(const char *mime_type);
+
+/**
+ * Create encoder by name.
+ */
+AMediaCodec* AMediaCodec_createEncoderByType(const char *mime_type);
+
+/**
+ * delete the codec and free its resources
+ */
+media_status_t AMediaCodec_delete(AMediaCodec*);
+
+/**
+ * Configure the codec. For decoding you would typically get the format from an extractor.
+ */
+media_status_t AMediaCodec_configure(
+        AMediaCodec*,
+        const AMediaFormat* format,
+        ANativeWindow* surface,
+        AMediaCrypto *crypto,
+        uint32_t flags);
+
+/**
+ * Start the codec. A codec must be configured before it can be started, and must be started
+ * before buffers can be sent to it.
+ */
+media_status_t AMediaCodec_start(AMediaCodec*);
+
+/**
+ * Stop the codec.
+ */
+media_status_t AMediaCodec_stop(AMediaCodec*);
+
+/*
+ * Flush the codec's input and output. All indices previously returned from calls to
+ * AMediaCodec_dequeueInputBuffer and AMediaCodec_dequeueOutputBuffer become invalid.
+ */
+media_status_t AMediaCodec_flush(AMediaCodec*);
+
+/**
+ * Get an input buffer. The specified buffer index must have been previously obtained from
+ * dequeueInputBuffer, and not yet queued.
+ */
+uint8_t* AMediaCodec_getInputBuffer(AMediaCodec*, size_t idx, size_t *out_size);
+
+/**
+ * Get an output buffer. The specified buffer index must have been previously obtained from
+ * dequeueOutputBuffer, and not yet queued.
+ */
+uint8_t* AMediaCodec_getOutputBuffer(AMediaCodec*, size_t idx, size_t *out_size);
+
+/**
+ * Get the index of the next available input buffer. An app will typically use this with
+ * getInputBuffer() to get a pointer to the buffer, then copy the data to be encoded or decoded
+ * into the buffer before passing it to the codec.
+ */
+ssize_t AMediaCodec_dequeueInputBuffer(AMediaCodec*, int64_t timeoutUs);
+
+/**
+ * Send the specified buffer to the codec for processing.
+ */
+media_status_t AMediaCodec_queueInputBuffer(AMediaCodec*,
+        size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags);
+
+/**
+ * Send the specified buffer to the codec for processing.
+ */
+media_status_t AMediaCodec_queueSecureInputBuffer(AMediaCodec*,
+        size_t idx, off_t offset, AMediaCodecCryptoInfo*, uint64_t time, uint32_t flags);
+
+/**
+ * Get the index of the next available buffer of processed data.
+ */
+ssize_t AMediaCodec_dequeueOutputBuffer(AMediaCodec*, AMediaCodecBufferInfo *info, int64_t timeoutUs);
+AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec*);
+
+/**
+ * If you are done with a buffer, use this call to return the buffer to
+ * the codec. If you previously specified a surface when configuring this
+ * video decoder you can optionally render the buffer.
+ */
+media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool render);
+
+/**
+ * If you are done with a buffer, use this call to update its surface timestamp
+ * and return it to the codec to render it on the output surface. If you
+ * have not specified an output surface when configuring this video codec,
+ * this call will simply return the buffer to the codec.
+ *
+ * For more details, see the Java documentation for MediaCodec.releaseOutputBuffer.
+ */
+media_status_t AMediaCodec_releaseOutputBufferAtTime(
+        AMediaCodec *mData, size_t idx, int64_t timestampNs);
+
+
+typedef enum {
+    AMEDIACODECRYPTOINFO_MODE_CLEAR = 0,
+    AMEDIACODECRYPTOINFO_MODE_AES_CTR = 1
+} cryptoinfo_mode_t;
+
+/**
+ * Create an AMediaCodecCryptoInfo from scratch. Use this if you need to use custom
+ * crypto info, rather than one obtained from AMediaExtractor.
+ *
+ * AMediaCodecCryptoInfo describes the structure of an (at least
+ * partially) encrypted input sample.
+ * A buffer's data is considered to be partitioned into "subsamples",
+ * each subsample starts with a (potentially empty) run of plain,
+ * unencrypted bytes followed by a (also potentially empty) run of
+ * encrypted bytes.
+ * numBytesOfClearData can be null to indicate that all data is encrypted.
+ * This information encapsulates per-sample metadata as outlined in
+ * ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files".
+ */
+AMediaCodecCryptoInfo *AMediaCodecCryptoInfo_new(
+        int numsubsamples,
+        uint8_t key[16],
+        uint8_t iv[16],
+        cryptoinfo_mode_t mode,
+        size_t *clearbytes,
+        size_t *encryptedbytes);
+
+/**
+ * delete an AMediaCodecCryptoInfo created previously with AMediaCodecCryptoInfo_new, or
+ * obtained from AMediaExtractor
+ */
+media_status_t AMediaCodecCryptoInfo_delete(AMediaCodecCryptoInfo*);
+
+/**
+ * The number of subsamples that make up the buffer's contents.
+ */
+size_t AMediaCodecCryptoInfo_getNumSubSamples(AMediaCodecCryptoInfo*);
+
+/**
+ * A 16-byte opaque key
+ */
+media_status_t AMediaCodecCryptoInfo_getKey(AMediaCodecCryptoInfo*, uint8_t *dst);
+
+/**
+ * A 16-byte initialization vector
+ */
+media_status_t AMediaCodecCryptoInfo_getIV(AMediaCodecCryptoInfo*, uint8_t *dst);
+
+/**
+ * The type of encryption that has been applied,
+ * one of AMEDIACODECRYPTOINFO_MODE_CLEAR or AMEDIACODECRYPTOINFO_MODE_AES_CTR.
+ */
+cryptoinfo_mode_t AMediaCodecCryptoInfo_getMode(AMediaCodecCryptoInfo*);
+
+/**
+ * The number of leading unencrypted bytes in each subsample.
+ */
+media_status_t AMediaCodecCryptoInfo_getClearBytes(AMediaCodecCryptoInfo*, size_t *dst);
+
+/**
+ * The number of trailing encrypted bytes in each subsample.
+ */
+media_status_t AMediaCodecCryptoInfo_getEncryptedBytes(AMediaCodecCryptoInfo*, size_t *dst);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif //_NDK_MEDIA_CODEC_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaCrypto.h b/ndk/platforms/android-20/include/media/NdkMediaCrypto.h
new file mode 100644
index 0000000..90374c5
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaCrypto.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_CRYPTO_H
+#define _NDK_MEDIA_CRYPTO_H
+
+#include <sys/types.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct AMediaCrypto;
+typedef struct AMediaCrypto AMediaCrypto;
+
+typedef uint8_t AMediaUUID[16];
+
+bool AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid);
+
+bool AMediaCrypto_requiresSecureDecoderComponent(const char *mime);
+
+AMediaCrypto* AMediaCrypto_new(const AMediaUUID uuid, const void *initData, size_t initDataSize);
+
+void AMediaCrypto_delete(AMediaCrypto* crypto);
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NDK_MEDIA_CRYPTO_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaDrm.h b/ndk/platforms/android-20/include/media/NdkMediaDrm.h
new file mode 100644
index 0000000..10afdd9
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaDrm.h
@@ -0,0 +1,455 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_DRM_H
+#define _NDK_MEDIA_DRM_H
+
+#include "NdkMediaError.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+
+struct AMediaDrm;
+typedef struct AMediaDrm AMediaDrm;
+
+typedef struct {
+    const uint8_t *ptr;
+    size_t length;
+} AMediaDrmByteArray;
+
+typedef AMediaDrmByteArray AMediaDrmSessionId;
+typedef AMediaDrmByteArray AMediaDrmScope;
+typedef AMediaDrmByteArray AMediaDrmKeySetId;
+typedef AMediaDrmByteArray AMediaDrmSecureStop;
+
+
+typedef enum AMediaDrmEventType {
+    /**
+     * This event type indicates that the app needs to request a certificate from
+     * the provisioning server.  The request message data is obtained using
+     * AMediaDrm_getProvisionRequest.
+     */
+    EVENT_PROVISION_REQUIRED = 1,
+
+    /**
+     * This event type indicates that the app needs to request keys from a license
+     * server.  The request message data is obtained using AMediaDrm_getKeyRequest.
+     */
+    EVENT_KEY_REQUIRED = 2,
+
+    /**
+     * This event type indicates that the licensed usage duration for keys in a session
+     * has expired.  The keys are no longer valid.
+     */
+    EVENT_KEY_EXPIRED = 3,
+
+    /**
+     * This event may indicate some specific vendor-defined condition, see your
+     * DRM provider documentation for details
+     */
+    EVENT_VENDOR_DEFINED = 4
+} AMediaDrmEventType;
+
+typedef void (*AMediaDrmEventListener)(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        AMediaDrmEventType eventType, int extra, const uint8_t *data, size_t dataSize);
+
+
+/**
+ * Query if the given scheme identified by its UUID is supported on this device, and
+ * whether the drm plugin is able to handle the media container format specified by mimeType.
+ *
+ * uuid identifies the universal unique ID of the crypto scheme. uuid must be 16 bytes.
+ * mimeType is the MIME type of the media container, e.g. "video/mp4".  If mimeType
+ * is not known or required, it can be provided as NULL.
+ */
+bool AMediaDrm_isCryptoSchemeSupported(const uint8_t *uuid, const char *mimeType);
+
+/**
+ * Create a MediaDrm instance from a UUID
+ * uuid identifies the universal unique ID of the crypto scheme. uuid must be 16 bytes.
+ */
+AMediaDrm* AMediaDrm_createByUUID(const uint8_t *uuid);
+
+/**
+ * Release a MediaDrm object
+ */
+void AMediaDrm_release(AMediaDrm *);
+
+/**
+ * Register a callback to be invoked when an event occurs
+ *
+ * listener is the callback that will be invoked on event
+ */
+media_status_t AMediaDrm_setOnEventListener(AMediaDrm *, AMediaDrmEventListener listener);
+
+/**
+ * Open a new session with the MediaDrm object.  A session ID is returned.
+ *
+ * returns MEDIADRM_NOT_PROVISIONED_ERROR if provisioning is needed
+ * returns MEDIADRM_RESOURCE_BUSY_ERROR if required resources are in use
+ */
+media_status_t AMediaDrm_openSession(AMediaDrm *, AMediaDrmSessionId *sessionId);
+
+/**
+ * Close a session on the MediaDrm object that was previously opened
+ * with AMediaDrm_openSession.
+ */
+media_status_t AMediaDrm_closeSession(AMediaDrm *, const AMediaDrmSessionId *sessionId);
+
+typedef enum AMediaDrmKeyType {
+    /**
+     * This key request type species that the keys will be for online use, they will
+     * not be saved to the device for subsequent use when the device is not connected
+     * to a network.
+     */
+    KEY_TYPE_STREAMING = 1,
+
+    /**
+     * This key request type specifies that the keys will be for offline use, they
+     * will be saved to the device for use when the device is not connected to a network.
+     */
+    KEY_TYPE_OFFLINE = 2,
+
+    /**
+     * This key request type specifies that previously saved offline keys should be released.
+     */
+    KEY_TYPE_RELEASE = 3
+} AMediaDrmKeyType;
+
+/**
+ *  Data type containing {key, value} pair
+ */
+typedef struct AMediaDrmKeyValuePair {
+    const char *mKey;
+    const char *mValue;
+} AMediaDrmKeyValue;
+
+/**
+ * A key request/response exchange occurs between the app and a license server
+ * to obtain or release keys used to decrypt encrypted content.
+ * AMediaDrm_getKeyRequest is used to obtain an opaque key request byte array that
+ * is delivered to the license server.  The opaque key request byte array is
+ * returned in KeyRequest.data.  The recommended URL to deliver the key request to
+ * is returned in KeyRequest.defaultUrl.
+ *
+ * After the app has received the key request response from the server,
+ * it should deliver to the response to the DRM engine plugin using the method
+ * AMediaDrm_provideKeyResponse.
+ *
+ * scope may be a sessionId or a keySetId, depending on the specified keyType.
+ * When the keyType is KEY_TYPE_STREAMING or KEY_TYPE_OFFLINE, scope should be set
+ * to the sessionId the keys will be provided to.  When the keyType is
+ * KEY_TYPE_RELEASE, scope should be set to the keySetId of the keys being released.
+ * Releasing keys from a device invalidates them for all sessions.
+ *
+ * init container-specific data, its meaning is interpreted based on the mime type
+ * provided in the mimeType parameter.  It could contain, for example, the content
+ * ID, key ID or other data obtained from the content metadata that is required in
+ * generating the key request. init may be null when keyType is KEY_TYPE_RELEASE.
+ *
+ * initSize is the number of bytes of initData
+ *
+ * mimeType identifies the mime type of the content.
+ *
+ * keyType specifes the type of the request. The request may be to acquire keys for
+ *   streaming or offline content, or to release previously acquired keys, which are
+ *   identified by a keySetId.
+ *
+ * optionalParameters are included in the key request message to allow a client
+ *   application to provide additional message parameters to the server.
+ *
+ * numOptionalParameters indicates the number of optional parameters provided
+ *   by the caller
+ *
+ * On exit:
+ *   1. The keyRequest pointer will reference the opaque key request data.  It
+ *       will reside in memory owned by the AMediaDrm object, and will remain
+ *       accessible until the next call to AMediaDrm_getKeyRequest or until the
+ *       MediaDrm object is released.
+ *   2. keyRequestSize will be set to the size of the request
+ *
+ * returns MEDIADRM_NOT_PROVISIONED_ERROR if reprovisioning is needed, due to a
+ * problem with the device certificate.
+*/
+media_status_t AMediaDrm_getKeyRequest(AMediaDrm *, const AMediaDrmScope *scope,
+        const uint8_t *init, size_t initSize, const char *mimeType, AMediaDrmKeyType keyType,
+        const AMediaDrmKeyValue *optionalParameters, size_t numOptionalParameters,
+        const uint8_t **keyRequest, size_t *keyRequestSize);
+
+/**
+ * A key response is received from the license server by the app, then it is
+ * provided to the DRM engine plugin using provideKeyResponse.  When the
+ * response is for an offline key request, a keySetId is returned that can be
+ * used to later restore the keys to a new session with AMediaDrm_restoreKeys.
+ * When the response is for a streaming or release request, a null keySetId is
+ * returned.
+ *
+ * scope may be a sessionId or keySetId depending on the type of the
+ * response.  Scope should be set to the sessionId when the response is for either
+ * streaming or offline key requests.  Scope should be set to the keySetId when
+ * the response is for a release request.
+ *
+ * response points to the opaque response from the server
+ * responseSize should be set to the size of the response in bytes
+ */
+
+media_status_t AMediaDrm_provideKeyResponse(AMediaDrm *, const AMediaDrmScope *scope,
+        const uint8_t *response, size_t responseSize, AMediaDrmKeySetId *keySetId);
+
+/**
+ * Restore persisted offline keys into a new session.  keySetId identifies the
+ * keys to load, obtained from a prior call to AMediaDrm_provideKeyResponse.
+ *
+ * sessionId is the session ID for the DRM session
+ * keySetId identifies the saved key set to restore
+ */
+media_status_t AMediaDrm_restoreKeys(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        const AMediaDrmKeySetId *keySetId);
+
+/**
+ * Remove the current keys from a session.
+ *
+ * keySetId identifies keys to remove
+ */
+media_status_t AMediaDrm_removeKeys(AMediaDrm *, const AMediaDrmSessionId *keySetId);
+
+/**
+ * Request an informative description of the key status for the session.  The status is
+ * in the form of {key, value} pairs.  Since DRM license policies vary by vendor,
+ * the specific status field names are determined by each DRM vendor.  Refer to your
+ * DRM provider documentation for definitions of the field names for a particular
+ * DRM engine plugin.
+ *
+ * On entry, numPairs should be set by the caller to the maximum number of pairs
+ * that can be returned (the size of the array).  On exit, numPairs will be set
+ * to the number of entries written to the array.  If the number of {key, value} pairs
+ * to be returned is greater than *numPairs, MEDIADRM_SHORT_BUFFER will be returned
+ * and numPairs will be set to the number of pairs available.
+ */
+media_status_t AMediaDrm_queryKeyStatus(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        AMediaDrmKeyValue *keyValuePairs, size_t *numPairs);
+
+
+/**
+ * A provision request/response exchange occurs between the app and a provisioning
+ * server to retrieve a device certificate.  If provisionining is required, the
+ * EVENT_PROVISION_REQUIRED event will be sent to the event handler.
+ * getProvisionRequest is used to obtain the opaque provision request byte array that
+ * should be delivered to the provisioning server.
+ * On exit:
+ *    1. The provision request data will be referenced by provisionRequest, in
+ *        memory owned by the AMediaDrm object.  It will remain accessible until the
+ *        next call to getProvisionRequest.
+ *    2. provisionRequestSize will be set to the size of the request data.
+ *    3. serverUrl will reference a NULL terminated string containing the URL
+ *       the provisioning request should be sent to.  It will remain accessible until
+ *       the next call to getProvisionRequest.
+ */
+media_status_t AMediaDrm_getProvisionRequest(AMediaDrm *, const uint8_t **provisionRequest,
+        size_t *provisionRequestSize, const char **serverUrl);
+
+
+/**
+ * After a provision response is received by the app, it is provided to the DRM
+ * engine plugin using this method.
+ *
+ * response is the opaque provisioning response byte array to provide to the
+ *   DRM engine plugin.
+ * responseSize is the length of the provisioning response in bytes.
+ *
+ * returns MEDIADRM_DEVICE_REVOKED_ERROR if the response indicates that the
+ * server rejected the request
+ */
+media_status_t AMediaDrm_provideProvisionResponse(AMediaDrm *,
+        const uint8_t *response, size_t responseSize);
+
+
+/**
+ * A means of enforcing limits on the number of concurrent streams per subscriber
+ * across devices is provided via SecureStop. This is achieved by securely
+ * monitoring the lifetime of sessions.
+ *
+ * Information from the server related to the current playback session is written
+ * to persistent storage on the device when each MediaCrypto object is created.
+ *
+ * In the normal case, playback will be completed, the session destroyed and the
+ * Secure Stops will be queried. The app queries secure stops and forwards the
+ * secure stop message to the server which verifies the signature and notifies the
+ * server side database that the session destruction has been confirmed. The persisted
+ * record on the client is only removed after positive confirmation that the server
+ * received the message using releaseSecureStops().
+ *
+ * numSecureStops is set by the caller to the maximum number of secure stops to
+ * return.  On exit, *numSecureStops will be set to the number actually returned.
+ * If *numSecureStops is too small for the number of secure stops available,
+ * MEDIADRM_SHORT_BUFFER will be returned and *numSecureStops will be set to the
+ * number required.
+ */
+media_status_t AMediaDrm_getSecureStops(AMediaDrm *,
+        AMediaDrmSecureStop *secureStops, size_t *numSecureStops);
+
+/**
+ * Process the SecureStop server response message ssRelease.  After authenticating
+ * the message, remove the SecureStops identified in the response.
+ *
+ * ssRelease is the server response indicating which secure stops to release
+ */
+media_status_t AMediaDrm_releaseSecureStops(AMediaDrm *,
+        const AMediaDrmSecureStop *ssRelease);
+
+/**
+ * String property name: identifies the maker of the DRM engine plugin
+ */
+const char *PROPERTY_VENDOR = "vendor";
+
+/**
+ * String property name: identifies the version of the DRM engine plugin
+ */
+const char *PROPERTY_VERSION = "version";
+
+/**
+ * String property name: describes the DRM engine plugin
+ */
+const char *PROPERTY_DESCRIPTION = "description";
+
+/**
+ * String property name: a comma-separated list of cipher and mac algorithms
+ * supported by CryptoSession.  The list may be empty if the DRM engine
+ * plugin does not support CryptoSession operations.
+ */
+const char *PROPERTY_ALGORITHMS = "algorithms";
+
+/**
+ * Read a DRM engine plugin String property value, given the property name string.
+ *
+ * propertyName identifies the property to query
+ * On return, propertyValue will be set to point to the property value.  The
+ * memory that the value resides in is owned by the NDK MediaDrm API and
+ * will remain valid until the next call to AMediaDrm_getPropertyString.
+ */
+media_status_t AMediaDrm_getPropertyString(AMediaDrm *, const char *propertyName,
+        const char **propertyValue);
+
+/**
+ * Byte array property name: the device unique identifier is established during
+ * device provisioning and provides a means of uniquely identifying each device.
+ */
+const char *PROPERTY_DEVICE_UNIQUE_ID = "deviceUniqueId";
+
+/**
+ * Read a DRM engine plugin byte array property value, given the property name string.
+ * On return, *propertyValue will be set to point to the property value.  The
+ * memory that the value resides in is owned by the NDK MediaDrm API and
+ * will remain valid until the next call to AMediaDrm_getPropertyByteArray.
+ */
+media_status_t AMediaDrm_getPropertyByteArray(AMediaDrm *, const char *propertyName,
+        AMediaDrmByteArray *propertyValue);
+
+/**
+ * Set a DRM engine plugin String property value.
+ */
+media_status_t AMediaDrm_setPropertyString(AMediaDrm *, const char *propertyName,
+        const char *value);
+
+/**
+ * Set a DRM engine plugin byte array property value.
+ */
+media_status_t AMediaDrm_setPropertyByteArray(AMediaDrm *, const char *propertyName,
+        const uint8_t *value, size_t valueSize);
+
+/**
+ * In addition to supporting decryption of DASH Common Encrypted Media, the
+ * MediaDrm APIs provide the ability to securely deliver session keys from
+ * an operator's session key server to a client device, based on the factory-installed
+ * root of trust, and then perform encrypt, decrypt, sign and verify operations
+ * with the session key on arbitrary user data.
+ *
+ * Operators create session key servers that receive session key requests and provide
+ * encrypted session keys which can be used for general purpose crypto operations.
+ *
+ * Generic encrypt/decrypt/sign/verify methods are based on the established session
+ * keys.  These keys are exchanged using the getKeyRequest/provideKeyResponse methods.
+ *
+ * Applications of this capability include securing various types of purchased or
+ * private content, such as applications, books and other media, photos or media
+ * delivery protocols.
+ */
+
+/*
+ * Encrypt the data referenced by input of length dataSize using algorithm specified
+ * by cipherAlgorithm, and write the encrypted result into output.  The caller must
+ * ensure that the output buffer is large enough to accept dataSize bytes. The key
+ * to use is identified by the 16 byte keyId.  The key must have been loaded into
+ * the session using provideKeyResponse.
+ */
+media_status_t AMediaDrm_encrypt(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv,
+        const uint8_t *input, uint8_t *output, size_t dataSize);
+
+/*
+ * Decrypt the data referenced by input of length dataSize using algorithm specified
+ * by cipherAlgorithm, and write the decrypted result into output.  The caller must
+ * ensure that the output buffer is large enough to accept dataSize bytes.  The key
+ * to use is identified by the 16 byte keyId.  The key must have been loaded into
+ * the session using provideKeyResponse.
+ */
+media_status_t AMediaDrm_decrypt(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        const char *cipherAlgorithm, uint8_t *keyId, uint8_t *iv,
+        const uint8_t *input, uint8_t *output, size_t dataSize);
+
+/*
+ * Generate a signature using the specified macAlgorithm over the message data
+ * referenced by message of size messageSize and store the signature in the
+ * buffer referenced signature of max size *signatureSize.  If the buffer is not
+ * large enough to hold the signature, MEDIADRM_SHORT_BUFFER is returned and
+ * *signatureSize is set to the buffer size required.  The key to use is identified
+ * by the 16 byte keyId.  The key must have been loaded into the session using
+ * provideKeyResponse.
+ */
+media_status_t AMediaDrm_sign(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        const char *macAlgorithm, uint8_t *keyId, uint8_t *message, size_t messageSize,
+        uint8_t *signature, size_t *signatureSize);
+
+/*
+ * Perform a signature verification using the specified macAlgorithm over the message
+ * data referenced by the message parameter of size messageSize. Returns MEDIADRM_OK
+ * if the signature matches, otherwise MEDAIDRM_VERIFY_FAILED is returned. The key to
+ * use is identified by the 16 byte keyId.  The key must have been loaded into the
+ * session using provideKeyResponse.
+ */
+media_status_t AMediaDrm_verify(AMediaDrm *, const AMediaDrmSessionId *sessionId,
+        const char *macAlgorithm, uint8_t *keyId, const uint8_t *message, size_t messageSize,
+        const uint8_t *signature, size_t signatureSize);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif //_NDK_MEDIA_DRM_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaError.h b/ndk/platforms/android-20/include/media/NdkMediaError.h
new file mode 100644
index 0000000..12613eb
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaError.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_ERROR_H
+#define _NDK_MEDIA_ERROR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+    AMEDIA_OK = 0,
+
+    AMEDIA_ERROR_BASE                  = -10000,
+    AMEDIA_ERROR_UNKNOWN               = AMEDIA_ERROR_BASE,
+    AMEDIA_ERROR_MALFORMED             = AMEDIA_ERROR_BASE - 1,
+    AMEDIA_ERROR_UNSUPPORTED           = AMEDIA_ERROR_BASE - 2,
+    AMEDIA_ERROR_INVALID_OBJECT        = AMEDIA_ERROR_BASE - 3,
+    AMEDIA_ERROR_INVALID_PARAMETER     = AMEDIA_ERROR_BASE - 4,
+
+    AMEDIA_DRM_ERROR_BASE              = -20000,
+    AMEDIA_DRM_NOT_PROVISIONED         = AMEDIA_DRM_ERROR_BASE - 1,
+    AMEDIA_DRM_RESOURCE_BUSY           = AMEDIA_DRM_ERROR_BASE - 2,
+    AMEDIA_DRM_DEVICE_REVOKED          = AMEDIA_DRM_ERROR_BASE - 3,
+    AMEDIA_DRM_SHORT_BUFFER            = AMEDIA_DRM_ERROR_BASE - 4,
+    AMEDIA_DRM_SESSION_NOT_OPENED      = AMEDIA_DRM_ERROR_BASE - 5,
+    AMEDIA_DRM_TAMPER_DETECTED         = AMEDIA_DRM_ERROR_BASE - 6,
+    AMEDIA_DRM_VERIFY_FAILED           = AMEDIA_DRM_ERROR_BASE - 7,
+    AMEDIA_DRM_NEED_KEY                = AMEDIA_DRM_ERROR_BASE - 8,
+    AMEDIA_DRM_LICENSE_EXPIRED         = AMEDIA_DRM_ERROR_BASE - 9,
+
+} media_status_t;
+
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NDK_MEDIA_ERROR_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaExtractor.h b/ndk/platforms/android-20/include/media/NdkMediaExtractor.h
new file mode 100644
index 0000000..7a4e702
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaExtractor.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_EXTRACTOR_H
+#define _NDK_MEDIA_EXTRACTOR_H
+
+#include <sys/types.h>
+
+#include "NdkMediaCodec.h"
+#include "NdkMediaFormat.h"
+#include "NdkMediaCrypto.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct AMediaExtractor;
+typedef struct AMediaExtractor AMediaExtractor;
+
+
+/**
+ * Create new media extractor
+ */
+AMediaExtractor* AMediaExtractor_new();
+
+/**
+ * Delete a previously created media extractor
+ */
+media_status_t AMediaExtractor_delete(AMediaExtractor*);
+
+/**
+ *  Set the file descriptor from which the extractor will read.
+ */
+media_status_t AMediaExtractor_setDataSourceFd(AMediaExtractor*, int fd, off64_t offset, off64_t length);
+
+/**
+ * Set the URI from which the extractor will read.
+ */
+media_status_t AMediaExtractor_setDataSource(AMediaExtractor*, const char *location); // TODO support headers
+
+/**
+ * Return the number of tracks in the previously specified media file
+ */
+size_t AMediaExtractor_getTrackCount(AMediaExtractor*);
+
+/**
+ * Return the format of the specified track. The caller must free the returned format
+ */
+AMediaFormat* AMediaExtractor_getTrackFormat(AMediaExtractor*, size_t idx);
+
+/**
+ * Select the specified track. Subsequent calls to readSampleData, getSampleTrackIndex and
+ * getSampleTime only retrieve information for the subset of tracks selected.
+ * Selecting the same track multiple times has no effect, the track is
+ * only selected once.
+ */
+media_status_t AMediaExtractor_selectTrack(AMediaExtractor*, size_t idx);
+
+/**
+ * Unselect the specified track. Subsequent calls to readSampleData, getSampleTrackIndex and
+ * getSampleTime only retrieve information for the subset of tracks selected..
+ */
+media_status_t AMediaExtractor_unselectTrack(AMediaExtractor*, size_t idx);
+
+/**
+ * Read the current sample.
+ */
+ssize_t AMediaExtractor_readSampleData(AMediaExtractor*, uint8_t *buffer, size_t capacity);
+
+/**
+ * Read the current sample's flags.
+ */
+uint32_t AMediaExtractor_getSampleFlags(AMediaExtractor*); // see definitions below
+
+/**
+ * Returns the track index the current sample originates from (or -1
+ * if no more samples are available)
+ */
+int AMediaExtractor_getSampleTrackIndex(AMediaExtractor*);
+
+/**
+ * Returns the current sample's presentation time in microseconds.
+ * or -1 if no more samples are available.
+ */
+int64_t AMediaExtractor_getSampleTime(AMediaExtractor*);
+
+/**
+ * Advance to the next sample. Returns false if no more sample data
+ * is available (end of stream).
+ */
+bool AMediaExtractor_advance(AMediaExtractor*);
+
+typedef enum {
+    AMEDIAEXTRACTOR_SEEK_PREVIOUS_SYNC,
+    AMEDIAEXTRACTOR_SEEK_NEXT_SYNC,
+    AMEDIAEXTRACTOR_SEEK_CLOSEST_SYNC
+} SeekMode;
+
+/**
+ *
+ */
+media_status_t AMediaExtractor_seekTo(AMediaExtractor*, int64_t seekPosUs, SeekMode mode);
+
+/**
+ * mapping of crypto scheme uuid to the scheme specific data for that scheme
+ */
+typedef struct PsshEntry {
+    AMediaUUID uuid;
+    size_t datalen;
+    void *data;
+} PsshEntry;
+
+/**
+ * list of crypto schemes and their data
+ */
+typedef struct PsshInfo {
+    size_t numentries;
+    PsshEntry entries[0];
+} PsshInfo;
+
+/**
+ * Get the PSSH info if present.
+ */
+PsshInfo* AMediaExtractor_getPsshInfo(AMediaExtractor*);
+
+
+AMediaCodecCryptoInfo *AMediaExtractor_getSampleCryptoInfo(AMediaExtractor *);
+
+
+enum {
+    AMEDIAEXTRACTOR_SAMPLE_FLAG_SYNC = 1,
+    AMEDIAEXTRACTOR_SAMPLE_FLAG_ENCRYPTED = 2,
+};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NDK_MEDIA_EXTRACTOR_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaFormat.h b/ndk/platforms/android-20/include/media/NdkMediaFormat.h
new file mode 100644
index 0000000..ab29791
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaFormat.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_FORMAT_H
+#define _NDK_MEDIA_FORMAT_H
+
+#include <sys/types.h>
+
+#include "NdkMediaError.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct AMediaFormat;
+typedef struct AMediaFormat AMediaFormat;
+
+AMediaFormat *AMediaFormat_new();
+media_status_t AMediaFormat_delete(AMediaFormat*);
+
+/**
+ * Human readable representation of the format. The returned string is owned by the format,
+ * and remains valid until the next call to toString, or until the format is deleted.
+ */
+const char* AMediaFormat_toString(AMediaFormat*);
+
+bool AMediaFormat_getInt32(AMediaFormat*, const char *name, int32_t *out);
+bool AMediaFormat_getInt64(AMediaFormat*, const char *name, int64_t *out);
+bool AMediaFormat_getFloat(AMediaFormat*, const char *name, float *out);
+/**
+ * The returned data is owned by the format and remains valid as long as the named entry
+ * is part of the format.
+ */
+bool AMediaFormat_getBuffer(AMediaFormat*, const char *name, void** data, size_t *size);
+/**
+ * The returned string is owned by the format, and remains valid until the next call to getString,
+ * or until the format is deleted.
+ */
+bool AMediaFormat_getString(AMediaFormat*, const char *name, const char **out);
+
+
+void AMediaFormat_setInt32(AMediaFormat*, const char* name, int32_t value);
+void AMediaFormat_setInt64(AMediaFormat*, const char* name, int64_t value);
+void AMediaFormat_setFloat(AMediaFormat*, const char* name, float value);
+/**
+ * The provided string is copied into the format.
+ */
+void AMediaFormat_setString(AMediaFormat*, const char* name, const char* value);
+/**
+ * The provided data is copied into the format.
+ */
+void AMediaFormat_setBuffer(AMediaFormat*, const char* name, void* data, size_t size);
+
+
+
+/**
+ * XXX should these be ints/enums that we look up in a table as needed?
+ */
+extern const char* AMEDIAFORMAT_KEY_AAC_PROFILE;
+extern const char* AMEDIAFORMAT_KEY_BIT_RATE;
+extern const char* AMEDIAFORMAT_KEY_CHANNEL_COUNT;
+extern const char* AMEDIAFORMAT_KEY_CHANNEL_MASK;
+extern const char* AMEDIAFORMAT_KEY_COLOR_FORMAT;
+extern const char* AMEDIAFORMAT_KEY_DURATION;
+extern const char* AMEDIAFORMAT_KEY_FLAC_COMPRESSION_LEVEL;
+extern const char* AMEDIAFORMAT_KEY_FRAME_RATE;
+extern const char* AMEDIAFORMAT_KEY_HEIGHT;
+extern const char* AMEDIAFORMAT_KEY_IS_ADTS;
+extern const char* AMEDIAFORMAT_KEY_IS_AUTOSELECT;
+extern const char* AMEDIAFORMAT_KEY_IS_DEFAULT;
+extern const char* AMEDIAFORMAT_KEY_IS_FORCED_SUBTITLE;
+extern const char* AMEDIAFORMAT_KEY_I_FRAME_INTERVAL;
+extern const char* AMEDIAFORMAT_KEY_LANGUAGE;
+extern const char* AMEDIAFORMAT_KEY_MAX_HEIGHT;
+extern const char* AMEDIAFORMAT_KEY_MAX_INPUT_SIZE;
+extern const char* AMEDIAFORMAT_KEY_MAX_WIDTH;
+extern const char* AMEDIAFORMAT_KEY_MIME;
+extern const char* AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP;
+extern const char* AMEDIAFORMAT_KEY_REPEAT_PREVIOUS_FRAME_AFTER;
+extern const char* AMEDIAFORMAT_KEY_SAMPLE_RATE;
+extern const char* AMEDIAFORMAT_KEY_WIDTH;
+extern const char* AMEDIAFORMAT_KEY_STRIDE;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NDK_MEDIA_FORMAT_H
diff --git a/ndk/platforms/android-20/include/media/NdkMediaMuxer.h b/ndk/platforms/android-20/include/media/NdkMediaMuxer.h
new file mode 100644
index 0000000..90d946c
--- /dev/null
+++ b/ndk/platforms/android-20/include/media/NdkMediaMuxer.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ * This file defines an NDK API.
+ * Do not remove methods.
+ * Do not change method signatures.
+ * Do not change the value of constants.
+ * Do not change the size of any of the classes defined in here.
+ * Do not reference types that are not part of the NDK.
+ * Do not #include files that aren't part of the NDK.
+ */
+
+#ifndef _NDK_MEDIA_MUXER_H
+#define _NDK_MEDIA_MUXER_H
+
+#include <sys/types.h>
+
+#include "NdkMediaCodec.h"
+#include "NdkMediaError.h"
+#include "NdkMediaFormat.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct AMediaMuxer;
+typedef struct AMediaMuxer AMediaMuxer;
+
+typedef enum {
+    AMEDIAMUXER_OUTPUT_FORMAT_MPEG_4 = 0,
+    AMEDIAMUXER_OUTPUT_FORMAT_WEBM   = 1,
+} OutputFormat;
+
+/**
+ * Create new media muxer
+ */
+AMediaMuxer* AMediaMuxer_new(int fd, OutputFormat format);
+
+/**
+ * Delete a previously created media muxer
+ */
+media_status_t AMediaMuxer_delete(AMediaMuxer*);
+
+/**
+ * Set and store the geodata (latitude and longitude) in the output file.
+ * This method should be called before AMediaMuxer_start. The geodata is stored
+ * in udta box if the output format is AMEDIAMUXER_OUTPUT_FORMAT_MPEG_4, and is
+ * ignored for other output formats.
+ * The geodata is stored according to ISO-6709 standard.
+ *
+ * Both values are specified in degrees.
+ * Latitude must be in the range [-90, 90].
+ * Longitude must be in the range [-180, 180].
+ */
+media_status_t AMediaMuxer_setLocation(AMediaMuxer*, float latitude, float longitude);
+
+/**
+ * Sets the orientation hint for output video playback.
+ * This method should be called before AMediaMuxer_start. Calling this
+ * method will not rotate the video frame when muxer is generating the file,
+ * but add a composition matrix containing the rotation angle in the output
+ * video if the output format is AMEDIAMUXER_OUTPUT_FORMAT_MPEG_4, so that a
+ * video player can choose the proper orientation for playback.
+ * Note that some video players may choose to ignore the composition matrix
+ * during playback.
+ * The angle is specified in degrees, clockwise.
+ * The supported angles are 0, 90, 180, and 270 degrees.
+ */
+media_status_t AMediaMuxer_setOrientationHint(AMediaMuxer*, int degrees);
+
+/**
+ * Adds a track with the specified format.
+ * Returns the index of the new track or a negative value in case of failure,
+ * which can be interpreted as a media_status_t.
+ */
+ssize_t AMediaMuxer_addTrack(AMediaMuxer*, const AMediaFormat* format);
+
+/**
+ * Start the muxer. Should be called after AMediaMuxer_addTrack and
+ * before AMediaMuxer_writeSampleData.
+ */
+media_status_t AMediaMuxer_start(AMediaMuxer*);
+
+/**
+ * Stops the muxer.
+ * Once the muxer stops, it can not be restarted.
+ */
+media_status_t AMediaMuxer_stop(AMediaMuxer*);
+
+/**
+ * Writes an encoded sample into the muxer.
+ * The application needs to make sure that the samples are written into
+ * the right tracks. Also, it needs to make sure the samples for each track
+ * are written in chronological order (e.g. in the order they are provided
+ * by the encoder.)
+ */
+media_status_t AMediaMuxer_writeSampleData(AMediaMuxer *muxer,
+        size_t trackIdx, const uint8_t *data, const AMediaCodecBufferInfo *info);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NDK_MEDIA_MUXER_H
diff --git a/ndk/platforms/android-20/samples/native-codec/AndroidManifest.xml b/ndk/platforms/android-20/samples/native-codec/AndroidManifest.xml
new file mode 100644
index 0000000..addf1f0
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.nativecodec">
+
+    <uses-feature android:glEsVersion="0x00020000" />
+
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".NativeCodec"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+
+    <uses-sdk android:minSdkVersion="19" />
+
+    <!-- INTERNET is needed to use a URI-based media player, depending on the URI -->
+    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
+
+</manifest>
diff --git a/ndk/platforms/android-20/samples/native-codec/README.txt b/ndk/platforms/android-20/samples/native-codec/README.txt
new file mode 100644
index 0000000..446941a
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/README.txt
@@ -0,0 +1,2 @@
+This sample app requires a video file to be placed in /sdcard/testfile.mp4
+For demonstration purposes we have supplied such a file.
diff --git a/ndk/platforms/android-20/samples/native-codec/default.properties b/ndk/platforms/android-20/samples/native-codec/default.properties
new file mode 100644
index 0000000..5874172
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/default.properties
@@ -0,0 +1,4 @@
+# Indicates whether an apk should be generated for each density.
+split.density=false
+# Project target.
+target=android-20
diff --git a/ndk/platforms/android-20/samples/native-codec/jni/Android.mk b/ndk/platforms/android-20/samples/native-codec/jni/Android.mk
new file mode 100644
index 0000000..34300c4
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/jni/Android.mk
@@ -0,0 +1,30 @@
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := native-codec-jni
+LOCAL_SRC_FILES := native-codec-jni.cpp looper.cpp
+# for native multimedia
+LOCAL_LDLIBS    += -lOpenMAXAL -lmediandk
+# for logging
+LOCAL_LDLIBS    += -llog
+# for native windows
+LOCAL_LDLIBS    += -landroid
+
+LOCAL_CFLAGS    += -UNDEBUG
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/platforms/android-20/samples/native-codec/jni/Application.mk b/ndk/platforms/android-20/samples/native-codec/jni/Application.mk
new file mode 100644
index 0000000..b02fc24
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/jni/Application.mk
@@ -0,0 +1,2 @@
+APP_PLATFORM := android-20
+APP_ABI := all
diff --git a/ndk/platforms/android-20/samples/native-codec/jni/looper.cpp b/ndk/platforms/android-20/samples/native-codec/jni/looper.cpp
new file mode 100644
index 0000000..98112f4
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/jni/looper.cpp
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "looper.h"
+
+#include <assert.h>
+#include <jni.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+#include <semaphore.h>
+
+// for __android_log_print(ANDROID_LOG_INFO, "YourApp", "formatted message");
+#include <android/log.h>
+#define TAG "NativeCodec-looper"
+#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, TAG, __VA_ARGS__)
+
+
+struct loopermessage;
+typedef struct loopermessage loopermessage;
+
+struct loopermessage {
+    int what;
+    void *obj;
+    loopermessage *next;
+    bool quit;
+};
+
+
+
+void* looper::trampoline(void* p) {
+    ((looper*)p)->loop();
+    return NULL;
+}
+
+looper::looper() {
+    sem_init(&headdataavailable, 0, 0);
+    sem_init(&headwriteprotect, 0, 1);
+    pthread_attr_t attr;
+    pthread_attr_init(&attr);
+
+    pthread_create(&worker, &attr, trampoline, this);
+    running = true;
+}
+
+
+looper::~looper() {
+    if (running) {
+        LOGV("Looper deleted while still running. Some messages will not be processed");
+        quit();
+    }
+}
+
+void looper::post(int what, void *data, bool flush) {
+    loopermessage *msg = new loopermessage();
+    msg->what = what;
+    msg->obj = data;
+    msg->next = NULL;
+    msg->quit = false;
+    addmsg(msg, flush);
+}
+
+void looper::addmsg(loopermessage *msg, bool flush) {
+    sem_wait(&headwriteprotect);
+    loopermessage *h = head;
+
+    if (flush) {
+        while(h) {
+            loopermessage *next = h->next;
+            delete h;
+            h = next;
+        }
+        h = NULL;
+    }
+    if (h) {
+        while (h->next) {
+            h = h->next;
+        }
+        h->next = msg;
+    } else {
+        head = msg;
+    }
+    LOGV("post msg %d", msg->what);
+    sem_post(&headwriteprotect);
+    sem_post(&headdataavailable);
+}
+
+void looper::loop() {
+    while(true) {
+        // wait for available message
+        sem_wait(&headdataavailable);
+
+        // get next available message
+        sem_wait(&headwriteprotect);
+        loopermessage *msg = head;
+        if (msg == NULL) {
+            LOGV("no msg");
+            sem_post(&headwriteprotect);
+            continue;
+        }
+        head = msg->next;
+        sem_post(&headwriteprotect);
+
+        if (msg->quit) {
+            LOGV("quitting");
+            delete msg;
+            return;
+        }
+        LOGV("processing msg %d", msg->what);
+        handle(msg->what, msg->obj);
+        delete msg;
+    }
+}
+
+void looper::quit() {
+    LOGV("quit");
+    loopermessage *msg = new loopermessage();
+    msg->what = 0;
+    msg->obj = NULL;
+    msg->next = NULL;
+    msg->quit = true;
+    addmsg(msg, false);
+    void *retval;
+    pthread_join(worker, &retval);
+    sem_destroy(&headdataavailable);
+    sem_destroy(&headwriteprotect);
+    running = false;
+}
+
+void looper::handle(int what, void* obj) {
+    LOGV("dropping msg %d %p", what, obj);
+}
+
diff --git a/ndk/platforms/android-20/samples/native-codec/jni/looper.h b/ndk/platforms/android-20/samples/native-codec/jni/looper.h
new file mode 100644
index 0000000..531a7cb
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/jni/looper.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <pthread.h>
+#include <semaphore.h>
+
+struct loopermessage;
+
+class looper {
+    public:
+        looper();
+        ~looper();
+
+        void post(int what, void *data, bool flush = false);
+        void quit();
+
+        virtual void handle(int what, void *data);
+
+    private:
+        void addmsg(loopermessage *msg, bool flush);
+        static void* trampoline(void* p);
+        void loop();
+        loopermessage *head;
+        pthread_t worker;
+        sem_t headwriteprotect;
+        sem_t headdataavailable;
+        bool running;
+};
diff --git a/ndk/platforms/android-20/samples/native-codec/jni/native-codec-jni.cpp b/ndk/platforms/android-20/samples/native-codec/jni/native-codec-jni.cpp
new file mode 100644
index 0000000..6053abe
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/jni/native-codec-jni.cpp
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* This is a JNI example where we use native methods to play video
+ * using the native AMedia* APIs.
+ * See the corresponding Java source file located at:
+ *
+ *   src/com/example/nativecodec/NativeMedia.java
+ *
+ * In this example we use assert() for "impossible" error conditions,
+ * and explicit handling and recovery for more likely error conditions.
+ */
+
+#include <assert.h>
+#include <jni.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+#include "looper.h"
+#include "media/NdkMediaCodec.h"
+#include "media/NdkMediaExtractor.h"
+
+// for __android_log_print(ANDROID_LOG_INFO, "YourApp", "formatted message");
+#include <android/log.h>
+#define TAG "NativeCodec"
+#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, TAG, __VA_ARGS__)
+
+// for native window JNI
+#include <android/native_window_jni.h>
+
+typedef struct {
+    int fd;
+    ANativeWindow* window;
+    AMediaExtractor* ex;
+    AMediaCodec *codec;
+    int64_t renderstart;
+    bool sawInputEOS;
+    bool sawOutputEOS;
+    bool isPlaying;
+    bool renderonce;
+} workerdata;
+
+workerdata data = {-1, NULL, NULL, NULL, 0, false, false, false, false};
+
+enum {
+    kMsgCodecBuffer,
+    kMsgPause,
+    kMsgResume,
+    kMsgPauseAck,
+    kMsgDecodeDone,
+    kMsgSeek,
+};
+
+
+
+class mylooper: public looper {
+    virtual void handle(int what, void* obj);
+};
+
+static mylooper *mlooper = NULL;
+
+int64_t systemnanotime() {
+    timespec now;
+    clock_gettime(CLOCK_MONOTONIC, &now);
+    return now.tv_sec * 1000000000LL + now.tv_nsec;
+}
+
+void doCodecWork(workerdata *d) {
+
+    ssize_t bufidx = -1;
+    if (!d->sawInputEOS) {
+        bufidx = AMediaCodec_dequeueInputBuffer(d->codec, 2000);
+        LOGV("input buffer %zd", bufidx);
+        if (bufidx >= 0) {
+            size_t bufsize;
+            uint8_t *buf = AMediaCodec_getInputBuffer(d->codec, bufidx, &bufsize);
+            ssize_t sampleSize = AMediaExtractor_readSampleData(d->ex, buf, bufsize);
+            if (sampleSize < 0) {
+                sampleSize = 0;
+                d->sawInputEOS = true;
+                LOGV("EOS");
+            }
+            int64_t presentationTimeUs = AMediaExtractor_getSampleTime(d->ex);
+
+            AMediaCodec_queueInputBuffer(d->codec, bufidx, 0, sampleSize, presentationTimeUs,
+                    d->sawInputEOS ? AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM : 0);
+            AMediaExtractor_advance(d->ex);
+        }
+    }
+
+    if (!d->sawOutputEOS) {
+        AMediaCodecBufferInfo info;
+        ssize_t status = AMediaCodec_dequeueOutputBuffer(d->codec, &info, 0);
+        if (status >= 0) {
+            if (info.flags & AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) {
+                LOGV("output EOS");
+                d->sawOutputEOS = true;
+            }
+            int64_t presentationNano = info.presentationTimeUs * 1000;
+            if (d->renderstart < 0) {
+                d->renderstart = systemnanotime() - presentationNano;
+            }
+            int64_t delay = (d->renderstart + presentationNano) - systemnanotime();
+            if (delay > 0) {
+                usleep(delay / 1000);
+            }
+            AMediaCodec_releaseOutputBuffer(d->codec, status, info.size != 0);
+            if (d->renderonce) {
+                d->renderonce = false;
+                return;
+            }
+        } else if (status == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) {
+            LOGV("output buffers changed");
+        } else if (status == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED) {
+            AMediaFormat *format = NULL;
+            format = AMediaCodec_getOutputFormat(d->codec);
+            LOGV("format changed to: %s", AMediaFormat_toString(format));
+            AMediaFormat_delete(format);
+        } else if (status == AMEDIACODEC_INFO_TRY_AGAIN_LATER) {
+            LOGV("no output buffer right now");
+        } else {
+            LOGV("unexpected info code: %zd", status);
+        }
+    }
+
+    if (!d->sawInputEOS || !d->sawOutputEOS) {
+        mlooper->post(kMsgCodecBuffer, d);
+    }
+}
+
+void mylooper::handle(int what, void* obj) {
+    switch (what) {
+        case kMsgCodecBuffer:
+            doCodecWork((workerdata*)obj);
+            break;
+
+        case kMsgDecodeDone:
+        {
+            workerdata *d = (workerdata*)obj;
+            AMediaCodec_stop(d->codec);
+            AMediaCodec_delete(d->codec);
+            AMediaExtractor_delete(d->ex);
+            d->sawInputEOS = true;
+            d->sawOutputEOS = true;
+        }
+        break;
+
+        case kMsgSeek:
+        {
+            workerdata *d = (workerdata*)obj;
+            AMediaExtractor_seekTo(d->ex, 0, AMEDIAEXTRACTOR_SEEK_NEXT_SYNC);
+            AMediaCodec_flush(d->codec);
+            d->renderstart = -1;
+            d->sawInputEOS = false;
+            d->sawOutputEOS = false;
+            if (!d->isPlaying) {
+                d->renderonce = true;
+                post(kMsgCodecBuffer, d);
+            }
+            LOGV("seeked");
+        }
+        break;
+
+        case kMsgPause:
+        {
+            workerdata *d = (workerdata*)obj;
+            if (d->isPlaying) {
+                // flush all outstanding codecbuffer messages with a no-op message
+                d->isPlaying = false;
+                post(kMsgPauseAck, NULL, true);
+            }
+        }
+        break;
+
+        case kMsgResume:
+        {
+            workerdata *d = (workerdata*)obj;
+            if (!d->isPlaying) {
+                d->renderstart = -1;
+                d->isPlaying = true;
+                post(kMsgCodecBuffer, d);
+            }
+        }
+        break;
+    }
+}
+
+
+
+
+extern "C" {
+
+jboolean Java_com_example_nativecodec_NativeCodec_createStreamingMediaPlayer(JNIEnv* env,
+        jclass clazz, jstring filename)
+{
+    LOGV("@@@ create");
+
+    // convert Java string to UTF-8
+    const char *utf8 = env->GetStringUTFChars(filename, NULL);
+    LOGV("opening %s", utf8);
+    int fd = open(utf8, O_RDONLY);
+    env->ReleaseStringUTFChars(filename, utf8);
+    if (fd < 0) {
+        LOGV("failed: %d (%s)", fd, strerror(errno));
+        return JNI_FALSE;
+    }
+
+    data.fd = fd;
+
+    workerdata *d = &data;
+
+    AMediaExtractor *ex = AMediaExtractor_new();
+    media_status_t err = AMediaExtractor_setDataSourceFd(ex, d->fd, 0 , LONG_MAX);
+    close(d->fd);
+    if (err != AMEDIA_OK) {
+        LOGV("setDataSource error: %d", err);
+        return JNI_FALSE;
+    }
+
+    int numtracks = AMediaExtractor_getTrackCount(ex);
+
+    AMediaCodec *codec = NULL;
+
+    LOGV("input has %d tracks", numtracks);
+    for (int i = 0; i < numtracks; i++) {
+        AMediaFormat *format = AMediaExtractor_getTrackFormat(ex, i);
+        const char *s = AMediaFormat_toString(format);
+        LOGV("track %d format: %s", i, s);
+        const char *mime;
+        if (!AMediaFormat_getString(format, AMEDIAFORMAT_KEY_MIME, &mime)) {
+            LOGV("no mime type");
+            return JNI_FALSE;
+        } else if (!strncmp(mime, "video/", 6)) {
+            // Omitting most error handling for clarity.
+            // Production code should check for errors.
+            AMediaExtractor_selectTrack(ex, i);
+            codec = AMediaCodec_createDecoderByType(mime);
+            AMediaCodec_configure(codec, format, d->window, NULL, 0);
+            d->ex = ex;
+            d->codec = codec;
+            d->renderstart = -1;
+            d->sawInputEOS = false;
+            d->sawOutputEOS = false;
+            d->isPlaying = false;
+            d->renderonce = true;
+            AMediaCodec_start(codec);
+        }
+        AMediaFormat_delete(format);
+    }
+
+    mlooper = new mylooper();
+    mlooper->post(kMsgCodecBuffer, d);
+
+    return JNI_TRUE;
+}
+
+// set the playing state for the streaming media player
+void Java_com_example_nativecodec_NativeCodec_setPlayingStreamingMediaPlayer(JNIEnv* env,
+        jclass clazz, jboolean isPlaying)
+{
+    LOGV("@@@ playpause: %d", isPlaying);
+    if (mlooper) {
+        if (isPlaying) {
+            mlooper->post(kMsgResume, &data);
+        } else {
+            mlooper->post(kMsgPause, &data);
+        }
+    }
+}
+
+
+// shut down the native media system
+void Java_com_example_nativecodec_NativeCodec_shutdown(JNIEnv* env, jclass clazz)
+{
+    LOGV("@@@ shutdown");
+    if (mlooper) {
+        mlooper->post(kMsgDecodeDone, &data, true /* flush */);
+        mlooper->quit();
+        delete mlooper;
+        mlooper = NULL;
+    }
+    if (data.window) {
+        ANativeWindow_release(data.window);
+        data.window = NULL;
+    }
+}
+
+
+// set the surface
+void Java_com_example_nativecodec_NativeCodec_setSurface(JNIEnv *env, jclass clazz, jobject surface)
+{
+    // obtain a native window from a Java surface
+    if (data.window) {
+        ANativeWindow_release(data.window);
+        data.window = NULL;
+    }
+    data.window = ANativeWindow_fromSurface(env, surface);
+    LOGV("@@@ setsurface %p", data.window);
+}
+
+
+// rewind the streaming media player
+void Java_com_example_nativecodec_NativeCodec_rewindStreamingMediaPlayer(JNIEnv *env, jclass clazz)
+{
+    LOGV("@@@ rewind");
+    mlooper->post(kMsgSeek, &data);
+}
+
+}
diff --git a/ndk/platforms/android-20/samples/native-codec/res/drawable/icon.png b/ndk/platforms/android-20/samples/native-codec/res/drawable/icon.png
new file mode 100644
index 0000000..a07c69f
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/res/drawable/icon.png
Binary files differ
diff --git a/ndk/platforms/android-20/samples/native-codec/res/layout/main.xml b/ndk/platforms/android-20/samples/native-codec/res/layout/main.xml
new file mode 100644
index 0000000..4e94a7b
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/res/layout/main.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dip"
+        >
+        <TextView
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/source_select"
+            />
+        <Spinner
+            android:id="@+id/source_spinner"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/source_prompt"
+            />
+    </LinearLayout>
+
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dip"
+        >
+        <Button
+            android:id="@+id/start_native"
+            android:text="@string/start_native"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            />
+        <Button
+            android:id="@+id/rewind_native"
+            android:text="@string/rewind_native"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            />
+    </LinearLayout>
+
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dip"
+        >
+        <RadioButton
+            android:id="@+id/radio1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:padding="10dip"
+        />
+        <SurfaceView
+            android:id="@+id/surfaceview1"
+            android:layout_width="640px"
+            android:layout_height="480px"
+            />
+    </LinearLayout>
+
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="8dip"
+        >
+        <RadioButton
+            android:id="@+id/radio2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:padding="10dip"
+        />
+        <com.example.nativecodec.MyGLSurfaceView
+            android:id="@+id/glsurfaceview1"
+            android:layout_width="640px"
+            android:layout_height="480px"
+            />
+    </LinearLayout>
+
+</LinearLayout>
diff --git a/ndk/platforms/android-20/samples/native-codec/res/values/strings.xml b/ndk/platforms/android-20/samples/native-codec/res/values/strings.xml
new file mode 100644
index 0000000..03169fc
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">NativeCodec</string>
+    <string name="start_java">Start/Pause\nJava MediaPlayer</string>
+    <string name="start_native">Start/Pause</string>
+
+    <string name="rewind_native">Rewind</string>
+
+    <string name="source_select">Please select the media source</string>
+    <string name="source_prompt">Media source</string>
+    <string-array name="source_array">
+        <item>/sdcard/testfile.mp4</item>
+    </string-array>
+
+    <string name="sink_select">Please select the video sink</string>
+    <string name="sink_prompt">Video sink</string>
+    <string-array name="sink_array">
+        <item>Surface</item>
+        <item>Texture</item>
+    </string-array>
+
+</resources>
diff --git a/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/MyGLSurfaceView.java b/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/MyGLSurfaceView.java
new file mode 100644
index 0000000..8897feb
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/MyGLSurfaceView.java
@@ -0,0 +1,354 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.nativecodec;
+
+import android.graphics.SurfaceTexture;
+import android.util.Log;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import android.content.Context;
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView;
+import android.opengl.Matrix;
+import android.os.SystemClock;
+import android.util.AttributeSet;
+
+public class MyGLSurfaceView extends GLSurfaceView {
+
+    MyRenderer mRenderer;
+
+    public MyGLSurfaceView(Context context) {
+        this(context, null);
+    }
+
+    public MyGLSurfaceView(Context context, AttributeSet attributeSet) {
+        super(context, attributeSet);
+        init();
+    }
+
+    private void init() {
+        setEGLContextClientVersion(2);
+        mRenderer = new MyRenderer();
+        setRenderer(mRenderer);
+        Log.i("@@@", "setrenderer");
+    }
+
+    @Override
+    public void onPause() {
+        mRenderer.onPause();
+        super.onPause();
+    }
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mRenderer.onResume();
+    }
+
+    public SurfaceTexture getSurfaceTexture() {
+        return mRenderer.getSurfaceTexture();
+    }
+}
+
+class MyRenderer implements GLSurfaceView.Renderer, SurfaceTexture.OnFrameAvailableListener {
+
+    public MyRenderer() {
+        mVertices = ByteBuffer.allocateDirect(mVerticesData.length
+                * FLOAT_SIZE_BYTES).order(ByteOrder.nativeOrder()).asFloatBuffer();
+        mVertices.put(mVerticesData).position(0);
+
+        Matrix.setIdentityM(mSTMatrix, 0);
+    }
+    public void onPause() {
+    }
+
+    public void onResume() {
+        mLastTime = SystemClock.elapsedRealtimeNanos();
+    }
+
+    @Override
+    public void onDrawFrame(GL10 glUnused) {
+        synchronized(this) {
+            if (updateSurface) {
+                mSurface.updateTexImage();
+
+                mSurface.getTransformMatrix(mSTMatrix);
+                updateSurface = false;
+            }
+        }
+
+        // Ignore the passed-in GL10 interface, and use the GLES20
+        // class's static methods instead.
+        GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
+        GLES20.glUseProgram(mProgram);
+        checkGlError("glUseProgram");
+
+        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
+        GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID);
+
+        mVertices.position(VERTICES_DATA_POS_OFFSET);
+        GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
+                VERTICES_DATA_STRIDE_BYTES, mVertices);
+        checkGlError("glVertexAttribPointer maPosition");
+        GLES20.glEnableVertexAttribArray(maPositionHandle);
+        checkGlError("glEnableVertexAttribArray maPositionHandle");
+
+        mVertices.position(VERTICES_DATA_UV_OFFSET);
+        GLES20.glVertexAttribPointer(maTextureHandle, 3, GLES20.GL_FLOAT, false,
+                VERTICES_DATA_STRIDE_BYTES, mVertices);
+        checkGlError("glVertexAttribPointer maTextureHandle");
+        GLES20.glEnableVertexAttribArray(maTextureHandle);
+        checkGlError("glEnableVertexAttribArray maTextureHandle");
+
+        long now = SystemClock.elapsedRealtimeNanos();
+        mRunTime += (now - mLastTime);
+        mLastTime = now;
+        double d = ((double)mRunTime) / 1000000000;
+        Matrix.setIdentityM(mMMatrix, 0);
+        Matrix.rotateM(mMMatrix, 0, 30, (float)Math.sin(d), (float)Math.cos(d), 0);
+        Matrix.multiplyMM(mMVPMatrix, 0, mVMatrix, 0, mMMatrix, 0);
+        Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mMVPMatrix, 0);
+
+        GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
+        GLES20.glUniformMatrix4fv(muSTMatrixHandle, 1, false, mSTMatrix, 0);
+
+        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
+        checkGlError("glDrawArrays");
+    }
+
+    @Override
+    public void onSurfaceChanged(GL10 glUnused, int width, int height) {
+        // Ignore the passed-in GL10 interface, and use the GLES20
+        // class's static methods instead.
+        GLES20.glViewport(0, 0, width, height);
+        mRatio = (float) width / height;
+        Matrix.frustumM(mProjMatrix, 0, -mRatio, mRatio, -1, 1, 3, 7);
+    }
+
+    @Override
+    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) {
+        // Ignore the passed-in GL10 interface, and use the GLES20
+        // class's static methods instead.
+
+        /* Set up alpha blending and an Android background color */
+        GLES20.glEnable(GLES20.GL_BLEND);
+        GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
+        GLES20.glClearColor(0.643f, 0.776f, 0.223f, 1.0f);
+
+        /* Set up shaders and handles to their variables */
+        mProgram = createProgram(mVertexShader, mFragmentShader);
+        if (mProgram == 0) {
+            return;
+        }
+        maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
+        checkGlError("glGetAttribLocation aPosition");
+        if (maPositionHandle == -1) {
+            throw new RuntimeException("Could not get attrib location for aPosition");
+        }
+        maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
+        checkGlError("glGetAttribLocation aTextureCoord");
+        if (maTextureHandle == -1) {
+            throw new RuntimeException("Could not get attrib location for aTextureCoord");
+        }
+
+        muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
+        checkGlError("glGetUniformLocation uMVPMatrix");
+        if (muMVPMatrixHandle == -1) {
+            throw new RuntimeException("Could not get attrib location for uMVPMatrix");
+        }
+
+        muSTMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uSTMatrix");
+        checkGlError("glGetUniformLocation uSTMatrix");
+        if (muMVPMatrixHandle == -1) {
+            throw new RuntimeException("Could not get attrib location for uSTMatrix");
+        }
+
+        checkGlError("glGetUniformLocation uCRatio");
+        if (muMVPMatrixHandle == -1) {
+            throw new RuntimeException("Could not get attrib location for uCRatio");
+        }
+
+        /*
+         * Create our texture. This has to be done each time the
+         * surface is created.
+         */
+
+        int[] textures = new int[1];
+        GLES20.glGenTextures(1, textures, 0);
+
+        mTextureID = textures[0];
+        GLES20.glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureID);
+        checkGlError("glBindTexture mTextureID");
+
+        // Can't do mipmapping with camera source
+        GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
+                GLES20.GL_NEAREST);
+        GLES20.glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
+                GLES20.GL_LINEAR);
+        // Clamp to edge is the only option
+        GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
+                GLES20.GL_CLAMP_TO_EDGE);
+        GLES20.glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
+                GLES20.GL_CLAMP_TO_EDGE);
+        checkGlError("glTexParameteri mTextureID");
+
+        /*
+         * Create the SurfaceTexture that will feed this textureID, and pass it to the camera
+         */
+
+        mSurface = new SurfaceTexture(mTextureID);
+        mSurface.setOnFrameAvailableListener(this);
+
+        Matrix.setLookAtM(mVMatrix, 0, 0, 0, 4f, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
+
+        synchronized(this) {
+            updateSurface = false;
+        }
+    }
+
+    @Override
+    synchronized public void onFrameAvailable(SurfaceTexture surface) {
+        /* For simplicity, SurfaceTexture calls here when it has new
+         * data available.  Call may come in from some random thread,
+         * so let's be safe and use synchronize. No OpenGL calls can be done here.
+         */
+        updateSurface = true;
+        //Log.v(TAG, "onFrameAvailable " + surface.getTimestamp());
+    }
+
+    private int loadShader(int shaderType, String source) {
+        int shader = GLES20.glCreateShader(shaderType);
+        if (shader != 0) {
+            GLES20.glShaderSource(shader, source);
+            GLES20.glCompileShader(shader);
+            int[] compiled = new int[1];
+            GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
+            if (compiled[0] == 0) {
+                Log.e(TAG, "Could not compile shader " + shaderType + ":");
+                Log.e(TAG, GLES20.glGetShaderInfoLog(shader));
+                GLES20.glDeleteShader(shader);
+                shader = 0;
+            }
+        }
+        return shader;
+    }
+
+    private int createProgram(String vertexSource, String fragmentSource) {
+        int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
+        if (vertexShader == 0) {
+            return 0;
+        }
+        int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
+        if (pixelShader == 0) {
+            return 0;
+        }
+
+        int program = GLES20.glCreateProgram();
+        if (program != 0) {
+            GLES20.glAttachShader(program, vertexShader);
+            checkGlError("glAttachShader");
+            GLES20.glAttachShader(program, pixelShader);
+            checkGlError("glAttachShader");
+            GLES20.glLinkProgram(program);
+            int[] linkStatus = new int[1];
+            GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
+            if (linkStatus[0] != GLES20.GL_TRUE) {
+                Log.e(TAG, "Could not link program: ");
+                Log.e(TAG, GLES20.glGetProgramInfoLog(program));
+                GLES20.glDeleteProgram(program);
+                program = 0;
+            }
+        }
+        return program;
+    }
+
+    private void checkGlError(String op) {
+        int error;
+        while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
+            Log.e(TAG, op + ": glError " + error);
+            throw new RuntimeException(op + ": glError " + error);
+        }
+    }
+
+    private static final int FLOAT_SIZE_BYTES = 4;
+    private static final int VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
+    private static final int VERTICES_DATA_POS_OFFSET = 0;
+    private static final int VERTICES_DATA_UV_OFFSET = 3;
+    private final float[] mVerticesData = {
+        // X, Y, Z, U, V
+        -1.25f, -1.0f, 0, 0.f, 0.f,
+         1.25f, -1.0f, 0, 1.f, 0.f,
+        -1.25f,  1.0f, 0, 0.f, 1.f,
+         1.25f,  1.0f, 0, 1.f, 1.f,
+    };
+
+    private FloatBuffer mVertices;
+
+    private final String mVertexShader =
+        "uniform mat4 uMVPMatrix;\n" +
+        "uniform mat4 uSTMatrix;\n" +
+        "attribute vec4 aPosition;\n" +
+        "attribute vec4 aTextureCoord;\n" +
+        "varying vec2 vTextureCoord;\n" +
+        "void main() {\n" +
+        "  gl_Position = uMVPMatrix * aPosition;\n" +
+        "  vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
+        "}\n";
+
+    private final String mFragmentShader =
+        "#extension GL_OES_EGL_image_external : require\n" +
+        "precision mediump float;\n" +
+        "varying vec2 vTextureCoord;\n" +
+        "uniform samplerExternalOES sTexture;\n" +
+        "void main() {\n" +
+        "  gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
+        "}\n";
+
+    private float[] mMVPMatrix = new float[16];
+    private float[] mProjMatrix = new float[16];
+    private float[] mMMatrix = new float[16];
+    private float[] mVMatrix = new float[16];
+    private float[] mSTMatrix = new float[16];
+
+    private int mProgram;
+    private int mTextureID;
+    private int muMVPMatrixHandle;
+    private int muSTMatrixHandle;
+    private int maPositionHandle;
+    private int maTextureHandle;
+
+    private float mRatio = 1.0f;
+    private SurfaceTexture mSurface;
+    private boolean updateSurface = false;
+    private long mLastTime = -1;
+    private long mRunTime = 0;
+
+    private static final String TAG = "MyRenderer";
+
+    // Magic key
+    private static final int GL_TEXTURE_EXTERNAL_OES = 0x8D65;
+
+    public SurfaceTexture getSurfaceTexture() {
+        return mSurface;
+    }
+}
diff --git a/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/NativeCodec.java b/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/NativeCodec.java
new file mode 100644
index 0000000..babd55f
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/src/com/example/nativecodec/NativeCodec.java
@@ -0,0 +1,319 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.nativecodec;
+
+import android.app.Activity;
+import android.graphics.SurfaceTexture;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.Surface;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.RadioButton;
+import android.widget.Spinner;
+
+import java.io.IOException;
+
+public class NativeCodec extends Activity {
+    static final String TAG = "NativeCodec";
+
+    String mSourceString = null;
+
+    SurfaceView mSurfaceView1;
+    SurfaceHolder mSurfaceHolder1;
+
+    VideoSink mSelectedVideoSink;
+    VideoSink mNativeCodecPlayerVideoSink;
+
+    SurfaceHolderVideoSink mSurfaceHolder1VideoSink;
+    GLViewVideoSink mGLView1VideoSink;
+
+    boolean mCreated = false;
+    boolean mIsPlaying = false;
+
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        setContentView(R.layout.main);
+
+        mGLView1 = (MyGLSurfaceView) findViewById(R.id.glsurfaceview1);
+
+        // set up the Surface 1 video sink
+        mSurfaceView1 = (SurfaceView) findViewById(R.id.surfaceview1);
+        mSurfaceHolder1 = mSurfaceView1.getHolder();
+
+        mSurfaceHolder1.addCallback(new SurfaceHolder.Callback() {
+
+            @Override
+            public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+                Log.v(TAG, "surfaceChanged format=" + format + ", width=" + width + ", height="
+                        + height);
+            }
+
+            @Override
+            public void surfaceCreated(SurfaceHolder holder) {
+                Log.v(TAG, "surfaceCreated");
+                if (mRadio1.isChecked()) {
+                    setSurface(holder.getSurface());
+                }
+            }
+
+            @Override
+            public void surfaceDestroyed(SurfaceHolder holder) {
+                Log.v(TAG, "surfaceDestroyed");
+            }
+
+        });
+
+        // initialize content source spinner
+        Spinner sourceSpinner = (Spinner) findViewById(R.id.source_spinner);
+        ArrayAdapter<CharSequence> sourceAdapter = ArrayAdapter.createFromResource(
+                this, R.array.source_array, android.R.layout.simple_spinner_item);
+        sourceAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        sourceSpinner.setAdapter(sourceAdapter);
+        sourceSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
+                mSourceString = parent.getItemAtPosition(pos).toString();
+                Log.v(TAG, "onItemSelected " + mSourceString);
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView parent) {
+                Log.v(TAG, "onNothingSelected");
+                mSourceString = null;
+            }
+
+        });
+
+        mRadio1 = (RadioButton) findViewById(R.id.radio1);
+        mRadio2 = (RadioButton) findViewById(R.id.radio2);
+
+        OnCheckedChangeListener checklistener = new CompoundButton.OnCheckedChangeListener() {
+
+          @Override
+          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+              Log.i("@@@@", "oncheckedchanged");
+              if (buttonView == mRadio1 && isChecked) {
+                  mRadio2.setChecked(false);
+              }
+              if (buttonView == mRadio2 && isChecked) {
+                  mRadio1.setChecked(false);
+              }
+              if (isChecked) {
+                  if (mRadio1.isChecked()) {
+                      if (mSurfaceHolder1VideoSink == null) {
+                          mSurfaceHolder1VideoSink = new SurfaceHolderVideoSink(mSurfaceHolder1);
+                      }
+                      mSelectedVideoSink = mSurfaceHolder1VideoSink;
+                      mGLView1.onPause();
+                      Log.i("@@@@", "glview pause");
+                  } else {
+                      mGLView1.onResume();
+                      if (mGLView1VideoSink == null) {
+                          mGLView1VideoSink = new GLViewVideoSink(mGLView1);
+                      }
+                      mSelectedVideoSink = mGLView1VideoSink;
+                  }
+                  switchSurface();
+              }
+          }
+        };
+        mRadio1.setOnCheckedChangeListener(checklistener);
+        mRadio2.setOnCheckedChangeListener(checklistener);
+        mRadio2.toggle();
+
+        // the surfaces themselves are easier targets than the radio buttons
+        mSurfaceView1.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mRadio1.toggle();
+            }
+        });
+        mGLView1.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mRadio2.toggle();
+            }
+      });
+
+        // initialize button click handlers
+
+        // native MediaPlayer start/pause
+        ((Button) findViewById(R.id.start_native)).setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View view) {
+                if (!mCreated) {
+                    if (mNativeCodecPlayerVideoSink == null) {
+                        if (mSelectedVideoSink == null) {
+                            return;
+                        }
+                        mSelectedVideoSink.useAsSinkForNative();
+                        mNativeCodecPlayerVideoSink = mSelectedVideoSink;
+                    }
+                    if (mSourceString != null) {
+                        mCreated = createStreamingMediaPlayer(mSourceString);
+                    }
+                }
+                if (mCreated) {
+                    mIsPlaying = !mIsPlaying;
+                    setPlayingStreamingMediaPlayer(mIsPlaying);
+                }
+            }
+
+        });
+
+
+        // native MediaPlayer rewind
+        ((Button) findViewById(R.id.rewind_native)).setOnClickListener(new View.OnClickListener() {
+
+            @Override
+            public void onClick(View view) {
+                if (mNativeCodecPlayerVideoSink != null) {
+                    rewindStreamingMediaPlayer();
+                }
+            }
+
+        });
+
+    }
+
+    void switchSurface() {
+        if (mCreated && mNativeCodecPlayerVideoSink != mSelectedVideoSink) {
+            // shutdown and recreate on other surface
+          Log.i("@@@", "shutting down player");
+            shutdown();
+            mCreated = false;
+            mSelectedVideoSink.useAsSinkForNative();
+            mNativeCodecPlayerVideoSink = mSelectedVideoSink;
+            if (mSourceString != null) {
+                Log.i("@@@", "recreating player");
+                mCreated = createStreamingMediaPlayer(mSourceString);
+                mIsPlaying = false;
+            }
+        }
+    }
+
+    /** Called when the activity is about to be paused. */
+    @Override
+    protected void onPause()
+    {
+        mIsPlaying = false;
+        setPlayingStreamingMediaPlayer(false);
+        mGLView1.onPause();
+        super.onPause();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        if (mRadio2.isChecked()) {
+            mGLView1.onResume();
+        }
+    }
+
+    /** Called when the activity is about to be destroyed. */
+    @Override
+    protected void onDestroy()
+    {
+        shutdown();
+        mCreated = false;
+        super.onDestroy();
+    }
+
+    private MyGLSurfaceView mGLView1;
+
+    private RadioButton mRadio1;
+
+    private RadioButton mRadio2;
+
+    /** Native methods, implemented in jni folder */
+    public static native void createEngine();
+    public static native boolean createStreamingMediaPlayer(String filename);
+    public static native void setPlayingStreamingMediaPlayer(boolean isPlaying);
+    public static native void shutdown();
+    public static native void setSurface(Surface surface);
+    public static native void rewindStreamingMediaPlayer();
+
+    /** Load jni .so on initialization */
+    static {
+         System.loadLibrary("native-codec-jni");
+    }
+
+    // VideoSink abstracts out the difference between Surface and SurfaceTexture
+    // aka SurfaceHolder and GLSurfaceView
+    static abstract class VideoSink {
+
+        abstract void setFixedSize(int width, int height);
+        abstract void useAsSinkForNative();
+
+    }
+
+    static class SurfaceHolderVideoSink extends VideoSink {
+
+        private final SurfaceHolder mSurfaceHolder;
+
+        SurfaceHolderVideoSink(SurfaceHolder surfaceHolder) {
+            mSurfaceHolder = surfaceHolder;
+        }
+
+        @Override
+        void setFixedSize(int width, int height) {
+            mSurfaceHolder.setFixedSize(width, height);
+        }
+
+        @Override
+        void useAsSinkForNative() {
+            Surface s = mSurfaceHolder.getSurface();
+            Log.i("@@@", "setting surface " + s);
+            setSurface(s);
+        }
+
+    }
+
+    static class GLViewVideoSink extends VideoSink {
+
+        private final MyGLSurfaceView mMyGLSurfaceView;
+
+        GLViewVideoSink(MyGLSurfaceView myGLSurfaceView) {
+            mMyGLSurfaceView = myGLSurfaceView;
+        }
+
+        @Override
+        void setFixedSize(int width, int height) {
+        }
+
+        @Override
+        void useAsSinkForNative() {
+            SurfaceTexture st = mMyGLSurfaceView.getSurfaceTexture();
+            Surface s = new Surface(st);
+            setSurface(s);
+            s.release();
+        }
+
+    }
+
+}
diff --git a/ndk/platforms/android-20/samples/native-codec/testfile.mp4 b/ndk/platforms/android-20/samples/native-codec/testfile.mp4
new file mode 100644
index 0000000..571ff44
--- /dev/null
+++ b/ndk/platforms/android-20/samples/native-codec/testfile.mp4
Binary files differ
diff --git a/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-arm/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-arm64/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-mips/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-mips64/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-x86/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.functions.txt b/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.functions.txt
new file mode 100644
index 0000000..8a4fa26
--- /dev/null
+++ b/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.functions.txt
@@ -0,0 +1,367 @@
+glActiveShaderProgram
+glActiveTexture
+glAttachShader
+glBeginQuery
+glBeginTransformFeedback
+glBindAttribLocation
+glBindBuffer
+glBindBufferBase
+glBindBufferRange
+glBindFramebuffer
+glBindImageTexture
+glBindProgramPipeline
+glBindRenderbuffer
+glBindSampler
+glBindTexture
+glBindTransformFeedback
+glBindVertexArray
+glBindVertexArrayOES
+glBindVertexBuffer
+glBlendBarrierKHR
+glBlendColor
+glBlendEquation
+glBlendEquationSeparate
+glBlendEquationSeparateiEXT
+glBlendEquationiEXT
+glBlendFunc
+glBlendFuncSeparate
+glBlendFuncSeparateiEXT
+glBlendFunciEXT
+glBlitFramebuffer
+glBufferData
+glBufferSubData
+glCheckFramebufferStatus
+glClear
+glClearBufferfi
+glClearBufferfv
+glClearBufferiv
+glClearBufferuiv
+glClearColor
+glClearDepthf
+glClearStencil
+glClientWaitSync
+glColorMask
+glColorMaskiEXT
+glCompileShader
+glCompressedTexImage2D
+glCompressedTexImage3D
+glCompressedTexImage3DOES
+glCompressedTexSubImage2D
+glCompressedTexSubImage3D
+glCompressedTexSubImage3DOES
+glCopyBufferSubData
+glCopyImageSubDataEXT
+glCopyTexImage2D
+glCopyTexSubImage2D
+glCopyTexSubImage3D
+glCopyTexSubImage3DOES
+glCreateProgram
+glCreateShader
+glCreateShaderProgramv
+glCullFace
+glDebugMessageCallbackKHR
+glDebugMessageControlKHR
+glDebugMessageInsertKHR
+glDeleteBuffers
+glDeleteFramebuffers
+glDeleteProgram
+glDeleteProgramPipelines
+glDeleteQueries
+glDeleteRenderbuffers
+glDeleteSamplers
+glDeleteShader
+glDeleteSync
+glDeleteTextures
+glDeleteTransformFeedbacks
+glDeleteVertexArrays
+glDeleteVertexArraysOES
+glDepthFunc
+glDepthMask
+glDepthRangef
+glDetachShader
+glDisable
+glDisableVertexAttribArray
+glDisableiEXT
+glDispatchCompute
+glDispatchComputeIndirect
+glDrawArrays
+glDrawArraysIndirect
+glDrawArraysInstanced
+glDrawBuffers
+glDrawElements
+glDrawElementsIndirect
+glDrawElementsInstanced
+glDrawRangeElements
+glEGLImageTargetRenderbufferStorageOES
+glEGLImageTargetTexture2DOES
+glEnable
+glEnableVertexAttribArray
+glEnableiEXT
+glEndQuery
+glEndTransformFeedback
+glFenceSync
+glFinish
+glFlush
+glFlushMappedBufferRange
+glFramebufferParameteri
+glFramebufferRenderbuffer
+glFramebufferTexture2D
+glFramebufferTexture3DOES
+glFramebufferTextureEXT
+glFramebufferTextureLayer
+glFrontFace
+glGenBuffers
+glGenFramebuffers
+glGenProgramPipelines
+glGenQueries
+glGenRenderbuffers
+glGenSamplers
+glGenTextures
+glGenTransformFeedbacks
+glGenVertexArrays
+glGenVertexArraysOES
+glGenerateMipmap
+glGetActiveAttrib
+glGetActiveUniform
+glGetActiveUniformBlockName
+glGetActiveUniformBlockiv
+glGetActiveUniformsiv
+glGetAttachedShaders
+glGetAttribLocation
+glGetBooleani_v
+glGetBooleanv
+glGetBufferParameteri64v
+glGetBufferParameteriv
+glGetBufferPointerv
+glGetBufferPointervOES
+glGetDebugMessageLogKHR
+glGetError
+glGetFloatv
+glGetFragDataLocation
+glGetFramebufferAttachmentParameteriv
+glGetFramebufferParameteriv
+glGetInteger64i_v
+glGetInteger64v
+glGetIntegeri_v
+glGetIntegerv
+glGetInternalformativ
+glGetMultisamplefv
+glGetObjectLabelKHR
+glGetObjectPtrLabelKHR
+glGetPointervKHR
+glGetProgramBinary
+glGetProgramBinaryOES
+glGetProgramInfoLog
+glGetProgramInterfaceiv
+glGetProgramPipelineInfoLog
+glGetProgramPipelineiv
+glGetProgramResourceIndex
+glGetProgramResourceLocation
+glGetProgramResourceName
+glGetProgramResourceiv
+glGetProgramiv
+glGetQueryObjectuiv
+glGetQueryiv
+glGetRenderbufferParameteriv
+glGetSamplerParameterIivEXT
+glGetSamplerParameterIuivEXT
+glGetSamplerParameterfv
+glGetSamplerParameteriv
+glGetShaderInfoLog
+glGetShaderPrecisionFormat
+glGetShaderSource
+glGetShaderiv
+glGetString
+glGetStringi
+glGetSynciv
+glGetTexLevelParameterfv
+glGetTexLevelParameteriv
+glGetTexParameterIivEXT
+glGetTexParameterIuivEXT
+glGetTexParameterfv
+glGetTexParameteriv
+glGetTransformFeedbackVarying
+glGetUniformBlockIndex
+glGetUniformIndices
+glGetUniformLocation
+glGetUniformfv
+glGetUniformiv
+glGetUniformuiv
+glGetVertexAttribIiv
+glGetVertexAttribIuiv
+glGetVertexAttribPointerv
+glGetVertexAttribfv
+glGetVertexAttribiv
+glHint
+glInvalidateFramebuffer
+glInvalidateSubFramebuffer
+glIsBuffer
+glIsEnabled
+glIsEnablediEXT
+glIsFramebuffer
+glIsProgram
+glIsProgramPipeline
+glIsQuery
+glIsRenderbuffer
+glIsSampler
+glIsShader
+glIsSync
+glIsTexture
+glIsTransformFeedback
+glIsVertexArray
+glIsVertexArrayOES
+glLineWidth
+glLinkProgram
+glMapBufferOES
+glMapBufferRange
+glMemoryBarrier
+glMemoryBarrierByRegion
+glMinSampleShadingOES
+glObjectLabelKHR
+glObjectPtrLabelKHR
+glPatchParameteriEXT
+glPauseTransformFeedback
+glPixelStorei
+glPolygonOffset
+glPopDebugGroupKHR
+glPrimitiveBoundingBoxEXT
+glProgramBinary
+glProgramBinaryOES
+glProgramParameteri
+glProgramUniform1f
+glProgramUniform1fv
+glProgramUniform1i
+glProgramUniform1iv
+glProgramUniform1ui
+glProgramUniform1uiv
+glProgramUniform2f
+glProgramUniform2fv
+glProgramUniform2i
+glProgramUniform2iv
+glProgramUniform2ui
+glProgramUniform2uiv
+glProgramUniform3f
+glProgramUniform3fv
+glProgramUniform3i
+glProgramUniform3iv
+glProgramUniform3ui
+glProgramUniform3uiv
+glProgramUniform4f
+glProgramUniform4fv
+glProgramUniform4i
+glProgramUniform4iv
+glProgramUniform4ui
+glProgramUniform4uiv
+glProgramUniformMatrix2fv
+glProgramUniformMatrix2x3fv
+glProgramUniformMatrix2x4fv
+glProgramUniformMatrix3fv
+glProgramUniformMatrix3x2fv
+glProgramUniformMatrix3x4fv
+glProgramUniformMatrix4fv
+glProgramUniformMatrix4x2fv
+glProgramUniformMatrix4x3fv
+glPushDebugGroupKHR
+glReadBuffer
+glReadPixels
+glReleaseShaderCompiler
+glRenderbufferStorage
+glRenderbufferStorageMultisample
+glResumeTransformFeedback
+glSampleCoverage
+glSampleMaski
+glSamplerParameterIivEXT
+glSamplerParameterIuivEXT
+glSamplerParameterf
+glSamplerParameterfv
+glSamplerParameteri
+glSamplerParameteriv
+glScissor
+glShaderBinary
+glShaderSource
+glStencilFunc
+glStencilFuncSeparate
+glStencilMask
+glStencilMaskSeparate
+glStencilOp
+glStencilOpSeparate
+glTexBufferEXT
+glTexBufferRangeEXT
+glTexImage2D
+glTexImage3D
+glTexImage3DOES
+glTexParameterIivEXT
+glTexParameterIuivEXT
+glTexParameterf
+glTexParameterfv
+glTexParameteri
+glTexParameteriv
+glTexStorage2D
+glTexStorage2DMultisample
+glTexStorage3D
+glTexStorage3DMultisampleOES
+glTexSubImage2D
+glTexSubImage3D
+glTexSubImage3DOES
+glTransformFeedbackVaryings
+glUniform1f
+glUniform1fv
+glUniform1i
+glUniform1iv
+glUniform1ui
+glUniform1uiv
+glUniform2f
+glUniform2fv
+glUniform2i
+glUniform2iv
+glUniform2ui
+glUniform2uiv
+glUniform3f
+glUniform3fv
+glUniform3i
+glUniform3iv
+glUniform3ui
+glUniform3uiv
+glUniform4f
+glUniform4fv
+glUniform4i
+glUniform4iv
+glUniform4ui
+glUniform4uiv
+glUniformBlockBinding
+glUniformMatrix2fv
+glUniformMatrix2x3fv
+glUniformMatrix2x4fv
+glUniformMatrix3fv
+glUniformMatrix3x2fv
+glUniformMatrix3x4fv
+glUniformMatrix4fv
+glUniformMatrix4x2fv
+glUniformMatrix4x3fv
+glUnmapBuffer
+glUnmapBufferOES
+glUseProgram
+glUseProgramStages
+glValidateProgram
+glValidateProgramPipeline
+glVertexAttrib1f
+glVertexAttrib1fv
+glVertexAttrib2f
+glVertexAttrib2fv
+glVertexAttrib3f
+glVertexAttrib3fv
+glVertexAttrib4f
+glVertexAttrib4fv
+glVertexAttribBinding
+glVertexAttribDivisor
+glVertexAttribFormat
+glVertexAttribI4i
+glVertexAttribI4iv
+glVertexAttribI4ui
+glVertexAttribI4uiv
+glVertexAttribIFormat
+glVertexAttribIPointer
+glVertexAttribPointer
+glVertexBindingDivisor
+glViewport
+glWaitSync
diff --git a/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.variables.txt b/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.variables.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ndk/platforms/android-21/arch-x86_64/symbols/libGLESv3.so.variables.txt
@@ -0,0 +1 @@
+
diff --git a/ndk/platforms/android-21/include/GLES2/gl2.h b/ndk/platforms/android-21/include/GLES2/gl2.h
new file mode 100644
index 0000000..8a4d43a
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES2/gl2.h
@@ -0,0 +1,525 @@
+#ifndef __gl2_h_
+#define __gl2_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision: 26696 $ on $Date: 2014-05-17 14:48:55 -0700 (Sat, 17 May 2014) $
+*/
+
+#include <GLES2/gl2platform.h>
+
+/* Generated on date 20140517 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-21/include/GLES2/gl2ext.h b/ndk/platforms/android-21/include/GLES2/gl2ext.h
new file mode 100644
index 0000000..9749f9f
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES2/gl2ext.h
@@ -0,0 +1,1932 @@
+#ifndef __gl2ext_h_
+#define __gl2ext_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision$ on $Date$
+*/
+
+#ifndef GL_APIENTRYP
+#define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/* Generated on date 20140519 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]
+ * Versions emitted: _nomatch_^
+ * Default extensions included: gles2
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_KHR_blend_equation_advanced
+#define GL_KHR_blend_equation_advanced 1
+#define GL_BLEND_ADVANCED_COHERENT_KHR    0x9285
+#define GL_MULTIPLY_KHR                   0x9294
+#define GL_SCREEN_KHR                     0x9295
+#define GL_OVERLAY_KHR                    0x9296
+#define GL_DARKEN_KHR                     0x9297
+#define GL_LIGHTEN_KHR                    0x9298
+#define GL_COLORDODGE_KHR                 0x9299
+#define GL_COLORBURN_KHR                  0x929A
+#define GL_HARDLIGHT_KHR                  0x929B
+#define GL_SOFTLIGHT_KHR                  0x929C
+#define GL_DIFFERENCE_KHR                 0x929E
+#define GL_EXCLUSION_KHR                  0x92A0
+#define GL_HSL_HUE_KHR                    0x92AD
+#define GL_HSL_SATURATION_KHR             0x92AE
+#define GL_HSL_COLOR_KHR                  0x92AF
+#define GL_HSL_LUMINOSITY_KHR             0x92B0
+typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void);
+#endif
+#endif /* GL_KHR_blend_equation_advanced */
+
+#ifndef GL_KHR_debug
+#define GL_KHR_debug 1
+typedef void (GL_APIENTRY  *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+#define GL_SAMPLER                        0x82E6
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR   0x8242
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243
+#define GL_DEBUG_CALLBACK_FUNCTION_KHR    0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM_KHR  0x8245
+#define GL_DEBUG_SOURCE_API_KHR           0x8246
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247
+#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR   0x8249
+#define GL_DEBUG_SOURCE_APPLICATION_KHR   0x824A
+#define GL_DEBUG_SOURCE_OTHER_KHR         0x824B
+#define GL_DEBUG_TYPE_ERROR_KHR           0x824C
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E
+#define GL_DEBUG_TYPE_PORTABILITY_KHR     0x824F
+#define GL_DEBUG_TYPE_PERFORMANCE_KHR     0x8250
+#define GL_DEBUG_TYPE_OTHER_KHR           0x8251
+#define GL_DEBUG_TYPE_MARKER_KHR          0x8268
+#define GL_DEBUG_TYPE_PUSH_GROUP_KHR      0x8269
+#define GL_DEBUG_TYPE_POP_GROUP_KHR       0x826A
+#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C
+#define GL_DEBUG_GROUP_STACK_DEPTH_KHR    0x826D
+#define GL_BUFFER_KHR                     0x82E0
+#define GL_SHADER_KHR                     0x82E1
+#define GL_PROGRAM_KHR                    0x82E2
+#define GL_VERTEX_ARRAY_KHR               0x8074
+#define GL_QUERY_KHR                      0x82E3
+#define GL_SAMPLER_KHR                    0x82E6
+#define GL_MAX_LABEL_LENGTH_KHR           0x82E8
+#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR   0x9143
+#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR  0x9144
+#define GL_DEBUG_LOGGED_MESSAGES_KHR      0x9145
+#define GL_DEBUG_SEVERITY_HIGH_KHR        0x9146
+#define GL_DEBUG_SEVERITY_MEDIUM_KHR      0x9147
+#define GL_DEBUG_SEVERITY_LOW_KHR         0x9148
+#define GL_DEBUG_OUTPUT_KHR               0x92E0
+#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR     0x00000002
+#define GL_STACK_OVERFLOW_KHR             0x0503
+#define GL_STACK_UNDERFLOW_KHR            0x0504
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam);
+typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);
+typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
+GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
+GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam);
+GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
+GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message);
+GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void);
+GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
+GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
+GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
+#endif
+#endif /* GL_KHR_debug */
+
+#ifndef GL_KHR_texture_compression_astc_hdr
+#define GL_KHR_texture_compression_astc_hdr 1
+#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR   0x93B0
+#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR   0x93B1
+#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR   0x93B2
+#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR   0x93B3
+#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR   0x93B4
+#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR   0x93B5
+#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR   0x93B6
+#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR   0x93B7
+#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR  0x93B8
+#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR  0x93B9
+#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR  0x93BA
+#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
+#endif /* GL_KHR_texture_compression_astc_hdr */
+
+#ifndef GL_KHR_texture_compression_astc_ldr
+#define GL_KHR_texture_compression_astc_ldr 1
+#endif /* GL_KHR_texture_compression_astc_ldr */
+
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+typedef void *GLeglImageOES;
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+#endif /* GL_OES_EGL_image */
+
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+#define GL_TEXTURE_EXTERNAL_OES           0x8D65
+#define GL_TEXTURE_BINDING_EXTERNAL_OES   0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#define GL_SAMPLER_EXTERNAL_OES           0x8D66
+#endif /* GL_OES_EGL_image_external */
+
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#define GL_ETC1_RGB8_OES                  0x8D64
+#endif /* GL_OES_compressed_ETC1_RGB8_texture */
+
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#define GL_PALETTE4_RGB8_OES              0x8B90
+#define GL_PALETTE4_RGBA8_OES             0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES          0x8B92
+#define GL_PALETTE4_RGBA4_OES             0x8B93
+#define GL_PALETTE4_RGB5_A1_OES           0x8B94
+#define GL_PALETTE8_RGB8_OES              0x8B95
+#define GL_PALETTE8_RGBA8_OES             0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES          0x8B97
+#define GL_PALETTE8_RGBA4_OES             0x8B98
+#define GL_PALETTE8_RGB5_A1_OES           0x8B99
+#endif /* GL_OES_compressed_paletted_texture */
+
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#define GL_DEPTH_COMPONENT24_OES          0x81A6
+#endif /* GL_OES_depth24 */
+
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#define GL_DEPTH_COMPONENT32_OES          0x81A7
+#endif /* GL_OES_depth32 */
+
+#ifndef GL_OES_depth_texture
+#define GL_OES_depth_texture 1
+#endif /* GL_OES_depth_texture */
+
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif /* GL_OES_element_index_uint */
+
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif /* GL_OES_fbo_render_mipmap */
+
+#ifndef GL_OES_fragment_precision_high
+#define GL_OES_fragment_precision_high 1
+#endif /* GL_OES_fragment_precision_high */
+
+#ifndef GL_OES_get_program_binary
+#define GL_OES_get_program_binary 1
+#define GL_PROGRAM_BINARY_LENGTH_OES      0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
+#define GL_PROGRAM_BINARY_FORMATS_OES     0x87FF
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#endif
+#endif /* GL_OES_get_program_binary */
+
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#define GL_WRITE_ONLY_OES                 0x88B9
+#define GL_BUFFER_ACCESS_OES              0x88BB
+#define GL_BUFFER_MAPPED_OES              0x88BC
+#define GL_BUFFER_MAP_POINTER_OES         0x88BD
+typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params);
+#endif
+#endif /* GL_OES_mapbuffer */
+
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#define GL_DEPTH_STENCIL_OES              0x84F9
+#define GL_UNSIGNED_INT_24_8_OES          0x84FA
+#define GL_DEPTH24_STENCIL8_OES           0x88F0
+#endif /* GL_OES_packed_depth_stencil */
+
+#ifndef GL_OES_required_internalformat
+#define GL_OES_required_internalformat 1
+#define GL_ALPHA8_OES                     0x803C
+#define GL_DEPTH_COMPONENT16_OES          0x81A5
+#define GL_LUMINANCE4_ALPHA4_OES          0x8043
+#define GL_LUMINANCE8_ALPHA8_OES          0x8045
+#define GL_LUMINANCE8_OES                 0x8040
+#define GL_RGBA4_OES                      0x8056
+#define GL_RGB5_A1_OES                    0x8057
+#define GL_RGB565_OES                     0x8D62
+#define GL_RGB8_OES                       0x8051
+#define GL_RGBA8_OES                      0x8058
+#define GL_RGB10_EXT                      0x8052
+#define GL_RGB10_A2_EXT                   0x8059
+#endif /* GL_OES_required_internalformat */
+
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif /* GL_OES_rgb8_rgba8 */
+
+#ifndef GL_OES_sample_shading
+#define GL_OES_sample_shading 1
+#define GL_SAMPLE_SHADING_OES             0x8C36
+#define GL_MIN_SAMPLE_SHADING_VALUE_OES   0x8C37
+typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value);
+#endif
+#endif /* GL_OES_sample_shading */
+
+#ifndef GL_OES_sample_variables
+#define GL_OES_sample_variables 1
+#endif /* GL_OES_sample_variables */
+
+#ifndef GL_OES_shader_image_atomic
+#define GL_OES_shader_image_atomic 1
+#endif /* GL_OES_shader_image_atomic */
+
+#ifndef GL_OES_shader_multisample_interpolation
+#define GL_OES_shader_multisample_interpolation 1
+#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B
+#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C
+#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D
+#endif /* GL_OES_shader_multisample_interpolation */
+
+#ifndef GL_OES_standard_derivatives
+#define GL_OES_standard_derivatives 1
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
+#endif /* GL_OES_standard_derivatives */
+
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#define GL_STENCIL_INDEX1_OES             0x8D46
+#endif /* GL_OES_stencil1 */
+
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#define GL_STENCIL_INDEX4_OES             0x8D47
+#endif /* GL_OES_stencil4 */
+
+#ifndef GL_OES_surfaceless_context
+#define GL_OES_surfaceless_context 1
+#define GL_FRAMEBUFFER_UNDEFINED_OES      0x8219
+#endif /* GL_OES_surfaceless_context */
+
+#ifndef GL_OES_texture_3D
+#define GL_OES_texture_3D 1
+#define GL_TEXTURE_WRAP_R_OES             0x8072
+#define GL_TEXTURE_3D_OES                 0x806F
+#define GL_TEXTURE_BINDING_3D_OES         0x806A
+#define GL_MAX_3D_TEXTURE_SIZE_OES        0x8073
+#define GL_SAMPLER_3D_OES                 0x8B5F
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+#endif /* GL_OES_texture_3D */
+
+#ifndef GL_OES_texture_compression_astc
+#define GL_OES_texture_compression_astc 1
+#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0
+#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1
+#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2
+#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3
+#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4
+#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5
+#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6
+#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7
+#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8
+#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8
+#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9
+#endif /* GL_OES_texture_compression_astc */
+
+#ifndef GL_OES_texture_float
+#define GL_OES_texture_float 1
+#endif /* GL_OES_texture_float */
+
+#ifndef GL_OES_texture_float_linear
+#define GL_OES_texture_float_linear 1
+#endif /* GL_OES_texture_float_linear */
+
+#ifndef GL_OES_texture_half_float
+#define GL_OES_texture_half_float 1
+#define GL_HALF_FLOAT_OES                 0x8D61
+#endif /* GL_OES_texture_half_float */
+
+#ifndef GL_OES_texture_half_float_linear
+#define GL_OES_texture_half_float_linear 1
+#endif /* GL_OES_texture_half_float_linear */
+
+#ifndef GL_OES_texture_npot
+#define GL_OES_texture_npot 1
+#endif /* GL_OES_texture_npot */
+
+#ifndef GL_OES_texture_stencil8
+#define GL_OES_texture_stencil8 1
+#define GL_STENCIL_INDEX_OES              0x1901
+#define GL_STENCIL_INDEX8_OES             0x8D48
+#endif /* GL_OES_texture_stencil8 */
+
+#ifndef GL_OES_texture_storage_multisample_2d_array
+#define GL_OES_texture_storage_multisample_2d_array 1
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#endif
+#endif /* GL_OES_texture_storage_multisample_2d_array */
+
+#ifndef GL_OES_vertex_array_object
+#define GL_OES_vertex_array_object 1
+#define GL_VERTEX_ARRAY_BINDING_OES       0x85B5
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
+#endif
+#endif /* GL_OES_vertex_array_object */
+
+#ifndef GL_OES_vertex_half_float
+#define GL_OES_vertex_half_float 1
+#endif /* GL_OES_vertex_half_float */
+
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_OES_vertex_type_10_10_10_2 1
+#define GL_UNSIGNED_INT_10_10_10_2_OES    0x8DF6
+#define GL_INT_10_10_10_2_OES             0x8DF7
+#endif /* GL_OES_vertex_type_10_10_10_2 */
+
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#define GL_3DC_X_AMD                      0x87F9
+#define GL_3DC_XY_AMD                     0x87FA
+#endif /* GL_AMD_compressed_3DC_texture */
+
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#define GL_ATC_RGB_AMD                    0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD    0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
+#endif /* GL_AMD_compressed_ATC_texture */
+
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#define GL_COUNTER_TYPE_AMD               0x8BC0
+#define GL_COUNTER_RANGE_AMD              0x8BC1
+#define GL_UNSIGNED_INT64_AMD             0x8BC2
+#define GL_PERCENTAGE_AMD                 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD   0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD        0x8BC5
+#define GL_PERFMON_RESULT_AMD             0x8BC6
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
+GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+#endif /* GL_AMD_performance_monitor */
+
+#ifndef GL_AMD_program_binary_Z400
+#define GL_AMD_program_binary_Z400 1
+#define GL_Z400_BINARY_AMD                0x8740
+#endif /* GL_AMD_program_binary_Z400 */
+
+#ifndef GL_ANGLE_depth_texture
+#define GL_ANGLE_depth_texture 1
+#endif /* GL_ANGLE_depth_texture */
+
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#define GL_READ_FRAMEBUFFER_ANGLE         0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE         0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+#endif /* GL_ANGLE_framebuffer_blit */
+
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_ANGLE     0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
+#define GL_MAX_SAMPLES_ANGLE              0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_ANGLE_framebuffer_multisample */
+
+#ifndef GL_ANGLE_instanced_arrays
+#define GL_ANGLE_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_ANGLE_instanced_arrays */
+
+#ifndef GL_ANGLE_pack_reverse_row_order
+#define GL_ANGLE_pack_reverse_row_order 1
+#define GL_PACK_REVERSE_ROW_ORDER_ANGLE   0x93A4
+#endif /* GL_ANGLE_pack_reverse_row_order */
+
+#ifndef GL_ANGLE_program_binary
+#define GL_ANGLE_program_binary 1
+#define GL_PROGRAM_BINARY_ANGLE           0x93A6
+#endif /* GL_ANGLE_program_binary */
+
+#ifndef GL_ANGLE_texture_compression_dxt3
+#define GL_ANGLE_texture_compression_dxt3 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
+#endif /* GL_ANGLE_texture_compression_dxt3 */
+
+#ifndef GL_ANGLE_texture_compression_dxt5
+#define GL_ANGLE_texture_compression_dxt5 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
+#endif /* GL_ANGLE_texture_compression_dxt5 */
+
+#ifndef GL_ANGLE_texture_usage
+#define GL_ANGLE_texture_usage 1
+#define GL_TEXTURE_USAGE_ANGLE            0x93A2
+#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE   0x93A3
+#endif /* GL_ANGLE_texture_usage */
+
+#ifndef GL_ANGLE_translated_shader_source
+#define GL_ANGLE_translated_shader_source 1
+#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
+typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
+#endif
+#endif /* GL_ANGLE_translated_shader_source */
+
+#ifndef GL_APPLE_copy_texture_levels
+#define GL_APPLE_copy_texture_levels 1
+typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
+#endif
+#endif /* GL_APPLE_copy_texture_levels */
+
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_APPLE     0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE              0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE         0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE         0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif
+#endif /* GL_APPLE_framebuffer_multisample */
+
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#define GL_RGB_422_APPLE                  0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE       0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE   0x85BB
+#define GL_RGB_RAW_422_APPLE              0x8A51
+#endif /* GL_APPLE_rgb_422 */
+
+#ifndef GL_APPLE_sync
+#define GL_APPLE_sync 1
+#define GL_SYNC_OBJECT_APPLE              0x8A53
+#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE  0x9111
+#define GL_OBJECT_TYPE_APPLE              0x9112
+#define GL_SYNC_CONDITION_APPLE           0x9113
+#define GL_SYNC_STATUS_APPLE              0x9114
+#define GL_SYNC_FLAGS_APPLE               0x9115
+#define GL_SYNC_FENCE_APPLE               0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
+#define GL_UNSIGNALED_APPLE               0x9118
+#define GL_SIGNALED_APPLE                 0x9119
+#define GL_ALREADY_SIGNALED_APPLE         0x911A
+#define GL_TIMEOUT_EXPIRED_APPLE          0x911B
+#define GL_CONDITION_SATISFIED_APPLE      0x911C
+#define GL_WAIT_FAILED_APPLE              0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE  0x00000001
+#define GL_TIMEOUT_IGNORED_APPLE          0xFFFFFFFFFFFFFFFFull
+typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
+typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
+typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
+typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+#endif
+#endif /* GL_APPLE_sync */
+
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#define GL_BGRA_EXT                       0x80E1
+#define GL_BGRA8_EXT                      0x93A1
+#endif /* GL_APPLE_texture_format_BGRA8888 */
+
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#define GL_TEXTURE_MAX_LEVEL_APPLE        0x813D
+#endif /* GL_APPLE_texture_max_level */
+
+#ifndef GL_ARM_mali_program_binary
+#define GL_ARM_mali_program_binary 1
+#define GL_MALI_PROGRAM_BINARY_ARM        0x8F61
+#endif /* GL_ARM_mali_program_binary */
+
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#define GL_MALI_SHADER_BINARY_ARM         0x8F60
+#endif /* GL_ARM_mali_shader_binary */
+
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif /* GL_ARM_rgba8 */
+
+#ifndef GL_ARM_shader_framebuffer_fetch
+#define GL_ARM_shader_framebuffer_fetch 1
+#define GL_FETCH_PER_SAMPLE_ARM           0x8F65
+#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66
+#endif /* GL_ARM_shader_framebuffer_fetch */
+
+#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil
+#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
+#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
+
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
+#define GL_SHADER_BINARY_DMP              0x9250
+#endif /* GL_DMP_shader_binary */
+
+#ifndef GL_EXT_blend_minmax
+#define GL_EXT_blend_minmax 1
+#define GL_MIN_EXT                        0x8007
+#define GL_MAX_EXT                        0x8008
+#endif /* GL_EXT_blend_minmax */
+
+#ifndef GL_EXT_color_buffer_half_float
+#define GL_EXT_color_buffer_half_float 1
+#define GL_RGBA16F_EXT                    0x881A
+#define GL_RGB16F_EXT                     0x881B
+#define GL_RG16F_EXT                      0x822F
+#define GL_R16F_EXT                       0x822D
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
+#define GL_UNSIGNED_NORMALIZED_EXT        0x8C17
+#endif /* GL_EXT_color_buffer_half_float */
+
+#ifndef GL_EXT_copy_image
+#define GL_EXT_copy_image 1
+typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
+#endif
+#endif /* GL_EXT_copy_image */
+
+#ifndef GL_EXT_debug_label
+#define GL_EXT_debug_label 1
+#define GL_PROGRAM_PIPELINE_OBJECT_EXT    0x8A4F
+#define GL_PROGRAM_OBJECT_EXT             0x8B40
+#define GL_SHADER_OBJECT_EXT              0x8B48
+#define GL_BUFFER_OBJECT_EXT              0x9151
+#define GL_QUERY_OBJECT_EXT               0x9153
+#define GL_VERTEX_ARRAY_OBJECT_EXT        0x9154
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
+GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
+#endif
+#endif /* GL_EXT_debug_label */
+
+#ifndef GL_EXT_debug_marker
+#define GL_EXT_debug_marker 1
+typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
+typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
+GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
+#endif
+#endif /* GL_EXT_debug_marker */
+
+#ifndef GL_EXT_discard_framebuffer
+#define GL_EXT_discard_framebuffer 1
+#define GL_COLOR_EXT                      0x1800
+#define GL_DEPTH_EXT                      0x1801
+#define GL_STENCIL_EXT                    0x1802
+typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+#endif
+#endif /* GL_EXT_discard_framebuffer */
+
+#ifndef GL_EXT_disjoint_timer_query
+#define GL_EXT_disjoint_timer_query 1
+#define GL_QUERY_COUNTER_BITS_EXT         0x8864
+#define GL_CURRENT_QUERY_EXT              0x8865
+#define GL_QUERY_RESULT_EXT               0x8866
+#define GL_QUERY_RESULT_AVAILABLE_EXT     0x8867
+#define GL_TIME_ELAPSED_EXT               0x88BF
+#define GL_TIMESTAMP_EXT                  0x8E28
+#define GL_GPU_DISJOINT_EXT               0x8FBB
+typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
+typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
+typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
+typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
+typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
+GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
+#endif
+#endif /* GL_EXT_disjoint_timer_query */
+
+#ifndef GL_EXT_draw_buffers
+#define GL_EXT_draw_buffers 1
+#define GL_MAX_COLOR_ATTACHMENTS_EXT      0x8CDF
+#define GL_MAX_DRAW_BUFFERS_EXT           0x8824
+#define GL_DRAW_BUFFER0_EXT               0x8825
+#define GL_DRAW_BUFFER1_EXT               0x8826
+#define GL_DRAW_BUFFER2_EXT               0x8827
+#define GL_DRAW_BUFFER3_EXT               0x8828
+#define GL_DRAW_BUFFER4_EXT               0x8829
+#define GL_DRAW_BUFFER5_EXT               0x882A
+#define GL_DRAW_BUFFER6_EXT               0x882B
+#define GL_DRAW_BUFFER7_EXT               0x882C
+#define GL_DRAW_BUFFER8_EXT               0x882D
+#define GL_DRAW_BUFFER9_EXT               0x882E
+#define GL_DRAW_BUFFER10_EXT              0x882F
+#define GL_DRAW_BUFFER11_EXT              0x8830
+#define GL_DRAW_BUFFER12_EXT              0x8831
+#define GL_DRAW_BUFFER13_EXT              0x8832
+#define GL_DRAW_BUFFER14_EXT              0x8833
+#define GL_DRAW_BUFFER15_EXT              0x8834
+#define GL_COLOR_ATTACHMENT0_EXT          0x8CE0
+#define GL_COLOR_ATTACHMENT1_EXT          0x8CE1
+#define GL_COLOR_ATTACHMENT2_EXT          0x8CE2
+#define GL_COLOR_ATTACHMENT3_EXT          0x8CE3
+#define GL_COLOR_ATTACHMENT4_EXT          0x8CE4
+#define GL_COLOR_ATTACHMENT5_EXT          0x8CE5
+#define GL_COLOR_ATTACHMENT6_EXT          0x8CE6
+#define GL_COLOR_ATTACHMENT7_EXT          0x8CE7
+#define GL_COLOR_ATTACHMENT8_EXT          0x8CE8
+#define GL_COLOR_ATTACHMENT9_EXT          0x8CE9
+#define GL_COLOR_ATTACHMENT10_EXT         0x8CEA
+#define GL_COLOR_ATTACHMENT11_EXT         0x8CEB
+#define GL_COLOR_ATTACHMENT12_EXT         0x8CEC
+#define GL_COLOR_ATTACHMENT13_EXT         0x8CED
+#define GL_COLOR_ATTACHMENT14_EXT         0x8CEE
+#define GL_COLOR_ATTACHMENT15_EXT         0x8CEF
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
+#endif
+#endif /* GL_EXT_draw_buffers */
+
+#ifndef GL_EXT_draw_buffers_indexed
+#define GL_EXT_draw_buffers_indexed 1
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode);
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst);
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index);
+GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index);
+#endif
+#endif /* GL_EXT_draw_buffers_indexed */
+
+#ifndef GL_EXT_draw_instanced
+#define GL_EXT_draw_instanced 1
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#endif
+#endif /* GL_EXT_draw_instanced */
+
+#ifndef GL_EXT_geometry_shader
+#define GL_EXT_geometry_shader 1
+#define GL_GEOMETRY_SHADER_EXT            0x8DD9
+#define GL_GEOMETRY_SHADER_BIT_EXT        0x00000004
+#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916
+#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917
+#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918
+#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F
+#define GL_LAYER_PROVOKING_VERTEX_EXT     0x825E
+#define GL_LINES_ADJACENCY_EXT            0x000A
+#define GL_LINE_STRIP_ADJACENCY_EXT       0x000B
+#define GL_TRIANGLES_ADJACENCY_EXT        0x000C
+#define GL_TRIANGLE_STRIP_ADJACENCY_EXT   0x000D
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
+#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF
+#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5
+#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD
+#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7
+#define GL_FIRST_VERTEX_CONVENTION_EXT    0x8E4D
+#define GL_LAST_VERTEX_CONVENTION_EXT     0x8E4E
+#define GL_UNDEFINED_VERTEX_EXT           0x8260
+#define GL_PRIMITIVES_GENERATED_EXT       0x8C87
+#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312
+#define GL_MAX_FRAMEBUFFER_LAYERS_EXT     0x9317
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
+#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level);
+#endif
+#endif /* GL_EXT_geometry_shader */
+
+#ifndef GL_EXT_gpu_shader5
+#define GL_EXT_gpu_shader5 1
+#endif /* GL_EXT_gpu_shader5 */
+
+#ifndef GL_EXT_instanced_arrays
+#define GL_EXT_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_EXT_instanced_arrays */
+
+#ifndef GL_EXT_map_buffer_range
+#define GL_EXT_map_buffer_range 1
+#define GL_MAP_READ_BIT_EXT               0x0001
+#define GL_MAP_WRITE_BIT_EXT              0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT_EXT   0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT  0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT     0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT_EXT     0x0020
+typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
+#endif
+#endif /* GL_EXT_map_buffer_range */
+
+#ifndef GL_EXT_multi_draw_arrays
+#define GL_EXT_multi_draw_arrays 1
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
+#endif
+#endif /* GL_EXT_multi_draw_arrays */
+
+#ifndef GL_EXT_multisampled_render_to_texture
+#define GL_EXT_multisampled_render_to_texture 1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
+#define GL_RENDERBUFFER_SAMPLES_EXT       0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
+#define GL_MAX_SAMPLES_EXT                0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+#endif /* GL_EXT_multisampled_render_to_texture */
+
+#ifndef GL_EXT_multiview_draw_buffers
+#define GL_EXT_multiview_draw_buffers 1
+#define GL_COLOR_ATTACHMENT_EXT           0x90F0
+#define GL_MULTIVIEW_EXT                  0x90F1
+#define GL_DRAW_BUFFER_EXT                0x0C01
+#define GL_READ_BUFFER_EXT                0x0C02
+#define GL_MAX_MULTIVIEW_BUFFERS_EXT      0x90F2
+typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index);
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices);
+typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index);
+GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices);
+GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data);
+#endif
+#endif /* GL_EXT_multiview_draw_buffers */
+
+#ifndef GL_EXT_occlusion_query_boolean
+#define GL_EXT_occlusion_query_boolean 1
+#define GL_ANY_SAMPLES_PASSED_EXT         0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
+#endif /* GL_EXT_occlusion_query_boolean */
+
+#ifndef GL_EXT_primitive_bounding_box
+#define GL_EXT_primitive_bounding_box 1
+#define GL_PRIMITIVE_BOUNDING_BOX_EXT     0x92BE
+typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW);
+#endif
+#endif /* GL_EXT_primitive_bounding_box */
+
+#ifndef GL_EXT_pvrtc_sRGB
+#define GL_EXT_pvrtc_sRGB 1
+#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54
+#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0
+#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1
+#endif /* GL_EXT_pvrtc_sRGB */
+
+#ifndef GL_EXT_read_format_bgra
+#define GL_EXT_read_format_bgra 1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
+#endif /* GL_EXT_read_format_bgra */
+
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#define GL_GUILTY_CONTEXT_RESET_EXT       0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT     0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT      0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT      0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT      0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT      0x8261
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+#endif /* GL_EXT_robustness */
+
+#ifndef GL_EXT_sRGB
+#define GL_EXT_sRGB 1
+#define GL_SRGB_EXT                       0x8C40
+#define GL_SRGB_ALPHA_EXT                 0x8C42
+#define GL_SRGB8_ALPHA8_EXT               0x8C43
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
+#endif /* GL_EXT_sRGB */
+
+#ifndef GL_EXT_sRGB_write_control
+#define GL_EXT_sRGB_write_control 1
+#define GL_FRAMEBUFFER_SRGB_EXT           0x8DB9
+#endif /* GL_EXT_sRGB_write_control */
+
+#ifndef GL_EXT_separate_shader_objects
+#define GL_EXT_separate_shader_objects 1
+#define GL_ACTIVE_PROGRAM_EXT             0x8259
+#define GL_VERTEX_SHADER_BIT_EXT          0x00000001
+#define GL_FRAGMENT_SHADER_BIT_EXT        0x00000002
+#define GL_ALL_SHADER_BITS_EXT            0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE_EXT          0x8258
+#define GL_PROGRAM_PIPELINE_BINDING_EXT   0x825A
+typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
+typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
+typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
+typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
+typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
+GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+#endif /* GL_EXT_separate_shader_objects */
+
+#ifndef GL_EXT_shader_framebuffer_fetch
+#define GL_EXT_shader_framebuffer_fetch 1
+#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
+#endif /* GL_EXT_shader_framebuffer_fetch */
+
+#ifndef GL_EXT_shader_implicit_conversions
+#define GL_EXT_shader_implicit_conversions 1
+#endif /* GL_EXT_shader_implicit_conversions */
+
+#ifndef GL_EXT_shader_integer_mix
+#define GL_EXT_shader_integer_mix 1
+#endif /* GL_EXT_shader_integer_mix */
+
+#ifndef GL_EXT_shader_io_blocks
+#define GL_EXT_shader_io_blocks 1
+#endif /* GL_EXT_shader_io_blocks */
+
+#ifndef GL_EXT_shader_pixel_local_storage
+#define GL_EXT_shader_pixel_local_storage 1
+#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63
+#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67
+#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64
+#endif /* GL_EXT_shader_pixel_local_storage */
+
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif /* GL_EXT_shader_texture_lod */
+
+#ifndef GL_EXT_shadow_samplers
+#define GL_EXT_shadow_samplers 1
+#define GL_TEXTURE_COMPARE_MODE_EXT       0x884C
+#define GL_TEXTURE_COMPARE_FUNC_EXT       0x884D
+#define GL_COMPARE_REF_TO_TEXTURE_EXT     0x884E
+#define GL_SAMPLER_2D_SHADOW_EXT          0x8B62
+#endif /* GL_EXT_shadow_samplers */
+
+#ifndef GL_EXT_tessellation_shader
+#define GL_EXT_tessellation_shader 1
+#define GL_PATCHES_EXT                    0x000E
+#define GL_PATCH_VERTICES_EXT             0x8E72
+#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75
+#define GL_TESS_GEN_MODE_EXT              0x8E76
+#define GL_TESS_GEN_SPACING_EXT           0x8E77
+#define GL_TESS_GEN_VERTEX_ORDER_EXT      0x8E78
+#define GL_TESS_GEN_POINT_MODE_EXT        0x8E79
+#define GL_ISOLINES_EXT                   0x8E7A
+#define GL_QUADS_EXT                      0x0007
+#define GL_FRACTIONAL_ODD_EXT             0x8E7B
+#define GL_FRACTIONAL_EVEN_EXT            0x8E7C
+#define GL_MAX_PATCH_VERTICES_EXT         0x8E7D
+#define GL_MAX_TESS_GEN_LEVEL_EXT         0x8E7E
+#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F
+#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80
+#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81
+#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82
+#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83
+#define GL_MAX_TESS_PATCH_COMPONENTS_EXT  0x8E84
+#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85
+#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86
+#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89
+#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A
+#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C
+#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D
+#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E
+#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE
+#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3
+#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4
+#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB
+#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC
+#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8
+#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9
+#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221
+#define GL_IS_PER_PATCH_EXT               0x92E7
+#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307
+#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308
+#define GL_TESS_CONTROL_SHADER_EXT        0x8E88
+#define GL_TESS_EVALUATION_SHADER_EXT     0x8E87
+#define GL_TESS_CONTROL_SHADER_BIT_EXT    0x00000008
+#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010
+typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value);
+#endif
+#endif /* GL_EXT_tessellation_shader */
+
+#ifndef GL_EXT_texture_border_clamp
+#define GL_EXT_texture_border_clamp 1
+#define GL_TEXTURE_BORDER_COLOR_EXT       0x1004
+#define GL_CLAMP_TO_BORDER_EXT            0x812D
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param);
+typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params);
+#endif
+#endif /* GL_EXT_texture_border_clamp */
+
+#ifndef GL_EXT_texture_buffer
+#define GL_EXT_texture_buffer 1
+#define GL_TEXTURE_BUFFER_EXT             0x8C2A
+#define GL_TEXTURE_BUFFER_BINDING_EXT     0x8C2A
+#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT    0x8C2B
+#define GL_TEXTURE_BINDING_BUFFER_EXT     0x8C2C
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
+#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F
+#define GL_SAMPLER_BUFFER_EXT             0x8DC2
+#define GL_INT_SAMPLER_BUFFER_EXT         0x8DD0
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
+#define GL_IMAGE_BUFFER_EXT               0x9051
+#define GL_INT_IMAGE_BUFFER_EXT           0x905C
+#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT  0x9067
+#define GL_TEXTURE_BUFFER_OFFSET_EXT      0x919D
+#define GL_TEXTURE_BUFFER_SIZE_EXT        0x919E
+typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
+#endif
+#endif /* GL_EXT_texture_buffer */
+
+#ifndef GL_EXT_texture_compression_dxt1
+#define GL_EXT_texture_compression_dxt1 1
+#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
+#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
+#endif /* GL_EXT_texture_compression_dxt1 */
+
+#ifndef GL_EXT_texture_compression_s3tc
+#define GL_EXT_texture_compression_s3tc 1
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
+#endif /* GL_EXT_texture_compression_s3tc */
+
+#ifndef GL_EXT_texture_cube_map_array
+#define GL_EXT_texture_cube_map_array 1
+#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT     0x9009
+#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A
+#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT     0x900C
+#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D
+#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E
+#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F
+#define GL_IMAGE_CUBE_MAP_ARRAY_EXT       0x9054
+#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT   0x905F
+#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
+#endif /* GL_EXT_texture_cube_map_array */
+
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+#endif /* GL_EXT_texture_filter_anisotropic */
+
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif /* GL_EXT_texture_format_BGRA8888 */
+
+#ifndef GL_EXT_texture_rg
+#define GL_EXT_texture_rg 1
+#define GL_RED_EXT                        0x1903
+#define GL_RG_EXT                         0x8227
+#define GL_R8_EXT                         0x8229
+#define GL_RG8_EXT                        0x822B
+#endif /* GL_EXT_texture_rg */
+
+#ifndef GL_EXT_texture_sRGB_decode
+#define GL_EXT_texture_sRGB_decode 1
+#define GL_TEXTURE_SRGB_DECODE_EXT        0x8A48
+#define GL_DECODE_EXT                     0x8A49
+#define GL_SKIP_DECODE_EXT                0x8A4A
+#endif /* GL_EXT_texture_sRGB_decode */
+
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT   0x912F
+#define GL_ALPHA8_EXT                     0x803C
+#define GL_LUMINANCE8_EXT                 0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT          0x8045
+#define GL_RGBA32F_EXT                    0x8814
+#define GL_RGB32F_EXT                     0x8815
+#define GL_ALPHA32F_EXT                   0x8816
+#define GL_LUMINANCE32F_EXT               0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT         0x8819
+#define GL_ALPHA16F_EXT                   0x881C
+#define GL_LUMINANCE16F_EXT               0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT         0x881F
+#define GL_R32F_EXT                       0x822E
+#define GL_RG32F_EXT                      0x8230
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
+GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+#endif
+#endif /* GL_EXT_texture_storage */
+
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_EXT_texture_type_2_10_10_10_REV 1
+#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
+#endif /* GL_EXT_texture_type_2_10_10_10_REV */
+
+#ifndef GL_EXT_texture_view
+#define GL_EXT_texture_view 1
+#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT     0x82DB
+#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT    0x82DC
+#define GL_TEXTURE_VIEW_MIN_LAYER_EXT     0x82DD
+#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT    0x82DE
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
+#endif
+#endif /* GL_EXT_texture_view */
+
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#define GL_UNPACK_ROW_LENGTH_EXT          0x0CF2
+#define GL_UNPACK_SKIP_ROWS_EXT           0x0CF3
+#define GL_UNPACK_SKIP_PIXELS_EXT         0x0CF4
+#endif /* GL_EXT_unpack_subimage */
+
+#ifndef GL_FJ_shader_binary_GCCSO
+#define GL_FJ_shader_binary_GCCSO 1
+#define GL_GCCSO_SHADER_BINARY_FJ         0x9260
+#endif /* GL_FJ_shader_binary_GCCSO */
+
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#define GL_RENDERBUFFER_SAMPLES_IMG       0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
+#define GL_MAX_SAMPLES_IMG                0x9135
+#define GL_TEXTURE_SAMPLES_IMG            0x9136
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+#endif /* GL_IMG_multisampled_render_to_texture */
+
+#ifndef GL_IMG_program_binary
+#define GL_IMG_program_binary 1
+#define GL_SGX_PROGRAM_BINARY_IMG         0x9130
+#endif /* GL_IMG_program_binary */
+
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#define GL_BGRA_IMG                       0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
+#endif /* GL_IMG_read_format */
+
+#ifndef GL_IMG_shader_binary
+#define GL_IMG_shader_binary 1
+#define GL_SGX_BINARY_IMG                 0x8C0A
+#endif /* GL_IMG_shader_binary */
+
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
+#endif /* GL_IMG_texture_compression_pvrtc */
+
+#ifndef GL_IMG_texture_compression_pvrtc2
+#define GL_IMG_texture_compression_pvrtc2 1
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
+#endif /* GL_IMG_texture_compression_pvrtc2 */
+
+#ifndef GL_INTEL_performance_query
+#define GL_INTEL_performance_query 1
+#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000
+#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001
+#define GL_PERFQUERY_WAIT_INTEL           0x83FB
+#define GL_PERFQUERY_FLUSH_INTEL          0x83FA
+#define GL_PERFQUERY_DONOT_FLUSH_INTEL    0x83F9
+#define GL_PERFQUERY_COUNTER_EVENT_INTEL  0x94F0
+#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1
+#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2
+#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3
+#define GL_PERFQUERY_COUNTER_RAW_INTEL    0x94F4
+#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5
+#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8
+#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9
+#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA
+#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB
+#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC
+#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD
+#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE
+#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF
+#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
+typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
+typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
+typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
+typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
+GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
+GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
+GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
+GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
+GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
+GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
+#endif
+#endif /* GL_INTEL_performance_query */
+
+#ifndef GL_NV_blend_equation_advanced
+#define GL_NV_blend_equation_advanced 1
+#define GL_BLEND_OVERLAP_NV               0x9281
+#define GL_BLEND_PREMULTIPLIED_SRC_NV     0x9280
+#define GL_BLUE_NV                        0x1905
+#define GL_COLORBURN_NV                   0x929A
+#define GL_COLORDODGE_NV                  0x9299
+#define GL_CONJOINT_NV                    0x9284
+#define GL_CONTRAST_NV                    0x92A1
+#define GL_DARKEN_NV                      0x9297
+#define GL_DIFFERENCE_NV                  0x929E
+#define GL_DISJOINT_NV                    0x9283
+#define GL_DST_ATOP_NV                    0x928F
+#define GL_DST_IN_NV                      0x928B
+#define GL_DST_NV                         0x9287
+#define GL_DST_OUT_NV                     0x928D
+#define GL_DST_OVER_NV                    0x9289
+#define GL_EXCLUSION_NV                   0x92A0
+#define GL_GREEN_NV                       0x1904
+#define GL_HARDLIGHT_NV                   0x929B
+#define GL_HARDMIX_NV                     0x92A9
+#define GL_HSL_COLOR_NV                   0x92AF
+#define GL_HSL_HUE_NV                     0x92AD
+#define GL_HSL_LUMINOSITY_NV              0x92B0
+#define GL_HSL_SATURATION_NV              0x92AE
+#define GL_INVERT_OVG_NV                  0x92B4
+#define GL_INVERT_RGB_NV                  0x92A3
+#define GL_LIGHTEN_NV                     0x9298
+#define GL_LINEARBURN_NV                  0x92A5
+#define GL_LINEARDODGE_NV                 0x92A4
+#define GL_LINEARLIGHT_NV                 0x92A7
+#define GL_MINUS_CLAMPED_NV               0x92B3
+#define GL_MINUS_NV                       0x929F
+#define GL_MULTIPLY_NV                    0x9294
+#define GL_OVERLAY_NV                     0x9296
+#define GL_PINLIGHT_NV                    0x92A8
+#define GL_PLUS_CLAMPED_ALPHA_NV          0x92B2
+#define GL_PLUS_CLAMPED_NV                0x92B1
+#define GL_PLUS_DARKER_NV                 0x9292
+#define GL_PLUS_NV                        0x9291
+#define GL_RED_NV                         0x1903
+#define GL_SCREEN_NV                      0x9295
+#define GL_SOFTLIGHT_NV                   0x929C
+#define GL_SRC_ATOP_NV                    0x928E
+#define GL_SRC_IN_NV                      0x928A
+#define GL_SRC_NV                         0x9286
+#define GL_SRC_OUT_NV                     0x928C
+#define GL_SRC_OVER_NV                    0x9288
+#define GL_UNCORRELATED_NV                0x9282
+#define GL_VIVIDLIGHT_NV                  0x92A6
+#define GL_XOR_NV                         0x1506
+typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
+typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glBlendBarrierNV (void);
+#endif
+#endif /* GL_NV_blend_equation_advanced */
+
+#ifndef GL_NV_blend_equation_advanced_coherent
+#define GL_NV_blend_equation_advanced_coherent 1
+#define GL_BLEND_ADVANCED_COHERENT_NV     0x9285
+#endif /* GL_NV_blend_equation_advanced_coherent */
+
+#ifndef GL_NV_copy_buffer
+#define GL_NV_copy_buffer 1
+#define GL_COPY_READ_BUFFER_NV            0x8F36
+#define GL_COPY_WRITE_BUFFER_NV           0x8F37
+typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+#endif
+#endif /* GL_NV_copy_buffer */
+
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#define GL_COVERAGE_COMPONENT_NV          0x8ED0
+#define GL_COVERAGE_COMPONENT4_NV         0x8ED1
+#define GL_COVERAGE_ATTACHMENT_NV         0x8ED2
+#define GL_COVERAGE_BUFFERS_NV            0x8ED3
+#define GL_COVERAGE_SAMPLES_NV            0x8ED4
+#define GL_COVERAGE_ALL_FRAGMENTS_NV      0x8ED5
+#define GL_COVERAGE_EDGE_FRAGMENTS_NV     0x8ED6
+#define GL_COVERAGE_AUTOMATIC_NV          0x8ED7
+#define GL_COVERAGE_BUFFER_BIT_NV         0x00008000
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+#endif /* GL_NV_coverage_sample */
+
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
+#endif /* GL_NV_depth_nonlinear */
+
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#define GL_MAX_DRAW_BUFFERS_NV            0x8824
+#define GL_DRAW_BUFFER0_NV                0x8825
+#define GL_DRAW_BUFFER1_NV                0x8826
+#define GL_DRAW_BUFFER2_NV                0x8827
+#define GL_DRAW_BUFFER3_NV                0x8828
+#define GL_DRAW_BUFFER4_NV                0x8829
+#define GL_DRAW_BUFFER5_NV                0x882A
+#define GL_DRAW_BUFFER6_NV                0x882B
+#define GL_DRAW_BUFFER7_NV                0x882C
+#define GL_DRAW_BUFFER8_NV                0x882D
+#define GL_DRAW_BUFFER9_NV                0x882E
+#define GL_DRAW_BUFFER10_NV               0x882F
+#define GL_DRAW_BUFFER11_NV               0x8830
+#define GL_DRAW_BUFFER12_NV               0x8831
+#define GL_DRAW_BUFFER13_NV               0x8832
+#define GL_DRAW_BUFFER14_NV               0x8833
+#define GL_DRAW_BUFFER15_NV               0x8834
+#define GL_COLOR_ATTACHMENT0_NV           0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV           0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV           0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV           0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV           0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV           0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV           0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV           0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV           0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV           0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV          0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV          0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV          0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV          0x8CED
+#define GL_COLOR_ATTACHMENT14_NV          0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV          0x8CEF
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+#endif /* GL_NV_draw_buffers */
+
+#ifndef GL_NV_draw_instanced
+#define GL_NV_draw_instanced 1
+typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
+#endif
+#endif /* GL_NV_draw_instanced */
+
+#ifndef GL_NV_explicit_attrib_location
+#define GL_NV_explicit_attrib_location 1
+#endif /* GL_NV_explicit_attrib_location */
+
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#define GL_MAX_COLOR_ATTACHMENTS_NV       0x8CDF
+#endif /* GL_NV_fbo_color_attachments */
+
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#define GL_ALL_COMPLETED_NV               0x84F2
+#define GL_FENCE_STATUS_NV                0x84F3
+#define GL_FENCE_CONDITION_NV             0x84F4
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
+GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
+#endif
+#endif /* GL_NV_fence */
+
+#ifndef GL_NV_framebuffer_blit
+#define GL_NV_framebuffer_blit 1
+#define GL_READ_FRAMEBUFFER_NV            0x8CA8
+#define GL_DRAW_FRAMEBUFFER_NV            0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_NV    0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_NV    0x8CAA
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+#endif /* GL_NV_framebuffer_blit */
+
+#ifndef GL_NV_framebuffer_multisample
+#define GL_NV_framebuffer_multisample 1
+#define GL_RENDERBUFFER_SAMPLES_NV        0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56
+#define GL_MAX_SAMPLES_NV                 0x8D57
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_NV_framebuffer_multisample */
+
+#ifndef GL_NV_generate_mipmap_sRGB
+#define GL_NV_generate_mipmap_sRGB 1
+#endif /* GL_NV_generate_mipmap_sRGB */
+
+#ifndef GL_NV_instanced_arrays
+#define GL_NV_instanced_arrays 1
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE
+typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor);
+#endif
+#endif /* GL_NV_instanced_arrays */
+
+#ifndef GL_NV_non_square_matrices
+#define GL_NV_non_square_matrices 1
+#define GL_FLOAT_MAT2x3_NV                0x8B65
+#define GL_FLOAT_MAT2x4_NV                0x8B66
+#define GL_FLOAT_MAT3x2_NV                0x8B67
+#define GL_FLOAT_MAT3x4_NV                0x8B68
+#define GL_FLOAT_MAT4x2_NV                0x8B69
+#define GL_FLOAT_MAT4x3_NV                0x8B6A
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+#endif
+#endif /* GL_NV_non_square_matrices */
+
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
+#define GL_READ_BUFFER_NV                 0x0C02
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
+#endif
+#endif /* GL_NV_read_buffer */
+
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif /* GL_NV_read_buffer_front */
+
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif /* GL_NV_read_depth */
+
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif /* GL_NV_read_depth_stencil */
+
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif /* GL_NV_read_stencil */
+
+#ifndef GL_NV_sRGB_formats
+#define GL_NV_sRGB_formats 1
+#define GL_SLUMINANCE_NV                  0x8C46
+#define GL_SLUMINANCE_ALPHA_NV            0x8C44
+#define GL_SRGB8_NV                       0x8C41
+#define GL_SLUMINANCE8_NV                 0x8C47
+#define GL_SLUMINANCE8_ALPHA8_NV          0x8C45
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV   0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F
+#define GL_ETC1_SRGB8_NV                  0x88EE
+#endif /* GL_NV_sRGB_formats */
+
+#ifndef GL_NV_shadow_samplers_array
+#define GL_NV_shadow_samplers_array 1
+#define GL_SAMPLER_2D_ARRAY_SHADOW_NV     0x8DC4
+#endif /* GL_NV_shadow_samplers_array */
+
+#ifndef GL_NV_shadow_samplers_cube
+#define GL_NV_shadow_samplers_cube 1
+#define GL_SAMPLER_CUBE_SHADOW_NV         0x8DC5
+#endif /* GL_NV_shadow_samplers_cube */
+
+#ifndef GL_NV_texture_border_clamp
+#define GL_NV_texture_border_clamp 1
+#define GL_TEXTURE_BORDER_COLOR_NV        0x1004
+#define GL_CLAMP_TO_BORDER_NV             0x812D
+#endif /* GL_NV_texture_border_clamp */
+
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif /* GL_NV_texture_compression_s3tc_update */
+
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
+#endif /* GL_NV_texture_npot_2D_mipmap */
+
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#define GL_ALPHA_TEST_QCOM                0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM           0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM            0x0BC2
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+#endif /* GL_QCOM_alpha_test */
+
+#ifndef GL_QCOM_binning_control
+#define GL_QCOM_binning_control 1
+#define GL_BINNING_CONTROL_HINT_QCOM      0x8FB0
+#define GL_CPU_OPTIMIZED_QCOM             0x8FB1
+#define GL_GPU_OPTIMIZED_QCOM             0x8FB2
+#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3
+#endif /* GL_QCOM_binning_control */
+
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
+GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+#endif /* GL_QCOM_driver_control */
+
+#ifndef GL_QCOM_extended_get
+#define GL_QCOM_extended_get 1
+#define GL_TEXTURE_WIDTH_QCOM             0x8BD2
+#define GL_TEXTURE_HEIGHT_QCOM            0x8BD3
+#define GL_TEXTURE_DEPTH_QCOM             0x8BD4
+#define GL_TEXTURE_INTERNAL_FORMAT_QCOM   0x8BD5
+#define GL_TEXTURE_FORMAT_QCOM            0x8BD6
+#define GL_TEXTURE_TYPE_QCOM              0x8BD7
+#define GL_TEXTURE_IMAGE_VALID_QCOM       0x8BD8
+#define GL_TEXTURE_NUM_LEVELS_QCOM        0x8BD9
+#define GL_TEXTURE_TARGET_QCOM            0x8BDA
+#define GL_TEXTURE_OBJECT_VALID_QCOM      0x8BDB
+#define GL_STATE_RESTORE                  0x8BDC
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
+typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
+GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
+GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
+GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
+GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
+GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params);
+#endif
+#endif /* GL_QCOM_extended_get */
+
+#ifndef GL_QCOM_extended_get2
+#define GL_QCOM_extended_get2 1
+typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
+typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
+GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
+GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
+GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
+#endif
+#endif /* GL_QCOM_extended_get2 */
+
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#define GL_PERFMON_GLOBAL_MODE_QCOM       0x8FA0
+#endif /* GL_QCOM_perfmon_global_mode */
+
+#ifndef GL_QCOM_tiled_rendering
+#define GL_QCOM_tiled_rendering 1
+#define GL_COLOR_BUFFER_BIT0_QCOM         0x00000001
+#define GL_COLOR_BUFFER_BIT1_QCOM         0x00000002
+#define GL_COLOR_BUFFER_BIT2_QCOM         0x00000004
+#define GL_COLOR_BUFFER_BIT3_QCOM         0x00000008
+#define GL_COLOR_BUFFER_BIT4_QCOM         0x00000010
+#define GL_COLOR_BUFFER_BIT5_QCOM         0x00000020
+#define GL_COLOR_BUFFER_BIT6_QCOM         0x00000040
+#define GL_COLOR_BUFFER_BIT7_QCOM         0x00000080
+#define GL_DEPTH_BUFFER_BIT0_QCOM         0x00000100
+#define GL_DEPTH_BUFFER_BIT1_QCOM         0x00000200
+#define GL_DEPTH_BUFFER_BIT2_QCOM         0x00000400
+#define GL_DEPTH_BUFFER_BIT3_QCOM         0x00000800
+#define GL_DEPTH_BUFFER_BIT4_QCOM         0x00001000
+#define GL_DEPTH_BUFFER_BIT5_QCOM         0x00002000
+#define GL_DEPTH_BUFFER_BIT6_QCOM         0x00004000
+#define GL_DEPTH_BUFFER_BIT7_QCOM         0x00008000
+#define GL_STENCIL_BUFFER_BIT0_QCOM       0x00010000
+#define GL_STENCIL_BUFFER_BIT1_QCOM       0x00020000
+#define GL_STENCIL_BUFFER_BIT2_QCOM       0x00040000
+#define GL_STENCIL_BUFFER_BIT3_QCOM       0x00080000
+#define GL_STENCIL_BUFFER_BIT4_QCOM       0x00100000
+#define GL_STENCIL_BUFFER_BIT5_QCOM       0x00200000
+#define GL_STENCIL_BUFFER_BIT6_QCOM       0x00400000
+#define GL_STENCIL_BUFFER_BIT7_QCOM       0x00800000
+#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM   0x01000000
+#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM   0x02000000
+#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM   0x04000000
+#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM   0x08000000
+#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM   0x10000000
+#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM   0x20000000
+#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM   0x40000000
+#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM   0x80000000
+typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
+GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
+#endif
+#endif /* GL_QCOM_tiled_rendering */
+
+#ifndef GL_QCOM_writeonly_rendering
+#define GL_QCOM_writeonly_rendering 1
+#define GL_WRITEONLY_RENDERING_QCOM       0x8823
+#endif /* GL_QCOM_writeonly_rendering */
+
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#define GL_SHADER_BINARY_VIV              0x8FC4
+#endif /* GL_VIV_shader_binary */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-21/include/GLES2/gl2platform.h b/ndk/platforms/android-21/include/GLES2/gl2platform.h
new file mode 100644
index 0000000..89d4d44
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES2/gl2platform.h
@@ -0,0 +1,30 @@
+#ifndef __gl2platform_h_
+#define __gl2platform_h_
+
+/* $Revision: 23328 $ on $Date:: 2013-10-02 02:28:28 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL  KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl2platform_h_ */
diff --git a/ndk/platforms/android-21/include/GLES3/gl3.h b/ndk/platforms/android-21/include/GLES3/gl3.h
new file mode 100644
index 0000000..c9a3175
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES3/gl3.h
@@ -0,0 +1,939 @@
+#ifndef __gl3_h_
+#define __gl3_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision: 26696 $ on $Date: 2014-05-17 14:48:55 -0700 (Sat, 17 May 2014) $
+*/
+
+#include <GLES3/gl3platform.h>
+
+/* Generated on date 20140517 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2\.[0-9]|3.0
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifndef GL_ES_VERSION_3_0
+#define GL_ES_VERSION_3_0 1
+typedef unsigned short GLhalf;
+#define GL_READ_BUFFER                    0x0C02
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+#define GL_RED                            0x1903
+#define GL_RGB8                           0x8051
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_PIXEL_PACK_BUFFER              0x88EB
+#define GL_PIXEL_UNPACK_BUFFER            0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
+#define GL_FLOAT_MAT2x3                   0x8B65
+#define GL_FLOAT_MAT2x4                   0x8B66
+#define GL_FLOAT_MAT3x2                   0x8B67
+#define GL_FLOAT_MAT3x4                   0x8B68
+#define GL_FLOAT_MAT4x2                   0x8B69
+#define GL_FLOAT_MAT4x3                   0x8B6A
+#define GL_SRGB                           0x8C40
+#define GL_SRGB8                          0x8C41
+#define GL_SRGB8_ALPHA8                   0x8C43
+#define GL_COMPARE_REF_TO_TEXTURE         0x884E
+#define GL_MAJOR_VERSION                  0x821B
+#define GL_MINOR_VERSION                  0x821C
+#define GL_NUM_EXTENSIONS                 0x821D
+#define GL_RGBA32F                        0x8814
+#define GL_RGB32F                         0x8815
+#define GL_RGBA16F                        0x881A
+#define GL_RGB16F                         0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905
+#define GL_MAX_VARYING_COMPONENTS         0x8B4B
+#define GL_TEXTURE_2D_ARRAY               0x8C1A
+#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D
+#define GL_R11F_G11F_B10F                 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B
+#define GL_RGB9_E5                        0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD             0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS            0x8C8C
+#define GL_SEPARATE_ATTRIBS               0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI                       0x8D70
+#define GL_RGB32UI                        0x8D71
+#define GL_RGBA16UI                       0x8D76
+#define GL_RGB16UI                        0x8D77
+#define GL_RGBA8UI                        0x8D7C
+#define GL_RGB8UI                         0x8D7D
+#define GL_RGBA32I                        0x8D82
+#define GL_RGB32I                         0x8D83
+#define GL_RGBA16I                        0x8D88
+#define GL_RGB16I                         0x8D89
+#define GL_RGBA8I                         0x8D8E
+#define GL_RGB8I                          0x8D8F
+#define GL_RED_INTEGER                    0x8D94
+#define GL_RGB_INTEGER                    0x8D98
+#define GL_RGBA_INTEGER                   0x8D99
+#define GL_SAMPLER_2D_ARRAY               0x8DC1
+#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW            0x8DC5
+#define GL_UNSIGNED_INT_VEC2              0x8DC6
+#define GL_UNSIGNED_INT_VEC3              0x8DC7
+#define GL_UNSIGNED_INT_VEC4              0x8DC8
+#define GL_INT_SAMPLER_2D                 0x8DCA
+#define GL_INT_SAMPLER_3D                 0x8DCB
+#define GL_INT_SAMPLER_CUBE               0x8DCC
+#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7
+#define GL_BUFFER_ACCESS_FLAGS            0x911F
+#define GL_BUFFER_MAP_LENGTH              0x9120
+#define GL_BUFFER_MAP_OFFSET              0x9121
+#define GL_DEPTH_COMPONENT32F             0x8CAC
+#define GL_DEPTH32F_STENCIL8              0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT            0x8218
+#define GL_FRAMEBUFFER_UNDEFINED          0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A
+#define GL_DEPTH_STENCIL                  0x84F9
+#define GL_UNSIGNED_INT_24_8              0x84FA
+#define GL_DEPTH24_STENCIL8               0x88F0
+#define GL_UNSIGNED_NORMALIZED            0x8C17
+#define GL_DRAW_FRAMEBUFFER_BINDING       0x8CA6
+#define GL_READ_FRAMEBUFFER               0x8CA8
+#define GL_DRAW_FRAMEBUFFER               0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA
+#define GL_RENDERBUFFER_SAMPLES           0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF
+#define GL_COLOR_ATTACHMENT1              0x8CE1
+#define GL_COLOR_ATTACHMENT2              0x8CE2
+#define GL_COLOR_ATTACHMENT3              0x8CE3
+#define GL_COLOR_ATTACHMENT4              0x8CE4
+#define GL_COLOR_ATTACHMENT5              0x8CE5
+#define GL_COLOR_ATTACHMENT6              0x8CE6
+#define GL_COLOR_ATTACHMENT7              0x8CE7
+#define GL_COLOR_ATTACHMENT8              0x8CE8
+#define GL_COLOR_ATTACHMENT9              0x8CE9
+#define GL_COLOR_ATTACHMENT10             0x8CEA
+#define GL_COLOR_ATTACHMENT11             0x8CEB
+#define GL_COLOR_ATTACHMENT12             0x8CEC
+#define GL_COLOR_ATTACHMENT13             0x8CED
+#define GL_COLOR_ATTACHMENT14             0x8CEE
+#define GL_COLOR_ATTACHMENT15             0x8CEF
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES                    0x8D57
+#define GL_HALF_FLOAT                     0x140B
+#define GL_MAP_READ_BIT                   0x0001
+#define GL_MAP_WRITE_BIT                  0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
+#define GL_RG                             0x8227
+#define GL_RG_INTEGER                     0x8228
+#define GL_R8                             0x8229
+#define GL_RG8                            0x822B
+#define GL_R16F                           0x822D
+#define GL_R32F                           0x822E
+#define GL_RG16F                          0x822F
+#define GL_RG32F                          0x8230
+#define GL_R8I                            0x8231
+#define GL_R8UI                           0x8232
+#define GL_R16I                           0x8233
+#define GL_R16UI                          0x8234
+#define GL_R32I                           0x8235
+#define GL_R32UI                          0x8236
+#define GL_RG8I                           0x8237
+#define GL_RG8UI                          0x8238
+#define GL_RG16I                          0x8239
+#define GL_RG16UI                         0x823A
+#define GL_RG32I                          0x823B
+#define GL_RG32UI                         0x823C
+#define GL_VERTEX_ARRAY_BINDING           0x85B5
+#define GL_R8_SNORM                       0x8F94
+#define GL_RG8_SNORM                      0x8F95
+#define GL_RGB8_SNORM                     0x8F96
+#define GL_RGBA8_SNORM                    0x8F97
+#define GL_SIGNED_NORMALIZED              0x8F9C
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
+#define GL_COPY_READ_BUFFER               0x8F36
+#define GL_COPY_WRITE_BUFFER              0x8F37
+#define GL_COPY_READ_BUFFER_BINDING       0x8F36
+#define GL_COPY_WRITE_BUFFER_BINDING      0x8F37
+#define GL_UNIFORM_BUFFER                 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING         0x8A28
+#define GL_UNIFORM_BUFFER_START           0x8A29
+#define GL_UNIFORM_BUFFER_SIZE            0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36
+#define GL_UNIFORM_TYPE                   0x8A37
+#define GL_UNIFORM_SIZE                   0x8A38
+#define GL_UNIFORM_NAME_LENGTH            0x8A39
+#define GL_UNIFORM_BLOCK_INDEX            0x8A3A
+#define GL_UNIFORM_OFFSET                 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING          0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX                  0xFFFFFFFFu
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
+#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111
+#define GL_OBJECT_TYPE                    0x9112
+#define GL_SYNC_CONDITION                 0x9113
+#define GL_SYNC_STATUS                    0x9114
+#define GL_SYNC_FLAGS                     0x9115
+#define GL_SYNC_FENCE                     0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117
+#define GL_UNSIGNALED                     0x9118
+#define GL_SIGNALED                       0x9119
+#define GL_ALREADY_SIGNALED               0x911A
+#define GL_TIMEOUT_EXPIRED                0x911B
+#define GL_CONDITION_SATISFIED            0x911C
+#define GL_WAIT_FAILED                    0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001
+#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
+#define GL_ANY_SAMPLES_PASSED             0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_SAMPLER_BINDING                0x8919
+#define GL_RGB10_A2UI                     0x906F
+#define GL_TEXTURE_SWIZZLE_R              0x8E42
+#define GL_TEXTURE_SWIZZLE_G              0x8E43
+#define GL_TEXTURE_SWIZZLE_B              0x8E44
+#define GL_TEXTURE_SWIZZLE_A              0x8E45
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_INT_2_10_10_10_REV             0x8D9F
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+#define GL_TRANSFORM_FEEDBACK_PAUSED      0x8E23
+#define GL_TRANSFORM_FEEDBACK_ACTIVE      0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH          0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
+#define GL_PROGRAM_BINARY_FORMATS         0x87FF
+#define GL_COMPRESSED_R11_EAC             0x9270
+#define GL_COMPRESSED_SIGNED_R11_EAC      0x9271
+#define GL_COMPRESSED_RG11_EAC            0x9272
+#define GL_COMPRESSED_SIGNED_RG11_EAC     0x9273
+#define GL_COMPRESSED_RGB8_ETC2           0x9274
+#define GL_COMPRESSED_SRGB8_ETC2          0x9275
+#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
+#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
+#define GL_COMPRESSED_RGBA8_ETC2_EAC      0x9278
+#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
+#define GL_TEXTURE_IMMUTABLE_FORMAT       0x912F
+#define GL_MAX_ELEMENT_INDEX              0x8D6B
+#define GL_NUM_SAMPLE_COUNTS              0x9380
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode);
+GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
+GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
+GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
+GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
+GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_ES_VERSION_3_0 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-21/include/GLES3/gl31.h b/ndk/platforms/android-21/include/GLES3/gl31.h
new file mode 100644
index 0000000..cfb9069
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES3/gl31.h
@@ -0,0 +1,1184 @@
+#ifndef __gl31_h_
+#define __gl31_h_ 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2013-2014 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+/*
+** This header is generated from the Khronos OpenGL / OpenGL ES XML
+** API Registry. The current version of the Registry, generator scripts
+** used to make the header, and the header can be found at
+**   http://www.opengl.org/registry/
+**
+** Khronos $Revision$ on $Date$
+*/
+
+#include <GLES3/gl3platform.h>
+
+/* Generated on date 20140517 */
+
+/* Generated C header for:
+ * API: gles2
+ * Profile: common
+ * Versions considered: 2.[0-9]|3.[01]
+ * Versions emitted: .*
+ * Default extensions included: None
+ * Additional extensions included: _nomatch_^
+ * Extensions removed: _nomatch_^
+ */
+
+#ifndef GL_ES_VERSION_2_0
+#define GL_ES_VERSION_2_0 1
+#include <KHR/khrplatform.h>
+typedef khronos_int8_t GLbyte;
+typedef khronos_float_t GLclampf;
+typedef khronos_int32_t GLfixed;
+typedef short GLshort;
+typedef unsigned short GLushort;
+typedef void GLvoid;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
+typedef unsigned int GLenum;
+typedef unsigned int GLuint;
+typedef char GLchar;
+typedef khronos_float_t GLfloat;
+typedef khronos_ssize_t GLsizeiptr;
+typedef khronos_intptr_t GLintptr;
+typedef unsigned int GLbitfield;
+typedef int GLint;
+typedef unsigned char GLboolean;
+typedef int GLsizei;
+typedef khronos_uint8_t GLubyte;
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+#define GL_FRAGMENT_SHADER                0x8B30
+#define GL_VERTEX_SHADER                  0x8B31
+#define GL_MAX_VERTEX_ATTRIBS             0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS     0x8DFB
+#define GL_MAX_VARYING_VECTORS            0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS        0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS   0x8DFD
+#define GL_SHADER_TYPE                    0x8B4F
+#define GL_DELETE_STATUS                  0x8B80
+#define GL_LINK_STATUS                    0x8B82
+#define GL_VALIDATE_STATUS                0x8B83
+#define GL_ATTACHED_SHADERS               0x8B85
+#define GL_ACTIVE_UNIFORMS                0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH      0x8B87
+#define GL_ACTIVE_ATTRIBUTES              0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH    0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION       0x8B8C
+#define GL_CURRENT_PROGRAM                0x8B8D
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_TEXTURE                        0x1702
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED    0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE       0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE     0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE       0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER    0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX8                 0x8D48
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+#define GL_NONE                           0
+#define GL_FRAMEBUFFER_COMPLETE           0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED        0x8CDD
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
+GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
+GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
+GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
+GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
+GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
+GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void GL_APIENTRY glFinish (void);
+GL_APICALL void GL_APIENTRY glFlush (void);
+GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
+GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
+GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
+GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL GLenum GL_APIENTRY glGetError (void);
+GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
+GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
+GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
+GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
+GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
+GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
+GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
+GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
+GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
+GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
+GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
+GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+#endif /* GL_ES_VERSION_2_0 */
+
+#ifndef GL_ES_VERSION_3_0
+#define GL_ES_VERSION_3_0 1
+typedef unsigned short GLhalf;
+#define GL_READ_BUFFER                    0x0C02
+#define GL_UNPACK_ROW_LENGTH              0x0CF2
+#define GL_UNPACK_SKIP_ROWS               0x0CF3
+#define GL_UNPACK_SKIP_PIXELS             0x0CF4
+#define GL_PACK_ROW_LENGTH                0x0D02
+#define GL_PACK_SKIP_ROWS                 0x0D03
+#define GL_PACK_SKIP_PIXELS               0x0D04
+#define GL_COLOR                          0x1800
+#define GL_DEPTH                          0x1801
+#define GL_STENCIL                        0x1802
+#define GL_RED                            0x1903
+#define GL_RGB8                           0x8051
+#define GL_RGBA8                          0x8058
+#define GL_RGB10_A2                       0x8059
+#define GL_TEXTURE_BINDING_3D             0x806A
+#define GL_UNPACK_SKIP_IMAGES             0x806D
+#define GL_UNPACK_IMAGE_HEIGHT            0x806E
+#define GL_TEXTURE_3D                     0x806F
+#define GL_TEXTURE_WRAP_R                 0x8072
+#define GL_MAX_3D_TEXTURE_SIZE            0x8073
+#define GL_UNSIGNED_INT_2_10_10_10_REV    0x8368
+#define GL_MAX_ELEMENTS_VERTICES          0x80E8
+#define GL_MAX_ELEMENTS_INDICES           0x80E9
+#define GL_TEXTURE_MIN_LOD                0x813A
+#define GL_TEXTURE_MAX_LOD                0x813B
+#define GL_TEXTURE_BASE_LEVEL             0x813C
+#define GL_TEXTURE_MAX_LEVEL              0x813D
+#define GL_MIN                            0x8007
+#define GL_MAX                            0x8008
+#define GL_DEPTH_COMPONENT24              0x81A6
+#define GL_MAX_TEXTURE_LOD_BIAS           0x84FD
+#define GL_TEXTURE_COMPARE_MODE           0x884C
+#define GL_TEXTURE_COMPARE_FUNC           0x884D
+#define GL_CURRENT_QUERY                  0x8865
+#define GL_QUERY_RESULT                   0x8866
+#define GL_QUERY_RESULT_AVAILABLE         0x8867
+#define GL_BUFFER_MAPPED                  0x88BC
+#define GL_BUFFER_MAP_POINTER             0x88BD
+#define GL_STREAM_READ                    0x88E1
+#define GL_STREAM_COPY                    0x88E2
+#define GL_STATIC_READ                    0x88E5
+#define GL_STATIC_COPY                    0x88E6
+#define GL_DYNAMIC_READ                   0x88E9
+#define GL_DYNAMIC_COPY                   0x88EA
+#define GL_MAX_DRAW_BUFFERS               0x8824
+#define GL_DRAW_BUFFER0                   0x8825
+#define GL_DRAW_BUFFER1                   0x8826
+#define GL_DRAW_BUFFER2                   0x8827
+#define GL_DRAW_BUFFER3                   0x8828
+#define GL_DRAW_BUFFER4                   0x8829
+#define GL_DRAW_BUFFER5                   0x882A
+#define GL_DRAW_BUFFER6                   0x882B
+#define GL_DRAW_BUFFER7                   0x882C
+#define GL_DRAW_BUFFER8                   0x882D
+#define GL_DRAW_BUFFER9                   0x882E
+#define GL_DRAW_BUFFER10                  0x882F
+#define GL_DRAW_BUFFER11                  0x8830
+#define GL_DRAW_BUFFER12                  0x8831
+#define GL_DRAW_BUFFER13                  0x8832
+#define GL_DRAW_BUFFER14                  0x8833
+#define GL_DRAW_BUFFER15                  0x8834
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS  0x8B4A
+#define GL_SAMPLER_3D                     0x8B5F
+#define GL_SAMPLER_2D_SHADOW              0x8B62
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_PIXEL_PACK_BUFFER              0x88EB
+#define GL_PIXEL_UNPACK_BUFFER            0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING      0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING    0x88EF
+#define GL_FLOAT_MAT2x3                   0x8B65
+#define GL_FLOAT_MAT2x4                   0x8B66
+#define GL_FLOAT_MAT3x2                   0x8B67
+#define GL_FLOAT_MAT3x4                   0x8B68
+#define GL_FLOAT_MAT4x2                   0x8B69
+#define GL_FLOAT_MAT4x3                   0x8B6A
+#define GL_SRGB                           0x8C40
+#define GL_SRGB8                          0x8C41
+#define GL_SRGB8_ALPHA8                   0x8C43
+#define GL_COMPARE_REF_TO_TEXTURE         0x884E
+#define GL_MAJOR_VERSION                  0x821B
+#define GL_MINOR_VERSION                  0x821C
+#define GL_NUM_EXTENSIONS                 0x821D
+#define GL_RGBA32F                        0x8814
+#define GL_RGB32F                         0x8815
+#define GL_RGBA16F                        0x881A
+#define GL_RGB16F                         0x881B
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER    0x88FD
+#define GL_MAX_ARRAY_TEXTURE_LAYERS       0x88FF
+#define GL_MIN_PROGRAM_TEXEL_OFFSET       0x8904
+#define GL_MAX_PROGRAM_TEXEL_OFFSET       0x8905
+#define GL_MAX_VARYING_COMPONENTS         0x8B4B
+#define GL_TEXTURE_2D_ARRAY               0x8C1A
+#define GL_TEXTURE_BINDING_2D_ARRAY       0x8C1D
+#define GL_R11F_G11F_B10F                 0x8C3A
+#define GL_UNSIGNED_INT_10F_11F_11F_REV   0x8C3B
+#define GL_RGB9_E5                        0x8C3D
+#define GL_UNSIGNED_INT_5_9_9_9_REV       0x8C3E
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_TRANSFORM_FEEDBACK_VARYINGS    0x8C83
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_RASTERIZER_DISCARD             0x8C89
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_INTERLEAVED_ATTRIBS            0x8C8C
+#define GL_SEPARATE_ATTRIBS               0x8C8D
+#define GL_TRANSFORM_FEEDBACK_BUFFER      0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_RGBA32UI                       0x8D70
+#define GL_RGB32UI                        0x8D71
+#define GL_RGBA16UI                       0x8D76
+#define GL_RGB16UI                        0x8D77
+#define GL_RGBA8UI                        0x8D7C
+#define GL_RGB8UI                         0x8D7D
+#define GL_RGBA32I                        0x8D82
+#define GL_RGB32I                         0x8D83
+#define GL_RGBA16I                        0x8D88
+#define GL_RGB16I                         0x8D89
+#define GL_RGBA8I                         0x8D8E
+#define GL_RGB8I                          0x8D8F
+#define GL_RED_INTEGER                    0x8D94
+#define GL_RGB_INTEGER                    0x8D98
+#define GL_RGBA_INTEGER                   0x8D99
+#define GL_SAMPLER_2D_ARRAY               0x8DC1
+#define GL_SAMPLER_2D_ARRAY_SHADOW        0x8DC4
+#define GL_SAMPLER_CUBE_SHADOW            0x8DC5
+#define GL_UNSIGNED_INT_VEC2              0x8DC6
+#define GL_UNSIGNED_INT_VEC3              0x8DC7
+#define GL_UNSIGNED_INT_VEC4              0x8DC8
+#define GL_INT_SAMPLER_2D                 0x8DCA
+#define GL_INT_SAMPLER_3D                 0x8DCB
+#define GL_INT_SAMPLER_CUBE               0x8DCC
+#define GL_INT_SAMPLER_2D_ARRAY           0x8DCF
+#define GL_UNSIGNED_INT_SAMPLER_2D        0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_3D        0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_CUBE      0x8DD4
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY  0x8DD7
+#define GL_BUFFER_ACCESS_FLAGS            0x911F
+#define GL_BUFFER_MAP_LENGTH              0x9120
+#define GL_BUFFER_MAP_OFFSET              0x9121
+#define GL_DEPTH_COMPONENT32F             0x8CAC
+#define GL_DEPTH32F_STENCIL8              0x8CAD
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_DEFAULT            0x8218
+#define GL_FRAMEBUFFER_UNDEFINED          0x8219
+#define GL_DEPTH_STENCIL_ATTACHMENT       0x821A
+#define GL_DEPTH_STENCIL                  0x84F9
+#define GL_UNSIGNED_INT_24_8              0x84FA
+#define GL_DEPTH24_STENCIL8               0x88F0
+#define GL_UNSIGNED_NORMALIZED            0x8C17
+#define GL_DRAW_FRAMEBUFFER_BINDING       0x8CA6
+#define GL_READ_FRAMEBUFFER               0x8CA8
+#define GL_DRAW_FRAMEBUFFER               0x8CA9
+#define GL_READ_FRAMEBUFFER_BINDING       0x8CAA
+#define GL_RENDERBUFFER_SAMPLES           0x8CAB
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_MAX_COLOR_ATTACHMENTS          0x8CDF
+#define GL_COLOR_ATTACHMENT1              0x8CE1
+#define GL_COLOR_ATTACHMENT2              0x8CE2
+#define GL_COLOR_ATTACHMENT3              0x8CE3
+#define GL_COLOR_ATTACHMENT4              0x8CE4
+#define GL_COLOR_ATTACHMENT5              0x8CE5
+#define GL_COLOR_ATTACHMENT6              0x8CE6
+#define GL_COLOR_ATTACHMENT7              0x8CE7
+#define GL_COLOR_ATTACHMENT8              0x8CE8
+#define GL_COLOR_ATTACHMENT9              0x8CE9
+#define GL_COLOR_ATTACHMENT10             0x8CEA
+#define GL_COLOR_ATTACHMENT11             0x8CEB
+#define GL_COLOR_ATTACHMENT12             0x8CEC
+#define GL_COLOR_ATTACHMENT13             0x8CED
+#define GL_COLOR_ATTACHMENT14             0x8CEE
+#define GL_COLOR_ATTACHMENT15             0x8CEF
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_MAX_SAMPLES                    0x8D57
+#define GL_HALF_FLOAT                     0x140B
+#define GL_MAP_READ_BIT                   0x0001
+#define GL_MAP_WRITE_BIT                  0x0002
+#define GL_MAP_INVALIDATE_RANGE_BIT       0x0004
+#define GL_MAP_INVALIDATE_BUFFER_BIT      0x0008
+#define GL_MAP_FLUSH_EXPLICIT_BIT         0x0010
+#define GL_MAP_UNSYNCHRONIZED_BIT         0x0020
+#define GL_RG                             0x8227
+#define GL_RG_INTEGER                     0x8228
+#define GL_R8                             0x8229
+#define GL_RG8                            0x822B
+#define GL_R16F                           0x822D
+#define GL_R32F                           0x822E
+#define GL_RG16F                          0x822F
+#define GL_RG32F                          0x8230
+#define GL_R8I                            0x8231
+#define GL_R8UI                           0x8232
+#define GL_R16I                           0x8233
+#define GL_R16UI                          0x8234
+#define GL_R32I                           0x8235
+#define GL_R32UI                          0x8236
+#define GL_RG8I                           0x8237
+#define GL_RG8UI                          0x8238
+#define GL_RG16I                          0x8239
+#define GL_RG16UI                         0x823A
+#define GL_RG32I                          0x823B
+#define GL_RG32UI                         0x823C
+#define GL_VERTEX_ARRAY_BINDING           0x85B5
+#define GL_R8_SNORM                       0x8F94
+#define GL_RG8_SNORM                      0x8F95
+#define GL_RGB8_SNORM                     0x8F96
+#define GL_RGBA8_SNORM                    0x8F97
+#define GL_SIGNED_NORMALIZED              0x8F9C
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX  0x8D69
+#define GL_COPY_READ_BUFFER               0x8F36
+#define GL_COPY_WRITE_BUFFER              0x8F37
+#define GL_COPY_READ_BUFFER_BINDING       0x8F36
+#define GL_COPY_WRITE_BUFFER_BINDING      0x8F37
+#define GL_UNIFORM_BUFFER                 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING         0x8A28
+#define GL_UNIFORM_BUFFER_START           0x8A29
+#define GL_UNIFORM_BUFFER_SIZE            0x8A2A
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS      0x8A2B
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS    0x8A2D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS    0x8A2E
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS    0x8A2F
+#define GL_MAX_UNIFORM_BLOCK_SIZE         0x8A30
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_BLOCKS          0x8A36
+#define GL_UNIFORM_TYPE                   0x8A37
+#define GL_UNIFORM_SIZE                   0x8A38
+#define GL_UNIFORM_NAME_LENGTH            0x8A39
+#define GL_UNIFORM_BLOCK_INDEX            0x8A3A
+#define GL_UNIFORM_OFFSET                 0x8A3B
+#define GL_UNIFORM_ARRAY_STRIDE           0x8A3C
+#define GL_UNIFORM_MATRIX_STRIDE          0x8A3D
+#define GL_UNIFORM_IS_ROW_MAJOR           0x8A3E
+#define GL_UNIFORM_BLOCK_BINDING          0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE        0x8A40
+#define GL_UNIFORM_BLOCK_NAME_LENGTH      0x8A41
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS  0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_INVALID_INDEX                  0xFFFFFFFFu
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS   0x9122
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS  0x9125
+#define GL_MAX_SERVER_WAIT_TIMEOUT        0x9111
+#define GL_OBJECT_TYPE                    0x9112
+#define GL_SYNC_CONDITION                 0x9113
+#define GL_SYNC_STATUS                    0x9114
+#define GL_SYNC_FLAGS                     0x9115
+#define GL_SYNC_FENCE                     0x9116
+#define GL_SYNC_GPU_COMMANDS_COMPLETE     0x9117
+#define GL_UNSIGNALED                     0x9118
+#define GL_SIGNALED                       0x9119
+#define GL_ALREADY_SIGNALED               0x911A
+#define GL_TIMEOUT_EXPIRED                0x911B
+#define GL_CONDITION_SATISFIED            0x911C
+#define GL_WAIT_FAILED                    0x911D
+#define GL_SYNC_FLUSH_COMMANDS_BIT        0x00000001
+#define GL_TIMEOUT_IGNORED                0xFFFFFFFFFFFFFFFFull
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR    0x88FE
+#define GL_ANY_SAMPLES_PASSED             0x8C2F
+#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
+#define GL_SAMPLER_BINDING                0x8919
+#define GL_RGB10_A2UI                     0x906F
+#define GL_TEXTURE_SWIZZLE_R              0x8E42
+#define GL_TEXTURE_SWIZZLE_G              0x8E43
+#define GL_TEXTURE_SWIZZLE_B              0x8E44
+#define GL_TEXTURE_SWIZZLE_A              0x8E45
+#define GL_GREEN                          0x1904
+#define GL_BLUE                           0x1905
+#define GL_INT_2_10_10_10_REV             0x8D9F
+#define GL_TRANSFORM_FEEDBACK             0x8E22
+#define GL_TRANSFORM_FEEDBACK_PAUSED      0x8E23
+#define GL_TRANSFORM_FEEDBACK_ACTIVE      0x8E24
+#define GL_TRANSFORM_FEEDBACK_BINDING     0x8E25
+#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
+#define GL_PROGRAM_BINARY_LENGTH          0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS     0x87FE
+#define GL_PROGRAM_BINARY_FORMATS         0x87FF
+#define GL_COMPRESSED_R11_EAC             0x9270
+#define GL_COMPRESSED_SIGNED_R11_EAC      0x9271
+#define GL_COMPRESSED_RG11_EAC            0x9272
+#define GL_COMPRESSED_SIGNED_RG11_EAC     0x9273
+#define GL_COMPRESSED_RGB8_ETC2           0x9274
+#define GL_COMPRESSED_SRGB8_ETC2          0x9275
+#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
+#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
+#define GL_COMPRESSED_RGBA8_ETC2_EAC      0x9278
+#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
+#define GL_TEXTURE_IMMUTABLE_FORMAT       0x912F
+#define GL_MAX_ELEMENT_INDEX              0x8D6B
+#define GL_NUM_SAMPLE_COUNTS              0x9380
+#define GL_TEXTURE_IMMUTABLE_LEVELS       0x82DF
+GL_APICALL void GL_APIENTRY glReadBuffer (GLenum mode);
+GL_APICALL void GL_APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices);
+GL_APICALL void GL_APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
+GL_APICALL void GL_APIENTRY glGenQueries (GLsizei n, GLuint *ids);
+GL_APICALL void GL_APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsQuery (GLuint id);
+GL_APICALL void GL_APIENTRY glBeginQuery (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glEndQuery (GLenum target);
+GL_APICALL void GL_APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBuffer (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params);
+GL_APICALL void GL_APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+GL_APICALL void *GL_APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length);
+GL_APICALL void GL_APIENTRY glBindVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays);
+GL_APICALL void GL_APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
+GL_APICALL GLboolean GL_APIENTRY glIsVertexArray (GLuint array);
+GL_APICALL void GL_APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data);
+GL_APICALL void GL_APIENTRY glBeginTransformFeedback (GLenum primitiveMode);
+GL_APICALL void GL_APIENTRY glEndTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer);
+GL_APICALL void GL_APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode);
+GL_APICALL void GL_APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
+GL_APICALL void GL_APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params);
+GL_APICALL void GL_APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+GL_APICALL void GL_APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v);
+GL_APICALL void GL_APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v);
+GL_APICALL void GL_APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params);
+GL_APICALL GLint GL_APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUniform1ui (GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value);
+GL_APICALL void GL_APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value);
+GL_APICALL void GL_APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+GL_APICALL const GLubyte *GL_APIENTRY glGetStringi (GLenum name, GLuint index);
+GL_APICALL void GL_APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+GL_APICALL void GL_APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices);
+GL_APICALL void GL_APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName);
+GL_APICALL void GL_APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+GL_APICALL void GL_APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+GL_APICALL void GL_APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);
+GL_APICALL GLsync GL_APIENTRY glFenceSync (GLenum condition, GLbitfield flags);
+GL_APICALL GLboolean GL_APIENTRY glIsSync (GLsync sync);
+GL_APICALL void GL_APIENTRY glDeleteSync (GLsync sync);
+GL_APICALL GLenum GL_APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout);
+GL_APICALL void GL_APIENTRY glGetInteger64v (GLenum pname, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+GL_APICALL void GL_APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data);
+GL_APICALL void GL_APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params);
+GL_APICALL void GL_APIENTRY glGenSamplers (GLsizei count, GLuint *samplers);
+GL_APICALL void GL_APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers);
+GL_APICALL GLboolean GL_APIENTRY glIsSampler (GLuint sampler);
+GL_APICALL void GL_APIENTRY glBindSampler (GLuint unit, GLuint sampler);
+GL_APICALL void GL_APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param);
+GL_APICALL void GL_APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param);
+GL_APICALL void GL_APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param);
+GL_APICALL void GL_APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor);
+GL_APICALL void GL_APIENTRY glBindTransformFeedback (GLenum target, GLuint id);
+GL_APICALL void GL_APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids);
+GL_APICALL void GL_APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids);
+GL_APICALL GLboolean GL_APIENTRY glIsTransformFeedback (GLuint id);
+GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void);
+GL_APICALL void GL_APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
+GL_APICALL void GL_APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value);
+GL_APICALL void GL_APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
+GL_APICALL void GL_APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+GL_APICALL void GL_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
+#endif /* GL_ES_VERSION_3_0 */
+
+#ifndef GL_ES_VERSION_3_1
+#define GL_ES_VERSION_3_1 1
+#define GL_COMPUTE_SHADER                 0x91B9
+#define GL_MAX_COMPUTE_UNIFORM_BLOCKS     0x91BB
+#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
+#define GL_MAX_COMPUTE_IMAGE_UNIFORMS     0x91BD
+#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
+#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
+#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
+#define GL_MAX_COMPUTE_ATOMIC_COUNTERS    0x8265
+#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
+#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
+#define GL_MAX_COMPUTE_WORK_GROUP_COUNT   0x91BE
+#define GL_MAX_COMPUTE_WORK_GROUP_SIZE    0x91BF
+#define GL_COMPUTE_WORK_GROUP_SIZE        0x8267
+#define GL_DISPATCH_INDIRECT_BUFFER       0x90EE
+#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
+#define GL_COMPUTE_SHADER_BIT             0x00000020
+#define GL_DRAW_INDIRECT_BUFFER           0x8F3F
+#define GL_DRAW_INDIRECT_BUFFER_BINDING   0x8F43
+#define GL_MAX_UNIFORM_LOCATIONS          0x826E
+#define GL_FRAMEBUFFER_DEFAULT_WIDTH      0x9310
+#define GL_FRAMEBUFFER_DEFAULT_HEIGHT     0x9311
+#define GL_FRAMEBUFFER_DEFAULT_SAMPLES    0x9313
+#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
+#define GL_MAX_FRAMEBUFFER_WIDTH          0x9315
+#define GL_MAX_FRAMEBUFFER_HEIGHT         0x9316
+#define GL_MAX_FRAMEBUFFER_SAMPLES        0x9318
+#define GL_UNIFORM                        0x92E1
+#define GL_UNIFORM_BLOCK                  0x92E2
+#define GL_PROGRAM_INPUT                  0x92E3
+#define GL_PROGRAM_OUTPUT                 0x92E4
+#define GL_BUFFER_VARIABLE                0x92E5
+#define GL_SHADER_STORAGE_BLOCK           0x92E6
+#define GL_ATOMIC_COUNTER_BUFFER          0x92C0
+#define GL_TRANSFORM_FEEDBACK_VARYING     0x92F4
+#define GL_ACTIVE_RESOURCES               0x92F5
+#define GL_MAX_NAME_LENGTH                0x92F6
+#define GL_MAX_NUM_ACTIVE_VARIABLES       0x92F7
+#define GL_NAME_LENGTH                    0x92F9
+#define GL_TYPE                           0x92FA
+#define GL_ARRAY_SIZE                     0x92FB
+#define GL_OFFSET                         0x92FC
+#define GL_BLOCK_INDEX                    0x92FD
+#define GL_ARRAY_STRIDE                   0x92FE
+#define GL_MATRIX_STRIDE                  0x92FF
+#define GL_IS_ROW_MAJOR                   0x9300
+#define GL_ATOMIC_COUNTER_BUFFER_INDEX    0x9301
+#define GL_BUFFER_BINDING                 0x9302
+#define GL_BUFFER_DATA_SIZE               0x9303
+#define GL_NUM_ACTIVE_VARIABLES           0x9304
+#define GL_ACTIVE_VARIABLES               0x9305
+#define GL_REFERENCED_BY_VERTEX_SHADER    0x9306
+#define GL_REFERENCED_BY_FRAGMENT_SHADER  0x930A
+#define GL_REFERENCED_BY_COMPUTE_SHADER   0x930B
+#define GL_TOP_LEVEL_ARRAY_SIZE           0x930C
+#define GL_TOP_LEVEL_ARRAY_STRIDE         0x930D
+#define GL_LOCATION                       0x930E
+#define GL_VERTEX_SHADER_BIT              0x00000001
+#define GL_FRAGMENT_SHADER_BIT            0x00000002
+#define GL_ALL_SHADER_BITS                0xFFFFFFFF
+#define GL_PROGRAM_SEPARABLE              0x8258
+#define GL_ACTIVE_PROGRAM                 0x8259
+#define GL_PROGRAM_PIPELINE_BINDING       0x825A
+#define GL_ATOMIC_COUNTER_BUFFER_BINDING  0x92C1
+#define GL_ATOMIC_COUNTER_BUFFER_START    0x92C2
+#define GL_ATOMIC_COUNTER_BUFFER_SIZE     0x92C3
+#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
+#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
+#define GL_MAX_VERTEX_ATOMIC_COUNTERS     0x92D2
+#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS   0x92D6
+#define GL_MAX_COMBINED_ATOMIC_COUNTERS   0x92D7
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
+#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
+#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS  0x92D9
+#define GL_UNSIGNED_INT_ATOMIC_COUNTER    0x92DB
+#define GL_MAX_IMAGE_UNITS                0x8F38
+#define GL_MAX_VERTEX_IMAGE_UNIFORMS      0x90CA
+#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS    0x90CE
+#define GL_MAX_COMBINED_IMAGE_UNIFORMS    0x90CF
+#define GL_IMAGE_BINDING_NAME             0x8F3A
+#define GL_IMAGE_BINDING_LEVEL            0x8F3B
+#define GL_IMAGE_BINDING_LAYERED          0x8F3C
+#define GL_IMAGE_BINDING_LAYER            0x8F3D
+#define GL_IMAGE_BINDING_ACCESS           0x8F3E
+#define GL_IMAGE_BINDING_FORMAT           0x906E
+#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
+#define GL_ELEMENT_ARRAY_BARRIER_BIT      0x00000002
+#define GL_UNIFORM_BARRIER_BIT            0x00000004
+#define GL_TEXTURE_FETCH_BARRIER_BIT      0x00000008
+#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
+#define GL_COMMAND_BARRIER_BIT            0x00000040
+#define GL_PIXEL_BUFFER_BARRIER_BIT       0x00000080
+#define GL_TEXTURE_UPDATE_BARRIER_BIT     0x00000100
+#define GL_BUFFER_UPDATE_BARRIER_BIT      0x00000200
+#define GL_FRAMEBUFFER_BARRIER_BIT        0x00000400
+#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
+#define GL_ATOMIC_COUNTER_BARRIER_BIT     0x00001000
+#define GL_ALL_BARRIER_BITS               0xFFFFFFFF
+#define GL_IMAGE_2D                       0x904D
+#define GL_IMAGE_3D                       0x904E
+#define GL_IMAGE_CUBE                     0x9050
+#define GL_IMAGE_2D_ARRAY                 0x9053
+#define GL_INT_IMAGE_2D                   0x9058
+#define GL_INT_IMAGE_3D                   0x9059
+#define GL_INT_IMAGE_CUBE                 0x905B
+#define GL_INT_IMAGE_2D_ARRAY             0x905E
+#define GL_UNSIGNED_INT_IMAGE_2D          0x9063
+#define GL_UNSIGNED_INT_IMAGE_3D          0x9064
+#define GL_UNSIGNED_INT_IMAGE_CUBE        0x9066
+#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY    0x9069
+#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
+#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
+#define GL_READ_ONLY                      0x88B8
+#define GL_WRITE_ONLY                     0x88B9
+#define GL_READ_WRITE                     0x88BA
+#define GL_SHADER_STORAGE_BUFFER          0x90D2
+#define GL_SHADER_STORAGE_BUFFER_BINDING  0x90D3
+#define GL_SHADER_STORAGE_BUFFER_START    0x90D4
+#define GL_SHADER_STORAGE_BUFFER_SIZE     0x90D5
+#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
+#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
+#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
+#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
+#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
+#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE  0x90DE
+#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
+#define GL_SHADER_STORAGE_BARRIER_BIT     0x00002000
+#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
+#define GL_DEPTH_STENCIL_TEXTURE_MODE     0x90EA
+#define GL_STENCIL_INDEX                  0x1901
+#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
+#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
+#define GL_SAMPLE_POSITION                0x8E50
+#define GL_SAMPLE_MASK                    0x8E51
+#define GL_SAMPLE_MASK_VALUE              0x8E52
+#define GL_TEXTURE_2D_MULTISAMPLE         0x9100
+#define GL_MAX_SAMPLE_MASK_WORDS          0x8E59
+#define GL_MAX_COLOR_TEXTURE_SAMPLES      0x910E
+#define GL_MAX_DEPTH_TEXTURE_SAMPLES      0x910F
+#define GL_MAX_INTEGER_SAMPLES            0x9110
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
+#define GL_TEXTURE_SAMPLES                0x9106
+#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
+#define GL_TEXTURE_WIDTH                  0x1000
+#define GL_TEXTURE_HEIGHT                 0x1001
+#define GL_TEXTURE_DEPTH                  0x8071
+#define GL_TEXTURE_INTERNAL_FORMAT        0x1003
+#define GL_TEXTURE_RED_SIZE               0x805C
+#define GL_TEXTURE_GREEN_SIZE             0x805D
+#define GL_TEXTURE_BLUE_SIZE              0x805E
+#define GL_TEXTURE_ALPHA_SIZE             0x805F
+#define GL_TEXTURE_DEPTH_SIZE             0x884A
+#define GL_TEXTURE_STENCIL_SIZE           0x88F1
+#define GL_TEXTURE_SHARED_SIZE            0x8C3F
+#define GL_TEXTURE_RED_TYPE               0x8C10
+#define GL_TEXTURE_GREEN_TYPE             0x8C11
+#define GL_TEXTURE_BLUE_TYPE              0x8C12
+#define GL_TEXTURE_ALPHA_TYPE             0x8C13
+#define GL_TEXTURE_DEPTH_TYPE             0x8C16
+#define GL_TEXTURE_COMPRESSED             0x86A1
+#define GL_SAMPLER_2D_MULTISAMPLE         0x9108
+#define GL_INT_SAMPLER_2D_MULTISAMPLE     0x9109
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
+#define GL_VERTEX_ATTRIB_BINDING          0x82D4
+#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET  0x82D5
+#define GL_VERTEX_BINDING_DIVISOR         0x82D6
+#define GL_VERTEX_BINDING_OFFSET          0x82D7
+#define GL_VERTEX_BINDING_STRIDE          0x82D8
+#define GL_VERTEX_BINDING_BUFFER          0x8F4F
+#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
+#define GL_MAX_VERTEX_ATTRIB_BINDINGS     0x82DA
+#define GL_MAX_VERTEX_ATTRIB_STRIDE       0x82E5
+GL_APICALL void GL_APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+GL_APICALL void GL_APIENTRY glDispatchComputeIndirect (GLintptr indirect);
+GL_APICALL void GL_APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect);
+GL_APICALL void GL_APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect);
+GL_APICALL void GL_APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void GL_APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params);
+GL_APICALL GLuint GL_APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name);
+GL_APICALL void GL_APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name);
+GL_APICALL void GL_APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params);
+GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name);
+GL_APICALL void GL_APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program);
+GL_APICALL void GL_APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program);
+GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings);
+GL_APICALL void GL_APIENTRY glBindProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines);
+GL_APICALL void GL_APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines);
+GL_APICALL GLboolean GL_APIENTRY glIsProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0);
+GL_APICALL void GL_APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1);
+GL_APICALL void GL_APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+GL_APICALL void GL_APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+GL_APICALL void GL_APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value);
+GL_APICALL void GL_APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
+GL_APICALL void GL_APIENTRY glValidateProgramPipeline (GLuint pipeline);
+GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
+GL_APICALL void GL_APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+GL_APICALL void GL_APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data);
+GL_APICALL void GL_APIENTRY glMemoryBarrier (GLbitfield barriers);
+GL_APICALL void GL_APIENTRY glMemoryBarrierByRegion (GLbitfield barriers);
+GL_APICALL void GL_APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+GL_APICALL void GL_APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val);
+GL_APICALL void GL_APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
+GL_APICALL void GL_APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
+GL_APICALL void GL_APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+GL_APICALL void GL_APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+GL_APICALL void GL_APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex);
+GL_APICALL void GL_APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);
+#endif /* GL_ES_VERSION_3_1 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-21/include/GLES3/gl3platform.h b/ndk/platforms/android-21/include/GLES3/gl3platform.h
new file mode 100644
index 0000000..1bd1a85
--- /dev/null
+++ b/ndk/platforms/android-21/include/GLES3/gl3platform.h
@@ -0,0 +1,30 @@
+#ifndef __gl3platform_h_
+#define __gl3platform_h_
+
+/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 3.X  gl3.h
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL  KHRONOS_APICALL
+#endif
+
+#ifndef GL_APIENTRY
+#define GL_APIENTRY KHRONOS_APIENTRY
+#endif
+
+#endif /* __gl3platform_h_ */
diff --git a/samples/ApiDemos/Android.mk b/samples/ApiDemos/Android.mk
index ca48f58..66100b1 100644
--- a/samples/ApiDemos/Android.mk
+++ b/samples/ApiDemos/Android.mk
@@ -10,7 +10,7 @@
         src/com/example/android/apis/app/IRemoteServiceCallback.aidl \
         src/com/example/android/apis/app/ISecondary.aidl \
 
-LOCAL_JAVA_LIBRARIES := telephony-common mms-common
+LOCAL_JAVA_LIBRARIES := telephony-common
 
 LOCAL_STATIC_JAVA_LIBRARIES = android-support-v4
 
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index f202d59..716fa86 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -37,8 +37,6 @@
     <!-- For android.media.audiofx.Visualizer -->
     <uses-permission android:name="android.permission.RECORD_AUDIO" />
 
-    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17" />
-
     <!-- We will request access to the camera, saying we require a camera
          of some sort but not one with autofocus capability. -->
     <uses-permission android:name="android.permission.CAMERA" />
@@ -78,7 +76,7 @@
 
         <activity android:name=".app.DialogActivity"
                 android:label="@string/activity_dialog"
-                android:theme="@android:style/Theme.Holo.Dialog">
+                android:theme="@style/ThemeCurrentDialog">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.SAMPLE_CODE" />
@@ -740,7 +738,7 @@
 <!-- BEGIN_INCLUDE(interstitial_affinity) -->
         <activity android:name=".app.IncomingMessageInterstitial"
                 android:label="You have messages"
-                android:theme="@style/ThemeHoloDialog"
+                android:theme="@style/ThemeCurrentDialog"
                 android:launchMode="singleTask"
                 android:taskAffinity=""
                 android:excludeFromRecents="true">
@@ -1232,6 +1230,15 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".content.DocumentsSample"
+                android:label="@string/activity_documents"
+                android:enabled="@bool/atLeastKitKat">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <provider android:name=".content.FileProvider"
                   android:authorities="com.example.android.apis.content.FileProvider"
                   android:enabled="@bool/atLeastHoneycombMR2" />
@@ -1258,13 +1265,6 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".os.Sensors" android:label="OS/Sensors">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.SAMPLE_CODE" />
-            </intent-filter>
-        </activity>
-
         <activity android:name=".os.TriggerSensors" android:label="OS/TriggerSensors">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1300,6 +1300,25 @@
         <!--     ANDROID.ANIMATION PACKAGE SAMPLES         -->
         <!-- ************************************* -->
 
+        <activity android:name=".animation.ActivityTransition"
+                android:label="Animation/Activity Transition"
+                android:enabled="@bool/atLeastLRelease"
+                android:theme="@style/ActivityTransitionTheme">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".animation.ActivityTransitionDetails"
+                android:label="Animation/Details of a specific thingy"
+                android:enabled="@bool/atLeastLRelease"
+                android:theme="@style/ActivityTransitionTheme">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+            </intent-filter>
+        </activity>
+
         <activity android:name=".animation.AnimationLoading"
                 android:label="Animation/Loading"
                 android:enabled="@bool/atLeastHoneycomb">
@@ -1417,6 +1436,15 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".animation.PathAnimations"
+                  android:label="Animation/Path Animations"
+                  android:enabled="@bool/atLeastHoneycomb">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--     ANIMATION PACKAGE SAMPLES         -->
         <!-- ************************************* -->
@@ -1976,20 +2004,6 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".view.Gallery1" android:label="Views/Gallery/1. Photos">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.SAMPLE_CODE" />
-            </intent-filter>
-        </activity>
-
-        <activity android:name=".view.Gallery2" android:label="Views/Gallery/2. People">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.SAMPLE_CODE" />
-            </intent-filter>
-        </activity>
-
         <activity android:name=".view.Spinner1" android:label="Views/Spinner">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -2027,14 +2041,6 @@
             </intent-filter>
         </activity>
 
-        <activity android:name=".view.ImageSwitcher1"
-                android:label="Views/ImageSwitcher">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.SAMPLE_CODE" />
-            </intent-filter>
-        </activity>
-
         <activity android:name=".view.TextSwitcher1"
                 android:label="Views/TextSwitcher">
             <intent-filter>
@@ -2160,8 +2166,9 @@
         </activity>
 
         <activity android:name=".view.Controls5"
-                  android:label="Views/Controls/5. Custom Theme"
-                  android:theme="@style/CustomTheme">
+                  android:label="Views/Controls/5. Material Light Theme"
+                  android:theme="@android:style/Theme.Material.Light"
+                  android:enabled="@bool/atLeastLRelease">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.SAMPLE_CODE" />
@@ -2169,8 +2176,35 @@
         </activity>
 
         <activity android:name=".view.Controls6"
-                  android:label="Views/Controls/6. Holo or Old Theme"
-                  android:theme="@style/ThemeHolo">
+                  android:label="Views/Controls/6. Material Dark Theme"
+                  android:theme="@android:style/Theme.Material"
+                  android:enabled="@bool/atLeastLRelease">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".view.Controls7"
+                  android:label="Views/Controls/7. Custom Theme"
+                  android:theme="@style/CustomTheme">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".view.Controls8"
+                  android:label="Views/Controls/8. Current or Old Theme"
+                  android:theme="@style/ThemeCurrent">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".view.Controls9"
+                  android:label="Views/Controls/9. Default Theme">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.SAMPLE_CODE" />
@@ -2584,7 +2618,7 @@
 
         <activity android:name=".graphics.TriangleActivity"
                 android:label="Graphics/OpenGL ES/Textured Triangle"
-                android:theme="@android:style/Theme.Holo.Dialog"
+                android:theme="@style/ThemeCurrentDialog"
                 android:configChanges="keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -2648,6 +2682,24 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".graphics.ShadowCardStack"
+                  android:label="Graphics/Shadow Card Stack"
+                  android:theme="@android:style/Theme.Material.Light">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".graphics.ShadowCardDrag"
+                  android:label="Graphics/Shadow Card Drag"
+                  android:theme="@android:style/Theme.Material.Light">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <activity android:name=".graphics.WindowSurface"
                 android:label="Graphics/Surface Window">
             <intent-filter>
diff --git a/samples/ApiDemos/res/drawable-nodpi/ball.jpg b/samples/ApiDemos/res/drawable-nodpi/ball.jpg
new file mode 100644
index 0000000..2960b73
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/ball.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/block.jpg b/samples/ApiDemos/res/drawable-nodpi/block.jpg
new file mode 100644
index 0000000..04c22a0
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/block.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/ducky.jpg b/samples/ApiDemos/res/drawable-nodpi/ducky.jpg
new file mode 100644
index 0000000..830bbe3
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/ducky.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/jellies.jpg b/samples/ApiDemos/res/drawable-nodpi/jellies.jpg
new file mode 100644
index 0000000..ee2b5c6
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/jellies.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/mug.jpg b/samples/ApiDemos/res/drawable-nodpi/mug.jpg
new file mode 100644
index 0000000..e149e19
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/mug.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/pencil.jpg b/samples/ApiDemos/res/drawable-nodpi/pencil.jpg
new file mode 100644
index 0000000..e348311
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/pencil.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/scissors.jpg b/samples/ApiDemos/res/drawable-nodpi/scissors.jpg
new file mode 100644
index 0000000..caf0ce8
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/scissors.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable-nodpi/woot.jpg b/samples/ApiDemos/res/drawable-nodpi/woot.jpg
new file mode 100644
index 0000000..ccaef67
--- /dev/null
+++ b/samples/ApiDemos/res/drawable-nodpi/woot.jpg
Binary files differ
diff --git a/samples/ApiDemos/res/drawable/round_rect.xml b/samples/ApiDemos/res/drawable/round_rect.xml
new file mode 100644
index 0000000..6577d14
--- /dev/null
+++ b/samples/ApiDemos/res/drawable/round_rect.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<shape
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#ffffffff" />
+    <corners android:radius="10dp" />
+</shape>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/action_bar_display_options.xml b/samples/ApiDemos/res/layout/action_bar_display_options.xml
index d4216f5..77da8df 100644
--- a/samples/ApiDemos/res/layout/action_bar_display_options.xml
+++ b/samples/ApiDemos/res/layout/action_bar_display_options.xml
@@ -39,10 +39,11 @@
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="@string/toggle_show_custom" />
-        <Button android:id="@+id/toggle_navigation"
+        <Spinner android:id="@+id/toggle_navigation"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/toggle_navigation" />
+                android:prompt="@string/toggle_navigation"
+                android:entries="@array/navigation_modes" />
         <Button android:id="@+id/cycle_custom_gravity"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
diff --git a/samples/ApiDemos/res/layout/controls_1.xml b/samples/ApiDemos/res/layout/controls_1.xml
index e280188..cd7fd0d 100644
--- a/samples/ApiDemos/res/layout/controls_1.xml
+++ b/samples/ApiDemos/res/layout/controls_1.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
+<!--
+     Copyright (C) 2007 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.
@@ -15,139 +16,143 @@
 -->
 
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
 
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:orientation="vertical" >
 
-       <LinearLayout
-           android:orientation="horizontal"
-           android:layout_width="match_parent"
-           android:layout_height="wrap_content">
-
-        <Button android:id="@+id/button"
-            android:text="@string/controls_1_save"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
-
-        <Button android:id="@+id/button_disabled"
-            android:text="@string/controls_1_save"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
-
-      </LinearLayout>
-
-      <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-
-        <EditText android:id="@+id/edit"
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" >
 
-        <EditText android:id="@+id/edit2"
+            <Button
+                android:id="@+id/button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/controls_1_save" />
+
+            <Button
+                android:id="@+id/button_disabled"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/controls_1_save" />
+        </LinearLayout>
+
+        <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"/>
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" >
 
-      </LinearLayout>
+            <EditText
+                android:id="@+id/edit"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1" />
 
-        <CheckBox android:id="@+id/check1"
-            android:paddingBottom="24sp"
-	        android:paddingTop="24sp"
+            <EditText
+                android:id="@+id/edit2"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_weight="1" />
+        </LinearLayout>
+
+        <CheckBox
+            android:id="@+id/check1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:paddingBottom="24sp"
+            android:paddingTop="24sp"
             android:text="@string/controls_1_checkbox_1" />
 
-        <CheckBox android:id="@+id/check2"
+        <CheckBox
+            android:id="@+id/check2"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/controls_1_checkbox_2" />
-    
+
         <RadioGroup
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical">
-    
-            <RadioButton android:id="@+id/radio1"
+            android:orientation="vertical" >
+
+            <RadioButton
+                android:id="@+id/radio1"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="@string/controls_1_radiobutton_1" />
-    
-            <RadioButton android:id="@+id/radio2"
+
+            <RadioButton
+                android:id="@+id/radio2"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="@string/controls_1_radiobutton_2" />
-    
         </RadioGroup>
-    
-        <CheckBox android:id="@+id/star"
+
+        <CheckBox
+            android:id="@+id/star"
             style="?android:attr/starStyle"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/controls_1_star" />
-                            
-        <ToggleButton android:id="@+id/toggle1"
+
+        <ToggleButton
+            android:id="@+id/toggle1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content" />
-   
-        <ToggleButton android:id="@+id/toggle2"
+
+        <ToggleButton
+            android:id="@+id/toggle2"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content" />
-             
-        <Spinner android:id="@+id/spinner1"
+
+        <Spinner
+            android:id="@+id/spinner1"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:drawSelectorOnTop="true"
-        />
+            android:drawSelectorOnTop="true" />
 
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="5dip"
-            android:text="@string/textColorPrimary"
-            android:textAppearance="?android:attr/textAppearanceLarge"
             android:focusable="true"
-        />
+            android:text="@string/textColorPrimary"
+            android:textAppearance="?android:attr/textAppearanceLarge" />
 
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="5dip"
+            android:focusable="true"
             android:text="@string/textColorSecondary"
             android:textAppearance="?android:attr/textAppearanceLarge"
-            android:textColor="?android:attr/textColorSecondary"
-            android:focusable="true"
-        />
+            android:textColor="?android:attr/textColorSecondary" />
 
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="5dip"
+            android:focusable="true"
             android:text="@string/textColorTertiary"
             android:textAppearance="?android:attr/textAppearanceLarge"
-            android:textColor="?android:attr/textColorTertiary"
-            android:focusable="true"
-        />
+            android:textColor="?android:attr/textColorTertiary" />
 
         <TextView
             style="?android:attr/listSeparatorTextViewStyle"
-            android:text="@string/listSeparatorTextViewStyle"
             android:layout_marginTop="5dip"
-        />
+            android:text="@string/listSeparatorTextViewStyle" />
 
         <TextView
-            android:layout_height="wrap_content"
             android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
             android:layout_marginTop="400dip"
-            android:textAppearance="?android:attr/textAppearanceLarge"
             android:text="(And all inside of a ScrollView!)"
-        />
-        
+            android:textAppearance="?android:attr/textAppearanceLarge" />
     </LinearLayout>
 
-</ScrollView>
+</ScrollView>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/fragment_tabs_fragment.xml b/samples/ApiDemos/res/layout/fragment_tabs_fragment.xml
index 89b2757..72dbf60 100644
--- a/samples/ApiDemos/res/layout/fragment_tabs_fragment.xml
+++ b/samples/ApiDemos/res/layout/fragment_tabs_fragment.xml
@@ -41,7 +41,7 @@
             android:layout_weight="0"/>
 
         <FrameLayout
-            android:id="@+android:id/realtabcontent"
+            android:id="@+id/realtabcontent"
             android:layout_width="match_parent"
             android:layout_height="0dp"
             android:layout_weight="1"/>
diff --git a/samples/ApiDemos/res/layout/gallery_1.xml b/samples/ApiDemos/res/layout/gallery_1.xml
deleted file mode 100644
index d884c61..0000000
--- a/samples/ApiDemos/res/layout/gallery_1.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/layout2"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-<Gallery  android:id="@+id/gallery"
-android:layout_width="match_parent"
-android:layout_height="wrap_content"
-/>
-<EditText
- android:text="@+id/EditText01"
- android:id="@+id/EditText01"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"></EditText>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/gallery_2.xml b/samples/ApiDemos/res/layout/gallery_2.xml
deleted file mode 100644
index 1192bb2..0000000
--- a/samples/ApiDemos/res/layout/gallery_2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content">
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
-        android:layout_marginBottom="10dip"
-        android:text="@string/gallery_2_text"
-    />
-
-    <Gallery android:id="@+id/gallery"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_vertical"
-        android:spacing="16dp"
-    />
-
-</LinearLayout>
-
diff --git a/samples/ApiDemos/res/layout/image_block.xml b/samples/ApiDemos/res/layout/image_block.xml
new file mode 100644
index 0000000..04b8d3f
--- /dev/null
+++ b/samples/ApiDemos/res/layout/image_block.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:clipChildren="true"
+            android:columnCount="2"
+            android:rowCount="4"
+        >
+    <ImageView android:id="@+id/ducky"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:layout_column="0"
+               android:layout_row="0"
+               android:src="@drawable/ducky"
+               android:onClick="clicked"
+               android:transitionName="ducky"
+            />
+    <ImageView android:id="@+id/woot"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/woot"
+               android:layout_column="1"
+               android:layout_row="0"
+               android:onClick="clicked"
+               android:transitionName="woot"
+            />
+    <ImageView android:id="@+id/ball"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/ball"
+               android:layout_column="0"
+               android:layout_row="1"
+               android:onClick="clicked"
+               android:transitionName="ball"
+            />
+    <ImageView android:id="@+id/block"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/block"
+               android:layout_column="1"
+               android:layout_row="1"
+               android:onClick="clicked"
+               android:transitionName="block"
+            />
+    <ImageView android:id="@+id/jellies"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/jellies"
+               android:layout_column="0"
+               android:layout_row="2"
+               android:onClick="clicked"
+               android:transitionName="jellies"
+            />
+    <ImageView android:id="@+id/mug"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/mug"
+               android:layout_column="1"
+               android:layout_row="2"
+               android:onClick="clicked"
+               android:transitionName="mug"
+            />
+    <ImageView android:id="@+id/pencil"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/pencil"
+               android:layout_column="0"
+               android:layout_row="3"
+               android:onClick="clicked"
+               android:transitionName="pencil"
+            />
+    <ImageView android:id="@+id/scissors"
+               android:layout_height="wrap_content"
+               android:layout_width="wrap_content"
+               android:scaleType="centerCrop"
+               android:src="@drawable/scissors"
+               android:layout_column="1"
+               android:layout_row="3"
+               android:onClick="clicked"
+               android:transitionName="scissors"
+            />
+</GridLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/image_details.xml b/samples/ApiDemos/res/layout/image_details.xml
new file mode 100644
index 0000000..1daee46
--- /dev/null
+++ b/samples/ApiDemos/res/layout/image_details.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+             android:layout_width="match_parent"
+             android:layout_height="match_parent"
+             android:orientation="vertical"
+        >
+    <ImageView android:id="@+id/titleImage"
+               android:layout_height="0px"
+               android:layout_weight="1"
+               android:layout_width="match_parent"
+               android:scaleType="centerCrop"
+               android:transitionName="hero"
+               android:onClick="clicked"
+            />
+    <LinearLayout android:layout_height="0px"
+                  android:layout_width="match_parent"
+                  android:layout_weight="2"
+                  android:orientation="vertical"
+            >
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Ducky"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Woot!"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Ball"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Block"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Jelly Bean"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Mug"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Pencil"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+        <View android:layout_width="match_parent"
+              android:layout_height="2dp"
+              android:background="#808080"/>
+        <TextView android:layout_height="wrap_content"
+                  android:layout_width="match_parent"
+                  android:text="Scissors"
+                  android:textSize="30sp"
+                  android:textColor="#FFF"
+                />
+
+    </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/image_switcher_1.xml b/samples/ApiDemos/res/layout/image_switcher_1.xml
deleted file mode 100644
index 0fdf3f9..0000000
--- a/samples/ApiDemos/res/layout/image_switcher_1.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-  
-          http://www.apache.org/licenses/LICENSE-2.0
-  
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
-    android:layout_width="match_parent" 
-    android:layout_height="match_parent"> 
-    
-    <ImageSwitcher android:id="@+id/switcher"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_alignParentTop="true"
-        android:layout_alignParentLeft="true"
-    />
-    
-    <Gallery android:id="@+id/gallery"
-        android:background="#55000000"
-        android:layout_width="match_parent"
-        android:layout_height="60dp"
-        android:layout_alignParentBottom="true"
-        android:layout_alignParentLeft="true"
-        
-        android:gravity="center_vertical"
-        android:spacing="16dp"
-    />
-
-</RelativeLayout>
-   
diff --git a/samples/ApiDemos/res/layout/path_animations.xml b/samples/ApiDemos/res/layout/path_animations.xml
new file mode 100644
index 0000000..93abc98
--- /dev/null
+++ b/samples/ApiDemos/res/layout/path_animations.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent">
+    <ScrollView android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+        <RadioGroup android:orientation="horizontal"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:id="@+id/path_animation_type"
+                >
+            <RadioButton android:id="@+id/named_components"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Named Components"/>
+            <RadioButton android:id="@+id/property_components"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Property Components"/>
+            <RadioButton android:id="@+id/multi_int"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Multi-int"/>
+            <RadioButton android:id="@+id/multi_float"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Multi-float"/>
+            <RadioButton android:id="@+id/named_setter"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Named Property"/>
+            <RadioButton android:id="@+id/property_setter"
+                         android:layout_width="wrap_content"
+                         android:layout_height="wrap_content"
+                         android:text="Property"/>
+        </RadioGroup>
+    </ScrollView>
+    <view class="com.example.android.apis.animation.PathAnimations$CanvasView"
+          android:id="@+id/canvas"
+          android:layout_width="match_parent"
+          android:layout_height="0px"
+          android:layout_weight="1">
+        <ImageView android:id="@+id/moved_item"
+                   android:layout_width="wrap_content"
+                   android:layout_height="wrap_content"
+                   android:src="@drawable/frog"/>
+    </view>
+</LinearLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/progressbar_2.xml b/samples/ApiDemos/res/layout/progressbar_2.xml
index 0c3f63c..32e6cdd 100644
--- a/samples/ApiDemos/res/layout/progressbar_2.xml
+++ b/samples/ApiDemos/res/layout/progressbar_2.xml
@@ -19,21 +19,21 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content">
 
-    <ProgressBar android:id="@+android:id/progress_large"
+    <ProgressBar android:id="@+id/progress_large"
         style="?android:attr/progressBarStyleLarge"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />
 
-    <ProgressBar android:id="@+android:id/progress"
+    <ProgressBar android:id="@+id/progress"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />
 
-    <ProgressBar android:id="@+android:id/progress_small"
+    <ProgressBar android:id="@+id/progress_small"
         style="?android:attr/progressBarStyleSmall"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />
 
-    <ProgressBar android:id="@+android:id/progress_small_title"
+    <ProgressBar android:id="@+id/progress_small_title"
         style="?android:attr/progressBarStyleSmallTitle"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />
diff --git a/samples/ApiDemos/res/layout/shadow_card_drag.xml b/samples/ApiDemos/res/layout/shadow_card_drag.xml
new file mode 100644
index 0000000..c3bc474
--- /dev/null
+++ b/samples/ApiDemos/res/layout/shadow_card_drag.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/card_parent"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clipChildren="false"
+    android:clipToPadding="false"
+    android:orientation="horizontal" >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <CheckBox
+            android:id="@+id/tilt_check"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:checked="false"
+            android:text="@string/enable_tilt"/>
+        <CheckBox
+            android:id="@+id/shading_check"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:checked="false"
+            android:text="@string/enable_shading"/>
+        <Button
+            android:id="@+id/shape_select"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/select_shape"/>
+        </LinearLayout>
+
+    <TextView
+        android:id="@+id/card"
+        android:layout_width="150dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:clipToPadding="false"
+        android:gravity="center"
+        android:padding="20dp"
+        android:text="@string/draggable_card"
+        android:textSize="20sp"
+        android:elevation="2dp"/>
+</FrameLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/layout/shadow_card_stack.xml b/samples/ApiDemos/res/layout/shadow_card_stack.xml
new file mode 100644
index 0000000..11d60f7
--- /dev/null
+++ b/samples/ApiDemos/res/layout/shadow_card_stack.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/card_parent"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clipChildren="false"
+    android:clipToPadding="false"
+    android:gravity="center">
+    <TextView
+        android:layout_width="250dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:padding="20dp"
+        android:textSize="20sp" />
+    <TextView
+        android:layout_width="250dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:padding="20dp"
+        android:textSize="20sp" />
+    <TextView
+        android:layout_width="250dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:padding="20dp"
+        android:textSize="20sp" />
+    <TextView
+        android:layout_width="250dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:padding="20dp"
+        android:textSize="20sp" />
+    <TextView
+        android:layout_width="250dp"
+        android:layout_height="150dp"
+        android:background="@drawable/round_rect"
+        android:padding="20dp"
+        android:textSize="20sp" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/transition/activity_transition_mgr.xml b/samples/ApiDemos/res/transition/activity_transition_mgr.xml
new file mode 100644
index 0000000..f1f461b
--- /dev/null
+++ b/samples/ApiDemos/res/transition/activity_transition_mgr.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2013 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<transitionManager xmlns:android="http://schemas.android.com/apk/res/android">
+</transitionManager>
diff --git a/samples/ApiDemos/res/transition/explode.xml b/samples/ApiDemos/res/transition/explode.xml
new file mode 100644
index 0000000..bb93ca7
--- /dev/null
+++ b/samples/ApiDemos/res/transition/explode.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<!-- BEGIN_INCLUDE(Explode) -->
+<explode/>
+<!-- END_INCLUDE(Explode) -->
diff --git a/samples/ApiDemos/res/transition/explode_move_together.xml b/samples/ApiDemos/res/transition/explode_move_together.xml
new file mode 100644
index 0000000..54477d8
--- /dev/null
+++ b/samples/ApiDemos/res/transition/explode_move_together.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<!-- BEGIN_INCLUDE(MultipleTransform) -->
+<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
+    <explode/>
+    <changeBounds/>
+    <changeTransform/>
+    <changeClipBounds/>
+    <changeImageTransform/>
+</transitionSet>
+<!-- END_INCLUDE(MultipleTransform) -->
diff --git a/samples/ApiDemos/res/transition/move_image.xml b/samples/ApiDemos/res/transition/move_image.xml
new file mode 100644
index 0000000..ae61d0c
--- /dev/null
+++ b/samples/ApiDemos/res/transition/move_image.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<!-- BEGIN_INCLUDE(ChangeImageTransform) -->
+<transitionSet>
+  <changeBounds/>
+  <changeImageTransform/>
+</transitionSet>
+<!-- END_INCLUDE(ChangeImageTransform) -->
diff --git a/samples/ApiDemos/res/values-v11/styles.xml b/samples/ApiDemos/res/values-v11/styles.xml
index 3b4fead..5b92c33 100644
--- a/samples/ApiDemos/res/values-v11/styles.xml
+++ b/samples/ApiDemos/res/values-v11/styles.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!--
+     Copyright (C) 2011 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.
@@ -15,15 +16,17 @@
 -->
 
 <resources>
-    <!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
-    <style name="ThemeHolo" parent="android:Theme.Holo">
-    </style>
 
     <!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
-    <style name="ThemeHoloDialog" parent="android:Theme.Holo.Dialog">
-    </style>
+    <style name="ThemeCurrent" parent="@android:Theme.Holo" />
+
+    <!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
+    <style name="ThemeCurrentDialog" parent="@android:Theme.Holo.Dialog" />
 
     <!-- For API level 11 or later, we can use the magical DialogWhenLarge theme. -->
-    <style name="ThemeDialogWhenLarge" parent="android:style/Theme.Holo.DialogWhenLarge">
-    </style>
-</resources>
+    <style name="ThemeDialogWhenLarge" parent="@android:style/Theme.Holo.DialogWhenLarge" />
+
+    <!-- For API level 11 or later, the Holo theme is available and we prefer that. -->
+    <style name="ThemeDefault" parent="@android:style/Theme.Holo" />
+
+</resources>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/values-v14/styles.xml b/samples/ApiDemos/res/values-v14/styles.xml
new file mode 100644
index 0000000..39e5290
--- /dev/null
+++ b/samples/ApiDemos/res/values-v14/styles.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+
+    <!-- For API level 14 or later, the DeviceDefault theme is available and we prefer that. -->
+    <style name="ThemeDefault" parent="@android:style/Theme.DeviceDefault" />
+
+</resources>
\ No newline at end of file
diff --git a/samples/ApiDemos/res/values-v19/styles.xml b/samples/ApiDemos/res/values-v19/styles.xml
new file mode 100644
index 0000000..cfd9cf8
--- /dev/null
+++ b/samples/ApiDemos/res/values-v19/styles.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <!-- For API level XX or later, the Material theme is available and we prefer that. -->
+    <style name="ThemeCurrent" parent="android:Theme.Material">
+    </style>
+
+    <!-- For API level XX or later, the Holo theme is available and we prefer that. -->
+    <style name="ThemeCurrentDialog" parent="android:Theme.Material.Dialog">
+    </style>
+
+    <!-- For API level XX or later, we can use the magical DialogWhenLarge theme. -->
+    <style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme.Material.DialogWhenLarge">
+    </style>
+</resources>
diff --git a/samples/ApiDemos/res/values-v20/bools.xml b/samples/ApiDemos/res/values-v20/bools.xml
new file mode 100644
index 0000000..3a4b91e
--- /dev/null
+++ b/samples/ApiDemos/res/values-v20/bools.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <!-- This resource is true if running under at least L-Release
+         API level.  The default value is false; an alternative value
+         for L-Release is true. -->
+    <bool name="atLeastLRelease">true</bool>
+</resources>
diff --git a/samples/ApiDemos/res/values-v20/styles.xml b/samples/ApiDemos/res/values-v20/styles.xml
new file mode 100644
index 0000000..727af03
--- /dev/null
+++ b/samples/ApiDemos/res/values-v20/styles.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <!-- For API level XX or later, the Material theme is available and we prefer that. -->
+    <style name="ThemeCurrent" parent="android:Theme.Material.Light">
+    </style>
+
+    <!-- For API level XX or later, the Holo theme is available and we prefer that. -->
+    <style name="ThemeCurrentDialog" parent="android:Theme.Material.Light.Dialog">
+    </style>
+
+    <!-- For API level XX or later, we can use the magical DialogWhenLarge theme. -->
+    <style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme.Material.Light.DialogWhenLarge">
+    </style>
+</resources>
diff --git a/samples/ApiDemos/res/values/arrays.xml b/samples/ApiDemos/res/values/arrays.xml
index 8f987ae..b515c1e 100644
--- a/samples/ApiDemos/res/values/arrays.xml
+++ b/samples/ApiDemos/res/values/arrays.xml
@@ -102,6 +102,7 @@
         <item>Unspecified</item>
         <item>Something</item>
         <item>Numeric</item>
+        <item>Numeric(Complex)</item>
         <item>Alphabetic</item>
         <item>Alphanumeric</item>
         <item>Complex</item>
@@ -359,4 +360,11 @@
         <item>AJS</item>
     </string-array>
 
+    <!-- Used in App/ActionBarDisplayOptions.java -->
+    <string-array name="navigation_modes">
+        <item>NAVIGATION_MODE_STANDARD</item>
+        <item>NAVIGATION_MODE_TABS</item>
+        <item>NAVIGATION_MODE_LIST</item>
+    </string-array>
+
 </resources>
diff --git a/samples/ApiDemos/res/values/attrs.xml b/samples/ApiDemos/res/values/attrs.xml
index bf33788..558f3ef 100644
--- a/samples/ApiDemos/res/values/attrs.xml
+++ b/samples/ApiDemos/res/values/attrs.xml
@@ -21,12 +21,6 @@
         <attr name="android:preferenceLayoutChild" />
     </declare-styleable>
     
-    <!-- These are the attributes that we want to retrieve from the theme
-         in view/Gallery1.java -->
-    <declare-styleable name="Gallery1">
-        <attr name="android:galleryItemBackground" />
-    </declare-styleable>
-    
      <declare-styleable name="LabelView">
         <attr name="text" format="string" />
         <attr name="textColor" format="color" />
diff --git a/samples/ApiDemos/res/values/bools.xml b/samples/ApiDemos/res/values/bools.xml
index fa3f25f..127c142 100644
--- a/samples/ApiDemos/res/values/bools.xml
+++ b/samples/ApiDemos/res/values/bools.xml
@@ -49,4 +49,9 @@
          for KitKat is true. -->
     <bool name="atLeastKitKat">false</bool>
 
+    <!-- This resource is true if running under at least L-Release
+         API level.  The default value is false; an alternative value
+         for L-Release is true. -->
+    <bool name="atLeastLRelease">false</bool>
+
 </resources>
diff --git a/samples/ApiDemos/res/values/colors.xml b/samples/ApiDemos/res/values/colors.xml
index f2534d1..147ba84 100644
--- a/samples/ApiDemos/res/values/colors.xml
+++ b/samples/ApiDemos/res/values/colors.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 The Android Open Source Project
+<!--
+     Copyright (C) 2007 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.
@@ -15,12 +16,12 @@
 -->
 
 <resources>
+
     <drawable name="red">#7f00</drawable>
     <drawable name="blue">#770000ff</drawable>
     <drawable name="green">#7700ff00</drawable>
-	<drawable name="yellow">#77ffff00</drawable>
-	
-	<drawable name="screen_background_black">#ff000000</drawable>
+    <drawable name="yellow">#77ffff00</drawable>
+    <drawable name="screen_background_black">#ff000000</drawable>
     <drawable name="translucent_background">#e0000000</drawable>
     <drawable name="transparent_background">#00000000</drawable>
 
@@ -28,5 +29,10 @@
     <color name="solid_blue">#0000ff</color>
     <color name="solid_green">#f0f0</color>
     <color name="solid_yellow">#ffffff00</color>
+    <color name="purply">#ff884488</color>
+
+    <!-- A custom theme that is a variation on the light them with a different
+         background color. -->
+    <color name="custom_theme_color">#b0b0ff</color>
 
 </resources>
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index 804087d..6a2df2e 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -463,6 +463,8 @@
     <string name="ir_send">Send IR</string>
     <string name="ir_get_freqs">Get Carrier Frequencies</string>
 
+    <string name="activity_documents">Content/Storage/Documents</string>
+
     <!-- ============================== -->
     <!--  app/intents examples strings     -->
     <!-- ============================== -->
@@ -741,10 +743,19 @@
     <string name="disable_camera">Disable all device cameras</string>
     <string name="disable_keyguard_widgets">Disable keyguard widgets</string>
     <string name="disable_keyguard_secure_camera">Disable keyguard secure camera</string>
+    <string name="disable_keyguard_notifications">Disable keyguard notifications</string>
+    <string name="disable_keyguard_unredacted_notifications">Disable keyguard unredacted notifications</string>
+    <string name="disable_keyguard_trust_agents">Disable keyguard Trust Agents</string>
     <string name="keyguard_widgets_disabled">Keyguard widgets disabled</string>
     <string name="keyguard_widgets_enabled">Keyguard widgets enabled</string>
     <string name="keyguard_secure_camera_disabled">Keyguard secure camera disabled</string>
     <string name="keyguard_secure_camera_enabled">Keyguard secure camera enabled</string>
+    <string name="keyguard_secure_notifications_disabled">Keyguard notifications disabled</string>
+    <string name="keyguard_secure_notifications_enabled">Keyguard notifications enabled</string>
+    <string name="keyguard_unredacted_notifications_disabled">Keyguard unredacted notifications disabled</string>
+    <string name="keyguard_unredacted_notifications_enabled">Keyguard unredacted notifications enabled</string>
+    <string name="keyguard_trust_agents_disabled">Keyguard Trust Agents disabled</string>
+    <string name="keyguard_trust_agents_enabled">Keyguard Trust Agents enabled</string>
     <string name="camera_disabled">Device cameras disabled</string>
     <string name="camera_enabled">Device cameras enabled</string>
     <string name="password_controls_category">Password controls</string>
@@ -893,6 +904,11 @@
     <string name="density_title">Density: Unknown Screen</string>
     <string name="camera_alert">Device has only one camera!</string>
     <string name="switch_cam">Switch Camera</string>
+    <string name="draggable_card">Draggable Card</string>
+
+    <string name="enable_tilt">Enable Tilt</string>
+    <string name="enable_shading">Enable Shading</string>
+    <string name="select_shape">Select Shape</string>
 
     <!-- ============================ -->
     <!--  media examples strings  -->
@@ -1116,7 +1132,6 @@
     <string name="focus_5_button3">3</string>
     <string name="focus_5_button4">4</string>
     <string name="focus_5_button5">5</string>
-    <string name="gallery_2_text">Testing</string>
     <string name="grid_layout_1_instructions">Type here:</string>
     <string name="grid_layout_1_ok">Ok</string>
     <string name="grid_layout_1_cancel">Cancel</string>
diff --git a/samples/ApiDemos/res/values/styles.xml b/samples/ApiDemos/res/values/styles.xml
index 49a1c25..0fa0cc1 100644
--- a/samples/ApiDemos/res/values/styles.xml
+++ b/samples/ApiDemos/res/values/styles.xml
@@ -15,9 +15,6 @@
 -->
 
 <resources>
-    <!-- A custom theme that is a variation on the light them with a different
-         background color. -->
-    <color name="custom_theme_color">#b0b0ff</color>
     <style name="CustomTheme" parent="android:Theme.Light">
         <item name="android:windowBackground">@color/custom_theme_color</item>
         <item name="android:colorBackground">@color/custom_theme_color</item>
@@ -26,24 +23,33 @@
     <!-- This is a theme that will adjust itself depending on the API version.
          The default definition is the safe one, using a theme that has always
          been defined.  Look at values-11/styles.xml for a variation that is
-         selected when the holographic theme is available. -->
-    <style name="ThemeHolo" parent="android:Theme">
-    </style>
+         selected when the holographic theme is available, or look at
+         values-XX/styles.xml for a variation that is selected when the material
+         theme is available. -->
+    <style name="ThemeCurrent" parent="android:Theme" />
+
+    <!-- This is a theme that reflects the default theme used when no theme is
+         specified by an application or activity. In API 14 and above, this
+         refers to the DeviceDefault theme. -->
+    <style name="ThemeDefault" parent="android:Theme" />
 
     <!-- This is a theme that will adjust itself depending on the API version.
          The default definition is the safe one, using a theme that has always
          been defined.  Look at values-11/styles.xml for a variation that is
-         selected when the holographic theme is available. -->
-    <style name="ThemeHoloDialog" parent="android:Theme.Dialog">
-    </style>
+         selected when the holographic theme is available, or look at
+         values-XX/styles.xml for a variation that is selected when the material
+         theme is available. -->
+    <style name="ThemeCurrentDialog" parent="android:Theme.Dialog" />
+
+    <!-- Older platforms don't have Theme.Holo.DialogWhenLarge; we will define
+         our own wrapper theme that uses it only when running on the appropriate
+         platform version.  On older platforms, we always use the generic
+         fullscreen theme, because they don't support some feature that help
+         in correctly laying out an activity as a dialog. -->
+    <style name="ThemeCurrentDialogWhenLarge" parent="android:style/Theme" />
 
     <!-- Base application theme is the default theme. -->
-    <style name="Theme" parent="android:Theme">
-    </style>
-
-    <!-- Base application theme is the default theme. -->
-    <style name="BadTheme" parent="@android:style/Theme.Holo.Light.NoActionBar">
-    </style>
+    <style name="Theme" parent="android:Theme" />
 
     <!-- Variation on our application theme that forces a plain
         text style. -->
@@ -91,14 +97,6 @@
         <item name="android:windowNoTitle">true</item>
         <item name="android:colorForeground">#fff</item>
     </style>
-    
-    <!-- Older platforms don't have Theme.Holo.DialogWhenLarge; we will define
-         our own wrapper theme that uses it only when running on the appropriate
-         platform version.  On older platforms, we always use the generic
-         fullscreen theme, because they don't support some feature that help
-         in correctly laying out an activity as a dialog. -->
-    <style name="ThemeDialogWhenLarge" parent="android:style/Theme">
-    </style>
 
     <style name="TextAppearance.Theme.PlainText" parent="android:TextAppearance.Theme">
         <item name="android:textStyle">normal</item>
@@ -121,4 +119,14 @@
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">wrap_content</item>
     </style>
+
+    <style name="ActivityTransitionTheme" parent="android:Theme.Material">
+	<item name="android:windowEnterTransition">@transition/explode</item>
+	<item name="android:windowExitTransition">@transition/explode</item>
+	<item name="android:windowSharedElementEnterTransition">@transition/move_image</item>
+	<item name="android:windowSharedElementExitTransition">@transition/move_image</item>
+	<item name="android:windowAllowExitTransitionOverlap">true</item>
+	<item name="android:windowAllowEnterTransitionOverlap">false</item>
+    </style>
+
 </resources>
diff --git a/samples/ApiDemos/res/xml/device_admin_general.xml b/samples/ApiDemos/res/xml/device_admin_general.xml
index 3a1dd45..cfd0048 100644
--- a/samples/ApiDemos/res/xml/device_admin_general.xml
+++ b/samples/ApiDemos/res/xml/device_admin_general.xml
@@ -43,6 +43,18 @@
             android:key="key_disable_keyguard_secure_camera"
             android:title="@string/disable_keyguard_secure_camera" />
 
+        <CheckBoxPreference
+            android:key="key_disable_notifications"
+            android:title="@string/disable_keyguard_notifications" />
+
+        <CheckBoxPreference
+            android:key="key_disable_unredacted"
+            android:title="@string/disable_keyguard_unredacted_notifications" />
+
+        <CheckBoxPreference
+            android:key="key_disable_trust_agents"
+            android:title="@string/disable_keyguard_trust_agents" />
+
     </PreferenceCategory>
 
 </PreferenceScreen>
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransition.java b/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransition.java
new file mode 100644
index 0000000..b295826
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransition.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.apis.animation;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.ActivityOptions;
+import android.app.SharedElementListener;
+import android.content.Intent;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ */
+public class ActivityTransition extends Activity {
+
+    private static final String TAG = "ActivityTransition";
+
+    private static final String KEY_ID = "ViewTransitionValues:id";
+
+    private ImageView mHero;
+
+    public static final int[] DRAWABLES = {
+            R.drawable.ball,
+            R.drawable.block,
+            R.drawable.ducky,
+            R.drawable.jellies,
+            R.drawable.mug,
+            R.drawable.pencil,
+            R.drawable.scissors,
+            R.drawable.woot,
+    };
+
+    public static final int[] IDS = {
+            R.id.ball,
+            R.id.block,
+            R.id.ducky,
+            R.id.jellies,
+            R.id.mug,
+            R.id.pencil,
+            R.id.scissors,
+            R.id.woot,
+    };
+
+    public static final String[] NAMES = {
+            "ball",
+            "block",
+            "ducky",
+            "jellies",
+            "mug",
+            "pencil",
+            "scissors",
+            "woot",
+    };
+
+    public static int getIdForKey(String id) {
+        return IDS[getIndexForKey(id)];
+    }
+
+    public static int getDrawableIdForKey(String id) {
+        return DRAWABLES[getIndexForKey(id)];
+    }
+
+    public static int getIndexForKey(String id) {
+        for (int i = 0; i < NAMES.length; i++) {
+            String name = NAMES[i];
+            if (name.equals(id)) {
+                return i;
+            }
+        }
+        return 2;
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        getWindow().setBackgroundDrawable(new ColorDrawable(randomColor()));
+        setContentView(R.layout.image_block);
+        setupHero();
+    }
+
+    private void setupHero() {
+        String name = getIntent().getStringExtra(KEY_ID);
+        mHero = null;
+        if (name != null) {
+            mHero = (ImageView) findViewById(getIdForKey(name));
+            setEnterSharedElementListener(new SharedElementListener() {
+                @Override
+                public void remapSharedElements(List<String> names,
+                        Map<String, View> sharedElements) {
+                    sharedElements.put("hero", mHero);
+                }
+            });
+        }
+    }
+
+    public void clicked(View v) {
+        mHero = (ImageView) v;
+        Intent intent = new Intent(this, ActivityTransitionDetails.class);
+        intent.putExtra(KEY_ID, v.getTransitionName());
+        ActivityOptions activityOptions
+                = ActivityOptions.makeSceneTransitionAnimation(this, mHero, "hero");
+        startActivity(intent, activityOptions.toBundle());
+    }
+
+    private static int randomColor() {
+        int red = (int)(Math.random() * 128);
+        int green = (int)(Math.random() * 128);
+        int blue = (int)(Math.random() * 128);
+        return 0xFF000000 | (red << 16) | (green << 8) | blue;
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransitionDetails.java b/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransitionDetails.java
new file mode 100644
index 0000000..e657c55
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/ActivityTransitionDetails.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.apis.animation;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.ActivityOptions;
+import android.content.Intent;
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ImageView;
+
+/**
+ *
+ */
+public class ActivityTransitionDetails extends Activity {
+
+    private static final String TAG = "ActivityTransitionDetails";
+
+    private static final String KEY_ID = "ViewTransitionValues:id";
+
+    private int mImageResourceId = R.drawable.ducky;
+
+    private String mName = "ducky";
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        getWindow().setBackgroundDrawable(new ColorDrawable(randomColor()));
+        setContentView(R.layout.image_details);
+        ImageView titleImage = (ImageView) findViewById(R.id.titleImage);
+        titleImage.setImageDrawable(getHeroDrawable());
+    }
+
+    private Drawable getHeroDrawable() {
+        String name = getIntent().getStringExtra(KEY_ID);
+        if (name != null) {
+            mName = name;
+            mImageResourceId = ActivityTransition.getDrawableIdForKey(name);
+        }
+
+        return getResources().getDrawable(mImageResourceId);
+    }
+
+    public void clicked(View v) {
+        Intent intent = new Intent(this, ActivityTransition.class);
+        intent.putExtra(KEY_ID, mName);
+        ActivityOptions activityOptions = ActivityOptions.makeSceneTransitionAnimation(this,
+                v, "hero");
+        startActivity(intent, activityOptions.toBundle());
+    }
+
+    private static int randomColor() {
+        int red = (int)(Math.random() * 128);
+        int green = (int)(Math.random() * 128);
+        int blue = (int)(Math.random() * 128);
+        return 0xFF000000 | (red << 16) | (green << 8) | blue;
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/PathAnimations.java b/samples/ApiDemos/src/com/example/android/apis/animation/PathAnimations.java
new file mode 100644
index 0000000..daa8d99
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/PathAnimations.java
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.apis.animation;
+
+import android.animation.ObjectAnimator;
+import android.animation.TypeConverter;
+import android.animation.ValueAnimator;
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.Point;
+import android.graphics.PointF;
+import android.graphics.RectF;
+import android.os.Bundle;
+import android.util.AttributeSet;
+import android.util.FloatMath;
+import android.util.Log;
+import android.util.Property;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.LinearInterpolator;
+import android.widget.FrameLayout;
+import android.widget.RadioGroup;
+
+import com.example.android.apis.R;
+
+/** This application demonstrates the use of Path animation. */
+public class PathAnimations extends Activity implements
+        RadioGroup.OnCheckedChangeListener, View.OnLayoutChangeListener {
+
+    final static Path sTraversalPath = new Path();
+    final static float TRAVERSE_PATH_SIZE = 7.0f;
+
+    final static Property<PathAnimations, Point> POINT_PROPERTY
+            = new Property<PathAnimations, Point>(Point.class, "point") {
+        @Override
+        public Point get(PathAnimations object) {
+            View v = object.findViewById(R.id.moved_item);
+            return new Point(Math.round(v.getX()), Math.round(v.getY()));
+        }
+
+        @Override
+        public void set(PathAnimations object, Point value) {
+            object.setCoordinates(value.x, value.y);
+        }
+    };
+
+    static {
+        float inverse_sqrt8 = FloatMath.sqrt(0.125f);
+        RectF bounds = new RectF(1, 1, 3, 3);
+        sTraversalPath.addArc(bounds, 45, 180);
+        sTraversalPath.addArc(bounds, 225, 180);
+
+        bounds.set(1.5f + inverse_sqrt8, 1.5f + inverse_sqrt8, 2.5f + inverse_sqrt8,
+                2.5f + inverse_sqrt8);
+        sTraversalPath.addArc(bounds, 45, 180);
+        sTraversalPath.addArc(bounds, 225, 180);
+
+        bounds.set(4, 1, 6, 3);
+        sTraversalPath.addArc(bounds, 135, -180);
+        sTraversalPath.addArc(bounds, -45, -180);
+
+        bounds.set(4.5f - inverse_sqrt8, 1.5f + inverse_sqrt8, 5.5f - inverse_sqrt8, 2.5f + inverse_sqrt8);
+        sTraversalPath.addArc(bounds, 135, -180);
+        sTraversalPath.addArc(bounds, -45, -180);
+
+        sTraversalPath.addCircle(3.5f, 3.5f, 0.5f, Path.Direction.CCW);
+
+        sTraversalPath.addArc(new RectF(1, 2, 6, 6), 0, 180);
+    }
+
+    private CanvasView mCanvasView;
+
+    private ObjectAnimator mAnimator;
+
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.path_animations);
+        mCanvasView = (CanvasView) findViewById(R.id.canvas);
+        mCanvasView.addOnLayoutChangeListener(this);
+        ((RadioGroup) findViewById(R.id.path_animation_type)).setOnCheckedChangeListener(this);
+    }
+
+    public void setCoordinates(int x, int y) {
+        changeCoordinates((float) x, (float) y);
+    }
+
+    public void changeCoordinates(float x, float y) {
+        View v = findViewById(R.id.moved_item);
+        v.setX(x);
+        v.setY(y);
+    }
+
+    public void setPoint(PointF point) {
+        changeCoordinates(point.x, point.y);
+    }
+
+    @Override
+    public void onCheckedChanged(RadioGroup group, int checkedId) {
+        startAnimator(checkedId);
+    }
+
+    @Override
+    public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
+            int oldTop, int oldRight, int oldBottom) {
+        int checkedId = ((RadioGroup)findViewById(R.id.path_animation_type)).getCheckedRadioButtonId();
+        if (checkedId != RadioGroup.NO_ID) {
+            startAnimator(checkedId);
+        }
+    }
+
+    private void startAnimator(int checkedId) {
+        if (mAnimator != null) {
+            mAnimator.cancel();
+            mAnimator = null;
+        }
+
+        View view = findViewById(R.id.moved_item);
+        Path path = mCanvasView.getPath();
+        if (path.isEmpty()) {
+            return;
+        }
+
+        switch (checkedId) {
+            case R.id.named_components:
+                // Use the named "x" and "y" properties for individual (x, y)
+                // coordinates of the Path and set them on the view object.
+                // The setX(float) and setY(float) methods are called on view.
+                // An int version of this method also exists for animating
+                // int Properties.
+                mAnimator = ObjectAnimator.ofFloat(view, "x", "y", path);
+                break;
+            case R.id.property_components:
+                // Use two Properties for individual (x, y) coordinates of the Path
+                // and set them on the view object.
+                // An int version of this method also exists for animating
+                // int Properties.
+                mAnimator = ObjectAnimator.ofFloat(view, View.X, View.Y, path);
+                break;
+            case R.id.multi_int:
+                // Use a multi-int setter to animate along a Path. The method
+                // setCoordinates(int x, int y) is called on this during the animation.
+                // Either "setCoordinates" or "coordinates" are acceptable parameters
+                // because the "set" can be implied.
+                mAnimator = ObjectAnimator.ofMultiInt(this, "setCoordinates", path);
+                break;
+            case R.id.multi_float:
+                // Use a multi-float setter to animate along a Path. The method
+                // changeCoordinates(float x, float y) is called on this during the animation.
+                mAnimator = ObjectAnimator.ofMultiFloat(this, "changeCoordinates", path);
+                break;
+            case R.id.named_setter:
+                // Use the named "point" property to animate along the Path.
+                // There must be a method setPoint(PointF) on the animated object.
+                // Because setPoint takes a PointF parameter, no TypeConverter is necessary.
+                // In this case, the animated object is PathAnimations.
+                mAnimator = ObjectAnimator.ofObject(this, "point", null, path);
+                break;
+            case R.id.property_setter:
+                // Use the POINT_PROPERTY property to animate along the Path.
+                // POINT_PROPERTY takes a Point, not a PointF, so the TypeConverter
+                // PointFToPointConverter is necessary.
+                mAnimator = ObjectAnimator.ofObject(this, POINT_PROPERTY,
+                        new PointFToPointConverter(), path);
+                break;
+        }
+
+        mAnimator.setDuration(10000);
+        mAnimator.setRepeatMode(Animation.RESTART);
+        mAnimator.setRepeatCount(ValueAnimator.INFINITE);
+        mAnimator.setInterpolator(new LinearInterpolator());
+        mAnimator.start();
+    }
+
+    public static class CanvasView extends FrameLayout {
+
+        Path mPath = new Path();
+
+        Paint mPathPaint = new Paint();
+
+        public CanvasView(Context context) {
+            super(context);
+            init();
+        }
+
+        public CanvasView(Context context, AttributeSet attrs) {
+            super(context, attrs);
+            init();
+        }
+
+        public CanvasView(Context context, AttributeSet attrs, int defStyle) {
+            super(context, attrs, defStyle);
+            init();
+        }
+
+        private void init() {
+            setWillNotDraw(false);
+            mPathPaint.setColor(0xFFFF0000);
+            mPathPaint.setStrokeWidth(2.0f);
+            mPathPaint.setStyle(Paint.Style.STROKE);
+        }
+
+        @Override
+        protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+            super.onLayout(changed, left, top, right, bottom);
+            if (changed) {
+                Matrix scale = new Matrix();
+                float scaleWidth = (right-left)/TRAVERSE_PATH_SIZE;
+                float scaleHeight= (bottom-top)/TRAVERSE_PATH_SIZE;
+                scale.setScale(scaleWidth, scaleHeight);
+                sTraversalPath.transform(scale, mPath);
+            }
+        }
+
+        public Path getPath() {
+            return mPath;
+        }
+
+        @Override
+        public void draw(Canvas canvas) {
+            canvas.drawPath(mPath, mPathPaint);
+            super.draw(canvas);
+        }
+    }
+
+    private static class PointFToPointConverter extends TypeConverter<PointF, Point> {
+        Point mPoint = new Point();
+
+        public PointFToPointConverter() {
+            super(PointF.class, Point.class);
+        }
+
+        @Override
+        public Point convert(PointF value) {
+            mPoint.set(Math.round(value.x), Math.round(value.y));
+            return mPoint;
+        }
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
index 73d8db9..40e63e9 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
@@ -26,12 +26,16 @@
 import android.view.Menu;
 import android.view.View;
 import android.view.ViewGroup.LayoutParams;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
 
 /**
- * This demo shows how various action bar display option flags can be combined and their effects.
+ * This demo shows how various action bar display option flags can be combined
+ * and their effects.
  */
-public class ActionBarDisplayOptions extends Activity
-        implements View.OnClickListener, ActionBar.TabListener {
+public class ActionBarDisplayOptions extends Activity implements View.OnClickListener,
+        ActionBar.TabListener, Spinner.OnItemSelectedListener, ActionBar.OnNavigationListener {
     private View mCustomView;
 
     @Override
@@ -44,11 +48,12 @@
         findViewById(R.id.toggle_use_logo).setOnClickListener(this);
         findViewById(R.id.toggle_show_title).setOnClickListener(this);
         findViewById(R.id.toggle_show_custom).setOnClickListener(this);
-        findViewById(R.id.toggle_navigation).setOnClickListener(this);
         findViewById(R.id.cycle_custom_gravity).setOnClickListener(this);
         findViewById(R.id.toggle_visibility).setOnClickListener(this);
         findViewById(R.id.toggle_system_ui).setOnClickListener(this);
 
+        ((Spinner) findViewById(R.id.toggle_navigation)).setOnItemSelectedListener(this);
+
         mCustomView = getLayoutInflater().inflate(R.layout.action_bar_display_options_custom, null);
         // Configure several action bar elements that will be toggled by display options.
         final ActionBar bar = getActionBar();
@@ -58,6 +63,13 @@
         bar.addTab(bar.newTab().setText("Tab 1").setTabListener(this));
         bar.addTab(bar.newTab().setText("Tab 2").setTabListener(this));
         bar.addTab(bar.newTab().setText("Tab 3").setTabListener(this));
+
+        final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
+                android.R.layout.simple_list_item_1);
+        adapter.add("Item 1");
+        adapter.add("Item 2");
+        adapter.add("Item 3");
+        bar.setListNavigationCallbacks(adapter, this);
     }
 
     @Override
@@ -66,6 +78,7 @@
         return true;
     }
 
+    @Override
     public void onClick(View v) {
         final ActionBar bar = getActionBar();
         int flags = 0;
@@ -85,13 +98,6 @@
             case R.id.toggle_show_custom:
                 flags = ActionBar.DISPLAY_SHOW_CUSTOM;
                 break;
-
-            case R.id.toggle_navigation:
-                bar.setNavigationMode(
-                        bar.getNavigationMode() == ActionBar.NAVIGATION_MODE_STANDARD
-                                ? ActionBar.NAVIGATION_MODE_TABS
-                                : ActionBar.NAVIGATION_MODE_STANDARD);
-                return;
             case R.id.cycle_custom_gravity:
                 ActionBar.LayoutParams lp = (ActionBar.LayoutParams) mCustomView.getLayoutParams();
                 int newGravity = 0;
@@ -131,12 +137,45 @@
         bar.setDisplayOptions(change, flags);
     }
 
+    @Override
     public void onTabSelected(Tab tab, FragmentTransaction ft) {
     }
 
+    @Override
     public void onTabUnselected(Tab tab, FragmentTransaction ft) {
     }
 
+    @Override
     public void onTabReselected(Tab tab, FragmentTransaction ft) {
     }
+
+    @Override
+    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+        final ActionBar bar = getActionBar();
+        switch (parent.getId()) {
+            case R.id.toggle_navigation:
+                final int mode;
+                switch (position) {
+                    case 1:
+                        mode = ActionBar.NAVIGATION_MODE_TABS;
+                        break;
+                    case 2:
+                        mode = ActionBar.NAVIGATION_MODE_LIST;
+                        break;
+                    default:
+                        mode = ActionBar.NAVIGATION_MODE_STANDARD;
+                }
+                bar.setNavigationMode(mode);
+                return;
+        }
+    }
+
+    @Override
+    public void onNothingSelected(AdapterView<?> parent) {
+    }
+
+    @Override
+    public boolean onNavigationItemSelected(int itemPosition, long itemId) {
+        return false;
+    }
 }
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
index db50185..f95b1bb 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
@@ -68,6 +68,9 @@
     // The following keys are used to find each preference item
     private static final String KEY_ENABLE_ADMIN = "key_enable_admin";
     private static final String KEY_DISABLE_CAMERA = "key_disable_camera";
+    private static final String KEY_DISABLE_NOTIFICATIONS = "key_disable_notifications";
+    private static final String KEY_DISABLE_UNREDACTED = "key_disable_unredacted";
+    private static final String KEY_DISABLE_TRUST_AGENTS = "key_disable_trust_agents";
     private static final String KEY_DISABLE_KEYGUARD_WIDGETS = "key_disable_keyguard_widgets";
     private static final String KEY_DISABLE_KEYGUARD_SECURE_CAMERA
             = "key_disable_keyguard_secure_camera";
@@ -128,6 +131,15 @@
         return mDPM.isAdminActive(mDeviceAdminSample);
     }
 
+    @Override
+    protected boolean isValidFragment(String fragmentName) {
+        return GeneralFragment.class.getName().equals(fragmentName)
+                || QualityFragment.class.getName().equals(fragmentName)
+                || ExpirationFragment.class.getName().equals(fragmentName)
+                || LockWipeFragment.class.getName().equals(fragmentName)
+                || EncryptionFragment.class.getName().equals(fragmentName);
+    }
+
     /**
      * Common fragment code for DevicePolicyManager access.  Provides two shared elements:
      *
@@ -197,6 +209,15 @@
             }
         }
 
+        protected void postReloadSummaries() {
+            getView().post(new Runnable() {
+                @Override
+                public void run() {
+                    reloadSummaries();
+                }
+            });
+        }
+
         @Override
         public boolean onPreferenceClick(Preference preference) {
             if (mSetPassword != null && preference == mSetPassword) {
@@ -250,6 +271,9 @@
         private CheckBoxPreference mDisableCameraCheckbox;
         private CheckBoxPreference mDisableKeyguardWidgetsCheckbox;
         private CheckBoxPreference mDisableKeyguardSecureCameraCheckbox;
+        private CheckBoxPreference mDisableKeyguardNotificationCheckbox;
+        private CheckBoxPreference mDisableKeyguardTrustAgentCheckbox;
+        private CheckBoxPreference mDisableKeyguardUnredactedCheckbox;
 
         @Override
         public void onCreate(Bundle savedInstanceState) {
@@ -257,14 +281,29 @@
             addPreferencesFromResource(R.xml.device_admin_general);
             mEnableCheckbox = (CheckBoxPreference) findPreference(KEY_ENABLE_ADMIN);
             mEnableCheckbox.setOnPreferenceChangeListener(this);
+
             mDisableCameraCheckbox = (CheckBoxPreference) findPreference(KEY_DISABLE_CAMERA);
             mDisableCameraCheckbox.setOnPreferenceChangeListener(this);
+
             mDisableKeyguardWidgetsCheckbox =
                 (CheckBoxPreference) findPreference(KEY_DISABLE_KEYGUARD_WIDGETS);
             mDisableKeyguardWidgetsCheckbox.setOnPreferenceChangeListener(this);
+
             mDisableKeyguardSecureCameraCheckbox =
                 (CheckBoxPreference) findPreference(KEY_DISABLE_KEYGUARD_SECURE_CAMERA);
             mDisableKeyguardSecureCameraCheckbox.setOnPreferenceChangeListener(this);
+
+            mDisableKeyguardNotificationCheckbox =
+                    (CheckBoxPreference) findPreference(KEY_DISABLE_NOTIFICATIONS);
+            mDisableKeyguardNotificationCheckbox.setOnPreferenceChangeListener(this);
+
+            mDisableKeyguardUnredactedCheckbox =
+                    (CheckBoxPreference) findPreference(KEY_DISABLE_UNREDACTED);
+            mDisableKeyguardUnredactedCheckbox.setOnPreferenceChangeListener(this);
+
+            mDisableKeyguardTrustAgentCheckbox =
+                    (CheckBoxPreference) findPreference(KEY_DISABLE_TRUST_AGENTS);
+            mDisableKeyguardTrustAgentCheckbox.setOnPreferenceChangeListener(this);
         }
 
         // At onResume time, reload UI with current values as required
@@ -287,6 +326,12 @@
                     DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_ALL : 0;
             flags |= mDisableKeyguardSecureCameraCheckbox.isChecked() ?
                     DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA : 0;
+            flags |= mDisableKeyguardNotificationCheckbox.isChecked() ?
+                    DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS : 0;
+            flags |= mDisableKeyguardUnredactedCheckbox.isChecked() ?
+                    DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS : 0;
+            flags |= mDisableKeyguardTrustAgentCheckbox.isChecked() ?
+                    DevicePolicyManager.KEYGUARD_DISABLE_TRUST_AGENTS : 0;
             return flags;
         }
 
@@ -315,11 +360,22 @@
                 }
             } else if (preference == mDisableCameraCheckbox) {
                 mDPM.setCameraDisabled(mDeviceAdminSample, value);
-                reloadSummaries();
+                // Delay update because the change is only applied after exiting this method.
+                postReloadSummaries();
             } else if (preference == mDisableKeyguardWidgetsCheckbox
-                    || preference == mDisableKeyguardSecureCameraCheckbox) {
-                mDPM.setKeyguardDisabledFeatures(mDeviceAdminSample, createKeyguardDisabledFlag());
-                reloadSummaries();
+                    || preference == mDisableKeyguardSecureCameraCheckbox
+                    || preference == mDisableKeyguardNotificationCheckbox
+                    || preference == mDisableKeyguardUnredactedCheckbox
+                    || preference == mDisableKeyguardTrustAgentCheckbox) {
+                // Delay update because the change is only applied after exiting this method.
+                getView().post(new Runnable() {
+                    @Override
+                    public void run() {
+                        mDPM.setKeyguardDisabledFeatures(mDeviceAdminSample,
+                                createKeyguardDisabledFlag());
+                    }
+                });
+                postReloadSummaries();
             }
             return true;
         }
@@ -342,6 +398,24 @@
                 (disabled & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0 ?
                 R.string.keyguard_secure_camera_disabled : R.string.keyguard_secure_camera_enabled);
             mDisableKeyguardSecureCameraCheckbox.setSummary(keyguardSecureCameraSummary);
+
+            String keyguardSecureNotificationsSummary = getString(
+                    (disabled & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS) != 0 ?
+                        R.string.keyguard_secure_notifications_disabled
+                        : R.string.keyguard_secure_notifications_enabled);
+            mDisableKeyguardNotificationCheckbox.setSummary(keyguardSecureNotificationsSummary);
+
+            String keyguardUnredactedSummary = getString(
+                    (disabled & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) != 0
+                        ? R.string.keyguard_unredacted_notifications_disabled
+                        : R.string.keyguard_unredacted_notifications_enabled);
+            mDisableKeyguardUnredactedCheckbox.setSummary(keyguardUnredactedSummary);
+
+            String keyguardEnableTrustAgentSummary = getString(
+                    (disabled & DevicePolicyManager.KEYGUARD_DISABLE_TRUST_AGENTS) != 0 ?
+                        R.string.keyguard_trust_agents_disabled
+                        : R.string.keyguard_trust_agents_enabled);
+            mDisableKeyguardTrustAgentCheckbox.setSummary(keyguardEnableTrustAgentSummary);
         }
 
         /** Updates the device capabilities area (dis/enabling) as the admin is (de)activated */
@@ -349,6 +423,9 @@
             mDisableCameraCheckbox.setEnabled(enabled);
             mDisableKeyguardWidgetsCheckbox.setEnabled(enabled);
             mDisableKeyguardSecureCameraCheckbox.setEnabled(enabled);
+            mDisableKeyguardNotificationCheckbox.setEnabled(enabled);
+            mDisableKeyguardUnredactedCheckbox.setEnabled(enabled);
+            mDisableKeyguardTrustAgentCheckbox.setEnabled(enabled);
         }
     }
 
@@ -364,6 +441,7 @@
             DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED,
             DevicePolicyManager.PASSWORD_QUALITY_SOMETHING,
             DevicePolicyManager.PASSWORD_QUALITY_NUMERIC,
+            DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX,
             DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC,
             DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC,
             DevicePolicyManager.PASSWORD_QUALITY_COMPLEX
@@ -375,6 +453,7 @@
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED),
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_SOMETHING),
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_NUMERIC),
+            String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_NUMERIC_COMPLEX),
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC),
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC),
             String.valueOf(DevicePolicyManager.PASSWORD_QUALITY_COMPLEX)
@@ -493,7 +572,8 @@
             } else if (preference == mMinNonLetter) {
                 mDPM.setPasswordMinimumNonLetter(mDeviceAdminSample, value);
             }
-            reloadSummaries();
+            // Delay update because the change is only applied after exiting this method.
+            postReloadSummaries();
             return true;
         }
 
@@ -583,7 +663,8 @@
             } else if (preference == mExpirationTimeout) {
                 mDPM.setPasswordExpirationTimeout(mDeviceAdminSample, value * MS_PER_MINUTE);
             }
-            reloadSummaries();
+            // Delay update because the change is only applied after exiting this method.
+            postReloadSummaries();
             return true;
         }
 
@@ -721,7 +802,8 @@
                 }
                 mDPM.setMaximumFailedPasswordsForWipe(mDeviceAdminSample, value);
             }
-            reloadSummaries();
+            // Delay update because the change is only applied after exiting this method.
+            postReloadSummaries();
             return true;
         }
 
@@ -839,7 +921,8 @@
             if (preference == mRequireEncryption) {
                 boolean newActive = (Boolean) newValue;
                 mDPM.setStorageEncryption(mDeviceAdminSample, newActive);
-                reloadSummaries();
+                // Delay update because the change is only applied after exiting this method.
+                postReloadSummaries();
                 return true;
             }
             return true;
diff --git a/samples/ApiDemos/src/com/example/android/apis/content/DocumentsSample.java b/samples/ApiDemos/src/com/example/android/apis/content/DocumentsSample.java
new file mode 100644
index 0000000..a00974b
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/content/DocumentsSample.java
@@ -0,0 +1,379 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.content;
+
+import android.app.Activity;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.DocumentsContract;
+import android.provider.DocumentsContract.Document;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Example that exercises client side of {@link DocumentsContract}.
+ */
+public class DocumentsSample extends Activity {
+    private static final String TAG = "DocumentsSample";
+
+    private static final int CODE_READ = 42;
+    private static final int CODE_WRITE = 43;
+    private static final int CODE_TREE = 44;
+    private static final int CODE_RENAME = 45;
+
+    private TextView mResult;
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+
+        final Context context = this;
+
+        final LinearLayout view = new LinearLayout(context);
+        view.setOrientation(LinearLayout.VERTICAL);
+
+        mResult = new TextView(context);
+        view.addView(mResult);
+
+        final CheckBox multiple = new CheckBox(context);
+        multiple.setText("ALLOW_MULTIPLE");
+        view.addView(multiple);
+        final CheckBox localOnly = new CheckBox(context);
+        localOnly.setText("LOCAL_ONLY");
+        view.addView(localOnly);
+
+        Button button;
+        button = new Button(context);
+        button.setText("OPEN_DOC */*");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("*/*");
+                if (multiple.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_READ);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("OPEN_DOC image/*");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("image/*");
+                if (multiple.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_READ);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("OPEN_DOC audio/ogg");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("audio/ogg");
+                if (multiple.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_READ);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("OPEN_DOC text/plain, application/msword");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("*/*");
+                intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[] {
+                        "text/plain", "application/msword" });
+                if (multiple.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_READ);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("CREATE_DOC text/plain");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("text/plain");
+                intent.putExtra(Intent.EXTRA_TITLE, "foobar.txt");
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_WRITE);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("CREATE_DOC image/png");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("image/png");
+                intent.putExtra(Intent.EXTRA_TITLE, "mypicture.png");
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(intent, CODE_WRITE);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("GET_CONTENT */*");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("*/*");
+                if (multiple.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
+                }
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(Intent.createChooser(intent, "Kittens!"), CODE_READ);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("OPEN_DOC_TREE");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
+                if (localOnly.isChecked()) {
+                    intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
+                }
+                startActivityForResult(Intent.createChooser(intent, "Kittens!"), CODE_TREE);
+            }
+        });
+        view.addView(button);
+
+        button = new Button(context);
+        button.setText("OPEN_DOC */* for rename");
+        button.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
+                intent.addCategory(Intent.CATEGORY_OPENABLE);
+                intent.setType("*/*");
+                startActivityForResult(intent, CODE_RENAME);
+            }
+        });
+        view.addView(button);
+
+        final ScrollView scroll = new ScrollView(context);
+        scroll.addView(view);
+
+        setContentView(scroll);
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        final ContentResolver cr = getContentResolver();
+
+        clearLog();
+
+        log("resultCode=" + resultCode);
+        log("data=" + String.valueOf(data));
+
+        final Uri uri = data != null ? data.getData() : null;
+        if (uri != null) {
+            log("isDocumentUri=" + DocumentsContract.isDocumentUri(this, uri));
+        } else {
+            log("missing URI?");
+            return;
+        }
+
+        if (requestCode == CODE_READ) {
+            try {
+                cr.takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
+            } catch (SecurityException e) {
+                log("FAILED TO TAKE PERMISSION", e);
+            }
+            InputStream is = null;
+            try {
+                is = cr.openInputStream(uri);
+                log("read length=" + readFullyNoClose(is).length);
+            } catch (Exception e) {
+                log("FAILED TO READ", e);
+            } finally {
+                closeQuietly(is);
+            }
+        } else if (requestCode == CODE_WRITE) {
+            try {
+                cr.takePersistableUriPermission(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
+            } catch (SecurityException e) {
+                log("FAILED TO TAKE PERMISSION", e);
+            }
+            OutputStream os = null;
+            try {
+                os = cr.openOutputStream(uri);
+                os.write("THE COMPLETE WORKS OF SHAKESPEARE".getBytes());
+                log("wrote data");
+            } catch (Exception e) {
+                log("FAILED TO WRITE", e);
+            } finally {
+                closeQuietly(os);
+            }
+        } else if (requestCode == CODE_TREE) {
+            // Find existing docs
+            Uri doc = DocumentsContract.buildDocumentUriUsingTree(uri,
+                    DocumentsContract.getTreeDocumentId(uri));
+            Uri child = DocumentsContract.buildChildDocumentsUriUsingTree(uri,
+                    DocumentsContract.getTreeDocumentId(uri));
+            Cursor c = cr.query(child, new String[] {
+                    Document.COLUMN_DISPLAY_NAME, Document.COLUMN_MIME_TYPE }, null, null, null);
+            try {
+                while (c.moveToNext()) {
+                    log("found child=" + c.getString(0) + ", mime=" + c.getString(1));
+                }
+            } finally {
+                closeQuietly(c);
+            }
+
+            // Create some documents
+            Uri pic = DocumentsContract.createDocument(cr, doc, "image/png", "pic.png");
+            Uri dir = DocumentsContract.createDocument(cr, doc, Document.MIME_TYPE_DIR, "my dir");
+            Uri dirPic = DocumentsContract.createDocument(cr, dir, "image/png", "pic2.png");
+
+            log("created " + pic);
+            log("created " + dir);
+            log("created " + dirPic);
+
+            // Write to one of them
+            OutputStream os = null;
+            try {
+                os = cr.openOutputStream(dirPic);
+                os.write("THE COMPLETE WORKS OF SHAKESPEARE".getBytes());
+                log("wrote data");
+            } catch (Exception e) {
+                log("FAILED TO WRITE", e);
+            } finally {
+                closeQuietly(os);
+            }
+
+            // And delete the first pic
+            if (DocumentsContract.deleteDocument(cr, pic)) {
+                log("deleted untouched pic");
+            } else {
+                log("FAILED TO DELETE PIC");
+            }
+        } else if (requestCode == CODE_RENAME) {
+            final Uri newUri = DocumentsContract.renameDocument(cr, uri, "MEOW.TEST");
+            log("rename result=" + newUri);
+
+            InputStream is = null;
+            try {
+                is = cr.openInputStream(newUri);
+                log("read length=" + readFullyNoClose(is).length);
+            } catch (Exception e) {
+                log("FAILED TO READ", e);
+            } finally {
+                closeQuietly(is);
+            }
+        }
+    }
+
+    private void clearLog() {
+        mResult.setText(null);
+    }
+
+    private void log(String msg) {
+        log(msg, null);
+    }
+
+    private void log(String msg, Throwable t) {
+        Log.d(TAG, msg, t);
+        mResult.setText(mResult.getText() + "\n" + msg);
+    }
+
+    public static byte[] readFullyNoClose(InputStream in) throws IOException {
+        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+        byte[] buffer = new byte[1024];
+        int count;
+        while ((count = in.read(buffer)) != -1) {
+            bytes.write(buffer, 0, count);
+        }
+        return bytes.toByteArray();
+    }
+
+    public static void closeQuietly(AutoCloseable closeable) {
+        if (closeable != null) {
+            try {
+                closeable.close();
+            } catch (RuntimeException rethrown) {
+                throw rethrown;
+            } catch (Exception ignored) {
+            }
+        }
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardDrag.java b/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardDrag.java
new file mode 100644
index 0000000..bca037a
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardDrag.java
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.graphics;
+
+import android.animation.ObjectAnimator;
+import android.app.Activity;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Outline;
+import android.graphics.Paint;
+import android.graphics.Path;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.ShapeDrawable;
+import android.graphics.drawable.shapes.OvalShape;
+import android.graphics.drawable.shapes.RectShape;
+import android.graphics.drawable.shapes.RoundRectShape;
+import android.graphics.drawable.shapes.Shape;
+import android.os.Bundle;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import com.example.android.apis.R;
+
+import java.util.ArrayList;
+
+public class ShadowCardDrag extends Activity {
+    private static final float MAX_Z_DP = 10;
+    private static final float MOMENTUM_SCALE = 10;
+    private static final int MAX_ANGLE = 10;
+
+    private class CardDragState {
+        long lastEventTime;
+        float lastX;
+        float lastY;
+
+        float momentumX;
+        float momentumY;
+
+        public void onDown(long eventTime, float x, float y) {
+            lastEventTime = eventTime;
+            lastX = x;
+            lastY = y;
+
+            momentumX = 0;
+            momentumY = 0;
+        }
+
+        public void onMove(long eventTime, float x, float y) {
+            final long deltaT = eventTime - lastEventTime;
+
+            if (deltaT != 0) {
+                float newMomentumX = (x - lastX) / (mDensity * deltaT);
+                float newMomentumY = (y - lastY) / (mDensity * deltaT);
+
+                momentumX = 0.9f * momentumX + 0.1f * (newMomentumX * MOMENTUM_SCALE);
+                momentumY = 0.9f * momentumY + 0.1f * (newMomentumY * MOMENTUM_SCALE);
+
+                momentumX = Math.max(Math.min((momentumX), MAX_ANGLE), -MAX_ANGLE);
+                momentumY = Math.max(Math.min((momentumY), MAX_ANGLE), -MAX_ANGLE);
+
+                //noinspection SuspiciousNameCombination
+                mCard.setRotationX(-momentumY);
+                //noinspection SuspiciousNameCombination
+                mCard.setRotationY(momentumX);
+
+                if (mShadingEnabled) {
+                    float alphaDarkening = (momentumX * momentumX + momentumY * momentumY) / (90 * 90);
+                    alphaDarkening /= 2;
+
+                    int alphaByte = 0xff - ((int)(alphaDarkening * 255) & 0xff);
+                    int color = Color.rgb(alphaByte, alphaByte, alphaByte);
+                    mCardBackground.setColorFilter(color, PorterDuff.Mode.MULTIPLY);
+                }
+            }
+
+            lastX = x;
+            lastY = y;
+            lastEventTime = eventTime;
+        }
+
+        public void onUp() {
+            ObjectAnimator flattenX = ObjectAnimator.ofFloat(mCard, "rotationX", 0);
+            flattenX.setDuration(100);
+            flattenX.setInterpolator(new AccelerateInterpolator());
+            flattenX.start();
+
+            ObjectAnimator flattenY = ObjectAnimator.ofFloat(mCard, "rotationY", 0);
+            flattenY.setDuration(100);
+            flattenY.setInterpolator(new AccelerateInterpolator());
+            flattenY.start();
+            mCardBackground.setColorFilter(null);
+        }
+    }
+
+    /**
+     * Simple shape example that generates a shadow casting outline.
+     */
+    private static class TriangleShape extends Shape {
+        private final Path mPath = new Path();
+
+        @Override
+        protected void onResize(float width, float height) {
+            mPath.reset();
+            mPath.moveTo(0, 0);
+            mPath.lineTo(width, 0);
+            mPath.lineTo(width / 2, height);
+            mPath.lineTo(0, 0);
+            mPath.close();
+        }
+
+        @Override
+        public void draw(Canvas canvas, Paint paint) {
+            canvas.drawPath(mPath, paint);
+        }
+
+        @Override
+        public void getOutline(Outline outline) {
+            outline.setConvexPath(mPath);
+        }
+    }
+
+    private final ShapeDrawable mCardBackground = new ShapeDrawable();
+    private final ArrayList<Shape> mShapes = new ArrayList<Shape>();
+    private float mDensity;
+    private View mCard;
+
+    private final CardDragState mDragState = new CardDragState();
+    private boolean mTiltEnabled;
+    private boolean mShadingEnabled;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.shadow_card_drag);
+
+        mDensity = getResources().getDisplayMetrics().density;
+        mShapes.add(new RectShape());
+        mShapes.add(new OvalShape());
+        float r = 10 * mDensity;
+        float radii[] = new float[] {r, r, r, r, r, r, r, r};
+        mShapes.add(new RoundRectShape(radii, null, null));
+        mShapes.add(new TriangleShape());
+
+        mCardBackground.getPaint().setColor(Color.WHITE);
+        mCardBackground.setShape(mShapes.get(0));
+        final View cardParent = findViewById(R.id.card_parent);
+        mCard = findViewById(R.id.card);
+        mCard.setBackground(mCardBackground);
+
+        final CheckBox tiltCheck = (CheckBox) findViewById(R.id.tilt_check);
+        tiltCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                mTiltEnabled = isChecked;
+                if (!mTiltEnabled) {
+                    mDragState.onUp();
+                }
+            }
+        });
+
+        final CheckBox shadingCheck = (CheckBox) findViewById(R.id.shading_check);
+        shadingCheck.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                mShadingEnabled = isChecked;
+                if (!mShadingEnabled) {
+                    mCardBackground.setColorFilter(null);
+                }
+            }
+        });
+
+        final Button shapeButton = (Button) findViewById(R.id.shape_select);
+        shapeButton.setOnClickListener(new View.OnClickListener() {
+            int index = 0;
+            @Override
+            public void onClick(View v) {
+                index = (index + 1) % mShapes.size();
+                mCardBackground.setShape(mShapes.get(index));
+            }
+        });
+
+        /**
+         * Enable any touch on the parent to drag the card. Note that this doesn't do a proper hit
+         * test, so any drag (including off of the card) will work.
+         *
+         * This enables the user to see the effect more clearly for the purpose of this demo.
+         */
+        cardParent.setOnTouchListener(new View.OnTouchListener() {
+            float downX;
+            float downY;
+            long downTime;
+
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                switch (event.getAction()) {
+                    case MotionEvent.ACTION_DOWN:
+                        downX = event.getX() - mCard.getTranslationX();
+                        downY = event.getY() - mCard.getTranslationY();
+                        downTime = event.getDownTime();
+                        ObjectAnimator upAnim = ObjectAnimator.ofFloat(mCard, "translationZ",
+                                MAX_Z_DP * mDensity);
+                        upAnim.setDuration(100);
+                        upAnim.setInterpolator(new DecelerateInterpolator());
+                        upAnim.start();
+                        if (mTiltEnabled) {
+                            mDragState.onDown(event.getDownTime(), event.getX(), event.getY());
+                        }
+                        break;
+                    case MotionEvent.ACTION_MOVE:
+                        mCard.setTranslationX(event.getX() - downX);
+                        mCard.setTranslationY(event.getY() - downY);
+                        if (mTiltEnabled) {
+                            mDragState.onMove(event.getEventTime(), event.getX(), event.getY());
+                        }
+                        break;
+                    case MotionEvent.ACTION_UP:
+                        ObjectAnimator downAnim = ObjectAnimator.ofFloat(mCard, "translationZ", 0);
+                        downAnim.setDuration(100);
+                        downAnim.setInterpolator(new AccelerateInterpolator());
+                        downAnim.start();
+                        if (mTiltEnabled) {
+                            mDragState.onUp();
+                        }
+                        break;
+                }
+                return true;
+            }
+        });
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardStack.java b/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardStack.java
new file mode 100644
index 0000000..5a34251
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/ShadowCardStack.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.graphics;
+
+import android.animation.Animator;
+import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.example.android.apis.R;
+
+import java.util.ArrayList;
+
+public class ShadowCardStack extends Activity {
+
+    private static final float X_SHIFT_DP = 1000;
+    private static final float Y_SHIFT_DP = 50;
+    private static final float Z_LIFT_DP = 8;
+    private static final float ROTATE_DEGREES = 15;
+
+    public AnimatorSet createSet(ArrayList<Animator> items, long startDelay) {
+        AnimatorSet set = new AnimatorSet();
+        set.playTogether(items);
+        set.setStartDelay(startDelay);
+        return set;
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.shadow_card_stack);
+
+        float density = getResources().getDisplayMetrics().density;
+
+        final ViewGroup cardParent = (ViewGroup) findViewById(R.id.card_parent);
+
+        final float X = X_SHIFT_DP * density;
+        final float Y = Y_SHIFT_DP * density;
+        final float Z = Z_LIFT_DP * density;
+
+        ArrayList<Animator> towardAnimators = new ArrayList<Animator>();
+        ArrayList<Animator> expandAnimators = new ArrayList<Animator>();
+        ArrayList<Animator> moveAwayAnimators = new ArrayList<Animator>();
+        ArrayList<Animator> moveBackAnimators = new ArrayList<Animator>();
+        ArrayList<Animator> awayAnimators = new ArrayList<Animator>();
+        ArrayList<Animator> collapseAnimators = new ArrayList<Animator>();
+
+        final int max = cardParent.getChildCount();
+        for (int i = 0; i < max; i++) {
+            TextView card = (TextView) cardParent.getChildAt(i);
+            card.setText("Card number " + i);
+
+            float targetY = (i - (max-1) / 2.0f) * Y;
+            Animator expand = ObjectAnimator.ofFloat(card, "translationY", targetY);
+            expandAnimators.add(expand);
+
+            Animator toward = ObjectAnimator.ofFloat(card, "translationZ", i * Z);
+            toward.setStartDelay(200 * ((max) - i));
+            towardAnimators.add(toward);
+
+            card.setPivotX(X_SHIFT_DP);
+            Animator rotateAway = ObjectAnimator.ofFloat(card, "rotationY",
+                    i == 0 ? 0 : ROTATE_DEGREES);
+            rotateAway.setStartDelay(200 * ((max) - i));
+            rotateAway.setDuration(100);
+            moveAwayAnimators.add(rotateAway);
+            Animator slideAway = ObjectAnimator.ofFloat(card, "translationX",
+                    i == 0 ? 0 : X);
+            slideAway.setStartDelay(200 * ((max) - i));
+            slideAway.setDuration(100);
+            moveAwayAnimators.add(slideAway);
+
+            Animator rotateBack = ObjectAnimator.ofFloat(card, "rotationY", 0);
+            rotateBack.setStartDelay(200 * i);
+            moveBackAnimators.add(rotateBack);
+            Animator slideBack = ObjectAnimator.ofFloat(card, "translationX", 0);
+            slideBack.setStartDelay(200 * i);
+            moveBackAnimators.add(slideBack);
+
+            Animator away = ObjectAnimator.ofFloat(card, "translationZ", 0);
+            away.setStartDelay(200 * i);
+            awayAnimators.add(away);
+
+            Animator collapse = ObjectAnimator.ofFloat(card, "translationY", 0);
+            collapseAnimators.add(collapse);
+        }
+
+        AnimatorSet totalSet = new AnimatorSet();
+        totalSet.playSequentially(
+                createSet(expandAnimators, 250),
+                createSet(towardAnimators, 0),
+
+                createSet(moveAwayAnimators, 250),
+                createSet(moveBackAnimators, 0),
+
+                createSet(awayAnimators, 250),
+                createSet(collapseAnimators, 0));
+        totalSet.start();
+        totalSet.addListener(new RepeatListener(totalSet));
+    }
+
+    public static class RepeatListener implements Animator.AnimatorListener {
+        final Animator mRepeatAnimator;
+        public RepeatListener(Animator repeatAnimator) {
+            mRepeatAnimator = repeatAnimator;
+        }
+
+        @Override
+        public void onAnimationStart(Animator animation) {}
+
+        @Override
+        public void onAnimationEnd(Animator animation) {
+            if (animation == mRepeatAnimator) {
+                mRepeatAnimator.start();
+            }
+        }
+
+        @Override
+        public void onAnimationCancel(Animator animation) {}
+
+        @Override
+        public void onAnimationRepeat(Animator animation) {}
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/Sweep.java b/samples/ApiDemos/src/com/example/android/apis/graphics/Sweep.java
index 5da10cf..4f51ff3 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/Sweep.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/Sweep.java
@@ -60,6 +60,7 @@
 
             mMatrix.setRotate(mRotate, x, y);
             mShader.setLocalMatrix(mMatrix);
+            mPaint.setShader(mShader);
             mRotate += 3;
             if (mRotate >= 360) {
                 mRotate = 0;
diff --git a/samples/ApiDemos/src/com/example/android/apis/os/Sensors.java b/samples/ApiDemos/src/com/example/android/apis/os/Sensors.java
deleted file mode 100644
index 9863222..0000000
--- a/samples/ApiDemos/src/com/example/android/apis/os/Sensors.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.apis.os;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.view.View;
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Paint;
-import android.graphics.Path;
-import android.graphics.RectF;
-
-/**
- * <h3>Application that displays the values of the acceleration sensor graphically.</h3>
-
-<p>This demonstrates the {@link android.hardware.SensorManager android.hardware.SensorManager} class.
-
-<h4>Demo</h4>
-OS / Sensors
- 
-<h4>Source files</h4>
- * <table class="LinkTable">
- *         <tr>
- *             <td >src/com.example.android.apis/os/Sensors.java</td>
- *             <td >Sensors</td>
- *         </tr>
- * </table> 
- */
-public class Sensors extends Activity {
-    private SensorManager mSensorManager;
-    private GraphView mGraphView;
-
-    private class GraphView extends View implements SensorEventListener
-    {
-        private Bitmap  mBitmap;
-        private Paint   mPaint = new Paint();
-        private Canvas  mCanvas = new Canvas();
-        private Path    mPath = new Path();
-        private RectF   mRect = new RectF();
-        private float   mLastValues[] = new float[3*2];
-        private float   mOrientationValues[] = new float[3];
-        private int     mColors[] = new int[3*2];
-        private float   mLastX;
-        private float   mScale[] = new float[2];
-        private float   mYOffset;
-        private float   mMaxX;
-        private float   mSpeed = 1.0f;
-        private float   mWidth;
-        private float   mHeight;
-        
-        public GraphView(Context context) {
-            super(context);
-            mColors[0] = Color.argb(192, 255, 64, 64);
-            mColors[1] = Color.argb(192, 64, 128, 64);
-            mColors[2] = Color.argb(192, 64, 64, 255);
-            mColors[3] = Color.argb(192, 64, 255, 255);
-            mColors[4] = Color.argb(192, 128, 64, 128);
-            mColors[5] = Color.argb(192, 255, 255, 64);
-
-            mPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
-            mRect.set(-0.5f, -0.5f, 0.5f, 0.5f);
-            mPath.arcTo(mRect, 0, 180);
-        }
-        
-        @Override
-        protected void onSizeChanged(int w, int h, int oldw, int oldh) {
-            mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
-            mCanvas.setBitmap(mBitmap);
-            mCanvas.drawColor(0xFFFFFFFF);
-            mYOffset = h * 0.5f;
-            mScale[0] = - (h * 0.5f * (1.0f / (SensorManager.STANDARD_GRAVITY * 2)));
-            mScale[1] = - (h * 0.5f * (1.0f / (SensorManager.MAGNETIC_FIELD_EARTH_MAX)));
-            mWidth = w;
-            mHeight = h;
-            if (mWidth < mHeight) {
-                mMaxX = w;
-            } else {
-                mMaxX = w-50;
-            }
-            mLastX = mMaxX;
-            super.onSizeChanged(w, h, oldw, oldh);
-        }
-
-        @Override
-        protected void onDraw(Canvas canvas) {
-            synchronized (this) {
-                if (mBitmap != null) {
-                    final Paint paint = mPaint;
-                    final Path path = mPath;
-                    final int outer = 0xFFC0C0C0;
-                    final int inner = 0xFFff7010;
-
-                    if (mLastX >= mMaxX) {
-                        mLastX = 0;
-                        final Canvas cavas = mCanvas;
-                        final float yoffset = mYOffset;
-                        final float maxx = mMaxX;
-                        final float oneG = SensorManager.STANDARD_GRAVITY * mScale[0];
-                        paint.setColor(0xFFAAAAAA);
-                        cavas.drawColor(0xFFFFFFFF);
-                        cavas.drawLine(0, yoffset,      maxx, yoffset,      paint);
-                        cavas.drawLine(0, yoffset+oneG, maxx, yoffset+oneG, paint);
-                        cavas.drawLine(0, yoffset-oneG, maxx, yoffset-oneG, paint);
-                    }
-                    canvas.drawBitmap(mBitmap, 0, 0, null);
-
-                    float[] values = mOrientationValues;
-                    if (mWidth < mHeight) {
-                        float w0 = mWidth * 0.333333f;
-                        float w  = w0 - 32;
-                        float x = w0*0.5f;
-                        for (int i=0 ; i<3 ; i++) {
-                            canvas.save(Canvas.MATRIX_SAVE_FLAG);
-                            canvas.translate(x, w*0.5f + 4.0f);
-                            canvas.save(Canvas.MATRIX_SAVE_FLAG);
-                            paint.setColor(outer);
-                            canvas.scale(w, w);
-                            canvas.drawOval(mRect, paint);
-                            canvas.restore();
-                            canvas.scale(w-5, w-5);
-                            paint.setColor(inner);
-                            canvas.rotate(-values[i]);
-                            canvas.drawPath(path, paint);
-                            canvas.restore();
-                            x += w0;
-                        }
-                    } else {
-                        float h0 = mHeight * 0.333333f;
-                        float h  = h0 - 32;
-                        float y = h0*0.5f;
-                        for (int i=0 ; i<3 ; i++) {
-                            canvas.save(Canvas.MATRIX_SAVE_FLAG);
-                            canvas.translate(mWidth - (h*0.5f + 4.0f), y);
-                            canvas.save(Canvas.MATRIX_SAVE_FLAG);
-                            paint.setColor(outer);
-                            canvas.scale(h, h);
-                            canvas.drawOval(mRect, paint);
-                            canvas.restore();
-                            canvas.scale(h-5, h-5);
-                            paint.setColor(inner);
-                            canvas.rotate(-values[i]);
-                            canvas.drawPath(path, paint);
-                            canvas.restore();
-                            y += h0;
-                        }
-                    }
-
-                }
-            }
-        }
-
-        public void onSensorChanged(SensorEvent event) {
-            //Log.d(TAG, "sensor: " + sensor + ", x: " + values[0] + ", y: " + values[1] + ", z: " + values[2]);
-            synchronized (this) {
-                if (mBitmap != null) {
-                    final Canvas canvas = mCanvas;
-                    final Paint paint = mPaint;
-                    if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) {
-                        for (int i=0 ; i<3 ; i++) {
-                            mOrientationValues[i] = event.values[i];
-                        }
-                    } else {
-                        float deltaX = mSpeed;
-                        float newX = mLastX + deltaX;
-
-                        int j = (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) ? 1 : 0;
-                        for (int i=0 ; i<3 ; i++) {
-                            int k = i+j*3;
-                            final float v = mYOffset + event.values[i] * mScale[j];
-                            paint.setColor(mColors[k]);
-                            canvas.drawLine(mLastX, mLastValues[k], newX, v, paint);
-                            mLastValues[k] = v;
-                        }
-                        if (event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD)
-                            mLastX += mSpeed;
-                    }
-                    invalidate();
-                }
-            }
-        }
-
-        public void onAccuracyChanged(Sensor sensor, int accuracy) {
-        }
-    }
-    
-    /**
-     * Initialization of the Activity after it is first created.  Must at least
-     * call {@link android.app.Activity#setContentView setContentView()} to
-     * describe what is to be displayed in the screen.
-     */
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        // Be sure to call the super class.
-        super.onCreate(savedInstanceState);
-
-        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
-        mGraphView = new GraphView(this);
-        setContentView(mGraphView);
-    }
-
-    @Override
-    protected void onResume() {
-        super.onResume();
-        mSensorManager.registerListener(mGraphView,
-                mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),
-                SensorManager.SENSOR_DELAY_FASTEST);
-        mSensorManager.registerListener(mGraphView,
-                mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),
-                SensorManager.SENSOR_DELAY_FASTEST);
-        mSensorManager.registerListener(mGraphView, 
-                mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),
-                SensorManager.SENSOR_DELAY_FASTEST);
-    }
-    
-    @Override
-    protected void onStop() {
-        mSensorManager.unregisterListener(mGraphView);
-        super.onStop();
-    }
-}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls7.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls7.java
new file mode 100644
index 0000000..6243d3b
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls7.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.view;
+
+public class Controls7 extends Controls1 {}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java
new file mode 100644
index 0000000..4dd4291
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls8.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.view;
+
+public class Controls8 extends Controls1 {}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java b/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java
new file mode 100644
index 0000000..8a940aa
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/Controls9.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.view;
+
+public class Controls9 extends Controls1 {}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Gallery1.java b/samples/ApiDemos/src/com/example/android/apis/view/Gallery1.java
deleted file mode 100644
index b252d5a..0000000
--- a/samples/ApiDemos/src/com/example/android/apis/view/Gallery1.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.apis.view;
-
-import com.example.android.apis.R;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.os.Bundle;
-import android.view.ContextMenu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ContextMenu.ContextMenuInfo;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.Gallery;
-import android.widget.ImageView;
-import android.widget.Toast;
-import android.widget.AdapterView.AdapterContextMenuInfo;
-import android.widget.AdapterView.OnItemClickListener;
-
-public class Gallery1 extends Activity {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.gallery_1);
-
-        // Reference the Gallery view
-        Gallery g = (Gallery) findViewById(R.id.gallery);
-        // Set the adapter to our custom adapter (below)
-        g.setAdapter(new ImageAdapter(this));
-        
-        // Set a item click listener, and just Toast the clicked position
-        g.setOnItemClickListener(new OnItemClickListener() {
-            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
-                Toast.makeText(Gallery1.this, "" + position, Toast.LENGTH_SHORT).show();
-            }
-        });
-        
-        // We also want to show context menu for longpressed items in the gallery
-        registerForContextMenu(g);
-    }
-
-    @Override
-    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
-        menu.add(R.string.gallery_2_text);
-    }
-    
-    @Override
-    public boolean onContextItemSelected(MenuItem item) {
-        AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
-        Toast.makeText(this, "Longpress: " + info.position, Toast.LENGTH_SHORT).show();
-        return true;
-    }
-
-    public class ImageAdapter extends BaseAdapter {
-        private static final int ITEM_WIDTH = 136;
-        private static final int ITEM_HEIGHT = 88;
-
-        private final int mGalleryItemBackground;
-        private final Context mContext;
-
-        private final Integer[] mImageIds = {
-                R.drawable.gallery_photo_1,
-                R.drawable.gallery_photo_2,
-                R.drawable.gallery_photo_3,
-                R.drawable.gallery_photo_4,
-                R.drawable.gallery_photo_5,
-                R.drawable.gallery_photo_6,
-                R.drawable.gallery_photo_7,
-                R.drawable.gallery_photo_8
-        };
-
-        private final float mDensity;
-
-        public ImageAdapter(Context c) {
-            mContext = c;
-            // See res/values/attrs.xml for the <declare-styleable> that defines
-            // Gallery1.
-            TypedArray a = obtainStyledAttributes(R.styleable.Gallery1);
-            mGalleryItemBackground = a.getResourceId(
-                    R.styleable.Gallery1_android_galleryItemBackground, 0);
-            a.recycle();
-
-            mDensity = c.getResources().getDisplayMetrics().density;
-        }
-
-        public int getCount() {
-            return mImageIds.length;
-        }
-
-        public Object getItem(int position) {
-            return position;
-        }
-
-        public long getItemId(int position) {
-            return position;
-        }
-
-        public View getView(int position, View convertView, ViewGroup parent) {
-            ImageView imageView;
-            if (convertView == null) {
-                convertView = new ImageView(mContext);
-
-                imageView = (ImageView) convertView;
-                imageView.setScaleType(ImageView.ScaleType.FIT_XY);
-                imageView.setLayoutParams(new Gallery.LayoutParams(
-                        (int) (ITEM_WIDTH * mDensity + 0.5f),
-                        (int) (ITEM_HEIGHT * mDensity + 0.5f)));
-            
-                // The preferred Gallery item background
-                imageView.setBackgroundResource(mGalleryItemBackground);
-            } else {
-                imageView = (ImageView) convertView;
-            }
-
-            imageView.setImageResource(mImageIds[position]);
-
-            return imageView;
-        }
-    }
-}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/Gallery2.java b/samples/ApiDemos/src/com/example/android/apis/view/Gallery2.java
deleted file mode 100644
index ed33451..0000000
--- a/samples/ApiDemos/src/com/example/android/apis/view/Gallery2.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.apis.view;
-
-import android.app.Activity;
-import android.database.Cursor;
-import android.provider.ContactsContract.Contacts;
-import android.os.Bundle;
-import android.widget.Gallery;
-import android.widget.SimpleCursorAdapter;
-import android.widget.SpinnerAdapter;
-
-// Need the following import to get access to the app resources, since this
-// class is in a sub-package.
-import com.example.android.apis.R;
-
-public class Gallery2 extends Activity {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.gallery_2);
-
-        // Get a cursor with all people
-        Cursor c = getContentResolver().query(Contacts.CONTENT_URI,
-                CONTACT_PROJECTION, null, null, null);
-        startManagingCursor(c);
-
-        SpinnerAdapter adapter = new SimpleCursorAdapter(this,
-        // Use a template that displays a text view
-                android.R.layout.simple_gallery_item,
-                // Give the cursor to the list adatper
-                c,
-                // Map the NAME column in the people database to...
-                new String[] {Contacts.DISPLAY_NAME},
-                // The "text1" view defined in the XML template
-                new int[] { android.R.id.text1 });
-
-        Gallery g = (Gallery) findViewById(R.id.gallery);
-        g.setAdapter(adapter);
-    }
-
-    private static final String[] CONTACT_PROJECTION = new String[] {
-        Contacts._ID,
-        Contacts.DISPLAY_NAME
-    };
-}
\ No newline at end of file
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.java b/samples/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.java
deleted file mode 100644
index 7f17c82..0000000
--- a/samples/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.android.apis.view;
-
-import com.example.android.apis.R;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.Window;
-import android.view.animation.AnimationUtils;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.Gallery;
-import android.widget.Gallery.LayoutParams;
-import android.widget.ImageSwitcher;
-import android.widget.ImageView;
-import android.widget.ViewSwitcher;
-
-
-public class ImageSwitcher1 extends Activity implements
-        AdapterView.OnItemSelectedListener, ViewSwitcher.ViewFactory {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        requestWindowFeature(Window.FEATURE_NO_TITLE);
-
-        setContentView(R.layout.image_switcher_1);
-
-        mSwitcher = (ImageSwitcher) findViewById(R.id.switcher);
-        mSwitcher.setFactory(this);
-        mSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
-                android.R.anim.fade_in));
-        mSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
-                android.R.anim.fade_out));
-
-        Gallery g = (Gallery) findViewById(R.id.gallery);
-        g.setAdapter(new ImageAdapter(this));
-        g.setOnItemSelectedListener(this);
-    }
-
-    public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
-        mSwitcher.setImageResource(mImageIds[position]);
-    }
-
-    public void onNothingSelected(AdapterView<?> parent) {
-    }
-
-    public View makeView() {
-        ImageView i = new ImageView(this);
-        i.setBackgroundColor(0xFF000000);
-        i.setScaleType(ImageView.ScaleType.FIT_CENTER);
-        i.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.MATCH_PARENT,
-                LayoutParams.MATCH_PARENT));
-        return i;
-    }
-
-    private ImageSwitcher mSwitcher;
-
-    public class ImageAdapter extends BaseAdapter {
-        public ImageAdapter(Context c) {
-            mContext = c;
-        }
-
-        public int getCount() {
-            return mThumbIds.length;
-        }
-
-        public Object getItem(int position) {
-            return position;
-        }
-
-        public long getItemId(int position) {
-            return position;
-        }
-
-        public View getView(int position, View convertView, ViewGroup parent) {
-            ImageView i = new ImageView(mContext);
-
-            i.setImageResource(mThumbIds[position]);
-            i.setAdjustViewBounds(true);
-            i.setLayoutParams(new Gallery.LayoutParams(
-                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
-            i.setBackgroundResource(R.drawable.picture_frame);
-            return i;
-        }
-
-        private Context mContext;
-
-    }
-
-    private Integer[] mThumbIds = {
-            R.drawable.sample_thumb_0, R.drawable.sample_thumb_1,
-            R.drawable.sample_thumb_2, R.drawable.sample_thumb_3,
-            R.drawable.sample_thumb_4, R.drawable.sample_thumb_5,
-            R.drawable.sample_thumb_6, R.drawable.sample_thumb_7};
-
-    private Integer[] mImageIds = {
-            R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2,
-            R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5,
-            R.drawable.sample_6, R.drawable.sample_7};
-
-}
diff --git a/samples/AtscTvInput/Android.mk b/samples/AtscTvInput/Android.mk
new file mode 100644
index 0000000..f7c60a7
--- /dev/null
+++ b/samples/AtscTvInput/Android.mk
@@ -0,0 +1,9 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_PACKAGE_NAME := AtscTvInput
+LOCAL_MODULE_TAGS := samples
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/samples/AtscTvInput/AndroidManifest.xml b/samples/AtscTvInput/AndroidManifest.xml
new file mode 100644
index 0000000..9842d5f
--- /dev/null
+++ b/samples/AtscTvInput/AndroidManifest.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.atsctvinput">
+
+    <uses-permission android:name="android.permission.READ_EPG_DATA" />
+    <uses-permission android:name="android.permission.WRITE_EPG_DATA" />
+
+    <application android:label="@string/atsc_tv_input">
+        <activity android:name="com.example.android.atsctvinput.AtscTvInputScanActivity"
+                android:screenOrientation="landscape">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <service android:name="com.example.android.atsctvinput.AtscTvInputService"
+            android:permission="android.permission.BIND_TV_INPUT"
+            android:process=":remoteAtscTvInput">
+            <intent-filter>
+                <action android:name="android.media.tv.TvInputService" />
+            </intent-filter>
+            <meta-data android:name="android.media.tv.input"
+                android:resource="@xml/atsctvinputservice" />
+        </service>
+    </application>
+</manifest>
diff --git a/samples/AtscTvInput/_index.html b/samples/AtscTvInput/_index.html
new file mode 100644
index 0000000..3e104d1
--- /dev/null
+++ b/samples/AtscTvInput/_index.html
@@ -0,0 +1,7 @@
+<p>
+A sample application that demonstrates how to implement TV input service.
+This sample uses captured ATSC streams which includes videos and channel
+and program information. On a setup request, this app registers channels and
+programs to the framework. Also, it plays the video when the framework tunes
+to the channel.
+</p>
diff --git a/samples/AtscTvInput/res/raw/freq_1_prog_1.mpg b/samples/AtscTvInput/res/raw/freq_1_prog_1.mpg
new file mode 100644
index 0000000..276bcca
--- /dev/null
+++ b/samples/AtscTvInput/res/raw/freq_1_prog_1.mpg
Binary files differ
diff --git a/samples/AtscTvInput/res/raw/freq_2_prog_1029.mpg b/samples/AtscTvInput/res/raw/freq_2_prog_1029.mpg
new file mode 100644
index 0000000..55a4a76
--- /dev/null
+++ b/samples/AtscTvInput/res/raw/freq_2_prog_1029.mpg
Binary files differ
diff --git a/samples/AtscTvInput/res/values/strings.xml b/samples/AtscTvInput/res/values/strings.xml
new file mode 100644
index 0000000..815c821
--- /dev/null
+++ b/samples/AtscTvInput/res/values/strings.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="atsc_tv_input">AtscTvInput</string>
+    <string name="label">ATSC Sample Input</string>
+    <string name="channel_scan_message">Scanning channels, please wait...</string>
+</resources>
diff --git a/samples/AtscTvInput/res/xml/atsctvinputservice.xml b/samples/AtscTvInput/res/xml/atsctvinputservice.xml
new file mode 100644
index 0000000..9f7bc4d
--- /dev/null
+++ b/samples/AtscTvInput/res/xml/atsctvinputservice.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<tv-input xmlns:android="http://schemas.android.com/apk/res/android"
+    android:setupActivity="com.example.android.atsctvinput.AtscTvInputScanActivity" />
diff --git a/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputScanActivity.java b/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputScanActivity.java
new file mode 100644
index 0000000..afc778b
--- /dev/null
+++ b/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputScanActivity.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.atsctvinput;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.ComponentName;
+import android.content.ContentValues;
+import android.content.DialogInterface;
+import android.media.tv.TvContract;
+import android.media.tv.TvInputInfo;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.util.Log;
+import android.util.Pair;
+
+import com.example.android.atsctvinput.SampleTsStream.TsStream;
+import com.example.android.atsctvinput.SectionParser.EITItem;
+import com.example.android.atsctvinput.SectionParser.VCTItem;
+import com.example.atsctvinput.R;
+
+import java.util.List;
+
+/**
+ * The scan/setup activity for ATSC TvInput app.
+ */
+public class AtscTvInputScanActivity extends Activity {
+    private static final String TAG = "AtscTvInputScanActivity";
+    private static final long FAKE_SCANTIME_PER_CHANNEL_MS = 1000;
+    private ProgressDialog mProgressDialog;
+
+    private String mInputId;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        mInputId = getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
+        if (mInputId == null) {
+            showErrorDialog("Invalid Intent.");
+            return;
+        }
+
+        mProgressDialog = new ProgressDialog(this);
+        mProgressDialog.setMessage(getResources().getString(R.string.channel_scan_message));
+        mProgressDialog.setCancelable(false);
+
+        mProgressDialog.show();
+        new AsyncTask<Void, Void, Void>() {
+            @Override
+            protected Void doInBackground(Void... params) {
+                clearChannels();
+                doAutoScan();
+                return null;
+            }
+
+            @Override
+            protected void onPostExecute(Void result) {
+                mProgressDialog.hide();
+                AtscTvInputScanActivity.this.setResult(Activity.RESULT_OK);
+                AtscTvInputScanActivity.this.finish();
+            }
+        }.execute();
+    }
+
+    private void showErrorDialog(String message) {
+        new AlertDialog.Builder(this, AlertDialog.THEME_HOLO_DARK)
+                .setTitle("Error")
+                .setMessage(message)
+                .setCancelable(false)
+                .setPositiveButton("OK",
+                        new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int id) {
+                                finishAffinity();
+                            }
+                })
+                .show();
+    }
+
+    private void clearChannels() {
+        Uri uri = TvContract.buildChannelsUriForInput(mInputId);
+        getContentResolver().delete(uri, null, null);
+    }
+
+    private void doAutoScan() {
+        for (TsStream s : SampleTsStream.SAMPLES) {
+            Pair<VCTItem, List<EITItem>> result = SampleTsStream.extractChannelInfo(this, s);
+            if (result != null) {
+                insertChannel(result.first, s);
+                try {
+                    Thread.sleep(FAKE_SCANTIME_PER_CHANNEL_MS);
+                } catch (InterruptedException e) {
+                    // Do nothing.
+                }
+            }
+        }
+    }
+
+    public void insertChannel(VCTItem channel, TsStream stream) {
+        Log.d(TAG, "Channel " + channel.getShortName() + " " + channel.getMajorChannelNumber()
+                + "-" + channel.getMinorChannelNumber() + " is detected.");
+        ContentValues values = new ContentValues();
+        values.put(TvContract.Channels.COLUMN_INPUT_ID, mInputId);
+        values.put(TvContract.Channels.COLUMN_DISPLAY_NUMBER,
+                channel.getMajorChannelNumber() + "-" + channel.getMinorChannelNumber());
+        values.put(TvContract.Channels.COLUMN_DISPLAY_NAME, channel.getShortName());
+        values.put(TvContract.Channels.COLUMN_INTERNAL_PROVIDER_DATA,
+                SampleTsStream.getTuneInfo(stream));
+        getContentResolver().insert(TvContract.Channels.CONTENT_URI, values);
+    }
+}
diff --git a/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputService.java b/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputService.java
new file mode 100644
index 0000000..4ea7852
--- /dev/null
+++ b/samples/AtscTvInput/src/com/example/android/atsctvinput/AtscTvInputService.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.atsctvinput;
+
+import android.content.ContentUris;
+import android.content.ContentValues;
+import android.content.res.AssetFileDescriptor;
+import android.database.Cursor;
+import android.media.MediaPlayer;
+import android.media.tv.TvContract;
+import android.media.tv.TvInputService;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.util.Log;
+import android.util.Pair;
+import android.view.Surface;
+
+import com.example.android.atsctvinput.SampleTsStream.TsStream;
+import com.example.android.atsctvinput.SectionParser.EITItem;
+import com.example.android.atsctvinput.SectionParser.VCTItem;
+
+import java.util.List;
+
+/**
+ * A sample TvInputService which plays ATSC TV stream.
+ */
+public class AtscTvInputService extends TvInputService {
+    private static final String TAG = "AtscTvInputService";
+    private static final int SEC_IN_MS = 1000;
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        Log.d(TAG, "onCreate()");
+        // TODO: Uncomment or remove when a new API design is locked down.
+        // setAvailable(true);
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        Log.d(TAG, "onDestroy()");
+    }
+
+    @Override
+    public TvInputService.Session onCreateSession(String inputId) {
+        return new MyTvInputSessionImpl();
+    }
+
+
+    public TsStream getTsStreamForChannel(Uri channelUri) {
+        String[] projection = { TvContract.Channels.COLUMN_INTERNAL_PROVIDER_DATA };
+        if (channelUri == null) {
+            return null;
+        }
+        Cursor cursor = this.getContentResolver().query(
+                channelUri, projection, null, null, null);
+        if (cursor == null) {
+            return null;
+        }
+        if (cursor.getCount() < 1) {
+            cursor.close();
+            return null;
+        }
+        cursor.moveToNext();
+        TsStream stream = SampleTsStream.getTsStreamFromTuneInfo(cursor.getString(0));
+        cursor.close();
+        return stream;
+    }
+
+    private class MyTvInputSessionImpl extends TvInputService.Session {
+        private MediaPlayer mPlayer;
+
+        protected MyTvInputSessionImpl() {
+            mPlayer = new MediaPlayer();
+        }
+
+        @Override
+        public void onRelease() {
+            if (mPlayer != null) {
+                mPlayer.release();
+                mPlayer = null;
+            }
+        }
+
+        @Override
+        public boolean onSetSurface(Surface surface) {
+            Log.d(TAG, "onSetSurface(" + surface + ")");
+            mPlayer.setSurface(surface);
+            return true;
+        }
+
+        @Override
+        public void onSetStreamVolume(float volume) {
+            Log.d(TAG, "onSetStreamVolume(" + volume + ")");
+            mPlayer.setVolume(volume, volume);
+        }
+
+        @Override
+        public boolean onTune(Uri channelUri) {
+            Log.d(TAG, "onTune(" + channelUri + ")");
+            mPlayer.reset();
+            TsStream stream = getTsStreamForChannel(channelUri);
+            if (stream == null) {
+                return false;
+            }
+            new ProgramUpdateTask().execute(stream, channelUri);
+            AssetFileDescriptor afd = getResources().openRawResourceFd(stream.mResourceId);
+            try {
+                mPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(),
+                        afd.getLength());
+                mPlayer.prepare();
+                afd.close();
+            } catch (Exception e) {
+                Log.e(TAG, "Failed to tune to(" + channelUri + ")");
+                mPlayer.reset();
+                return false;
+            }
+            mPlayer.start();
+            return true;
+        }
+
+        @Override
+        public void onSetCaptionEnabled(boolean enabled) {
+            Log.d(TAG, "onSetCaptionEnabled(" + enabled + ")");
+        }
+    }
+
+    private class ProgramUpdateTask extends AsyncTask<Object, Void, Void> {
+        @Override
+        protected Void doInBackground(Object... objs) {
+            TsStream stream = (TsStream) objs[0];
+            Uri channelUri = (Uri) objs[1];
+            Pair<VCTItem, List<EITItem>> result =
+                    SampleTsStream.extractChannelInfo(AtscTvInputService.this, stream);
+            if (result == null) {
+                return null;
+            }
+            clearPrograms(channelUri);
+            // The sample streams have passed timestamps. In order to show the metadata properly in
+            // TV app, we offset the time here.
+            long timeOffsetMs = Long.MIN_VALUE;
+            long currentTimeMs = System.currentTimeMillis();
+            for (EITItem i : result.second) {
+                if (timeOffsetMs == Long.MIN_VALUE) {
+                    timeOffsetMs = currentTimeMs - i.getStartTime() * SEC_IN_MS;
+                }
+                insertProgram(channelUri, i, timeOffsetMs);
+            }
+            return null;
+        }
+
+        private void clearPrograms(Uri channelUri) {
+            Uri uri = TvContract.buildProgramsUriForChannel(channelUri);
+            getContentResolver().delete(uri, null, null);
+        }
+
+        private Uri insertProgram(Uri channelUri, EITItem event, long timeOffsetMs) {
+            Log.d(TAG, "insertProgram " + event.getTitleText());
+            ContentValues values = new ContentValues();
+            values.put(TvContract.Programs.COLUMN_CHANNEL_ID, ContentUris.parseId(channelUri));
+            values.put(TvContract.Programs.COLUMN_TITLE, event.getTitleText());
+            values.put(TvContract.Programs.COLUMN_START_TIME_UTC_MILLIS, timeOffsetMs
+                    + event.getStartTime() * SEC_IN_MS);
+            values.put(TvContract.Programs.COLUMN_END_TIME_UTC_MILLIS, timeOffsetMs
+                    + (event.getStartTime() + event.getLengthInSecond()) * SEC_IN_MS);
+            return getContentResolver().insert(
+                    TvContract.Programs.CONTENT_URI, values);
+        }
+    }
+}
diff --git a/samples/AtscTvInput/src/com/example/android/atsctvinput/PSIPParser.java b/samples/AtscTvInput/src/com/example/android/atsctvinput/PSIPParser.java
new file mode 100644
index 0000000..cb3480c
--- /dev/null
+++ b/samples/AtscTvInput/src/com/example/android/atsctvinput/PSIPParser.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.atsctvinput;
+
+import android.util.Log;
+
+import com.example.android.atsctvinput.SectionParser.EITItem;
+import com.example.android.atsctvinput.SectionParser.MGTItem;
+import com.example.android.atsctvinput.SectionParser.OutputListener;
+import com.example.android.atsctvinput.SectionParser.VCTItem;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ATSC Program and System Information Protocol (PSIP) parser.
+ */
+public class PSIPParser {
+    private static final String TAG = "PSIPParser";
+
+    public static final int ATSC_SI_BASE_PID = 0x1ffb;
+    private static final int TS_PACKET_START_CODE = 0x47;
+    private static final int TS_PACKET_SIZE = 188;
+
+    private Map<Integer, Stream> mStreamMap = new HashMap<Integer, Stream>();
+    private Map<Integer, VCTItem> mSourceIdToVCTItemMap = new HashMap<Integer, VCTItem>();
+    private SectionParser mSectionParser;
+    private PSIPOutputListener mListener;
+
+    private int mPartialTSPacketSize;
+    private byte[] mPartialTSPacketBuf = new byte[TS_PACKET_SIZE];
+
+    public interface PSIPOutputListener {
+        void onEITPidDetected(int pid);
+        void onEITItemParsed(VCTItem channel, List<EITItem> items);
+    }
+
+    private class Stream {
+        private static final int INVALID_CONTINUITY_COUNTER = -1;
+        private static final int NUM_CONTINUITY_COUNTER = 16;
+
+        int mContinuityCounter = INVALID_CONTINUITY_COUNTER;
+        byte[] mData = new byte[0];
+
+        public void feedData(byte[] data, int continuityCounter, boolean startIndicator) {
+            if ((mContinuityCounter + 1) % NUM_CONTINUITY_COUNTER
+                    != continuityCounter) {
+                mData = new byte[0];
+            }
+            mContinuityCounter = continuityCounter;
+            int startPos = 0;
+            if (mData.length == 0) {
+                if (startIndicator) {
+                    startPos = (data[0] & 0xff) + 1;
+                } else {
+                    // Don't know where the section starts yet. Wait until start indicator is on.
+                    return;
+                }
+            } else {
+                if (startIndicator) {
+                    startPos = 1;
+                }
+            }
+            int prevSize = mData.length;
+            mData = Arrays.copyOf(mData, mData.length + data.length - startPos);
+            System.arraycopy(data, startPos, mData, prevSize, data.length - startPos);
+            parseSectionIfAny();
+        }
+
+        private void parseSectionIfAny() {
+            while (mData.length >= 3) {
+                if ((mData[0] & 0xff) == 0xff) {
+                    // Clear stuffing bytes according to H222.0 section 2.4.4.
+                    mData = new byte[0];
+                    break;
+                }
+                int sectionLength = (((mData[1] & 0x0f) << 8) | (mData[2] & 0xff) + 3);
+                if (mData.length < sectionLength) {
+                    break;
+                }
+                Log.d(TAG, "parseSection 0x" + Integer.toHexString(mData[0] & 0xff));
+                parseSection(Arrays.copyOfRange(mData, 0, sectionLength));
+                mData = Arrays.copyOfRange(mData, sectionLength, mData.length);
+            }
+        }
+    }
+
+    private OutputListener mSectionListener = new OutputListener() {
+        @Override
+        public void onMGTParsed(List<MGTItem> items) {
+            for (MGTItem i : items) {
+                if (i.getTableType() == MGTItem.TABLE_TYPE_EIT_0
+                        && mStreamMap.get(i.getTableTypePid()) == null) {
+                    mStreamMap.put(i.getTableTypePid(), new Stream());
+                    if (mListener != null) {
+                        mListener.onEITPidDetected(i.getTableTypePid());
+                    }
+                }
+            }
+        }
+
+        @Override
+        public void onVCTParsed(List<VCTItem> items) {
+            for (VCTItem i : items) {
+                mSourceIdToVCTItemMap.put(i.getSourceId(), i);
+            }
+        }
+
+        @Override
+        public void onEITParsed(int sourceId, List<EITItem> items) {
+            Log.d(TAG, "onEITParsed " + sourceId);
+            VCTItem channel = mSourceIdToVCTItemMap.get(sourceId);
+            if (channel != null && mListener != null) {
+                mListener.onEITItemParsed(channel, items);
+            }
+        }
+    };
+
+    public PSIPParser(PSIPOutputListener listener) {
+        mSectionParser = new SectionParser(mSectionListener);
+        mStreamMap.put(ATSC_SI_BASE_PID, new Stream());
+        mListener = listener;
+    }
+
+    private boolean feedTSPacket(byte[] tsData, int pos) {
+        if (tsData.length < pos + TS_PACKET_SIZE) {
+            Log.d(TAG, "Data should include a single TS packet.");
+            return false;
+        }
+        if (tsData[pos + 0] != TS_PACKET_START_CODE) {
+            Log.d(TAG, "Invalid ts packet.");
+            return false;
+        }
+        if ((tsData[pos + 1] & 0x80) != 0) {
+            Log.d(TAG, "Erroneous ts packet.");
+            return false;
+        }
+        // For details for the structire of TS packet, please see H.222.0 Table 2-2.
+        int pid = ((tsData[pos + 1] & 0x1f) << 8) | (tsData[pos + 2] & 0xff);
+        boolean hasAdaptation = (tsData[pos + 3] & 0x20) != 0;
+        boolean hasPayload = (tsData[pos + 3] & 0x10) != 0;
+        boolean payloadStartIndicator = (tsData[pos + 1] & 0x40) != 0;
+        int continuityCounter = tsData[pos + 3] & 0x0f;
+        Stream stream = mStreamMap.get(pid);
+        int payloadPos = pos;
+        payloadPos += hasAdaptation ? 5 + (tsData[pos + 4] & 0xff) : 4;
+        if (!hasPayload || stream == null) {
+            // We are not interested in this packet.
+            return false;
+        }
+        stream.feedData(Arrays.copyOfRange(tsData, payloadPos, pos + TS_PACKET_SIZE),
+                continuityCounter, payloadStartIndicator);
+        return true;
+    }
+
+    public void feedTSData(byte[] tsData, int pos, int length) {
+        int origPos = pos;
+        if (mPartialTSPacketSize != 0
+                && (mPartialTSPacketSize + length) > TS_PACKET_SIZE) {
+            System.arraycopy(tsData, pos, mPartialTSPacketBuf, mPartialTSPacketSize,
+                    TS_PACKET_SIZE - mPartialTSPacketSize);
+            feedTSPacket(mPartialTSPacketBuf, 0);
+            pos += TS_PACKET_SIZE - mPartialTSPacketSize;
+            mPartialTSPacketSize = 0;
+        }
+        for (;pos <= length - TS_PACKET_SIZE; pos += TS_PACKET_SIZE) {
+            feedTSPacket(tsData, pos);
+        }
+        int remaining = origPos + length - pos;
+        if (remaining > 0) {
+            System.arraycopy(tsData, pos, mPartialTSPacketBuf, mPartialTSPacketSize, remaining);
+        }
+    }
+
+    private void parseSection(byte[] data) {
+        mSectionParser.parseSection(data);
+    }
+}
diff --git a/samples/AtscTvInput/src/com/example/android/atsctvinput/SampleTsStream.java b/samples/AtscTvInput/src/com/example/android/atsctvinput/SampleTsStream.java
new file mode 100644
index 0000000..875d69d
--- /dev/null
+++ b/samples/AtscTvInput/src/com/example/android/atsctvinput/SampleTsStream.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.atsctvinput;
+
+import android.content.Context;
+import android.util.Log;
+import android.util.Pair;
+
+import com.example.android.atsctvinput.PSIPParser.PSIPOutputListener;
+import com.example.android.atsctvinput.SectionParser.EITItem;
+import com.example.android.atsctvinput.SectionParser.VCTItem;
+import com.example.atsctvinput.R;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+public class SampleTsStream {
+    private static final String TAG = "SampleTsStream";
+    /*
+     * Sample MPEG2 transport streams which include ATSC PSIP data.
+     * In order to play the stream with Android mediaplayer, each stream has exactly one program
+     * and video and audio tracks are transcoded to MPEG4 and AAC respectively.
+     */
+    public static final TsStream[] SAMPLES = new TsStream[] {
+        new TsStream(R.raw.freq_1_prog_1, 1, 1),
+        new TsStream(R.raw.freq_2_prog_1029, 2, 1029),
+    };
+
+    private static final int READ_BUF_SIZE = 188;
+
+    public static String getTuneInfo(TsStream stream) {
+        return Long.toString(stream.mFrequency) + "," + Integer.toString(stream.mProgramNumber);
+    }
+
+    public static TsStream getTsStreamFromTuneInfo(String tuneInfo) {
+        String values[] = tuneInfo.split(",");
+        if (values.length != 2) {
+            return null;
+        }
+        long freq = Long.parseLong(values[0]);
+        int programNumber = Integer.parseInt(values[1]);
+        for (TsStream s : SAMPLES) {
+            if (s.mFrequency == freq && s.mProgramNumber == programNumber) {
+                return s;
+            }
+        }
+        return null;
+    }
+
+    public static Pair<VCTItem, List<EITItem>> extractChannelInfo(
+            Context context, final TsStream stream) {
+        final Object[] results = new Object[2];
+        PSIPParser mPSIPParser = new PSIPParser(new PSIPOutputListener() {
+            @Override
+            public void onEITPidDetected(int pid) {
+                // Do nothing;
+            }
+
+            @Override
+            public void onEITItemParsed(VCTItem channel, List<EITItem> items) {
+                if (channel.getProgramNumber() == stream.mProgramNumber) {
+                    results[0] = channel;
+                    results[1] = items;
+                }
+            }
+        });
+        InputStream in = context.getResources().openRawResource(stream.mResourceId);
+        byte[] buf = new byte[READ_BUF_SIZE];
+        try {
+            while (results[0] == null && results[1] == null
+                    && in.read(buf, 0, READ_BUF_SIZE) == READ_BUF_SIZE) {
+                mPSIPParser.feedTSData(buf, 0, buf.length);
+            }
+        } catch (IOException e) {
+            Log.e(TAG, "Error while detecting channel from freq " + stream.mFrequency
+                    + " program number " + stream.mProgramNumber);
+        } finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                Log.e(TAG, "Error while closing input stream for " + stream.mFrequency);
+            }
+        }
+        if (results[0] != null && results[1] != null) {
+            return new Pair<VCTItem, List<EITItem>>(
+                    (VCTItem) results[0], (List<EITItem>) results[1]);
+        }
+        return null;
+    }
+
+    public static class TsStream {
+        public final int mResourceId;
+        public final long mFrequency;
+        public final int mProgramNumber;
+
+        public TsStream(int resourceId, long frequency, int programNumber) {
+            mResourceId = resourceId;
+            mFrequency = frequency;
+            mProgramNumber = programNumber;
+        }
+    }
+}
diff --git a/samples/AtscTvInput/src/com/example/android/atsctvinput/SectionParser.java b/samples/AtscTvInput/src/com/example/android/atsctvinput/SectionParser.java
new file mode 100644
index 0000000..0c5ec28
--- /dev/null
+++ b/samples/AtscTvInput/src/com/example/android/atsctvinput/SectionParser.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.atsctvinput;
+
+
+import android.util.Log;
+
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * PSIP section parser which conforms to ATSC A/65.
+ */
+public class SectionParser {
+    private static final String TAG = "SectionParser";
+
+    private static final boolean DEBUG = false;
+
+    private static final byte TABLE_ID_MGT = (byte) 0xc7;
+    private static final byte TABLE_ID_TVCT = (byte) 0xc8;
+    private static final byte TABLE_ID_CVCT = (byte) 0xc9;
+    private static final byte TABLE_ID_EIT = (byte) 0xcb;
+
+    private static final byte COMPRESSION_TYPE_NO_COMPRESSION = (byte) 0x00;
+    private static final byte MODE_SELECTED_UNICODE_RANGE_1 = (byte) 0x00;  // 0x0000 - 0x00ff
+    private static final byte MODE_UTF16 = (byte) 0x3f;
+    private static final int MAX_SHORT_NAME_BYTES = 14;
+
+    /*
+     * The following CRC table is from the generated code by the following command.
+     * $ python pycrc.py --model crc-32-mpeg --algorithm table-driven --generate c
+     * To see the details of pycrc, please visit http://www.tty1.net/pycrc/index_en.html
+     */
+    private static final int [] CRC_TABLE = {
+        0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
+        0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
+        0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+        0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+        0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
+        0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+        0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
+        0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
+        0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+        0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
+        0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
+        0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+        0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
+        0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+        0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+        0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
+        0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
+        0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+        0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+        0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
+        0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+        0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
+        0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
+        0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+        0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
+        0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
+        0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+        0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
+        0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+        0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+        0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
+        0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
+        0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+        0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+        0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
+        0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+        0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
+        0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
+        0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+        0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
+        0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
+        0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+        0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
+        0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+        0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+        0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
+        0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
+        0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+        0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+        0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
+        0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+        0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
+        0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
+        0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+        0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
+        0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
+        0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+        0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
+        0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+        0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+        0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
+        0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
+        0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+        0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+    };
+
+    public interface OutputListener {
+        void onMGTParsed(List<MGTItem> items);
+        void onVCTParsed(List<VCTItem> items);
+        void onEITParsed(int sourceId, List<EITItem> items);
+    }
+
+    public static class MGTItem {
+        public static final int TABLE_TYPE_EIT_0 = 0x0100;
+        private int mTableType;
+        private int mTableTypePid;
+
+        public MGTItem(int tableType, int tableTypePid) {
+            mTableType = tableType;
+            mTableTypePid = tableTypePid;
+        }
+
+        public int getTableType() {
+            return mTableType;
+        }
+
+        public int getTableTypePid() {
+            return mTableTypePid;
+        }
+    }
+
+    public static class VCTItem {
+        private String mShortName;
+        private int mProgramNumber;
+        private int mMajorChannelNumber;
+        private int mMinorChannelNumber;
+        private int mSourceId;
+
+        public VCTItem(String shortName, int programNumber, int majorChannelNumber,
+                int minorChannelNumber, int sourceId) {
+            mShortName = shortName;
+            mProgramNumber = programNumber;
+            mMajorChannelNumber = majorChannelNumber;
+            mMinorChannelNumber = minorChannelNumber;
+            mSourceId = sourceId;
+        }
+
+        public String getShortName() {
+            return mShortName;
+        }
+
+        public int getProgramNumber() {
+            return mProgramNumber;
+        }
+
+        public int getMajorChannelNumber() {
+            return mMajorChannelNumber;
+        }
+
+        public int getMinorChannelNumber() {
+            return mMinorChannelNumber;
+        }
+
+        public int getSourceId() {
+            return mSourceId;
+        }
+    }
+
+    public static class EITItem {
+        private String mTitleText;
+        private long mStartTime;
+        private int mLengthInSecond;
+
+        public EITItem(String titleText, long startTime, int lengthInSecond) {
+            mTitleText = titleText;
+            mStartTime = startTime;
+            mLengthInSecond = lengthInSecond;
+        }
+
+        public String getTitleText() {
+            return mTitleText;
+        }
+
+        public long getStartTime() {
+            return mStartTime;
+        }
+
+        public int getLengthInSecond() {
+            return mLengthInSecond;
+        }
+    }
+
+    private OutputListener mListener;
+
+    public SectionParser(OutputListener listener) {
+        mListener = listener;
+    }
+
+    public void parseSection(byte[] data) {
+        if (!checkSanity(data)) {
+            Log.d(TAG, "Bad CRC!");
+            return;
+        }
+        switch (data[0]) {
+            case TABLE_ID_MGT:
+                parseMGT(data);
+                break;
+            case TABLE_ID_TVCT:
+            case TABLE_ID_CVCT:
+                parseVCT(data);
+                break;
+            case TABLE_ID_EIT:
+                parseEIT(data);
+                break;
+            default:
+                break;
+        }
+    }
+
+    private void parseMGT(byte[] data) {
+        // For details of the structure for MGT, please see ATSC A/65 Table 6.2.
+        if (DEBUG) {
+            Log.d(TAG, "MGT is discovered.");
+        }
+        int tablesDefined = ((data[9] & 0xff) << 8) | (data[10] & 0xff);
+        int pos = 11;
+        List<MGTItem> results = new ArrayList<MGTItem>();
+        for (int i = 0; i < tablesDefined; ++i) {
+            int tableType = ((data[pos] & 0xff) << 8) | (data[pos + 1] & 0xff);
+            int tableTypePid = ((data[pos + 2] & 0x1f) << 8) | (data[pos + 3] & 0xff);
+            int descriptorsLength = ((data[pos + 9] & 0x0f) << 8) | (data[pos + 10] & 0xff);
+            pos += 11 + descriptorsLength;
+            if (pos >= data.length) {
+                Log.d(TAG, "Broken MGT.");
+                return;
+            }
+            results.add(new MGTItem(tableType, tableTypePid));
+        }
+        if ((data[pos] & 0xf0) != 0xf0) {
+            Log.d(TAG, "Broken MGT.");
+            return;
+        }
+        if (mListener != null) {
+            mListener.onMGTParsed(results);
+        }
+    }
+
+    private void parseVCT(byte[] data) {
+        // For details of the structure for VCT, please see ATSC A/65 Table 6.4 and 6.8.
+        if (DEBUG) {
+            Log.d(TAG, "VCT is discovered.");
+        }
+        int sectionNumber = (data[6] & 0xff);
+        int lastSectionNumber = (data[7] & 0xff);
+        int numChannelsInSection = (data[9] & 0xff);
+        int pos = 10;
+        List<VCTItem> results = new ArrayList<VCTItem>();
+        for (int i = 0; i < numChannelsInSection; ++i) {
+            String shortName = "";
+            int shortNameSize = getShortNameSize(data, pos);
+            try {
+                shortName = new String(
+                        Arrays.copyOfRange(data, pos, pos + shortNameSize), "UTF-16");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            if ((data[pos + 14] & 0xf0) != 0xf0) {
+                Log.d(TAG, "Broken VCT.");
+                return;
+            }
+            int majorNumber = ((data[pos + 14] & 0x0f) << 6) | ((data[pos + 15] & 0xff) >> 2);
+            int minorNumber = ((data[pos + 15] & 0x03) << 8) | (data[pos + 16] & 0xff);
+            if ((majorNumber & 0x3f0) == 0x3f0) {
+                // If the six MSBs are 111111, these indicate that there is only one-part channel
+                // number. To see details, please refer A/65 Section 6.3.2.
+                majorNumber = ((majorNumber & 0xf) << 10) + minorNumber;
+                minorNumber = 0;
+            }
+            int programNumber = ((data[pos + 24] & 0xff) << 8) | (data[pos + 25] & 0xff);
+            int sourceId = ((data[pos + 28] & 0xff) << 8) | (data[pos + 29] & 0xff);
+            int descriptorsLength = ((data[pos + 30] & 0x03) << 8) | (data[pos + 31] & 0xff);
+            pos += 32 + descriptorsLength;
+            if (pos >= data.length) {
+                Log.d(TAG, "Broken VCT.");
+                return;
+            }
+            results.add(new VCTItem(shortName, programNumber, majorNumber, minorNumber, sourceId));
+        }
+        if ((data[pos] & 0xfc) != 0xfc) {
+            Log.d(TAG, "Broken VCT.");
+            return;
+        }
+        if (mListener != null) {
+            mListener.onVCTParsed(results);
+        }
+    }
+
+    private void parseEIT(byte[] data) {
+        // For details of the structure for EIT, please see ATSC A/65 Table 6.11.
+        if (DEBUG) {
+            Log.d(TAG, "EIT is discovered.");
+        }
+        int sourceId = ((data[3] & 0xff) << 8) | (data[4] & 0xff);
+        int sectionNumber = (data[6] & 0xff);
+        int lastSectionNumber = (data[7] & 0xff);
+        int numEventsInSection = (data[9] & 0xff);
+
+        int pos = 10;
+        List<EITItem> results = new ArrayList<EITItem>();
+        for (int i = 0; i < numEventsInSection; ++i) {
+            if ((data[pos] & 0xc0) != 0xc0) {
+                Log.d(TAG, "Broken EIT.");
+                return;
+            }
+            long startTime = ((data[pos + 2] & (long) 0xff) << 24) | ((data[pos + 3] & 0xff) << 16)
+                    | ((data[pos + 4] & 0xff) << 8) | (data[pos + 5] & 0xff);
+            int lengthInSecond = ((data[pos + 6] & 0x0f) << 16)
+                    | ((data[pos + 7] & 0xff) << 8) | (data[pos + 8] & 0xff);
+            int titleLength = (data[pos + 9] & 0xff);
+            String titleText = "";
+            if (titleLength > 0) {
+                titleText = extractText(data, pos + 10);
+            }
+            if ((data[pos + 10 + titleLength] & 0xf0) != 0xf0) {
+                Log.d(TAG, "Broken EIT.");
+                return;
+            }
+            int descriptorsLength = ((data[pos + 10 + titleLength] & 0x0f) << 8)
+                    | (data[pos + 10 + titleLength + 1] & 0xff);
+            pos += 10 + titleLength + 2 + descriptorsLength;
+            if (pos >= data.length) {
+                Log.d(TAG, "Broken EIT.");
+                return;
+            }
+            results.add(new EITItem(titleText, startTime, lengthInSecond));
+        }
+        if (mListener != null) {
+            mListener.onEITParsed(sourceId, results);
+        }
+    }
+
+    private int getShortNameSize(byte[] data, int offset) {
+        for (int i = 0; i < MAX_SHORT_NAME_BYTES; i += 2) {
+            if(data[offset + i] == 0 && data[offset + i + 1] == 0) {
+                return i;
+            }
+        }
+        return MAX_SHORT_NAME_BYTES;
+    }
+
+    private String extractText(byte[] data, int startOffset) {
+        int pos = startOffset;
+        int numStrings = data[pos] & 0xff;
+        pos++;
+        for (int i = 0; i < numStrings; ++i) {
+            int numSegments = data[pos + 3] & 0xff;
+            pos += 4;
+            for (int j = 0; j < numSegments; ++j) {
+                int compressionType = data[pos] & 0xff;
+                int mode = data[pos + 1] & 0xff;
+                int numBytes = data[pos + 2] & 0xff;
+                if (compressionType == COMPRESSION_TYPE_NO_COMPRESSION) {
+                    try {
+                        if (mode == MODE_UTF16) {
+                            return new String(Arrays.copyOfRange(
+                                    data, pos + 3, pos + 3 + numBytes), "UTF-16");
+                        } else if (mode == MODE_SELECTED_UNICODE_RANGE_1){
+                            return new String(Arrays.copyOfRange(
+                                    data, pos + 3, pos + 3 + numBytes), "UTF-8");
+                        }
+                    } catch (UnsupportedEncodingException e) {
+                        System.out.println("Unsupported text format.");
+                    }
+                }
+                pos += 3 + numBytes;
+            }
+        }
+        return null;
+    }
+
+    private boolean checkSanity(byte[] data) {
+        boolean hasCRC = (data[1] & 0x80) != 0; // section_syntax_indicator
+        if (hasCRC) {
+            int crc = 0xffffffff;
+            for(byte b : data) {
+                int index = ((crc >> 24) ^ (b & 0xff)) & 0xff;
+                crc = CRC_TABLE[index] ^ (crc << 8);
+            }
+            if(crc != 0){
+                return false;
+            }
+        }
+        return true;
+    }
+}
diff --git a/samples/SampleSyncAdapter/AndroidManifest.xml b/samples/SampleSyncAdapter/AndroidManifest.xml
index 48f6fad..7402f9d 100644
--- a/samples/SampleSyncAdapter/AndroidManifest.xml
+++ b/samples/SampleSyncAdapter/AndroidManifest.xml
@@ -104,7 +104,7 @@
         </activity>
 
         <activity
-            android:name=".activites.InviteContactActivity"
+            android:name=".activities.InviteContactActivity"
             android:theme="@android:style/Theme.Dialog">
             <!--
                 We use the INVITE intent to add a raw contact to an existing contact.
@@ -133,34 +133,5 @@
             </intent-filter>
         </activity>
 
-        <activity
-            android:name=".activities.ViewStreamItemActivity"
-            android:theme="@android:style/Theme.Dialog">
-            <!--
-                We use the VIEW intent to view a stream item in our app.
-                It always comes with a lookup URI.
-            -->
-            <intent-filter>
-                <action
-                    android:name="android.intent.action.VIEW" />
-                <data
-                    android:mimeType="vnd.android.cursor.item/stream_item" />
-            </intent-filter>
-        </activity>
-
-        <activity
-            android:name=".activities.ViewStreamItemPhotoActivity"
-            android:theme="@android:style/Theme.Dialog">
-            <!--
-                We use the VIEW intent to view a stream item photo in our app.
-                It always comes with a lookup URI.
-            -->
-            <intent-filter>
-                <action
-                    android:name="android.intent.action.VIEW" />
-                <data
-                    android:mimeType="vnd.android.cursor.item/stream_item_photo" />
-            </intent-filter>
-        </activity>
     </application>
 </manifest>
diff --git a/samples/SampleSyncAdapter/res/layout/view_stream_item_activity.xml b/samples/SampleSyncAdapter/res/layout/view_stream_item_activity.xml
deleted file mode 100644
index a04d07f..0000000
--- a/samples/SampleSyncAdapter/res/layout/view_stream_item_activity.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
-/**
- * Copyright (c) 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content">
-    <TextView
-        android:text="@string/view_stream_item_description"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-    <TextView
-        android:id="@+id/view_stream_item_uri"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/samples/SampleSyncAdapter/res/layout/view_stream_item_photo_activity.xml b/samples/SampleSyncAdapter/res/layout/view_stream_item_photo_activity.xml
deleted file mode 100644
index ddc09d0..0000000
--- a/samples/SampleSyncAdapter/res/layout/view_stream_item_photo_activity.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
-/**
- * Copyright (c) 2011, The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content">
-    <TextView
-        android:text="@string/view_stream_item_photo_description"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-    <TextView
-        android:id="@+id/view_stream_item_photo_uri"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/samples/SampleSyncAdapter/res/values/strings.xml b/samples/SampleSyncAdapter/res/values/strings.xml
index 22fe14e..84c94d1 100644
--- a/samples/SampleSyncAdapter/res/values/strings.xml
+++ b/samples/SampleSyncAdapter/res/values/strings.xml
@@ -129,14 +129,4 @@
 
         This is the group uri:</string>
 
-    <!-- The description for the view stream item -->
-    <string name="view_stream_item_description">This would now show the details of the stream item.
-
-        This is the uri of the stream item:</string>
-
-    <!-- The description for the view stream item photo -->
-    <string name="view_stream_item_photo_description">This would now show the details of the stream item photo.
-
-        This is the uri of the photo:</string>
-
 </resources>
\ No newline at end of file
diff --git a/samples/SampleSyncAdapter/res/xml-v14/contacts.xml b/samples/SampleSyncAdapter/res/xml-v14/contacts.xml
index 48e079a..b4ad2a0 100644
--- a/samples/SampleSyncAdapter/res/xml-v14/contacts.xml
+++ b/samples/SampleSyncAdapter/res/xml-v14/contacts.xml
@@ -24,8 +24,6 @@
     viewContactNotifyService="com.example.android.samplesync.notifier.NotifierService"
     viewGroupActivity="com.example.android.samplesync.activities.ViewGroupActivity"
     viewGroupActionLabel="@string/view_group_action_label"
-    viewStreamItemActivity="com.example.android.samplesync.activities.ViewStreamItemActivity"
-    viewStreamItemPhotoActivity="com.example.android.samplesync.activities.ViewStreamItemPhotoActivity"
 >
 
     <ContactsDataKind
diff --git a/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemActivity.java b/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemActivity.java
deleted file mode 100644
index 6d54f31..0000000
--- a/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemActivity.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.example.android.samplesync.activities;
-
-import com.example.android.samplesync.R;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.widget.TextView;
-
-/**
- * Activity to handle view a stream-item. In a real app, this would show a rich view of the
- * item.
- */
-public class ViewStreamItemActivity extends Activity {
-    private static final String TAG = "ViewStreamItemActivity";
-
-    private TextView mUriTextView;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.view_stream_item_activity);
-
-        mUriTextView = (TextView) findViewById(R.id.view_stream_item_uri);
-        mUriTextView.setText(getIntent().getDataString());
-    }
-}
diff --git a/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemPhotoActivity.java b/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemPhotoActivity.java
deleted file mode 100644
index 962bc70..0000000
--- a/samples/SampleSyncAdapter/src/com/example/android/samplesync/activities/ViewStreamItemPhotoActivity.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.example.android.samplesync.activities;
-
-import com.example.android.samplesync.R;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.widget.TextView;
-
-/**
- * Activity to view a stream-item-photo. In a real app, this would show a fullscreen view of the
- * photo, potentially with ways to interact with it
- */
-public class ViewStreamItemPhotoActivity extends Activity {
-    private static final String TAG = "ViewStreamItemPhotoActivity";
-
-    private TextView mUriTextView;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.view_stream_item_photo_activity);
-
-        mUriTextView = (TextView) findViewById(R.id.view_stream_item_photo_uri);
-        mUriTextView.setText(getIntent().getDataString());
-    }
-}
diff --git a/samples/SampleSyncAdapter/src/com/example/android/samplesync/platform/ContactManager.java b/samples/SampleSyncAdapter/src/com/example/android/samplesync/platform/ContactManager.java
index 5b09eb1..22f4f26 100644
--- a/samples/SampleSyncAdapter/src/com/example/android/samplesync/platform/ContactManager.java
+++ b/samples/SampleSyncAdapter/src/com/example/android/samplesync/platform/ContactManager.java
@@ -24,10 +24,7 @@
 import android.content.ContentUris;
 import android.content.ContentValues;
 import android.content.Context;
-import android.content.res.AssetFileDescriptor;
 import android.database.Cursor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.net.Uri;
 import android.provider.ContactsContract;
 import android.provider.ContactsContract.CommonDataKinds.Email;
@@ -41,14 +38,8 @@
 import android.provider.ContactsContract.RawContacts;
 import android.provider.ContactsContract.Settings;
 import android.provider.ContactsContract.StatusUpdates;
-import android.provider.ContactsContract.StreamItemPhotos;
-import android.provider.ContactsContract.StreamItems;
 import android.util.Log;
 
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -244,43 +235,6 @@
     }
 
     /**
-     * Demonstrate how to add stream items and stream item photos to a raw
-     * contact. This just adds items for all of the contacts for this sync
-     * adapter with some locally created text and an image. You should check
-     * for stream items on the server that you are syncing with and use the
-     * text and photo data from there instead.
-     *
-     * @param context The context of Authenticator Activity
-     * @param rawContacts The list of users we want to update
-     */
-    public static void addStreamItems(Context context, List<RawContact> rawContacts,
-             String accountName, String accountType) {
-        final ContentResolver resolver = context.getContentResolver();
-        final BatchOperation batchOperation = new BatchOperation(context, resolver);
-        String text = "This is a test stream item!";
-        String message = "via SampleSyncAdapter";
-        for (RawContact rawContact : rawContacts) {
-           addContactStreamItem(context, lookupRawContact(resolver,
-                   rawContact.getServerContactId()), accountName, accountType,
-                   text, message, batchOperation );
-        }
-        List<Uri> streamItemUris = batchOperation.execute();
-
-        // Stream item photos are added after the stream items that they are
-        // associated with, using the stream item's ID as a reference.
-
-        for (Uri uri : streamItemUris){
-          // All you need is the ID of the stream item, which is the last index
-          // path segment returned by getPathSegments().
-          long streamItemId = Long.parseLong(uri.getPathSegments().get(
-                  uri.getPathSegments().size()-1));
-          addStreamItemPhoto(context, resolver, streamItemId, accountName,
-                  accountType, batchOperation);
-        }
-        batchOperation.execute();
-    }
-
-    /**
      * After we've finished up a sync operation, we want to clean up the sync-state
      * so that we're ready for the next time.  This involves clearing out the 'dirty'
      * flag on the synced contacts - but we also have to finish the DELETE operation
@@ -596,59 +550,6 @@
     }
 
     /**
-     * Adds a stream item to a raw contact. The stream item is usually obtained
-     * from the server you are syncing with, but we create it here locally as an
-     * example.
-     *
-     * @param context the Authenticator Activity context
-     * @param rawContactId the raw contact ID that the stream item is associated with
-     * @param accountName the account name of the sync adapter
-     * @param accountType the account type of the sync adapter
-     * @param text the text of the stream item
-     * @param comments the comments for the stream item, such as where the stream item came from
-     * @param batchOperation allow us to batch together multiple operations
-     */
-    private static void addContactStreamItem(Context context, long rawContactId,
-        String accountName, String accountType, String text, String comments,
-        BatchOperation batchOperation) {
-
-        final ContentValues values = new ContentValues();
-        final ContentResolver resolver = context.getContentResolver();
-        if (rawContactId > 0){
-            values.put(StreamItems.RAW_CONTACT_ID, rawContactId);
-            values.put(StreamItems.TEXT, text);
-            values.put(StreamItems.TIMESTAMP, System.currentTimeMillis());
-            values.put(StreamItems.COMMENTS, comments);
-            values.put(StreamItems.ACCOUNT_NAME, accountName);
-            values.put(StreamItems.ACCOUNT_TYPE, accountType);
-
-            batchOperation.add(ContactOperations.newInsertCpo(
-                    StreamItems.CONTENT_URI, false, true).withValues(values).build());
-        }
-    }
-
-    private static void addStreamItemPhoto(Context context, ContentResolver
-        resolver, long streamItemId, String accountName, String accountType,
-        BatchOperation batchOperation){
-
-        ByteArrayOutputStream stream = new ByteArrayOutputStream();
-        Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),
-                R.raw.img1);
-        bitmap.compress(Bitmap.CompressFormat.JPEG, 30, stream);
-        byte[] photoData = stream.toByteArray();
-
-        final ContentValues values = new ContentValues();
-        values.put(StreamItemPhotos.STREAM_ITEM_ID, streamItemId);
-        values.put(StreamItemPhotos.SORT_INDEX, 1);
-        values.put(StreamItemPhotos.PHOTO, photoData);
-        values.put(StreamItems.ACCOUNT_NAME, accountName);
-        values.put(StreamItems.ACCOUNT_TYPE, accountType);
-
-        batchOperation.add(ContactOperations.newInsertCpo(
-                StreamItems.CONTENT_PHOTO_URI, false, true).withValues(values).build());
-    }
-
-    /**
      * Clear the local system 'dirty' flag for a contact.
      *
      * @param context the Authenticator Activity context
diff --git a/samples/SampleSyncAdapter/src/com/example/android/samplesync/syncadapter/SyncAdapter.java b/samples/SampleSyncAdapter/src/com/example/android/samplesync/syncadapter/SyncAdapter.java
index 8aa0784..7144524 100644
--- a/samples/SampleSyncAdapter/src/com/example/android/samplesync/syncadapter/SyncAdapter.java
+++ b/samples/SampleSyncAdapter/src/com/example/android/samplesync/syncadapter/SyncAdapter.java
@@ -119,18 +119,6 @@
 
             ContactManager.updateStatusMessages(mContext, updatedContacts);
 
-            // This is a demo of how you can add stream items for contacts on
-            // the client. This probably won't apply to
-            // 2-way contact sync providers - it's more likely that one-way
-            // sync providers (IM clients, social networking apps, etc) would
-            // use this feature. This is only supported in ICS MR1 or above.
-
-            if (Build.VERSION.SDK_INT >=
-                    Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
-                ContactManager.addStreamItems(mContext, updatedContacts,
-                    account.name, account.type);
-            }
-
             // Save off the new sync marker. On our next sync, we only want to receive
             // contacts that have changed since this sync...
             setServerSyncMarker(account, newSyncState);
diff --git a/samples/SoftKeyboard/res/drawable-hdpi/sym_keyboard_language_switch.png b/samples/SoftKeyboard/res/drawable-hdpi/sym_keyboard_language_switch.png
new file mode 100644
index 0000000..78d3a1f
--- /dev/null
+++ b/samples/SoftKeyboard/res/drawable-hdpi/sym_keyboard_language_switch.png
Binary files differ
diff --git a/samples/SoftKeyboard/res/drawable-mdpi/sym_keyboard_language_switch.png b/samples/SoftKeyboard/res/drawable-mdpi/sym_keyboard_language_switch.png
new file mode 100644
index 0000000..828929b
--- /dev/null
+++ b/samples/SoftKeyboard/res/drawable-mdpi/sym_keyboard_language_switch.png
Binary files differ
diff --git a/samples/SoftKeyboard/res/xml/method.xml b/samples/SoftKeyboard/res/xml/method.xml
index 2f2d6f0..37a59c8 100644
--- a/samples/SoftKeyboard/res/xml/method.xml
+++ b/samples/SoftKeyboard/res/xml/method.xml
@@ -22,6 +22,7 @@
 
 <input-method xmlns:android="http://schemas.android.com/apk/res/android"
         android:settingsActivity="com.example.android.softkeyboard.ImePreferences"
+        android:supportsSwitchingToNextInputMethod="true"
 >
     <subtype
         android:label="@string/label_subtype_generic"
diff --git a/samples/SoftKeyboard/res/xml/qwerty.xml b/samples/SoftKeyboard/res/xml/qwerty.xml
index e81d9f1..936c977 100755
--- a/samples/SoftKeyboard/res/xml/qwerty.xml
+++ b/samples/SoftKeyboard/res/xml/qwerty.xml
@@ -69,8 +69,14 @@
     
     <Row android:rowEdgeFlags="bottom">
         <Key android:codes="-3" android:keyIcon="@drawable/sym_keyboard_done" 
-                android:keyWidth="20%p" android:keyEdgeFlags="left"/>
-        <Key android:codes="-2" android:keyLabel="123" android:keyWidth="15%p"/>
+                android:keyWidth="15%p" android:keyEdgeFlags="left"/>
+        <Key android:codes="-2" android:keyLabel="123" android:keyWidth="10%p"/>
+        <!--
+            android:codes: -101 is not a framework-defined key code but a key code that is
+            privately defined in com.example.android.softkeyboard.LatinKeyboardView.
+        -->
+        <Key android:codes="-101" android:keyIcon="@drawable/sym_keyboard_language_switch"
+                android:keyWidth="10%p"/>
         <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" 
                 android:keyWidth="30%p" android:isRepeatable="true"/>
         <Key android:codes="46,44" android:keyLabel=". ,"
diff --git a/samples/SoftKeyboard/res/xml/symbols.xml b/samples/SoftKeyboard/res/xml/symbols.xml
index a28d752..225ea08 100755
--- a/samples/SoftKeyboard/res/xml/symbols.xml
+++ b/samples/SoftKeyboard/res/xml/symbols.xml
@@ -69,8 +69,14 @@
     
     <Row  android:rowEdgeFlags="bottom">
         <Key android:codes="-3" android:keyIcon="@drawable/sym_keyboard_done"
-                android:keyWidth="20%p" android:keyEdgeFlags="left" />
-        <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" />
+                android:keyWidth="15%p" android:keyEdgeFlags="left" />
+        <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="10%p" />
+        <!--
+            android:codes: -101 is not a framework-defined key code but a key code that is
+            privately defined in com.example.android.softkeyboard.LatinKeyboardView.
+        -->
+        <Key android:codes="-101" android:keyIcon="@drawable/sym_keyboard_language_switch"
+                android:keyWidth="10%p" />
         <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" 
                 android:isRepeatable="true"/>
         <Key android:codes="44" android:keyLabel="," android:keyWidth="15%p" />
diff --git a/samples/SoftKeyboard/res/xml/symbols_shift.xml b/samples/SoftKeyboard/res/xml/symbols_shift.xml
index d7139f3..fa551f2 100755
--- a/samples/SoftKeyboard/res/xml/symbols_shift.xml
+++ b/samples/SoftKeyboard/res/xml/symbols_shift.xml
@@ -69,8 +69,14 @@
     
     <Row android:rowEdgeFlags="bottom">
         <Key android:codes="-3" android:keyIcon="@drawable/sym_keyboard_done" 
-                android:keyWidth="20%p" android:keyEdgeFlags="left" />
-        <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="15%p" />
+                android:keyWidth="15%p" android:keyEdgeFlags="left" />
+        <Key android:codes="-2" android:keyLabel="ABC" android:keyWidth="10%p" />
+        <!--
+            android:codes: -101 is not a framework-defined key code but a key code that is
+            privately defined in com.example.android.softkeyboard.LatinKeyboardView.
+        -->
+        <Key android:codes="-101" android:keyIcon="@drawable/sym_keyboard_language_switch"
+                android:keyWidth="10%p" />
         <Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" 
                 android:isRepeatable="true"/>
         <Key android:codes="8230" android:keyLabel="…" android:keyWidth="15%p" />
diff --git a/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboard.java b/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboard.java
index 67787dc..aae67cd 100644
--- a/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboard.java
+++ b/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboard.java
@@ -22,11 +22,35 @@
 import android.graphics.drawable.Drawable;
 import android.inputmethodservice.Keyboard;
 import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
 
 public class LatinKeyboard extends Keyboard {
 
     private Key mEnterKey;
     private Key mSpaceKey;
+    /**
+     * Stores the current state of the mode change key. Its width will be dynamically updated to
+     * match the region of {@link #mModeChangeKey} when {@link #mModeChangeKey} becomes invisible.
+     */
+    private Key mModeChangeKey;
+    /**
+     * Stores the current state of the language switch key (a.k.a. globe key). This should be
+     * visible while {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod(IBinder)}
+     * returns true. When this key becomes invisible, its width will be shrunk to zero.
+     */
+    private Key mLanguageSwitchKey;
+    /**
+     * Stores the size and other information of {@link #mModeChangeKey} when
+     * {@link #mLanguageSwitchKey} is visible. This should be immutable and will be used only as a
+     * reference size when the visibility of {@link #mLanguageSwitchKey} is changed.
+     */
+    private Key mSavedModeChangeKey;
+    /**
+     * Stores the size and other information of {@link #mLanguageSwitchKey} when it is visible.
+     * This should be immutable and will be used only as a reference size when the visibility of
+     * {@link #mLanguageSwitchKey} is changed.
+     */
+    private Key mSavedLanguageSwitchKey;
     
     public LatinKeyboard(Context context, int xmlLayoutResId) {
         super(context, xmlLayoutResId);
@@ -45,10 +69,39 @@
             mEnterKey = key;
         } else if (key.codes[0] == ' ') {
             mSpaceKey = key;
+        } else if (key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) {
+            mModeChangeKey = key;
+            mSavedModeChangeKey = new LatinKey(res, parent, x, y, parser);
+        } else if (key.codes[0] == LatinKeyboardView.KEYCODE_LANGUAGE_SWITCH) {
+            mLanguageSwitchKey = key;
+            mSavedLanguageSwitchKey = new LatinKey(res, parent, x, y, parser);
         }
         return key;
     }
-    
+
+    /**
+     * Dynamically change the visibility of the language switch key (a.k.a. globe key).
+     * @param visible True if the language switch key should be visible.
+     */
+    void setLanguageSwitchKeyVisibility(boolean visible) {
+        if (visible) {
+            // The language switch key should be visible. Restore the size of the mode change key
+            // and language switch key using the saved layout.
+            mModeChangeKey.width = mSavedModeChangeKey.width;
+            mModeChangeKey.x = mSavedModeChangeKey.x;
+            mLanguageSwitchKey.width = mSavedLanguageSwitchKey.width;
+            mLanguageSwitchKey.icon = mSavedLanguageSwitchKey.icon;
+            mLanguageSwitchKey.iconPreview = mSavedLanguageSwitchKey.iconPreview;
+        } else {
+            // The language switch key should be hidden. Change the width of the mode change key
+            // to fill the space of the language key so that the user will not see any strange gap.
+            mModeChangeKey.width = mSavedModeChangeKey.width + mSavedLanguageSwitchKey.width;
+            mLanguageSwitchKey.width = 0;
+            mLanguageSwitchKey.icon = null;
+            mLanguageSwitchKey.iconPreview = null;
+        }
+    }
+
     /**
      * This looks at the ime options given by the current editor, to set the
      * appropriate label on the keyboard's enter key (if it has one).
@@ -57,7 +110,7 @@
         if (mEnterKey == null) {
             return;
         }
-        
+
         switch (options&(EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
             case EditorInfo.IME_ACTION_GO:
                 mEnterKey.iconPreview = null;
@@ -93,7 +146,8 @@
 
     static class LatinKey extends Keyboard.Key {
         
-        public LatinKey(Resources res, Keyboard.Row parent, int x, int y, XmlResourceParser parser) {
+        public LatinKey(Resources res, Keyboard.Row parent, int x, int y,
+                XmlResourceParser parser) {
             super(res, parent, x, y, parser);
         }
         
diff --git a/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboardView.java b/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboardView.java
index 489c283..abfa2f2 100644
--- a/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboardView.java
+++ b/samples/SoftKeyboard/src/com/example/android/softkeyboard/LatinKeyboardView.java
@@ -26,6 +26,8 @@
 public class LatinKeyboardView extends KeyboardView {
 
     static final int KEYCODE_OPTIONS = -100;
+    // TODO: Move this into android.inputmethodservice.Keyboard
+    static final int KEYCODE_LANGUAGE_SWITCH = -101;
 
     public LatinKeyboardView(Context context, AttributeSet attrs) {
         super(context, attrs);
diff --git a/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java b/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java
index 7c4a17e..cdebde5 100644
--- a/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java
+++ b/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.java
@@ -16,14 +16,17 @@
 
 package com.example.android.softkeyboard;
 
+import android.app.Dialog;
 import android.inputmethodservice.InputMethodService;
 import android.inputmethodservice.Keyboard;
 import android.inputmethodservice.KeyboardView;
+import android.os.IBinder;
 import android.text.InputType;
 import android.text.method.MetaKeyKeyListener;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
 import android.view.View;
+import android.view.Window;
 import android.view.inputmethod.CompletionInfo;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputConnection;
@@ -114,10 +117,17 @@
         mInputView = (LatinKeyboardView) getLayoutInflater().inflate(
                 R.layout.input, null);
         mInputView.setOnKeyboardActionListener(this);
-        mInputView.setKeyboard(mQwertyKeyboard);
+        setLatinKeyboard(mQwertyKeyboard);
         return mInputView;
     }
 
+    private void setLatinKeyboard(LatinKeyboard nextKeyboard) {
+        final boolean shouldSupportLanguageSwitchKey =
+                mInputMethodManager.shouldOfferSwitchingToNextInputMethod(getToken());
+        nextKeyboard.setLanguageSwitchKeyVisibility(shouldSupportLanguageSwitchKey);
+        mInputView.setKeyboard(nextKeyboard);
+    }
+
     /**
      * Called by the framework when your view for showing candidates needs to
      * be generated, like {@link #onCreateInputView}.
@@ -247,7 +257,7 @@
     @Override public void onStartInputView(EditorInfo attribute, boolean restarting) {
         super.onStartInputView(attribute, restarting);
         // Apply the selected keyboard to the input view.
-        mInputView.setKeyboard(mCurKeyboard);
+        setLatinKeyboard(mCurKeyboard);
         mInputView.closing();
         final InputMethodSubtype subtype = mInputMethodManager.getCurrentInputMethodSubtype();
         mInputView.setSubtypeOnSpaceKey(subtype);
@@ -509,19 +519,19 @@
         } else if (primaryCode == Keyboard.KEYCODE_CANCEL) {
             handleClose();
             return;
+        } else if (primaryCode == LatinKeyboardView.KEYCODE_LANGUAGE_SWITCH) {
+            handleLanguageSwitch();
+            return;
         } else if (primaryCode == LatinKeyboardView.KEYCODE_OPTIONS) {
             // Show a menu or somethin'
         } else if (primaryCode == Keyboard.KEYCODE_MODE_CHANGE
                 && mInputView != null) {
             Keyboard current = mInputView.getKeyboard();
             if (current == mSymbolsKeyboard || current == mSymbolsShiftedKeyboard) {
-                current = mQwertyKeyboard;
+                setLatinKeyboard(mQwertyKeyboard);
             } else {
-                current = mSymbolsKeyboard;
-            }
-            mInputView.setKeyboard(current);
-            if (current == mSymbolsKeyboard) {
-                current.setShifted(false);
+                setLatinKeyboard(mSymbolsKeyboard);
+                mSymbolsKeyboard.setShifted(false);
             }
         } else {
             handleCharacter(primaryCode, keyCodes);
@@ -597,11 +607,11 @@
             mInputView.setShifted(mCapsLock || !mInputView.isShifted());
         } else if (currentKeyboard == mSymbolsKeyboard) {
             mSymbolsKeyboard.setShifted(true);
-            mInputView.setKeyboard(mSymbolsShiftedKeyboard);
+            setLatinKeyboard(mSymbolsShiftedKeyboard);
             mSymbolsShiftedKeyboard.setShifted(true);
         } else if (currentKeyboard == mSymbolsShiftedKeyboard) {
             mSymbolsShiftedKeyboard.setShifted(false);
-            mInputView.setKeyboard(mSymbolsKeyboard);
+            setLatinKeyboard(mSymbolsKeyboard);
             mSymbolsKeyboard.setShifted(false);
         }
     }
@@ -629,6 +639,22 @@
         mInputView.closing();
     }
 
+    private IBinder getToken() {
+        final Dialog dialog = getWindow();
+        if (dialog == null) {
+            return null;
+        }
+        final Window window = dialog.getWindow();
+        if (window == null) {
+            return null;
+        }
+        return window.getAttributes().token;
+    }
+
+    private void handleLanguageSwitch() {
+        mInputMethodManager.switchToNextInputMethod(getToken(), false /* onlyCurrentIme */);
+    }
+
     private void checkToggleCapsLock() {
         long now = System.currentTimeMillis();
         if (mLastShiftTime + 800 > now) {
diff --git a/samples/SpellChecker/SampleSpellCheckerService/src/com/example/android/samplespellcheckerservice/SpellCheckerSettingsActivity.java b/samples/SpellChecker/SampleSpellCheckerService/src/com/example/android/samplespellcheckerservice/SpellCheckerSettingsActivity.java
index f223ef7..9447a48 100644
--- a/samples/SpellChecker/SampleSpellCheckerService/src/com/example/android/samplespellcheckerservice/SpellCheckerSettingsActivity.java
+++ b/samples/SpellChecker/SampleSpellCheckerService/src/com/example/android/samplespellcheckerservice/SpellCheckerSettingsActivity.java
@@ -36,4 +36,9 @@
         modIntent.putExtra(EXTRA_NO_HEADERS, true);
         return modIntent;
     }
+
+    @Override
+    protected boolean isValidFragment(String fragmentName) {
+        return SpellCheckerSettingsFragment.class.getName().equals(fragmentName);
+    }
 }
diff --git a/samples/Support7Demos/Android.mk b/samples/Support7Demos/Android.mk
index ca8310f..0d2fadb 100644
--- a/samples/Support7Demos/Android.mk
+++ b/samples/Support7Demos/Android.mk
@@ -27,13 +27,16 @@
         android-support-v7-appcompat \
         android-support-v7-gridlayout \
         android-support-v7-mediarouter \
-        android-support-v7-recyclerview
+        android-support-v7-palette \
+        android-support-v7-recyclerview \
+        android-support-v7-cardview
 LOCAL_RESOURCE_DIR = \
         $(LOCAL_PATH)/res \
         frameworks/support/v7/appcompat/res \
         frameworks/support/v7/gridlayout/res \
-        frameworks/support/v7/mediarouter/res
+        frameworks/support/v7/mediarouter/res \
+        frameworks/support/v7/cardview/res
 LOCAL_AAPT_FLAGS := \
         --auto-add-overlay \
-        --extra-packages android.support.v7.appcompat:android.support.v7.gridlayout:android.support.v7.mediarouter
+        --extra-packages android.support.v7.cardview:android.support.v7.appcompat:android.support.v7.gridlayout:android.support.v7.mediarouter
 include $(BUILD_PACKAGE)
diff --git a/samples/Support7Demos/AndroidManifest.xml b/samples/Support7Demos/AndroidManifest.xml
index 6f9b237..32c14ae 100644
--- a/samples/Support7Demos/AndroidManifest.xml
+++ b/samples/Support7Demos/AndroidManifest.xml
@@ -27,6 +27,9 @@
     <!-- Permission for SYSTEM_ALERT_WINDOW is only required for emulating
          remote display using system alert window. -->
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
+    <!-- Permission for READ_EXTERNAL_STORAGE is explicitly required for
+         reading images from the media store from API v19+. -->
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
 
     <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" />
 
@@ -201,5 +204,27 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".view.CardViewActivity"
+                  android:label="@string/card_view"
+                  android:theme="@style/Theme.AppCompat">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".graphics.PaletteActivity"
+                  android:label="@string/palette"
+                  android:theme="@style/Theme.AppCompat">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name=".graphics.PaletteDetailActivity"
+                  android:label="@string/palette"
+                  android:theme="@style/Theme.AppCompat" />
+
     </application>
 </manifest>
diff --git a/samples/Support7Demos/res/layout/activity_card_view.xml b/samples/Support7Demos/res/layout/activity_card_view.xml
new file mode 100644
index 0000000..f88daf7
--- /dev/null
+++ b/samples/Support7Demos/res/layout/activity_card_view.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              xmlns:card_view="http://schemas.android.com/apk/res-auto"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent"
+              android:background="#ffffffff"
+              android:orientation="vertical">
+    <RelativeLayout
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:orientation="vertical"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+        <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/radius_label"
+                android:layout_marginBottom="5dp"
+                android:text="@string/card_view_radius"/>
+        <SeekBar
+                android:id="@+id/corner_radius_seek_bar"
+                android:max="100"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_toRightOf="@id/radius_label"
+                android:layout_alignTop="@id/radius_label"/>
+        <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="5dp"
+                android:id="@+id/width_label"
+                android:text="@string/card_view_width"
+                android:layout_below="@id/radius_label"
+                android:layout_alignRight="@id/radius_label"/>
+        <SeekBar
+                android:id="@+id/width_seek_bar"
+                android:max="600"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_toRightOf="@id/width_label"
+                android:layout_alignTop="@id/width_label"/>
+        <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="5dp"
+                android:id="@+id/height_label"
+                android:text="@string/card_view_height"
+                android:layout_below="@id/width_label"
+                android:layout_alignRight="@id/width_label"/>
+        <SeekBar
+                android:id="@+id/height_seek_bar"
+                android:max="600"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_toRightOf="@id/height_label"
+                android:layout_alignTop="@id/height_label"/>
+
+    </RelativeLayout>
+    <android.support.v7.widget.CardView
+            android:id="@+id/card_view"
+            android:layout_gravity="center"
+            android:layout_width="200dp"
+            android:layout_height="200dp"
+            card_view:cardCornerRadius="4dp">
+        <TextView
+                android:id="@+id/info_text"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent" />
+    </android.support.v7.widget.CardView>
+</LinearLayout>
diff --git a/samples/Support7Demos/res/layout/animated_recycler_view.xml b/samples/Support7Demos/res/layout/animated_recycler_view.xml
index 188a154..b719f1a 100644
--- a/samples/Support7Demos/res/layout/animated_recycler_view.xml
+++ b/samples/Support7Demos/res/layout/animated_recycler_view.xml
@@ -6,12 +6,33 @@
               android:layout_width="match_parent"
               android:layout_height="match_parent">
 
-    <CheckBox
-            android:id="@+id/enableAnimations"
-            android:checked="true"
-            android:text="@string/enableAnimations"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                  android:orientation="horizontal"
+                  android:layout_width="match_parent"
+                  android:layout_height="wrap_content">
+
+        <CheckBox
+                android:id="@+id/enableAnimations"
+                android:checked="true"
+                android:text="@string/enableAnimations"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"/>
+
+        <CheckBox
+                android:id="@+id/enablePredictiveAnimations"
+                android:checked="true"
+                android:text="@string/enablePredictiveAnimations"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"/>
+
+        <CheckBox
+                android:id="@+id/enableChangeAnimations"
+                android:checked="false"
+                android:text="@string/enableChangeAnimations"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"/>
+
+    </LinearLayout>
 
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                   android:orientation="horizontal"
diff --git a/samples/Support7Demos/res/layout/palette_activity_detail.xml b/samples/Support7Demos/res/layout/palette_activity_detail.xml
new file mode 100644
index 0000000..e59abce
--- /dev/null
+++ b/samples/Support7Demos/res/layout/palette_activity_detail.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout
+      xmlns:android="http://schemas.android.com/apk/res/android"
+      android:layout_width="match_parent"
+      android:layout_height="match_parent"
+      android:orientation="vertical">
+
+    <include layout="@layout/palette_list_item" />
+
+    <TextView
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"
+          android:text="@string/palette_all_colors"
+          style="?android:attr/listSeparatorTextViewStyle"/>
+
+    <GridView
+          android:id="@+id/palette"
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content"
+          android:layout_weight="1"
+          android:columnWidth="@dimen/color_palette_size"
+          android:numColumns="auto_fit"/>
+
+</LinearLayout>
diff --git a/samples/Support7Demos/res/layout/palette_grid_item.xml b/samples/Support7Demos/res/layout/palette_grid_item.xml
new file mode 100644
index 0000000..29e11eb
--- /dev/null
+++ b/samples/Support7Demos/res/layout/palette_grid_item.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+          android:layout_width="match_parent"
+          android:layout_height="@dimen/color_palette_size" />
\ No newline at end of file
diff --git a/samples/Support7Demos/res/layout/palette_list_item.xml b/samples/Support7Demos/res/layout/palette_list_item.xml
new file mode 100644
index 0000000..ea9fa7d
--- /dev/null
+++ b/samples/Support7Demos/res/layout/palette_list_item.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="110dp"
+    android:divider="?android:attr/dividerHorizontal"
+    android:orientation="horizontal"
+    android:showDividers="middle">
+
+    <ImageView
+        android:id="@+id/image"
+        android:layout_width="130dp"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:scaleType="fitCenter" />
+
+    <TextView
+        android:id="@+id/text_light_vibrant"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:textAppearance="?android:attr/textAppearanceInverse"
+        android:text="LV" />
+
+    <TextView
+        android:id="@+id/text_vibrant"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="V" />
+
+    <TextView
+        android:id="@+id/text_dark_vibrant"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="DV" />
+
+    <TextView
+        android:id="@+id/text_light_muted"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:textAppearance="?android:attr/textAppearanceInverse"
+        android:text="LM" />
+
+    <TextView
+        android:id="@+id/text_muted"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="M" />
+
+    <TextView
+        android:id="@+id/text_dark_muted"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_weight="1"
+        android:gravity="center"
+        android:text="DM" />
+
+</LinearLayout>
diff --git a/samples/Support7Demos/res/layout/selectable_item.xml b/samples/Support7Demos/res/layout/selectable_item.xml
index 65a23cc..3cab6fb 100644
--- a/samples/Support7Demos/res/layout/selectable_item.xml
+++ b/samples/Support7Demos/res/layout/selectable_item.xml
@@ -2,6 +2,7 @@
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:orientation="horizontal"
+              android:onClick="itemClicked"
               android:layout_width="match_parent"
               android:layout_height="match_parent">
 
@@ -11,9 +12,20 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"/>
 
-    <TextView
-            android:id="@+id/text"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"/>
+    <LinearLayout
+            android:orientation="vertical"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+        <TextView
+                android:id="@+id/text"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+
+        <TextView
+                android:id="@+id/expandedText"
+                android:visibility="gone"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"/>
+    </LinearLayout>
 
 </LinearLayout>
\ No newline at end of file
diff --git a/samples/Support7Demos/res/menu/sample_palette_actions.xml b/samples/Support7Demos/res/menu/sample_palette_actions.xml
new file mode 100644
index 0000000..5f98efd
--- /dev/null
+++ b/samples/Support7Demos/res/menu/sample_palette_actions.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+      xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <item
+        android:id="@+id/menu_num_colors"
+        android:title="Num Colors"
+        app:showAsAction="always">
+
+        <menu>
+
+            <group android:checkableBehavior="single">
+
+                <item
+                    android:id="@+id/menu_num_colors_8"
+                    android:title="8" />
+
+                <item
+                      android:id="@+id/menu_num_colors_12"
+                      android:title="12" />
+
+                <item
+                    android:id="@+id/menu_num_colors_16"
+                    android:title="16"
+                    android:checked="true" />
+
+                <item
+                    android:id="@+id/menu_num_colors_24"
+                    android:title="24" />
+
+                <item
+                    android:id="@+id/menu_num_colors_32"
+                    android:title="32" />
+
+            </group>
+
+        </menu>
+
+    </item>
+
+</menu>
\ No newline at end of file
diff --git a/samples/Support7Demos/res/values/dimens.xml b/samples/Support7Demos/res/values/dimens.xml
new file mode 100644
index 0000000..f952d18
--- /dev/null
+++ b/samples/Support7Demos/res/values/dimens.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+
+    <dimen name="color_palette_size">60dp</dimen>
+
+</resources>
diff --git a/samples/Support7Demos/res/values/strings.xml b/samples/Support7Demos/res/values/strings.xml
index 7e4e03c..3ae6be7 100644
--- a/samples/Support7Demos/res/values/strings.xml
+++ b/samples/Support7Demos/res/values/strings.xml
@@ -102,11 +102,21 @@
     <string name="checkbox_reverse">Rev.</string>
     <string name="checkbox_layout_dir">Layout Dir</string>
     <string name="checkbox_stack_from_end">Stack From End</string>
-    <string name="enableAnimations">Animate Changes</string>
+    <string name="enableAnimations">Animate</string>
+    <string name="enablePredictiveAnimations">Predictive</string>
+    <string name="enableChangeAnimations">Change Anims</string>
     <string name="add_item">Add</string>
-    <string name="delete_item">Delete</string>
+    <string name="delete_item">Del</string>
     <string name="add_delete_item">A+D</string>
     <string name="delete_add_item">D+A</string>
     <string name="d1a2d3">d1a2d3</string>
 
+    <string name="card_view">Card View</string>
+    <string name="card_view_radius">Radius</string>
+    <string name="card_view_width">Width</string>
+    <string name="card_view_height">Height</string>
+
+    <string name="palette">Palette</string>
+    <string name="palette_all_colors">Full color palette</string>
+
 </resources>
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/graphics/ImageLoader.java b/samples/Support7Demos/src/com/example/android/supportv7/graphics/ImageLoader.java
new file mode 100644
index 0000000..30a0aa2
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/graphics/ImageLoader.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.supportv7.graphics;
+
+import android.graphics.Bitmap;
+import android.os.AsyncTask;
+import android.provider.MediaStore;
+import android.support.v4.graphics.BitmapCompat;
+import android.support.v4.os.AsyncTaskCompat;
+import android.support.v4.util.LruCache;
+import android.widget.ImageView;
+
+/**
+ * A very naive lazily implemented image loader. Do not use this in production code.
+ */
+class ImageLoader {
+
+    /**
+     * A LruCache used to store images which has a maximum size of 10% of the maximum heap size.
+     */
+    private static final BitmapCache CACHE = new BitmapCache(
+            Math.round(Runtime.getRuntime().maxMemory() / 10));
+
+    private ImageLoader() {
+    }
+
+    interface Listener {
+        void onImageLoaded(Bitmap bitmap);
+    }
+
+    static void loadMediaStoreThumbnail(final ImageView imageView,
+            final long id,
+            final Listener listener) {
+
+        final Bitmap cachedValue = CACHE.get(id);
+        if (cachedValue != null) {
+            // If the image is already in the cache, display the image,
+            // call the listener now and return
+            imageView.setImageBitmap(cachedValue);
+            if (listener != null) {
+                listener.onImageLoaded(cachedValue);
+            }
+            return;
+        }
+
+        AsyncTaskCompat.executeParallel(new AsyncTask<Void, Void, Bitmap>() {
+            @Override
+            protected Bitmap doInBackground(Void... params) {
+                return MediaStore.Images.Thumbnails.getThumbnail(
+                        imageView.getContext().getContentResolver(),
+                        id,
+                        MediaStore.Images.Thumbnails.MINI_KIND,
+                        null);
+            }
+
+            @Override
+            protected void onPostExecute(Bitmap bitmap) {
+                imageView.setImageBitmap(bitmap);
+
+                if (bitmap != null) {
+                    // Add the image to the memory cache first
+                    CACHE.put(id, bitmap);
+
+                    if (listener != null) {
+                        listener.onImageLoaded(bitmap);
+                    }
+                }
+            }
+        });
+    }
+
+    /**
+     * A simple cache implementation for {@link android.graphics.Bitmap} instances which uses
+     * {@link android.support.v4.util.LruCache}.
+     */
+    private static class BitmapCache extends LruCache<Long, Bitmap> {
+        BitmapCache(int maxSize) {
+            super(maxSize);
+        }
+
+        @Override
+        protected int sizeOf(Long key, Bitmap value) {
+            return BitmapCompat.getAllocationByteCount(value);
+        }
+    }
+
+}
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteActivity.java
new file mode 100644
index 0000000..9f33f28
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteActivity.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.supportv7.graphics;
+
+import com.example.android.supportv7.R;
+
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.Bundle;
+import android.provider.MediaStore;
+import android.support.v4.app.ListFragment;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.CursorLoader;
+import android.support.v4.content.Loader;
+import android.support.v4.widget.ResourceCursorAdapter;
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.graphics.Palette;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.ListView;
+
+/**
+ * Activity which displays the images from the device's {@link MediaStore}, alongside the generated
+ * {@link android.support.v7.graphics.Palette} results.
+ *
+ * Allows the customization of the number of colors used in the palette generation, to demonstrate
+ * the difference in results for different types of images.
+ */
+public class PaletteActivity extends ActionBarActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        getSupportFragmentManager()
+                .beginTransaction()
+                .replace(android.R.id.content, new PaletteMediaStoreListFragment())
+                .commit();
+    }
+
+    /**
+     * The {@link android.support.v4.app.ListFragment} which does all of the hard work.
+     */
+    public static class PaletteMediaStoreListFragment extends ListFragment
+            implements LoaderManager.LoaderCallbacks<Cursor> {
+
+        /**
+         * Projection used for querying the {@link android.provider.MediaStore}.
+         */
+        static final String[] PROJECTION = {
+                MediaStore.Images.ImageColumns._ID,
+                MediaStore.Images.ImageColumns.DATE_ADDED
+        };
+
+        private PhotosCursorAdapter mAdapter;
+
+        @Override
+        public void onCreate(Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+            setHasOptionsMenu(true);
+        }
+
+        @Override
+        public void onViewCreated(View view, Bundle savedInstanceState) {
+            super.onViewCreated(view, savedInstanceState);
+
+            // Enable fast scroll to make it easier to navigate large number of images
+            getListView().setFastScrollEnabled(true);
+        }
+
+        @Override
+        public void onActivityCreated(Bundle savedInstanceState) {
+            super.onActivityCreated(savedInstanceState);
+
+            // Create an Adapter and use a new Adapter
+            mAdapter = new PhotosCursorAdapter(getActivity(), null);
+            mAdapter.setNumColors(16);
+            setListAdapter(mAdapter);
+
+            // Start the loader manager to create our CursorLoader
+            getLoaderManager().initLoader(0, null, this);
+        }
+
+        @Override
+        public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+            inflater.inflate(R.menu.sample_palette_actions, menu);
+        }
+
+        @Override
+        public boolean onOptionsItemSelected(MenuItem item) {
+            switch (item.getItemId()) {
+                case R.id.menu_num_colors_8:
+                    mAdapter.setNumColors(8);
+                    item.setChecked(true);
+                    return true;
+                case R.id.menu_num_colors_12:
+                    mAdapter.setNumColors(12);
+                    item.setChecked(true);
+                    return true;
+                case R.id.menu_num_colors_16:
+                    mAdapter.setNumColors(16);
+                    item.setChecked(true);
+                    return true;
+                case R.id.menu_num_colors_24:
+                    mAdapter.setNumColors(24);
+                    item.setChecked(true);
+                    return true;
+                case R.id.menu_num_colors_32:
+                    mAdapter.setNumColors(32);
+                    item.setChecked(true);
+                    return true;
+            }
+
+            return super.onOptionsItemSelected(item);
+        }
+
+        @Override
+        public void onListItemClick(ListView l, View v, int position, long id) {
+            final Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI.buildUpon()
+                    .appendEncodedPath(String.valueOf(id)).build();
+
+            // Start the Detail Activity
+            Intent intent = new Intent(getActivity(), PaletteDetailActivity.class);
+            intent.setData(uri);
+            startActivity(intent);
+        }
+
+        @Override
+        public Loader<Cursor> onCreateLoader(int id, Bundle bundle) {
+            return new CursorLoader(
+                    getActivity(),
+                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
+                    PROJECTION,
+                    null,
+                    null,
+                    MediaStore.Images.ImageColumns.DATE_ADDED + " DESC");
+        }
+
+        @Override
+        public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
+            mAdapter.swapCursor(cursor);
+        }
+
+        @Override
+        public void onLoaderReset(Loader<Cursor> cursorLoader) {
+            mAdapter.swapCursor(null);
+        }
+
+        private static class PhotosCursorAdapter extends ResourceCursorAdapter {
+
+            private int mNumColors;
+
+            public PhotosCursorAdapter(Context context, Cursor c) {
+                super(context, R.layout.palette_list_item, c, false);
+                mContext = context;
+            }
+
+            /**
+             * Set the number of colors used for {@link Palette} generation.
+             */
+            void setNumColors(int numColors) {
+                mNumColors = numColors;
+                notifyDataSetChanged();
+            }
+
+            @Override
+            public void bindView(final View view, Context context, Cursor cursor) {
+                // Let's reset the view, clearing the ImageView and resetting the background colors
+                // of the Palette UI
+                ImageView imageView = (ImageView) view.findViewById(R.id.image);
+                imageView.setImageDrawable(null);
+
+                view.findViewById(R.id.text_vibrant).setBackgroundDrawable(null);
+                view.findViewById(R.id.text_muted).setBackgroundDrawable(null);
+                view.findViewById(R.id.text_light_vibrant).setBackgroundDrawable(null);
+                view.findViewById(R.id.text_light_muted).setBackgroundDrawable(null);
+                view.findViewById(R.id.text_dark_vibrant).setBackgroundDrawable(null);
+                view.findViewById(R.id.text_dark_muted).setBackgroundDrawable(null);
+
+                final long id = cursor.getLong(
+                        cursor.getColumnIndexOrThrow(MediaStore.Images.ImageColumns._ID));
+
+                ImageLoader.loadMediaStoreThumbnail(imageView, id, new ImageLoader.Listener() {
+                    @Override
+                    public void onImageLoaded(Bitmap bitmap) {
+                        Palette.generateAsync(bitmap, mNumColors,
+                                new Palette.PaletteAsyncListener() {
+                                    @Override
+                                    public void onGenerated(Palette palette) {
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_vibrant),
+                                                palette.getVibrantSwatch());
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_muted),
+                                                palette.getMutedSwatch());
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_light_vibrant),
+                                                palette.getLightVibrantSwatch());
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_light_muted),
+                                                palette.getLightMutedSwatch());
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_dark_vibrant),
+                                                palette.getDarkVibrantSwatch());
+                                        setBackgroundColor(
+                                                view.findViewById(R.id.text_dark_muted),
+                                                palette.getDarkMutedSwatch());
+                                    }
+                                });
+                    }
+                });
+            }
+        }
+
+        static void setBackgroundColor(View view, Palette.Swatch swatch) {
+            if (view != null && swatch != null) {
+                view.setBackgroundColor(swatch.getRgb());
+            }
+        }
+
+    }
+
+}
\ No newline at end of file
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteDetailActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteDetailActivity.java
new file mode 100644
index 0000000..a91257f
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/graphics/PaletteDetailActivity.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.supportv7.graphics;
+
+import com.example.android.supportv7.R;
+import android.graphics.Bitmap;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.v7.app.ActionBarActivity;
+import android.support.v7.graphics.Palette;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.BaseAdapter;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import java.util.List;
+
+/**
+ * Activity which displays the more details about a generated {@link Palette} for a specific
+ * {@link android.provider.MediaStore} image.
+ *
+ * Displays the full generated palette of colors in a grid, which allows clicking on an palette item
+ * to display more information in a {@link Toast}.
+ *
+ * Also allows the customization of the number of colors used in the palette generation for
+ * demonstration purposes.
+ */
+public class PaletteDetailActivity extends ActionBarActivity {
+
+    private ImageView mImageView;
+    private GridView mGridView;
+    private SwatchesPalette mSwatchesPalette;
+
+    private Uri mImageUri;
+
+    private Toast mCurrentToast;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.palette_activity_detail);
+
+        mImageUri = getIntent().getData();
+
+        mImageView = (ImageView) findViewById(R.id.image);
+        mGridView = (GridView) findViewById(R.id.palette);
+        mSwatchesPalette = new SwatchesPalette();
+        mGridView.setAdapter(mSwatchesPalette);
+
+        // Set an OnItemClickListener to display a information Toast when a Palette item is clicked
+        mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+            @Override
+            public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) {
+                // Cancel the current Toast if there is already one being displayed
+                if (mCurrentToast != null) {
+                    mCurrentToast.cancel();
+                }
+
+                final Palette.Swatch item = (Palette.Swatch) adapterView.getItemAtPosition(pos);
+                mCurrentToast = Toast.makeText(PaletteDetailActivity.this,
+                        item.toString(), Toast.LENGTH_LONG);
+                mCurrentToast.show();
+            }
+        });
+
+        // Load the image with a default number of colors
+        loadImage(16);
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.sample_palette_actions, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case R.id.menu_num_colors_8:
+                loadImage(8);
+                item.setChecked(true);
+                return true;
+            case R.id.menu_num_colors_12:
+                loadImage(12);
+                item.setChecked(true);
+                return true;
+            case R.id.menu_num_colors_16:
+                loadImage(16);
+                item.setChecked(true);
+                return true;
+            case R.id.menu_num_colors_24:
+                loadImage(24);
+                item.setChecked(true);
+                return true;
+            case R.id.menu_num_colors_32:
+                loadImage(32);
+                item.setChecked(true);
+                return true;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    private void loadImage(final int numColors) {
+        final int id = Integer.parseInt(mImageUri.getLastPathSegment());
+
+        ImageLoader.loadMediaStoreThumbnail(mImageView, id, new ImageLoader.Listener() {
+            @Override
+            public void onImageLoaded(Bitmap bitmap) {
+                Palette.generateAsync(bitmap, numColors, new Palette.PaletteAsyncListener() {
+                    @Override
+                    public void onGenerated(Palette palette) {
+                        populatePalette(palette);
+                    }
+                });
+            }
+        });
+    }
+
+    private class SwatchesPalette extends BaseAdapter {
+
+        private List<Palette.Swatch> mSwatches;
+
+        @Override
+        public int getCount() {
+            return mSwatches != null ? mSwatches.size() : 0;
+        }
+
+        @Override
+        public Palette.Swatch getItem(int position) {
+            return mSwatches.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        void setSwatches(List<Palette.Swatch> palette) {
+            mSwatches = palette;
+            notifyDataSetChanged();
+        }
+
+        @Override
+        public View getView(int position, View view, ViewGroup parent) {
+            if (view == null) {
+                view = getLayoutInflater().inflate(R.layout.palette_grid_item, parent, false);
+            }
+            setBackgroundColor(view, getItem(position));
+            return view;
+        }
+    }
+
+    private void populatePalette(Palette palette) {
+        mSwatchesPalette.setSwatches(palette.getSwatches());
+
+        setBackgroundColor(findViewById(R.id.text_vibrant), palette.getVibrantSwatch());
+        setBackgroundColor(findViewById(R.id.text_muted), palette.getMutedSwatch());
+        setBackgroundColor(findViewById(R.id.text_light_vibrant), palette.getLightVibrantSwatch());
+        setBackgroundColor(findViewById(R.id.text_light_muted), palette.getLightMutedSwatch());
+        setBackgroundColor(findViewById(R.id.text_dark_vibrant), palette.getDarkVibrantSwatch());
+        setBackgroundColor(findViewById(R.id.text_dark_muted), palette.getDarkMutedSwatch());
+    }
+
+    private void setBackgroundColor(View view, Palette.Swatch swatch) {
+        if (view != null && swatch != null) {
+            view.setBackgroundColor(swatch.getRgb());
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/view/CardViewActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/view/CardViewActivity.java
new file mode 100644
index 0000000..e680aaa
--- /dev/null
+++ b/samples/Support7Demos/src/com/example/android/supportv7/view/CardViewActivity.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.supportv7.view;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.os.Handler;
+import android.support.v7.widget.CardView;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.SeekBar;
+import android.widget.TextView;
+import com.example.android.supportv7.R;
+
+public class CardViewActivity extends Activity {
+
+    CardView mCardView;
+
+    TextView mInfoText;
+
+    SeekBar mCornerRadiusSeekBar;
+
+    SeekBar mWidthSeekBar;
+
+    SeekBar mHeightSeekBar;
+
+    private SeekBar.OnSeekBarChangeListener mOnSeekBarChangedListener
+            = new SeekBar.OnSeekBarChangeListener() {
+        @Override
+        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+            update();
+        }
+
+        @Override
+        public void onStartTrackingTouch(SeekBar seekBar) {
+
+        }
+
+        @Override
+        public void onStopTrackingTouch(SeekBar seekBar) {
+
+        }
+    };
+
+    private void update() {
+        mCardView.setRadius(mCornerRadiusSeekBar.getProgress());
+        LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mCardView.getLayoutParams();
+        lp.width = mWidthSeekBar.getProgress();
+        lp.height = mHeightSeekBar.getProgress();
+        mCardView.setLayoutParams(lp);
+        mInfoText.setText("radius : " + mCornerRadiusSeekBar.getProgress()
+                + "\n w:" + lp.width + "\nh:" + lp.height);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_card_view);
+        mInfoText = (TextView) findViewById(R.id.info_text);
+        mCardView = (CardView) findViewById(R.id.card_view);
+        mCornerRadiusSeekBar = (SeekBar) findViewById(R.id.corner_radius_seek_bar);
+        mCornerRadiusSeekBar.setProgress((int) mCardView.getRadius());
+        mCornerRadiusSeekBar.setOnSeekBarChangeListener(mOnSeekBarChangedListener);
+
+        mWidthSeekBar = (SeekBar) findViewById(R.id.width_seek_bar);
+        mWidthSeekBar.setProgress(mCardView.getLayoutParams().width);
+
+        mWidthSeekBar.setOnSeekBarChangeListener(mOnSeekBarChangedListener);
+
+        mHeightSeekBar = (SeekBar) findViewById(R.id.height_seek_bar);
+        mHeightSeekBar.setProgress(mCardView.getLayoutParams().height);
+        mHeightSeekBar.setOnSeekBarChangeListener(mOnSeekBarChangedListener);
+
+        update();
+        new Handler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                View content = findViewById(android.R.id.content);
+                mWidthSeekBar.setMax(content.getWidth());
+                mHeightSeekBar.setMax(content.getHeight());
+            }
+        }, 100);
+    }
+
+}
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java
index 83cf4d3..1125685 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/AnimatedRecyclerView.java
@@ -15,6 +15,7 @@
  */
 package com.example.android.supportv7.widget;
 
+import android.support.v4.util.ArrayMap;
 import android.widget.CompoundButton;
 import com.example.android.supportv7.R;
 import android.app.Activity;
@@ -45,9 +46,9 @@
     ArrayList<String> mItems = new ArrayList<String>();
     MyAdapter mAdapter;
 
-    static final boolean USE_CUSTOM_ANIMATIONS = false;
-
     boolean mAnimationsEnabled = true;
+    boolean mPredictiveAnimationsEnabled = true;
+    RecyclerView.ItemAnimator mCachedAnimator = null;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -56,6 +57,7 @@
 
         ViewGroup container = (ViewGroup) findViewById(R.id.container);
         mRecyclerView = new RecyclerView(this);
+        mCachedAnimator = mRecyclerView.getItemAnimator();
         mRecyclerView.setLayoutManager(new MyLayoutManager(this));
         mRecyclerView.setHasFixedSize(true);
         mRecyclerView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
@@ -71,9 +73,32 @@
         enableAnimations.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                if (isChecked && mRecyclerView.getItemAnimator() == null) {
+                    mRecyclerView.setItemAnimator(mCachedAnimator);
+                } else if (!isChecked && mRecyclerView.getItemAnimator() != null) {
+                    mRecyclerView.setItemAnimator(null);
+                }
                 mAnimationsEnabled = isChecked;
             }
         });
+
+        CheckBox enablePredictiveAnimations =
+                (CheckBox) findViewById(R.id.enablePredictiveAnimations);
+        enablePredictiveAnimations.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                mPredictiveAnimationsEnabled = isChecked;
+            }
+        });
+
+        CheckBox enableChangeAnimations =
+                (CheckBox) findViewById(R.id.enableChangeAnimations);
+        enableChangeAnimations.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                mCachedAnimator.setSupportsChangeAnimations(isChecked);
+            }
+        });
     }
 
     @Override
@@ -96,6 +121,13 @@
         mAdapter.selectItem(holder, selected);
     }
 
+    public void itemClicked(View view) {
+        ViewGroup parent = (ViewGroup) view;
+        MyViewHolder holder = (MyViewHolder) mRecyclerView.getChildViewHolder(parent);
+        mAdapter.toggleExpanded(holder);
+        mAdapter.notifyItemChanged(holder.getPosition());
+    }
+
     public void deleteItem(View view) {
         int numItems = mItems.size();
         if (numItems > 0) {
@@ -127,6 +159,7 @@
     private void addAtPosition(int position, String text) {
         mItems.add(position, text);
         mAdapter.mSelected.put(text, Boolean.FALSE);
+        mAdapter.mExpanded.put(text, Boolean.FALSE);
         mAdapter.notifyItemInserted(position);
     }
 
@@ -158,8 +191,8 @@
         }
 
         @Override
-        public boolean supportsItemAnimations() {
-            return mAnimationsEnabled;
+        public boolean supportsPredictiveItemAnimations() {
+            return mPredictiveAnimationsEnabled;
         }
 
         @Override
@@ -186,44 +219,46 @@
                 View v = recycler.getViewForPosition(mFirstPosition + i);
 
                 RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) v.getLayoutParams();
-                if (!params.isItemRemoved()) {
+                if (!mPredictiveAnimationsEnabled || !params.isItemRemoved()) {
                     addView(v);
                 }
                 measureChild(v, 0, 0);
                 bottom = top + v.getMeasuredHeight();
                 v.layout(left, top, right, bottom);
-                if (params.isItemRemoved()) {
+                if (mPredictiveAnimationsEnabled && params.isItemRemoved()) {
                     parentBottom += v.getHeight();
                 }
             }
 
-            // Now that we've run a full layout, figure out which views were not used
-            // (cached in previousViews). For each of these views, position it where
-            // it would go, according to its position relative to the visible
-            // positions in the list. This information will be used by RecyclerView to
-            // record post-layout positions of these items for the purposes of animating them
-            // out of view
+            if (mAnimationsEnabled && mPredictiveAnimationsEnabled) {
+                // Now that we've run a full layout, figure out which views were not used
+                // (cached in previousViews). For each of these views, position it where
+                // it would go, according to its position relative to the visible
+                // positions in the list. This information will be used by RecyclerView to
+                // record post-layout positions of these items for the purposes of animating them
+                // out of view
 
-            View lastVisibleView = getChildAt(getChildCount() - 1);
-            if (lastVisibleView != null) {
-                RecyclerView.LayoutParams lastParams =
-                        (RecyclerView.LayoutParams) lastVisibleView.getLayoutParams();
-                int lastPosition = lastParams.getViewPosition();
-                final List<RecyclerView.ViewHolder> previousViews = recycler.getScrapList();
-                count = previousViews.size();
-                for (int i = 0; i < count; ++i) {
-                    View view = previousViews.get(i).itemView;
-                    RecyclerView.LayoutParams params =
-                            (RecyclerView.LayoutParams) view.getLayoutParams();
-                    int position = params.getViewPosition();
-                    int newTop;
-                    if (position < mFirstPosition) {
-                        newTop = view.getHeight() * (position - mFirstPosition);
-                    } else {
-                        newTop = lastVisibleView.getTop() + view.getHeight() *
-                                (position - lastPosition);
+                View lastVisibleView = getChildAt(getChildCount() - 1);
+                if (lastVisibleView != null) {
+                    RecyclerView.LayoutParams lastParams =
+                            (RecyclerView.LayoutParams) lastVisibleView.getLayoutParams();
+                    int lastPosition = lastParams.getViewPosition();
+                    final List<RecyclerView.ViewHolder> previousViews = recycler.getScrapList();
+                    count = previousViews.size();
+                    for (int i = 0; i < count; ++i) {
+                        View view = previousViews.get(i).itemView;
+                        RecyclerView.LayoutParams params =
+                                (RecyclerView.LayoutParams) view.getLayoutParams();
+                        int position = params.getViewPosition();
+                        int newTop;
+                        if (position < mFirstPosition) {
+                            newTop = view.getHeight() * (position - mFirstPosition);
+                        } else {
+                            newTop = lastVisibleView.getTop() + view.getHeight() *
+                                    (position - lastPosition);
+                        }
+                        view.offsetTopAndBottom(newTop - view.getTop());
                     }
-                    view.offsetTopAndBottom(newTop - view.getTop());
                 }
             }
         }
@@ -276,7 +311,7 @@
                     final int scrollBy = -Math.min(dy - scrolled, hangingBottom);
                     scrolled -= scrollBy;
                     offsetChildrenVertical(scrollBy);
-                    if (scrolled < dy && getItemCount() > mFirstPosition + getChildCount()) {
+                    if (scrolled < dy && state.getItemCount() > mFirstPosition + getChildCount()) {
                         View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
                         final int top = getChildAt(getChildCount() - 1).getBottom();
                         addView(v);
@@ -322,7 +357,7 @@
                 }
             }
             if (direction == View.FOCUS_DOWN || direction == View.FOCUS_FORWARD) {
-                while (mFirstPosition + getChildCount() < getItemCount() &&
+                while (mFirstPosition + getChildCount() < state.getItemCount() &&
                         newViewsHeight < mScrollDistance) {
                     View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
                     final int top = getChildAt(getChildCount() - 1).getBottom();
@@ -389,7 +424,8 @@
     class MyAdapter extends RecyclerView.Adapter {
         private int mBackground;
         List<String> mData;
-        HashMap<String, Boolean> mSelected = new HashMap<String, Boolean>();
+        ArrayMap<String, Boolean> mSelected = new ArrayMap<String, Boolean>();
+        ArrayMap<String, Boolean> mExpanded = new ArrayMap<String, Boolean>();
 
         public MyAdapter(List<String> data) {
             TypedValue val = new TypedValue();
@@ -399,6 +435,7 @@
             mData = data;
             for (String itemText : mData) {
                 mSelected.put(itemText, Boolean.FALSE);
+                mExpanded.put(itemText, Boolean.FALSE);
             }
         }
 
@@ -416,11 +453,20 @@
         public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
             String itemText = mData.get(position);
             ((MyViewHolder) holder).textView.setText(itemText);
+            ((MyViewHolder) holder).expandedText.setText("More text for the expanded version");
             boolean selected = false;
             if (mSelected.get(itemText) != null) {
                 selected = mSelected.get(itemText);
             }
             ((MyViewHolder) holder).checkBox.setChecked(selected);
+            Boolean expanded = mExpanded.get(itemText);
+            if (expanded != null && expanded) {
+                ((MyViewHolder) holder).expandedText.setVisibility(View.VISIBLE);
+                ((MyViewHolder) holder).textView.setVisibility(View.GONE);
+            } else {
+                ((MyViewHolder) holder).expandedText.setVisibility(View.GONE);
+                ((MyViewHolder) holder).textView.setVisibility(View.VISIBLE);
+            }
         }
 
         @Override
@@ -435,14 +481,21 @@
         public void selectItem(MyViewHolder holder, boolean selected) {
             mSelected.put((String) holder.textView.getText(), selected);
         }
+
+        public void toggleExpanded(MyViewHolder holder) {
+            String text = (String) holder.textView.getText();
+            mExpanded.put(text, !mExpanded.get(text));
+        }
     }
 
     static class MyViewHolder extends RecyclerView.ViewHolder {
+        public TextView expandedText;
         public TextView textView;
         public CheckBox checkBox;
 
         public MyViewHolder(View v) {
             super(v);
+            expandedText = (TextView) v.findViewById(R.id.expandedText);
             textView = (TextView) v.findViewById(R.id.text);
             checkBox = (CheckBox) v.findViewById(R.id.selected);
         }
@@ -451,4 +504,5 @@
         public String toString() {
             return super.toString() + " \"" + textView.getText() + "\"";
         }
-    }}
+    }
+}
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
index baecf86..747992b 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/RecyclerViewActivity.java
@@ -176,7 +176,7 @@
                     final int scrollBy = -Math.min(dy - scrolled, hangingBottom);
                     scrolled -= scrollBy;
                     offsetChildrenVertical(scrollBy);
-                    if (scrolled < dy && getItemCount() > mFirstPosition + getChildCount()) {
+                    if (scrolled < dy && state.getItemCount() > mFirstPosition + getChildCount()) {
                         View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
                         final int top = getDecoratedBottom(getChildAt(getChildCount() - 1));
                         addView(v);
@@ -222,7 +222,7 @@
                 }
             }
             if (direction == View.FOCUS_DOWN || direction == View.FOCUS_FORWARD) {
-                while (mFirstPosition + getChildCount() < getItemCount() &&
+                while (mFirstPosition + getChildCount() < state.getItemCount() &&
                         newViewsHeight < mScrollDistance) {
                     View v = recycler.getViewForPosition(mFirstPosition + getChildCount());
                     final int top = getDecoratedBottom(getChildAt(getChildCount() - 1));
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/widget/decorator/DividerItemDecoration.java b/samples/Support7Demos/src/com/example/android/supportv7/widget/decorator/DividerItemDecoration.java
index 4d5d208..4386f4f 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/widget/decorator/DividerItemDecoration.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/widget/decorator/DividerItemDecoration.java
@@ -21,6 +21,7 @@
 import android.graphics.Canvas;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
+import android.support.v4.view.ViewCompat;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
@@ -71,7 +72,8 @@
             final View child = parent.getChildAt(i);
             final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
                     .getLayoutParams();
-            final int top = child.getBottom() + params.bottomMargin;
+            final int top = child.getBottom() + params.bottomMargin +
+                    Math.round(ViewCompat.getTranslationY(child));
             final int bottom = top + mDivider.getIntrinsicHeight();
             mDivider.setBounds(left, top, right, bottom);
             mDivider.draw(c);
@@ -87,7 +89,8 @@
             final View child = parent.getChildAt(i);
             final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
                     .getLayoutParams();
-            final int left = child.getRight() + params.rightMargin;
+            final int left = child.getRight() + params.rightMargin +
+                    Math.round(ViewCompat.getTranslationX(child));
             final int right = left + mDivider.getIntrinsicHeight();
             mDivider.setBounds(left, top, right, bottom);
             mDivider.draw(c);
diff --git a/samples/SupportLeanbackDemos/AndroidManifest.xml b/samples/SupportLeanbackDemos/AndroidManifest.xml
index ee0707d..b02e3bf 100644
--- a/samples/SupportLeanbackDemos/AndroidManifest.xml
+++ b/samples/SupportLeanbackDemos/AndroidManifest.xml
@@ -6,10 +6,13 @@
 
     <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="19" />
 
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+
     <application
         android:label="@string/app_name"
         android:icon="@drawable/ic_launcher"
-        android:theme="@style/Theme.Leanback">
+        android:banner="@drawable/ic_launcher"
+        android:theme="@style/Theme.Example.Leanback">
 
         <activity android:name="MainActivity"
             android:label="@string/app_name">
@@ -19,14 +22,24 @@
             </intent-filter>
         </activity>
 
+        <activity android:name="BrowseAnimationActivity"
+            android:exported="true" >
+        </activity>
+
         <activity android:name="DetailsActivity"
             android:exported="true" />
 
+        <activity android:name="PlaybackOverlayActivity"
+            android:exported="true" />
+
         <activity android:name="VerticalGridActivity"
             android:exported="true" />
 
         <activity android:name="SearchActivity"
             android:exported="true" />
 
+        <activity android:name="BrowseErrorActivity"
+                  android:exported="true" />
+
     </application>
 </manifest>
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_1.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_1.jpg
new file mode 100644
index 0000000..a2581fe
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_1.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_2.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_2.jpg
new file mode 100644
index 0000000..82ba3a8
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_2.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_3.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_3.jpg
new file mode 100644
index 0000000..2a83021
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_3.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_4.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_4.jpg
new file mode 100644
index 0000000..70a1c55
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_4.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_5.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_5.jpg
new file mode 100644
index 0000000..dc3f677
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_5.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_6.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_6.jpg
new file mode 100644
index 0000000..2e113a0
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_6.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_7.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_7.jpg
new file mode 100644
index 0000000..bc30297
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_7.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/gallery_photo_8.jpg b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_8.jpg
new file mode 100644
index 0000000..dc3aa85
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/drawable/gallery_photo_8.jpg
Binary files differ
diff --git a/samples/SupportLeanbackDemos/res/drawable/text_bg.xml b/samples/SupportLeanbackDemos/res/drawable/text_bg.xml
index c67924c..2f5a213 100644
--- a/samples/SupportLeanbackDemos/res/drawable/text_bg.xml
+++ b/samples/SupportLeanbackDemos/res/drawable/text_bg.xml
@@ -26,4 +26,7 @@
         android:top="7dp"
         android:right="7dp"
         android:bottom="7dp" />
+    <size
+        android:height="160dp"
+        android:width="100dp" />
 </shape>
diff --git a/samples/SupportLeanbackDemos/res/layout/browse_animation.xml b/samples/SupportLeanbackDemos/res/layout/browse_animation.xml
new file mode 100644
index 0000000..7b00345
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/layout/browse_animation.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="com.example.android.leanback.BrowseAnimationFragment"
+    android:id="@+id/main_browse_fragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+/>
diff --git a/samples/SupportLeanbackDemos/res/layout/main.xml b/samples/SupportLeanbackDemos/res/layout/main.xml
index b6b08b3..367337a 100644
--- a/samples/SupportLeanbackDemos/res/layout/main.xml
+++ b/samples/SupportLeanbackDemos/res/layout/main.xml
@@ -15,9 +15,16 @@
      limitations under the License.
 -->
 
-<fragment xmlns:android="http://schemas.android.com/apk/res/android"
-    android:name="com.example.android.leanback.BrowseFragment"
-    android:id="@+id/main_browse_fragment"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/main_frame"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-/>
+    android:layout_height="match_parent">
+
+	<fragment
+	    android:name="com.example.android.leanback.BrowseFragment"
+	    android:id="@+id/main_browse_fragment"
+	    android:layout_width="match_parent"
+	    android:layout_height="match_parent"
+	/>
+
+</FrameLayout>
diff --git a/samples/SupportLeanbackDemos/res/layout/playback_controls.xml b/samples/SupportLeanbackDemos/res/layout/playback_controls.xml
new file mode 100644
index 0000000..357184c
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/layout/playback_controls.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<fragment xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="com.example.android.leanback.PlaybackOverlayFragment"
+    android:id="@+id/playback_controls_fragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+/>
diff --git a/samples/SupportLeanbackDemos/res/values/themes.xml b/samples/SupportLeanbackDemos/res/values/themes.xml
new file mode 100644
index 0000000..121e25c
--- /dev/null
+++ b/samples/SupportLeanbackDemos/res/values/themes.xml
@@ -0,0 +1,13 @@
+<resources>
+    <style name="Theme.Example.Leanback" parent="Theme.Leanback">
+<!-- uncomment to override default transition settings:
+        <item name="android:windowEnterTransition">@android:transition/fade</item>
+        <item name="android:windowExitTransition">@android:transition/fade</item>
+        <item name="android:windowSharedElementExitTransition">@android:transition/move</item>
+        <item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
+        <item name="android:windowAllowExitTransitionOverlap">true</item>
+        <item name="android:windowAllowEnterTransitionOverlap">false</item>
+        <item name="android:windowContentTransitions">true</item>
+ -->
+    </style>
+</resources>
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationActivity.java
new file mode 100644
index 0000000..42ce8a6
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationActivity.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class BrowseAnimationActivity extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.browse_animation);
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java
new file mode 100644
index 0000000..9b3a074
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseAnimationFragment.java
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v17.leanback.widget.ArrayObjectAdapter;
+import android.support.v17.leanback.widget.HeaderItem;
+import android.support.v17.leanback.widget.ListRow;
+import android.support.v17.leanback.widget.ListRowPresenter;
+import android.support.v17.leanback.widget.OnItemClickedListener;
+import android.support.v17.leanback.widget.Row;
+import android.util.Log;
+import android.view.View;
+
+import java.util.Random;
+
+public class BrowseAnimationFragment extends
+        android.support.v17.leanback.app.BrowseFragment {
+    private static final String TAG = "leanback.BrowseAnimationFragment";
+
+    private static final int NUM_ROWS = 10;
+    private ArrayObjectAdapter mRowsAdapter;
+    private static Random sRand = new Random();
+
+    static class Item {
+        final String mText;
+        final OnItemClickedListener mAction;
+
+        Item(String text, OnItemClickedListener action) {
+            mText = text;
+            mAction = action;
+        }
+
+        @Override
+        public String toString() {
+            return mText;
+        }
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log.i(TAG, "onCreate");
+        super.onCreate(savedInstanceState);
+
+        setBadgeDrawable(
+                getActivity().getResources().getDrawable(R.drawable.ic_title));
+        setTitle("Leanback Sample App");
+        setHeadersState(HEADERS_ENABLED);
+
+        setOnSearchClickedListener(new View.OnClickListener() {
+                @Override
+            public void onClick(View view) {
+                Intent intent = new Intent(getActivity(), SearchActivity.class);
+                startActivity(intent);
+            }
+        });
+
+        setupRows();
+        setOnItemClickedListener(new ItemClickedListener());
+    }
+
+    private void setupRows() {
+        ListRowPresenter lrp = new ListRowPresenter();
+        mRowsAdapter = new ArrayObjectAdapter(lrp);
+        for (int i = 0; i < NUM_ROWS; ++i) {
+            mRowsAdapter.add(
+                    createRandomRow(new HeaderItem(i, "Row " + i, null)));
+        }
+        setAdapter(mRowsAdapter);
+    }
+
+    Item createRandomItem() {
+        switch (sRand.nextInt(13)) {
+        default:
+        case 0:
+            return new Item("Remove Item before", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    int index = adapter.indexOf(item);
+                    if (index >= 0) {
+                        if (index > 0)
+                            index = 0;
+                        adapter.removeItems(index, 1);
+                    }
+                }
+            });
+        case 1:
+            return new Item("Remove Item after", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    int index = adapter.indexOf(item);
+                    if (index >= 0) {
+                        if (index < adapter.size() - 1)
+                            index++;
+                        adapter.removeItems(index, 1);
+                    }
+                }
+            });
+        case 2:
+            return new Item("Remove Item", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    int index = adapter.indexOf(item);
+                    if (index >= 0) {
+                        adapter.removeItems(index, 1);
+                    }
+                }
+            });
+        case 3:
+            return new Item("Remove all Items", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    adapter.clear();
+                }
+            });
+        case 4:
+            return new Item("add item before", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    int index = adapter.indexOf(item);
+                    if (index >= 0) {
+                        adapter.add(index, createRandomItem());
+                    }
+                }
+            });
+        case 5:
+            return new Item("add item after", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                            .getAdapter());
+                    int index = adapter.indexOf(item);
+                    if (index >= 0) {
+                        adapter.add(index + 1, createRandomItem());
+                    }
+                }
+            });
+        case 6:
+            return new Item("add random items before",
+                    new OnItemClickedListener() {
+                            @Override
+                        public void onItemClicked(Object item, Row row) {
+                            ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                                    .getAdapter());
+                            int index = adapter.indexOf(item);
+                            if (index >= 0) {
+                                int count = sRand.nextInt(4) + 1;
+                                for (int i = 0; i < count; i++) {
+                                    adapter.add(index + i, createRandomItem());
+                                }
+                            }
+                        }
+                    });
+        case 7:
+            return new Item("add random items after",
+                    new OnItemClickedListener() {
+                            @Override
+                        public void onItemClicked(Object item, Row row) {
+                            ArrayObjectAdapter adapter = ((ArrayObjectAdapter) ((ListRow) row)
+                                    .getAdapter());
+                            int index = adapter.indexOf(item);
+                            if (index >= 0) {
+                                int count = sRand.nextInt(4) + 1;
+                                for (int i = 0; i < count; i++) {
+                                    adapter.add(index + 1 + i,
+                                            createRandomItem());
+                                }
+                            }
+                        }
+                    });
+        case 8:
+            return new Item("add row before", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    int index = mRowsAdapter.indexOf(row);
+                    if (index >= 0) {
+                        int headerId = sRand.nextInt();
+                        mRowsAdapter.add(index, createRandomRow(new HeaderItem(
+                                headerId, "Row " + headerId, null)));
+                    }
+                }
+            });
+        case 9:
+            return new Item("add row after", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    int index = mRowsAdapter.indexOf(row);
+                    if (index >= 0) {
+                        int headerId = sRand.nextInt();
+                        mRowsAdapter.add(
+                                index + 1, createRandomRow(new HeaderItem(
+                                        headerId, "Row " + headerId, null)));
+                    }
+                }
+            });
+        case 10:
+            return new Item("delete row", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    mRowsAdapter.remove(row);
+                }
+            });
+        case 11:
+            return new Item("delete row before", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    int index = mRowsAdapter.indexOf(row);
+                    if (index > 0) {
+                        mRowsAdapter.removeItems(index - 1, 1);
+                    }
+                }
+            });
+        case 12:
+            return new Item("delete row after", new OnItemClickedListener() {
+                    @Override
+                public void onItemClicked(Object item, Row row) {
+                    int index = mRowsAdapter.indexOf(row);
+                    if (index < mRowsAdapter.size() - 1) {
+                        mRowsAdapter.removeItems(index + 1, 1);
+                    }
+                }
+            });
+        }
+    }
+
+    ListRow createRandomRow(HeaderItem header) {
+        ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(
+                new CardPresenter());
+        for (int i = 0; i < 8; i++) {
+            listRowAdapter.add(createRandomItem());
+        }
+        return new ListRow(header, listRowAdapter);
+    }
+
+    private final class ItemClickedListener implements OnItemClickedListener {
+        @Override
+        public void onItemClicked(Object item, Row row) {
+            ((Item) item).mAction.onItemClicked(item, row);
+        }
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java
new file mode 100644
index 0000000..a35ab5e
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseErrorActivity.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ProgressBar;
+
+public class BrowseErrorActivity extends Activity
+{
+    private ErrorFragment mErrorFragment;
+    private SpinnerFragment mSpinnerFragment;
+
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.main);
+
+        testError();
+    }
+
+    private void testError() {
+        mErrorFragment = new ErrorFragment();
+        getFragmentManager().beginTransaction().add(R.id.main_frame, mErrorFragment).commit();
+
+        mSpinnerFragment = new SpinnerFragment();
+        getFragmentManager().beginTransaction().add(R.id.main_frame, mSpinnerFragment).commit();
+
+        Handler handler = new Handler();
+        handler.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                getFragmentManager().beginTransaction().remove(mSpinnerFragment).commit();
+                mErrorFragment.setErrorContent(getResources());
+            }
+        }, 3000);
+    }
+
+    static public class SpinnerFragment extends Fragment {
+        @Override
+        public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                    Bundle savedInstanceState) {
+            ProgressBar progressBar = new ProgressBar(container.getContext());
+            if (container instanceof FrameLayout) {
+                FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(100, 100, Gravity.CENTER);
+                progressBar.setLayoutParams(layoutParams);
+            }
+            return progressBar;
+        }
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
index 2345ed0..87c7506 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/BrowseFragment.java
@@ -15,19 +15,24 @@
 
 import android.content.Intent;
 import android.os.Bundle;
+import android.support.v4.app.ActivityOptionsCompat;
 import android.support.v17.leanback.widget.ArrayObjectAdapter;
 import android.support.v17.leanback.widget.HeaderItem;
+import android.support.v17.leanback.widget.ImageCardView;
 import android.support.v17.leanback.widget.ListRow;
 import android.support.v17.leanback.widget.ListRowPresenter;
-import android.support.v17.leanback.widget.OnItemClickedListener;
+import android.support.v17.leanback.widget.OnItemViewClickedListener;
+import android.support.v17.leanback.widget.Presenter;
 import android.support.v17.leanback.widget.Row;
+import android.support.v17.leanback.widget.RowPresenter;
 import android.util.Log;
 import android.view.View;
+import android.view.ViewGroup;
 
 public class BrowseFragment extends android.support.v17.leanback.app.BrowseFragment {
     private static final String TAG = "leanback.BrowseFragment";
 
-    private static final int NUM_ROWS = 3;
+    private static final int NUM_ROWS = 10;
     private ArrayObjectAdapter mRowsAdapter;
 
     @Override
@@ -35,11 +40,9 @@
         Log.i(TAG, "onCreate");
         super.onCreate(savedInstanceState);
 
-        Params p = new Params();
-        p.setBadgeImage(getActivity().getResources().getDrawable(R.drawable.ic_title));
-        p.setTitle("Leanback Sample App");
-        p.setHeadersState(HEADERS_ENABLED);
-        setBrowseParams(p);
+        setBadgeDrawable(getActivity().getResources().getDrawable(R.drawable.ic_title));
+        setTitle("Leanback Sample App");
+        setHeadersState(HEADERS_ENABLED);
 
         setOnSearchClickedListener(new View.OnClickListener() {
             @Override
@@ -50,16 +53,30 @@
         });
 
         setupRows();
-        setOnItemClickedListener(new ItemClickedListener());
+        setOnItemViewClickedListener(new ItemViewClickedListener());
     }
 
     private void setupRows() {
-        mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
+        ListRowPresenter lrp = new ListRowPresenter();
+        lrp.setRowHeight(CardPresenter.getRowHeight(getActivity()));
+        lrp.setExpandedRowHeight(CardPresenter.getExpandedRowHeight(getActivity()));
+
+        mRowsAdapter = new ArrayObjectAdapter(lrp);
+
+        // For good performance, it's important to use a single instance of
+        // a card presenter for all rows using that presenter.
+        final CardPresenter cardPresenter = new CardPresenter();
 
         for (int i = 0; i < NUM_ROWS; ++i) {
-            ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new CardPresenter());
-            listRowAdapter.add("Hello world");
-            listRowAdapter.add("This is a test");
+            ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(cardPresenter);
+            listRowAdapter.add(new PhotoItem("Hello world", R.drawable.gallery_photo_1));
+            listRowAdapter.add(new PhotoItem("This is a test", R.drawable.gallery_photo_2));
+            listRowAdapter.add(new PhotoItem("Android TV", R.drawable.gallery_photo_3));
+            listRowAdapter.add(new PhotoItem("Leanback", R.drawable.gallery_photo_4));
+            listRowAdapter.add(new PhotoItem("Hello world", R.drawable.gallery_photo_5));
+            listRowAdapter.add(new PhotoItem("This is a test", R.drawable.gallery_photo_6));
+            listRowAdapter.add(new PhotoItem("Android TV", R.drawable.gallery_photo_7));
+            listRowAdapter.add(new PhotoItem("Leanback", R.drawable.gallery_photo_8));
             HeaderItem header = new HeaderItem(i, "Row " + i, null);
             mRowsAdapter.add(new ListRow(header, listRowAdapter));
         }
@@ -67,12 +84,18 @@
         setAdapter(mRowsAdapter);
     }
 
-    private final class ItemClickedListener implements OnItemClickedListener {
-        public void onItemClicked(Object item, Row row) {
-            // TODO: use a fragment transaction instead of launching a new
-            // activity
+    private final class ItemViewClickedListener implements OnItemViewClickedListener {
+        @Override
+        public void onItemClicked(Presenter.ViewHolder itemViewHolder, Object item,
+                RowPresenter.ViewHolder rowViewHolder, Row row) {
             Intent intent = new Intent(getActivity(), DetailsActivity.class);
-            startActivity(intent);
+            intent.putExtra(DetailsActivity.EXTRA_ITEM, (PhotoItem) item);
+
+            Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(
+                    getActivity(),
+                    ((ImageCardView)itemViewHolder.view).getMainImageView(),
+                    DetailsActivity.SHARED_ELEMENT_NAME).toBundle();
+            getActivity().startActivity(intent, bundle);
         }
     }
 }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
index 502c77a..4c53342 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/CardPresenter.java
@@ -13,30 +13,71 @@
  */
 package com.example.android.leanback;
 
+import android.content.Context;
+import android.graphics.drawable.Drawable;
 import android.support.v17.leanback.widget.ImageCardView;
 import android.support.v17.leanback.widget.Presenter;
 import android.util.Log;
 import android.view.ViewGroup;
+import android.view.View.MeasureSpec;
+import android.view.ViewGroup.LayoutParams;
 import android.widget.TextView;
 
 public class CardPresenter extends Presenter {
     private static final String TAG = "CardPresenter";
 
+    private static final int IMAGE_HEIGHT_DP = 120;
+
+    private static int sRowHeight = 0;
+    private static int sExpandedRowHeight = 0;
+
+    private static void setupRowHeights(Context context) {
+        if (sRowHeight == 0) {
+            float density = context.getResources().getDisplayMetrics().density;
+            int height = (int) (IMAGE_HEIGHT_DP * density + 0.5f);
+
+            ImageCardView v = new ImageCardView(context);
+            v.setMainImageDimensions(LayoutParams.WRAP_CONTENT, height);
+            v.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
+            sRowHeight = v.getMeasuredHeight();
+            v.setActivated(true);
+            v.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
+            sExpandedRowHeight = v.getMeasuredHeight();
+        }
+    }
+
+    public static int getRowHeight(Context context) {
+        setupRowHeights(context);
+        return sRowHeight;
+    }
+
+    public static int getExpandedRowHeight(Context context) {
+        setupRowHeights(context);
+        return sExpandedRowHeight;
+    }
+
+    @Override
     public ViewHolder onCreateViewHolder(ViewGroup parent) {
         Log.d(TAG, "onCreateViewHolder");
         ImageCardView v = new ImageCardView(parent.getContext());
         v.setFocusable(true);
         v.setFocusableInTouchMode(true);
-        v.setMainImage(
-                parent.getContext().getResources().getDrawable(R.drawable.text_bg));
+        v.setMainImageAdjustViewBounds(true);
+        v.setMainImageDimensions(LayoutParams.WRAP_CONTENT, getRowHeight(parent.getContext()));
         return new ViewHolder(v);
     }
 
+    @Override
     public void onBindViewHolder(ViewHolder viewHolder, Object item) {
         Log.d(TAG, "onBindViewHolder for " + item.toString());
-        ((ImageCardView) viewHolder.view).setTitleText(item.toString());
+        PhotoItem photoItem = (PhotoItem) item;
+        Drawable drawable =  viewHolder.view.getContext().getResources()
+                .getDrawable(photoItem.getImageResourceId());
+        ((ImageCardView) viewHolder.view).setMainImage(drawable);
+        ((ImageCardView) viewHolder.view).setTitleText(photoItem.getTitle());
     }
 
+    @Override
     public void onUnbindViewHolder(ViewHolder viewHolder) {
         Log.d(TAG, "onUnbindViewHolder");
     }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsActivity.java
index 082b134..d74a50a 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsActivity.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsActivity.java
@@ -18,11 +18,17 @@
 
 public class DetailsActivity extends Activity
 {
+    public static final String EXTRA_ITEM = "item";
+    public static final String SHARED_ELEMENT_NAME = "hero";
+
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.details);
+        ((DetailsFragment)getFragmentManager().findFragmentById(R.id.details_fragment))
+                .setItem((PhotoItem) getIntent().getParcelableExtra(EXTRA_ITEM));
     }
+
 }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsFragment.java
index c9a85f3..eb04502 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/DetailsFragment.java
@@ -15,6 +15,8 @@
 
 import android.content.res.Resources;
 import android.os.Bundle;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.view.ViewCompat;
 import android.support.v17.leanback.widget.Action;
 import android.support.v17.leanback.widget.ArrayObjectAdapter;
 import android.support.v17.leanback.widget.ClassPresenterSelector;
@@ -24,27 +26,31 @@
 import android.support.v17.leanback.widget.ListRow;
 import android.support.v17.leanback.widget.ListRowPresenter;
 import android.support.v17.leanback.widget.OnActionClickedListener;
+import android.support.v17.leanback.widget.RowPresenter;
 import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
 import android.widget.Toast;
 
+import java.util.ArrayList;
+
 public class DetailsFragment extends android.support.v17.leanback.app.DetailsFragment {
     private static final String TAG = "leanback.BrowseFragment";
+    private static final String ITEM = "item";
 
     private static final int NUM_ROWS = 3;
     private ArrayObjectAdapter mRowsAdapter;
+    private PhotoItem mPhotoItem;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         Log.i(TAG, "onCreate");
         super.onCreate(savedInstanceState);
 
-        setupRows();
-    }
-
-    private void setupRows() {
         ClassPresenterSelector ps = new ClassPresenterSelector();
         DetailsOverviewRowPresenter dorPresenter =
-            new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
+                new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
         dorPresenter.setOnActionClickedListener(new OnActionClickedListener() {
             public void onActionClicked(Action action) {
                 Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
@@ -54,11 +60,30 @@
         ps.addClassPresenter(DetailsOverviewRow.class, dorPresenter);
         ps.addClassPresenter(ListRow.class,
                 new ListRowPresenter());
+
         mRowsAdapter = new ArrayObjectAdapter(ps);
 
+        PhotoItem item = (PhotoItem) (savedInstanceState != null ?
+                savedInstanceState.getParcelable(ITEM) : null);
+        if (item != null) {
+            setItem(item);
+        }
+        dorPresenter.setSharedElementEnterTransition(getActivity(),
+                DetailsActivity.SHARED_ELEMENT_NAME);
+    }
+
+    @Override
+    public void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        outState.putParcelable(ITEM, mPhotoItem);
+    }
+
+    public void setItem(PhotoItem photoItem) {
+        mPhotoItem = photoItem;
+
         Resources res = getActivity().getResources();
         DetailsOverviewRow dor = new DetailsOverviewRow("Details Overview");
-        dor.setImageDrawable(res.getDrawable(R.drawable.details_img));
+        dor.setImageDrawable(res.getDrawable(photoItem.getImageResourceId()));
         dor.addAction(new Action(1, "Buy $9.99"));
         dor.addAction(new Action(2, "Rent", "$3.99", res.getDrawable(R.drawable.ic_action_a)));
         mRowsAdapter.add(dor);
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/ErrorFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/ErrorFragment.java
new file mode 100644
index 0000000..f944ffa
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/ErrorFragment.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.content.Intent;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.support.v17.leanback.widget.ArrayObjectAdapter;
+import android.support.v17.leanback.widget.HeaderItem;
+import android.support.v17.leanback.widget.ListRow;
+import android.support.v17.leanback.widget.ListRowPresenter;
+import android.support.v17.leanback.widget.OnItemClickedListener;
+import android.support.v17.leanback.widget.Row;
+import android.support.v17.leanback.widget.SearchOrbView;
+import android.util.Log;
+import android.view.View;
+
+public class ErrorFragment extends android.support.v17.leanback.app.ErrorFragment {
+    private static final String TAG = "leanback.ErrorFragment";
+    private static final boolean TRANSLUCENT = true;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log.i(TAG, "onCreate");
+        super.onCreate(savedInstanceState);
+
+        setTitle("Leanback Sample App");
+    }
+
+    void setErrorContent(Resources resources) {
+        setImageDrawable(resources.getDrawable(R.drawable.lb_ic_sad_cloud));
+        setMessage("An error occurred.");
+        setDefaultBackground(TRANSLUCENT);
+
+        setButtonText("Dismiss");
+        setButtonClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View arg0) {
+                Log.i(TAG, "button clicked");
+                getFragmentManager().beginTransaction().remove(ErrorFragment.this).commit();
+            }
+        });
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java
new file mode 100644
index 0000000..be3c8a6
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PhotoItem.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class PhotoItem implements Parcelable {
+
+    private String mTitle;
+    private int mImageResourceId;
+
+    public PhotoItem(String title, int imageResourceId) {
+        mTitle = title;
+        mImageResourceId = imageResourceId;
+    }
+
+    public int getImageResourceId() {
+        return mImageResourceId;
+    }
+
+    public String getTitle() {
+        return mTitle;
+    }
+
+    @Override
+    public String toString() {
+        return mTitle;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(mTitle);
+        dest.writeInt(mImageResourceId);
+    }
+
+    public static final Parcelable.Creator<PhotoItem> CREATOR
+            = new Parcelable.Creator<PhotoItem>() {
+        @Override
+        public PhotoItem createFromParcel(Parcel in) {
+            return new PhotoItem(in);
+        }
+
+        @Override
+        public PhotoItem[] newArray(int size) {
+            return new PhotoItem[size];
+        }
+    };
+
+    private PhotoItem(Parcel in) {
+        mTitle = in.readString();
+        mImageResourceId = in.readInt();
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayActivity.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayActivity.java
new file mode 100644
index 0000000..72ef1c4
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayActivity.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class PlaybackOverlayActivity extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.playback_controls);
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java
new file mode 100644
index 0000000..ddb4f48
--- /dev/null
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/PlaybackOverlayFragment.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.example.android.leanback;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.support.v17.leanback.widget.Action;
+import android.support.v17.leanback.widget.ArrayObjectAdapter;
+import android.support.v17.leanback.widget.ClassPresenterSelector;
+import android.support.v17.leanback.widget.PlaybackControlsRow;
+import android.support.v17.leanback.widget.PlaybackControlsRowPresenter;
+import android.support.v17.leanback.widget.HeaderItem;
+import android.support.v17.leanback.widget.ListRow;
+import android.support.v17.leanback.widget.ListRowPresenter;
+import android.support.v17.leanback.widget.OnActionClickedListener;
+import android.support.v17.leanback.widget.ControlButtonPresenterSelector;
+import android.util.Log;
+import android.widget.Toast;
+
+public class PlaybackOverlayFragment extends android.support.v17.leanback.app.PlaybackOverlayFragment {
+    private static final String TAG = "leanback.PlaybackControlsFragment";
+
+    private static final int NUM_ROWS = 3;
+    private static final boolean SHOW_ITEM_DETAIL = true;
+    private static final boolean HIDE_MORE_ACTIONS = false;
+
+    private ArrayObjectAdapter mRowsAdapter;
+    private ArrayObjectAdapter mPrimaryActionsAdapter;
+    private ArrayObjectAdapter mSecondaryActionsAdapter;
+    private PlaybackControlsRow.PlayPauseAction mPlayPauseAction;
+    private PlaybackControlsRow.RepeatAction mRepeatAction;
+    private PlaybackControlsRow mPlaybackControlsRow;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log.i(TAG, "onCreate");
+        super.onCreate(savedInstanceState);
+
+        setupRows();
+    }
+
+    private static void notifyChanged(ArrayObjectAdapter adapter, Action action) {
+        adapter.notifyArrayItemRangeChanged(adapter.indexOf(action), 1);
+    }
+
+    private void setupRows() {
+        ClassPresenterSelector ps = new ClassPresenterSelector();
+
+        PlaybackControlsRowPresenter playbackControlsRowPresenter;
+        if (SHOW_ITEM_DETAIL) {
+            playbackControlsRowPresenter = new PlaybackControlsRowPresenter(
+                    new DetailsDescriptionPresenter());
+        } else {
+            playbackControlsRowPresenter = new PlaybackControlsRowPresenter();
+        }
+        playbackControlsRowPresenter.setOnActionClickedListener(new OnActionClickedListener() {
+            public void onActionClicked(Action action) {
+                Toast.makeText(getActivity(), action.toString(), Toast.LENGTH_SHORT).show();
+                if (action.getId() == mPlayPauseAction.getId()) {
+                    mPlayPauseAction.toggle();
+                    notifyChanged(mPrimaryActionsAdapter, mPlayPauseAction);
+                } else if (action.getId() == mRepeatAction.getId()) {
+                    mRepeatAction.next();
+                    notifyChanged(mSecondaryActionsAdapter, mRepeatAction);
+                }
+            }
+        });
+        playbackControlsRowPresenter.setSecondaryActionsHidden(HIDE_MORE_ACTIONS);
+
+        ps.addClassPresenter(PlaybackControlsRow.class, playbackControlsRowPresenter);
+        ps.addClassPresenter(ListRow.class, new ListRowPresenter());
+        mRowsAdapter = new ArrayObjectAdapter(ps);
+
+        addPlaybackControlsRow();
+
+        setAdapter(mRowsAdapter);
+    }
+
+    private void addPlaybackControlsRow() {
+        Context context = getActivity();
+
+        ControlButtonPresenterSelector presenterSelector = new ControlButtonPresenterSelector();
+        mPrimaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
+        mSecondaryActionsAdapter = new ArrayObjectAdapter(presenterSelector);
+
+        if (SHOW_ITEM_DETAIL) {
+            mPlaybackControlsRow = new PlaybackControlsRow("Playback Controls Title");
+            mPlaybackControlsRow.setImageDrawable(context.getResources().getDrawable(
+                    R.drawable.details_img));
+        } else {
+            mPlaybackControlsRow = new PlaybackControlsRow();
+        }
+        mPlaybackControlsRow.setPrimaryActionsAdapter(mPrimaryActionsAdapter);
+        mPlaybackControlsRow.setSecondaryActionsAdapter(mSecondaryActionsAdapter);
+        mRowsAdapter.add(mPlaybackControlsRow);
+
+        mPlayPauseAction = new PlaybackControlsRow.PlayPauseAction(context);
+        mRepeatAction = new PlaybackControlsRow.RepeatAction(context);
+
+        mPrimaryActionsAdapter.add(new PlaybackControlsRow.SkipPreviousAction(context));
+        mPrimaryActionsAdapter.add(new PlaybackControlsRow.RewindAction(context));
+        mPrimaryActionsAdapter.add(mPlayPauseAction);
+        mPrimaryActionsAdapter.add(new PlaybackControlsRow.FastForwardAction(context));
+        mPrimaryActionsAdapter.add(new PlaybackControlsRow.SkipNextAction(context));
+
+        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ThumbsUpAction(context));
+        mSecondaryActionsAdapter.add(mRepeatAction);
+        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ShuffleAction(context));
+        mSecondaryActionsAdapter.add(new PlaybackControlsRow.ThumbsDownAction(context));
+
+        for (int i = 0; i < NUM_ROWS; ++i) {
+            ArrayObjectAdapter listRowAdapter = new ArrayObjectAdapter(new StringPresenter());
+            listRowAdapter.add("Some related content");
+            listRowAdapter.add("Other related content");
+            HeaderItem header = new HeaderItem(i, "Row " + i, null);
+            mRowsAdapter.add(new ListRow(header, listRowAdapter));
+        }
+    }
+}
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/SearchFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/SearchFragment.java
index 0489196..7d277cf 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/SearchFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/SearchFragment.java
@@ -27,6 +27,9 @@
         super.onCreate(savedInstanceState);
 
         mRowsAdapter = new ArrayObjectAdapter(new ListRowPresenter());
+
+        setBadgeDrawable(getActivity().getResources().getDrawable(R.drawable.ic_title));
+        setTitle("Leanback Sample App");
         setSearchResultProvider(this);
         setOnItemClickedListener(new ItemClickedListener());
     }
diff --git a/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridFragment.java b/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridFragment.java
index 495bebe..5b464f4 100644
--- a/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridFragment.java
+++ b/samples/SupportLeanbackDemos/src/com/example/android/leanback/VerticalGridFragment.java
@@ -13,6 +13,7 @@
  */
 package com.example.android.leanback;
 
+import android.content.Intent;
 import android.content.res.Resources;
 import android.graphics.Color;
 import android.os.Bundle;
@@ -47,10 +48,8 @@
 
         mRandom = new Random();
 
-        Params p = new Params();
-        p.setBadgeImage(getActivity().getResources().getDrawable(R.drawable.ic_title));
-        p.setTitle("Leanback Vertical Grid Demo");
-        setParams(p);
+        setBadgeDrawable(getActivity().getResources().getDrawable(R.drawable.ic_title));
+        setTitle("Leanback Vertical Grid Demo");
 
         setupFragment();
     }
@@ -60,52 +59,31 @@
         gridPresenter.setNumberOfColumns(NUM_COLUMNS);
         setGridPresenter(gridPresenter);
 
-        mAdapter = new ArrayObjectAdapter(new GridItemPresenter());
+        mAdapter = new ArrayObjectAdapter(new CardPresenter());
         for (int i = 0; i < NUM_ITEMS; i++) {
-            mAdapter.add(new MyItem(i));
+            mAdapter.add(Integer.toString(i));
         }
         setAdapter(mAdapter);
 
         setOnItemSelectedListener(new OnItemSelectedListener() {
             @Override
             public void onItemSelected(Object item, Row row) {
-                Log.i(TAG, "item selected: " + ((MyItem) item).id);
+                Log.i(TAG, "item selected: " + item);
             }
         });
 
         setOnItemClickedListener(new OnItemClickedListener() {
             @Override
             public void onItemClicked(Object item, Row row) {
-                Log.i(TAG, "item clicked: " + ((MyItem) item).id);
+                Log.i(TAG, "item clicked: " + item);
             }
         });
-    }
-
-    private class GridItemPresenter extends Presenter {
-        public ViewHolder onCreateViewHolder(ViewGroup parent) {
-            TextView view = new TextView(parent.getContext());
-            // Choose a random height between HEIGHT and 1.5 * HEIGHT to
-            // demonstrate the staggered nature of the grid.
-            final int height = HEIGHT + mRandom.nextInt(HEIGHT / 2);
-            view.setLayoutParams(new ViewGroup.LayoutParams(200, height));
-            view.setFocusable(true);
-            view.setFocusableInTouchMode(true);
-            view.setBackgroundColor(Color.DKGRAY);
-            view.setGravity(Gravity.CENTER);
-            return new ViewHolder(view);
-        }
-
-        public void onBindViewHolder(ViewHolder viewHolder, Object item) {
-            ((TextView) viewHolder.view).setText(Integer.toString(((MyItem) item).id));
-        }
-
-        public void onUnbindViewHolder(ViewHolder viewHolder) {}
-    }
-
-    static class MyItem {
-        int id;
-        MyItem(int id) {
-            this.id = id;
-        }
+        setOnSearchClickedListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                Intent intent = new Intent(getActivity(), SearchActivity.class);
+                startActivity(intent);
+            }
+        });
     }
 }
diff --git a/samples/Vault/src/com/example/android/vault/VaultProvider.java b/samples/Vault/src/com/example/android/vault/VaultProvider.java
index 02e3211..bf3f1ce 100644
--- a/samples/Vault/src/com/example/android/vault/VaultProvider.java
+++ b/samples/Vault/src/com/example/android/vault/VaultProvider.java
@@ -36,6 +36,7 @@
 import android.provider.DocumentsContract.Root;
 import android.provider.DocumentsProvider;
 import android.security.KeyChain;
+import android.text.TextUtils;
 import android.util.Log;
 
 import org.json.JSONArray;
@@ -204,7 +205,8 @@
         final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
         final RowBuilder row = result.newRow();
         row.add(Root.COLUMN_ROOT_ID, DEFAULT_ROOT_ID);
-        row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY);
+        row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_LOCAL_ONLY
+                | Root.FLAG_SUPPORTS_IS_CHILD);
         row.add(Root.COLUMN_TITLE, getContext().getString(R.string.app_label));
         row.add(Root.COLUMN_DOCUMENT_ID, DEFAULT_DOCUMENT_ID);
         row.add(Root.COLUMN_ICON, R.drawable.ic_lock_lock);
@@ -242,6 +244,7 @@
         } else {
             flags |= Document.FLAG_SUPPORTS_WRITE;
         }
+        flags |= Document.FLAG_SUPPORTS_RENAME;
         flags |= Document.FLAG_SUPPORTS_DELETE;
 
         final RowBuilder row = result.newRow();
@@ -254,6 +257,39 @@
     }
 
     @Override
+    public boolean isChildDocument(String parentDocumentId, String documentId) {
+        if (TextUtils.equals(parentDocumentId, documentId)) {
+            return true;
+        }
+
+        try {
+            final long parentDocId = Long.parseLong(parentDocumentId);
+            final EncryptedDocument parentDoc = getDocument(parentDocId);
+
+            // Recursively search any children
+            // TODO: consider building an index to optimize this check
+            final JSONObject meta = parentDoc.readMetadata();
+            if (Document.MIME_TYPE_DIR.equals(meta.getString(Document.COLUMN_MIME_TYPE))) {
+                final JSONArray children = meta.getJSONArray(KEY_CHILDREN);
+                for (int i = 0; i < children.length(); i++) {
+                    final String childDocumentId = children.getString(i);
+                    if (isChildDocument(childDocumentId, documentId)) {
+                        return true;
+                    }
+                }
+            }
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        } catch (GeneralSecurityException e) {
+            throw new IllegalStateException(e);
+        } catch (JSONException e) {
+            throw new IllegalStateException(e);
+        }
+
+        return false;
+    }
+
+    @Override
     public String createDocument(String parentDocumentId, String mimeType, String displayName)
             throws FileNotFoundException {
         final long parentDocId = Long.parseLong(parentDocumentId);
@@ -314,6 +350,29 @@
     }
 
     @Override
+    public String renameDocument(String documentId, String displayName)
+            throws FileNotFoundException {
+        final long docId = Long.parseLong(documentId);
+
+        try {
+            final EncryptedDocument doc = getDocument(docId);
+            final JSONObject meta = doc.readMetadata();
+
+            meta.put(Document.COLUMN_DISPLAY_NAME, displayName);
+            doc.writeMetadataAndContent(meta, null);
+
+            return null;
+
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        } catch (GeneralSecurityException e) {
+            throw new IllegalStateException(e);
+        } catch (JSONException e) {
+            throw new IllegalStateException(e);
+        }
+    }
+
+    @Override
     public void deleteDocument(String documentId) throws FileNotFoundException {
         final long docId = Long.parseLong(documentId);
 
diff --git a/samples/browseable/BasicMediaDecoder/src/com.example.android.common.media/MediaCodecWrapper.java b/samples/browseable/BasicMediaDecoder/src/com.example.android.common.media/MediaCodecWrapper.java
index a511221..a483374 100644
--- a/samples/browseable/BasicMediaDecoder/src/com.example.android.common.media/MediaCodecWrapper.java
+++ b/samples/browseable/BasicMediaDecoder/src/com.example.android.common.media/MediaCodecWrapper.java
@@ -21,6 +21,7 @@
 import android.os.Looper;
 import android.view.Surface;
 
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayDeque;
 import java.util.Queue;
@@ -136,7 +137,7 @@
      * @return
      */
     public static MediaCodecWrapper fromVideoFormat(final MediaFormat trackFormat,
-            Surface surface) {
+            Surface surface) throws IOException {
         MediaCodecWrapper result = null;
         MediaCodec videoCodec = null;
 
diff --git a/samples/devbytes/graphics/FoldingLayout/src/com/example/android/foldinglayout/FoldingLayout.java b/samples/devbytes/graphics/FoldingLayout/src/com/example/android/foldinglayout/FoldingLayout.java
index 8afb27e..f758399 100644
--- a/samples/devbytes/graphics/FoldingLayout/src/com/example/android/foldinglayout/FoldingLayout.java
+++ b/samples/devbytes/graphics/FoldingLayout/src/com/example/android/foldinglayout/FoldingLayout.java
@@ -477,6 +477,7 @@
             mShadowGradientMatrix.setScale(1, mFoldDrawHeight);
             mShadowLinearGradient.setLocalMatrix(mShadowGradientMatrix);
         }
+        mGradientShadow.setShader(mShadowLinearGradient);
 
         mGradientShadow.setAlpha(alpha);
     }
diff --git a/samples/samples_source.prop_template b/samples/samples_source.prop_template
index 523d6bd..d3cdfd5 100644
--- a/samples/samples_source.prop_template
+++ b/samples/samples_source.prop_template
@@ -1,4 +1,4 @@
 Pkg.UserSrc=false
-Pkg.Revision=2
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
diff --git a/samples/training/NsdChat/src/com/example/android/nsdchat/ChatConnection.java b/samples/training/NsdChat/src/com/example/android/nsdchat/ChatConnection.java
index 80aa9fd..534f218 100644
--- a/samples/training/NsdChat/src/com/example/android/nsdchat/ChatConnection.java
+++ b/samples/training/NsdChat/src/com/example/android/nsdchat/ChatConnection.java
@@ -52,7 +52,9 @@
 
     public void tearDown() {
         mChatServer.tearDown();
-        mChatClient.tearDown();
+        if (mChatClient != null) {
+          mChatClient.tearDown();
+        }
     }
 
     public void connectToServer(InetAddress address, int port) {
@@ -64,15 +66,15 @@
             mChatClient.sendMessage(msg);
         }
     }
-    
+
     public int getLocalPort() {
         return mPort;
     }
-    
+
     public void setLocalPort(int port) {
         mPort = port;
     }
-    
+
 
     public synchronized void updateMessages(String msg, boolean local) {
         Log.e(TAG, "Updating message: " + msg);
@@ -142,7 +144,7 @@
                     // used.  Just grab an available one  and advertise it via Nsd.
                     mServerSocket = new ServerSocket(0);
                     setLocalPort(mServerSocket.getLocalPort());
-                    
+
                     while (!Thread.currentThread().isInterrupted()) {
                         Log.d(TAG, "ServerSocket Created, awaiting connection");
                         setSocket(mServerSocket.accept());
diff --git a/samples/training/NsdChat/src/com/example/android/nsdchat/NsdChatActivity.java b/samples/training/NsdChat/src/com/example/android/nsdchat/NsdChatActivity.java
index 47ee098..5782634 100644
--- a/samples/training/NsdChat/src/com/example/android/nsdchat/NsdChatActivity.java
+++ b/samples/training/NsdChat/src/com/example/android/nsdchat/NsdChatActivity.java
@@ -43,6 +43,7 @@
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        Log.d(TAG, "Creating chat activity");
         setContentView(R.layout.main);
         mStatusView = (TextView) findViewById(R.id.status);
 
@@ -54,11 +55,6 @@
             }
         };
 
-        mConnection = new ChatConnection(mUpdateHandler);
-
-        mNsdHelper = new NsdHelper(this);
-        mNsdHelper.initializeNsd();
-
     }
 
     public void clickAdvertise(View v) {
@@ -101,25 +97,58 @@
     }
 
     @Override
+    protected void onStart() {
+        Log.d(TAG, "Starting.");
+        mConnection = new ChatConnection(mUpdateHandler);
+
+        mNsdHelper = new NsdHelper(this);
+        mNsdHelper.initializeNsd();
+        super.onStart();
+    }
+
+
+    @Override
     protected void onPause() {
+        Log.d(TAG, "Pausing.");
         if (mNsdHelper != null) {
             mNsdHelper.stopDiscovery();
         }
         super.onPause();
     }
-    
+
     @Override
     protected void onResume() {
+        Log.d(TAG, "Resuming.");
         super.onResume();
         if (mNsdHelper != null) {
             mNsdHelper.discoverServices();
         }
     }
-    
+
+
+    // For KitKat and earlier releases, it is necessary to remove the
+    // service registration when the application is stopped.  There's
+    // no guarantee that the onDestroy() method will be called (we're
+    // killable after onStop() returns) and the NSD service won't remove
+    // the registration for us if we're killed.
+
+    // In L and later, NsdService will automatically unregister us when
+    // our connection goes away when we're killed, so this step is
+    // optional (but recommended).
+
     @Override
-    protected void onDestroy() {
+    protected void onStop() {
+        Log.d(TAG, "Being stopped.");
         mNsdHelper.tearDown();
         mConnection.tearDown();
+        mNsdHelper = null;
+        mConnection = null;
+        super.onStop();
+    }
+
+    @Override
+    protected void onDestroy() {
+        Log.d(TAG, "Being destroyed.");
         super.onDestroy();
     }
 }
diff --git a/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java b/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
index 568a79b..5111318 100644
--- a/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
+++ b/samples/training/NsdChat/src/com/example/android/nsdchat/NsdHelper.java
@@ -44,8 +44,6 @@
 
     public void initializeNsd() {
         initializeResolveListener();
-        initializeDiscoveryListener();
-        initializeRegistrationListener();
 
         //mNsdManager.init(mContext.getMainLooper(), this);
 
@@ -78,22 +76,20 @@
                     mService = null;
                 }
             }
-            
+
             @Override
             public void onDiscoveryStopped(String serviceType) {
-                Log.i(TAG, "Discovery stopped: " + serviceType);        
+                Log.i(TAG, "Discovery stopped: " + serviceType);
             }
 
             @Override
             public void onStartDiscoveryFailed(String serviceType, int errorCode) {
                 Log.e(TAG, "Discovery failed: Error code:" + errorCode);
-                mNsdManager.stopServiceDiscovery(this);
             }
 
             @Override
             public void onStopDiscoveryFailed(String serviceType, int errorCode) {
                 Log.e(TAG, "Discovery failed: Error code:" + errorCode);
-                mNsdManager.stopServiceDiscovery(this);
             }
         };
     }
@@ -125,48 +121,68 @@
             @Override
             public void onServiceRegistered(NsdServiceInfo NsdServiceInfo) {
                 mServiceName = NsdServiceInfo.getServiceName();
+                Log.d(TAG, "Service registered: " + mServiceName);
             }
-            
+
             @Override
             public void onRegistrationFailed(NsdServiceInfo arg0, int arg1) {
+                Log.d(TAG, "Service registration failed: " + arg1);
             }
 
             @Override
             public void onServiceUnregistered(NsdServiceInfo arg0) {
+                Log.d(TAG, "Service unregistered: " + arg0.getServiceName());
             }
-            
+
             @Override
             public void onUnregistrationFailed(NsdServiceInfo serviceInfo, int errorCode) {
+                Log.d(TAG, "Service unregistration failed: " + errorCode);
             }
-            
+
         };
     }
 
     public void registerService(int port) {
+        tearDown();  // Cancel any previous registration request
+        initializeRegistrationListener();
         NsdServiceInfo serviceInfo  = new NsdServiceInfo();
         serviceInfo.setPort(port);
         serviceInfo.setServiceName(mServiceName);
         serviceInfo.setServiceType(SERVICE_TYPE);
-        
+
         mNsdManager.registerService(
                 serviceInfo, NsdManager.PROTOCOL_DNS_SD, mRegistrationListener);
-        
+
     }
 
     public void discoverServices() {
+        stopDiscovery();  // Cancel any existing discovery request
+        initializeDiscoveryListener();
         mNsdManager.discoverServices(
                 SERVICE_TYPE, NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener);
     }
-    
+
     public void stopDiscovery() {
-        mNsdManager.stopServiceDiscovery(mDiscoveryListener);
+        if (mDiscoveryListener != null) {
+            try {
+                mNsdManager.stopServiceDiscovery(mDiscoveryListener);
+            } finally {
+            }
+            mDiscoveryListener = null;
+        }
     }
 
     public NsdServiceInfo getChosenServiceInfo() {
         return mService;
     }
-    
+
     public void tearDown() {
-        mNsdManager.unregisterService(mRegistrationListener);
+        if (mRegistrationListener != null) {
+            try {
+                mNsdManager.unregisterService(mRegistrationListener);
+            } finally {
+            }
+            mRegistrationListener = null;
+        }
     }
 }
diff --git a/scripts/stack_core.py b/scripts/stack_core.py
index 62d2aa5..6b1e11e 100755
--- a/scripts/stack_core.py
+++ b/scripts/stack_core.py
@@ -49,7 +49,7 @@
 
   register_names = {
     "arm": "r0|r1|r2|r3|r4|r5|r6|r7|r8|r9|sl|fp|ip|sp|lr|pc|cpsr",
-    "arm64": "x0|x1|x2|x3|x4|x5|x6|x7|x8|x9|x10|x11|x12|x13|x14|x15|x16|x17|x18|x19|x20|x21|x22|x23|x24|x25|x26|x27|x28|x29|x30|sp|pc",
+    "arm64": "x0|x1|x2|x3|x4|x5|x6|x7|x8|x9|x10|x11|x12|x13|x14|x15|x16|x17|x18|x19|x20|x21|x22|x23|x24|x25|x26|x27|x28|x29|x30|sp|pc|pstate",
     "mips": "zr|at|v0|v1|a0|a1|a2|a3|t0|t1|t2|t3|t4|t5|t6|t7|s0|s1|s2|s3|s4|s5|s6|s7|t8|t9|k0|k1|gp|sp|s8|ra|hi|lo|bva|epc",
     "x86": "eax|ebx|ecx|edx|esi|edi|x?cs|x?ds|x?es|x?fs|x?ss|eip|ebp|esp|flags",
     "x86_64": "rax|rbx|rcx|rdx|rsi|rdi|r8|r9|r10|r11|r12|r13|r14|r15|cs|ss|rip|rbp|rsp|eflags",
@@ -59,7 +59,7 @@
     if symbol.ARCH == "arm64" or symbol.ARCH == "mips64" or symbol.ARCH == "x86_64":
       self.width = "{16}"
 
-    self.register_line = re.compile("(([ ]*\\b(" + self.register_names[symbol.ARCH] + ")\\b +[0-9a-f]" + self.width + "){2,4})")
+    self.register_line = re.compile("(([ ]*\\b(" + self.register_names[symbol.ARCH] + ")\\b +[0-9a-f]" + self.width + "){2,5})")
 
     # Note that both trace and value line matching allow for variable amounts of
     # whitespace (e.g. \t). This is because the we want to allow for the stack
diff --git a/sdk/build_tools_source.prop_template b/sdk/build_tools_source.prop_template
index 5d62307..fe50573 100644
--- a/sdk/build_tools_source.prop_template
+++ b/sdk/build_tools_source.prop_template
@@ -1,3 +1,5 @@
 Pkg.UserSrc=false
-Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0
+// due to the codename this resolve to 20 instead of 21, so replace it with hardcoded version for now.
+//Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0
+Pkg.Revision=21.0.0 rc1
 
diff --git a/sdk/platform_source.prop_template b/sdk/platform_source.prop_template
index 452aa89..7ecb1e2 100644
--- a/sdk/platform_source.prop_template
+++ b/sdk/platform_source.prop_template
@@ -2,9 +2,9 @@
 Pkg.UserSrc=false
 Platform.Version=${PLATFORM_VERSION}
 Platform.CodeName=KitKat
-Pkg.Revision=2
+Pkg.Revision=1
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
-Layoutlib.Api=12
+Layoutlib.Api=10
 Layoutlib.Revision=1
 Platform.MinToolsRev=22
diff --git a/sys-img/images_armeabi-v7a_hardware.ini b/sys-img/images_armeabi-v7a_hardware.ini
new file mode 100644
index 0000000..fe594c6
--- /dev/null
+++ b/sys-img/images_armeabi-v7a_hardware.ini
@@ -0,0 +1 @@
+hw.cpu.model=cortex-a8
diff --git a/testrunner/adb_interface.py b/testrunner/adb_interface.py
index fa394cd..dc43a93 100755
--- a/testrunner/adb_interface.py
+++ b/testrunner/adb_interface.py
@@ -506,3 +506,34 @@
   def GetSerialNumber(self):
     """Returns the serial number of the targeted device."""
     return self.SendCommand("get-serialno").strip()
+
+  def RuntimeReset(self, disable_keyguard=False, retry_count=3, preview_only=False):
+    """
+    Resets the Android runtime (does *not* reboot the kernel).
+
+    Blocks until the reset is complete and the package manager
+    is available.
+
+    Args:
+      disable_keyguard: if True, presses the MENU key to disable
+        key guard, after reset is finished
+      retry_count: number of times to retry reset before failing
+
+    Raises:
+      WaitForResponseTimedOutError if package manager does not respond
+      AbortError if unrecoverable error occurred
+    """
+
+    logger.Log("adb shell stop")
+    logger.Log("adb shell start")
+
+    if not preview_only:
+      self.SendShellCommand("stop", retry_count=retry_count)
+      self.SendShellCommand("start", retry_count=retry_count)
+
+    self.WaitForDevicePm()
+
+    if disable_keyguard:
+      logger.Log("input keyevent 82 ## disable keyguard")
+      if not preview_only:
+        self.SendShellCommand("input keyevent 82", retry_count=retry_count)
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index a76d9c0..f9f4771 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -73,11 +73,12 @@
   # default value for make -jX
   _DEFAULT_JOBS = 16
 
-  _DALVIK_VERIFIER_OFF_PROP = "dalvik.vm.dexopt-flags = v=n"
+  _DALVIK_VERIFIER_PROP = "dalvik.vm.dexopt-flags"
+  _DALVIK_VERIFIER_OFF_VALUE = "v=n"
+  _DALVIK_VERIFIER_OFF_PROP = "%s = %s" %(_DALVIK_VERIFIER_PROP, _DALVIK_VERIFIER_OFF_VALUE)
 
   # regular expression to match path to artifacts to install in make output
-  _RE_MAKE_INSTALL = re.compile(r'INSTALL-PATH:\s(.+)\s(.+)')
-
+  _RE_MAKE_INSTALL = re.compile(r'INSTALL-PATH:\s([^\s]+)\s(.*)$')
 
   def __init__(self):
     # disable logging of timestamp
@@ -113,6 +114,9 @@
     parser.add_option("-n", "--skip_execute", dest="preview", default=False,
                       action="store_true",
                       help="Do not execute, just preview commands")
+    parser.add_option("-i", "--build-install-only", dest="build_install_only", default=False,
+                      action="store_true",
+                      help="Do not execute, build tests and install to device only")
     parser.add_option("-r", "--raw-mode", dest="raw_mode", default=False,
                       action="store_true",
                       help="Raw mode (for output to other tools)")
@@ -193,7 +197,6 @@
       self._adb.SetDeviceTarget()
     elif self._options.serial is not None:
       self._adb.SetTargetSerial(self._options.serial)
-
     if self._options.verbose:
       logger.SetVerbose(True)
 
@@ -247,7 +250,9 @@
 
     tests = self._GetTestsToRun()
     # turn off dalvik verifier if necessary
-    self._TurnOffVerifier(tests)
+    # TODO: skip turning off verifier for now, since it puts device in bad
+    # state b/14088982
+    #self._TurnOffVerifier(tests)
     self._DoFullBuild(tests)
 
     target_tree = make_tree.MakeTree()
@@ -267,7 +272,9 @@
         target_tree.AddPath("external/emma")
 
       target_list = target_tree.GetPrunedMakeList()
+      target_dir_list = [re.sub(r'Android[.]mk$', r'', i) for i in target_list]
       target_build_string = " ".join(target_list)
+      target_dir_build_string = " ".join(target_dir_list)
       extra_args_string = " ".join(extra_args_set)
 
       # mmm cannot be used from python, so perform a similar operation using
@@ -275,9 +282,24 @@
       cmd = 'ONE_SHOT_MAKEFILE="%s" make -j%s -C "%s" GET-INSTALL-PATH all_modules %s' % (
           target_build_string, self._options.make_jobs, self._root_path,
           extra_args_string)
+      # mmma equivalent, used when regular mmm fails
+      alt_cmd = 'make -j%s -C "%s" -f build/core/main.mk %s all_modules BUILD_MODULES_IN_PATHS="%s"' % (
+              self._options.make_jobs, self._root_path, extra_args_string, target_dir_build_string)
+
       logger.Log(cmd)
       if not self._options.preview:
-        output = run_command.RunCommand(cmd, return_output=True, timeout_time=600)
+        run_command.SetAbortOnError()
+        try:
+          output = run_command.RunCommand(cmd, return_output=True, timeout_time=600)
+          ## Chances are this failed because it didn't build the dependencies
+        except errors.AbortError:
+          logger.Log("make failed. Trying to rebuild all dependencies.")
+          logger.Log("mmma -j%s %s" %(self._options.make_jobs, target_dir_build_string))
+          # Try again with mma equivalent, which will build the dependencies
+          run_command.RunCommand(alt_cmd, return_output=False, timeout_time=600)
+          # Run mmm again to get the install paths only
+          output = run_command.RunCommand(cmd, return_output=True, timeout_time=600)
+        run_command.SetAbortOnError(False)
         logger.SilentLog(output)
         self._DoInstall(output)
 
@@ -286,19 +308,25 @@
 
     Looks for 'install:' text from make output to find artifacts to install.
 
+    Files with the .apk extension get 'adb install'ed, all other files
+    get 'adb push'ed onto the device.
+
     Args:
       make_output: stdout from make command
     """
     for line in make_output.split("\n"):
       m = self._RE_MAKE_INSTALL.match(line)
       if m:
-        install_path = m.group(2)
-        if install_path.endswith(".apk"):
-          abs_install_path = os.path.join(self._root_path, install_path)
-          logger.Log("adb install -r %s" % abs_install_path)
-          logger.Log(self._adb.Install(abs_install_path))
-        else:
-          self._PushInstallFileToDevice(install_path)
+        # strip the 'INSTALL: <name>' from the left hand side
+        # the remaining string is a space-separated list of build-generated files
+        install_paths = m.group(2)
+        for install_path in re.split(r'\s+', install_paths):
+          if install_path.endswith(".apk"):
+            abs_install_path = os.path.join(self._root_path, install_path)
+            logger.Log("adb install -r %s" % abs_install_path)
+            logger.Log(self._adb.Install(abs_install_path))
+          else:
+            self._PushInstallFileToDevice(install_path)
 
   def _PushInstallFileToDevice(self, install_path):
     m = self._re_make_install_path.match(install_path)
@@ -348,7 +376,7 @@
         if is_cts:
           # hack! hardcode install of CtsTestStubs
           out = android_build.GetTestAppPath()
-          abs_install_path = os.path.join(out, "CtsTestStubs.apk")
+          abs_install_path = os.path.join(out, "CtsTestStubs", "CtsTestStubs.apk")
           logger.Log("adb install -r %s" % abs_install_path)
           logger.Log(self._adb.Install(abs_install_path))
 
@@ -406,7 +434,7 @@
     turns off verifier and reboots device to allow change to take effect.
     """
     # hack to check if these are frameworks/base tests. If so, turn off verifier
-    # to allow framework tests to access package-private framework api
+    # to allow framework tests to access private/protected/package-private framework api
     framework_test = False
     for test in test_list:
       if os.path.commonprefix([test.GetBuildPath(), "frameworks/base"]):
@@ -416,35 +444,54 @@
       # necessary
       output = self._adb.SendShellCommand("cat /data/local.prop")
       if not self._DALVIK_VERIFIER_OFF_PROP in output:
+
+        # Read the existing dalvik verifier flags.
+        old_prop_value = self._adb.SendShellCommand("getprop %s" \
+            %(self._DALVIK_VERIFIER_PROP))
+        old_prop_value = old_prop_value.strip() if old_prop_value else ""
+
+        # Append our verifier flags to existing flags
+        new_prop_value = "%s %s" %(self._DALVIK_VERIFIER_OFF_VALUE, old_prop_value)
+
+        # Update property now, as /data/local.prop is not read until reboot
+        logger.Log("adb shell setprop %s '%s'" \
+            %(self._DALVIK_VERIFIER_PROP, new_prop_value))
+        if not self._options.preview:
+          self._adb.SendShellCommand("setprop %s '%s'" \
+            %(self._DALVIK_VERIFIER_PROP, new_prop_value))
+
+        # Write prop to /data/local.prop
+        # Every time device is booted, it will pick up this value
+        new_prop_assignment = "%s = %s" %(self._DALVIK_VERIFIER_PROP, new_prop_value)
         if self._options.preview:
           logger.Log("adb shell \"echo %s >> /data/local.prop\""
-                     % self._DALVIK_VERIFIER_OFF_PROP)
+                     % new_prop_assignment)
           logger.Log("adb shell chmod 644 /data/local.prop")
-          logger.Log("adb reboot")
-          logger.Log("adb wait-for-device")
         else:
           logger.Log("Turning off dalvik verifier and rebooting")
           self._adb.SendShellCommand("\"echo %s >> /data/local.prop\""
-                                     % self._DALVIK_VERIFIER_OFF_PROP)
+                                     % new_prop_assignment)
 
-          self._ChmodReboot()
+        # Reset runtime so that dalvik picks up new verifier flags from prop
+        self._ChmodRuntimeReset()
       elif not self._options.preview:
         # check the permissions on the file
         permout = self._adb.SendShellCommand("ls -l /data/local.prop")
         if not "-rw-r--r--" in permout:
           logger.Log("Fixing permissions on /data/local.prop and rebooting")
-          self._ChmodReboot()
+          self._ChmodRuntimeReset()
 
-  def _ChmodReboot(self):
-    """Perform a chmod of /data/local.prop and reboot.
+  def _ChmodRuntimeReset(self):
+    """Perform a chmod of /data/local.prop and reset the runtime.
     """
-    self._adb.SendShellCommand("chmod 644 /data/local.prop")
-    self._adb.SendCommand("reboot")
-    # wait for device to go offline
-    time.sleep(10)
-    self._adb.SendCommand("wait-for-device", timeout_time=60,
-                          retry_count=3)
-    self._adb.EnableAdbRoot()
+    logger.Log("adb shell chmod 644 /data/local.prop ## u+w,a+r")
+    if not self._options.preview:
+      self._adb.SendShellCommand("chmod 644 /data/local.prop")
+
+    self._adb.RuntimeReset(preview_only=self._options.preview)
+
+    if not self._options.preview:
+      self._adb.EnableAdbRoot()
 
 
   def RunTests(self):
@@ -459,6 +506,10 @@
       if not self._options.skip_build:
         self._DoBuild()
 
+      if self._options.build_install_only:
+        logger.Log("Skipping test execution (due to --build-install-only flag)")
+        return
+
       for test_suite in self._GetTestsToRun():
         try:
           test_suite.Run(self._options, self._adb)
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index 751a142..c231323 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -512,11 +512,17 @@
 
 <!-- Unit tests for the phone application. -->
 <test name="phone-unit"
-    build_path="packages/apps/Phone"
+    build_path="packages/services/Telephony"
     package="com.android.phone.tests"
     continuous="true"
     coverage_target="Phone" />
 
+<test name="telecomm-unit"
+    build_path="packages/services/Telecomm"
+    package="com.android.telecomm.tests"
+    continuous="true"
+    coverage_target="Phone" />
+
 <test name="quicksearchbox"
     build_path="packages/apps/QuickSearchBox"
     package="com.android.quicksearchbox.tests"
diff --git a/testrunner/test_defs/gtest.py b/testrunner/test_defs/gtest.py
index dc72f94..cceead9 100644
--- a/testrunner/test_defs/gtest.py
+++ b/testrunner/test_defs/gtest.py
@@ -73,6 +73,7 @@
       - test_*.[c|cc|cpp]
       - *_test.[c|cc|cpp]
       - *_unittest.[c|cc|cpp]
+      - *Tests.[cc|cpp]
 
     """
     if not sub_tests_path:
@@ -101,6 +102,7 @@
       - test_*.[cc|cpp]
       - *_test.[cc|cpp]
       - *_unittest.[cc|cpp]
+      - *Tests.[cc|cpp]
 
     This method is a callback for os.path.walk.
 
@@ -115,6 +117,6 @@
   def _EvaluateFile(self, test_list, file):
     (name, ext) = os.path.splitext(file)
     if ext == ".cc" or ext == ".cpp" or ext == ".c":
-      if re.search("_test$|_test_$|_unittest$|_unittest_$|^test_", name):
+      if re.search("_test$|_test_$|_unittest$|_unittest_$|^test_|Tests$", name):
         logger.SilentLog("Found native test file %s" % file)
         test_list.append(name)
diff --git a/tools/emulator/test-apps/GpsLocationTest/Android.mk b/tools/emulator/test-apps/GpsLocationTest/Android.mk
deleted file mode 100644
index 5f90f3a..0000000
--- a/tools/emulator/test-apps/GpsLocationTest/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-# Only compile source java files in this apk.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := GpsLocationTest
-
-LOCAL_SDK_VERSION := 4
-
-LOCAL_PROGUARD_ENABLED := disabled
-
-include $(BUILD_PACKAGE)
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tools/emulator/test-apps/GpsLocationTest/AndroidManifest.xml b/tools/emulator/test-apps/GpsLocationTest/AndroidManifest.xml
deleted file mode 100644
index 901855e..0000000
--- a/tools/emulator/test-apps/GpsLocationTest/AndroidManifest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.android.emulator.gps.test"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-sdk android:minSdkVersion="4" />
-    <instrumentation android:targetPackage="com.android.emulator.gps.test"
-                     android:name="android.test.InstrumentationTestRunner" />
-    <application  android:label="GPS Location Test">
-        <uses-library android:name="android.test.runner" />
-    </application>
-</manifest>
\ No newline at end of file
diff --git a/tools/emulator/test-apps/ConnectivityTest/Android.mk b/tools/emulator/test-apps/SmokeTests/Android.mk
similarity index 80%
rename from tools/emulator/test-apps/ConnectivityTest/Android.mk
rename to tools/emulator/test-apps/SmokeTests/Android.mk
index ca20d57..ccd3eb4 100644
--- a/tools/emulator/test-apps/ConnectivityTest/Android.mk
+++ b/tools/emulator/test-apps/SmokeTests/Android.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 The Android Open Source Project
+# Copyright (C) 2014 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.
@@ -15,18 +15,18 @@
 LOCAL_PATH:= $(call my-dir)
 include $(CLEAR_VARS)
 
+LOCAL_STATIC_JAVA_LIBRARIES := android-support-test
+
 LOCAL_MODULE_TAGS := optional
 
 # Only compile source java files in this apk.
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := ConnectivityTest
+LOCAL_PACKAGE_NAME := EmulatorSmokeTests
 
 LOCAL_SDK_VERSION := 4
 
 LOCAL_PROGUARD_ENABLED := disabled
 
-include $(BUILD_PACKAGE)
 
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
+include $(BUILD_PACKAGE)
diff --git a/tools/emulator/test-apps/ConnectivityTest/AndroidManifest.xml b/tools/emulator/test-apps/SmokeTests/AndroidManifest.xml
similarity index 70%
rename from tools/emulator/test-apps/ConnectivityTest/AndroidManifest.xml
rename to tools/emulator/test-apps/SmokeTests/AndroidManifest.xml
index 80f65cf..8843a00 100644
--- a/tools/emulator/test-apps/ConnectivityTest/AndroidManifest.xml
+++ b/tools/emulator/test-apps/SmokeTests/AndroidManifest.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 The Android Open Source Project
+<!-- Copyright (C) 2014 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.
@@ -14,14 +14,14 @@
      limitations under the License.
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.android.emulator.connectivity.test"
-      android:versionCode="1"
-      android:versionName="1.0">
+      package="com.android.emulator.smoketests">
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.READ_SMS" />
     <uses-sdk android:minSdkVersion="4" />
-    <instrumentation android:targetPackage="com.android.emulator.connectivity.test" android:name="android.test.InstrumentationTestRunner" />
-    <application  android:label="Connectivity Test">
-        <uses-library android:name="android.test.runner" />
+    <instrumentation android:targetPackage="com.android.emulator.smoketests"
+                     android:name="android.support.test.runner.AndroidJUnitRunner" />
+    <application  android:label="Emulator Smoke Tests">
     </application>
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/tools/emulator/test-apps/ConnectivityTest/src/com/android/emulator/connectivity/test/ConnectivityTest.java b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/connectivity/ConnectivityTest.java
similarity index 97%
rename from tools/emulator/test-apps/ConnectivityTest/src/com/android/emulator/connectivity/test/ConnectivityTest.java
rename to tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/connectivity/ConnectivityTest.java
index 9931eb8..9fe1ebe 100644
--- a/tools/emulator/test-apps/ConnectivityTest/src/com/android/emulator/connectivity/test/ConnectivityTest.java
+++ b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/connectivity/ConnectivityTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.emulator.connectivity.test;
+package com.android.emulator.smoketests.connectivity;
 
 import java.io.IOException;
 import java.net.URL;
diff --git a/tools/emulator/test-apps/GpsLocationTest/src/com/android/emulator/gps/test/GpsLocationTest.java b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/gps/GpsLocationTest.java
similarity index 98%
rename from tools/emulator/test-apps/GpsLocationTest/src/com/android/emulator/gps/test/GpsLocationTest.java
rename to tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/gps/GpsLocationTest.java
index 6eb3834..1e0258c 100644
--- a/tools/emulator/test-apps/GpsLocationTest/src/com/android/emulator/gps/test/GpsLocationTest.java
+++ b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/gps/GpsLocationTest.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.emulator.gps.test;
+package com.android.emulator.smoketests.gps;
 
 import android.content.Context;
 import android.location.Location;
diff --git a/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/sms/SmsTest.java b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/sms/SmsTest.java
new file mode 100644
index 0000000..2e18cc4
--- /dev/null
+++ b/tools/emulator/test-apps/SmokeTests/src/com/android/emulator/smoketests/sms/SmsTest.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.emulator.smoketests.sms;
+
+import android.content.Context;
+import android.content.ContentResolver;
+import android.net.Uri;
+import android.database.Cursor;
+import android.os.Bundle;
+import android.os.HandlerThread;
+import android.support.test.InjectContext;
+
+import org.junit.Assert;
+import static junit.framework.Assert.assertEquals;
+
+import org.junit.Test;
+/**
+ * Sms Test
+ *
+ * Test that an SMS message has been received
+ */
+public class SmsTest {
+
+    /**
+     * Prior to running this test an sms must be sent
+     * via DDMS
+     */
+    public final static String NUMBER = "5551212";
+    public final static String BODY = "test sms";
+    private final static int SMS_POLL_TIME_MS = 10 * 1000;
+    private final static int SIXY_SECONDS_OF_LOOPS = 6;
+    @InjectContext
+    public Context mContext;
+
+    /**
+     * Verify that an SMS has been received with the correct number and body
+     */
+    @Test
+    public void testReceivedSms() throws java.lang.InterruptedException {
+        Cursor c = getSmsCursor();
+        c.moveToFirst();
+
+        String number = c.getString(c.getColumnIndexOrThrow("address"));
+        String body = c.getString(c.getColumnIndexOrThrow("body"));
+
+        c.close();
+
+        assertEquals(NUMBER, number);
+        assertEquals(BODY, body);
+    }
+
+    private Cursor getSmsCursor() throws java.lang.InterruptedException {
+        ContentResolver r = mContext.getContentResolver();
+        Uri message = Uri.parse("content://sms/");
+        Cursor c;
+
+        for(int i = 0; i < SIXY_SECONDS_OF_LOOPS; i++) {
+            c = r.query(message,null,null,null,null);
+
+            if(c.getCount() != 0) {
+                return c;
+            }
+
+            c.close();
+            Thread.sleep(SMS_POLL_TIME_MS);
+        }
+        Assert.fail("Did not find any SMS messages. Giving up");
+        // necessary for compilation
+        return null;
+    }
+
+}
diff --git a/tools/idegen/index-gen.sh b/tools/idegen/index-gen.sh
index 5b9e24b..3363308 100755
--- a/tools/idegen/index-gen.sh
+++ b/tools/idegen/index-gen.sh
@@ -38,8 +38,8 @@
     exit 1
   fi
 fi
-tmp_file=tmp.txt
-dest_file=module-index.txt
+tmp_file=${root_dir}/tmp.txt
+dest_file=${root_dir}/module-index.txt
 
 echo "Generating index file $dest_file..."
 start=$(($(date +%s%N) / 1000000))
diff --git a/tools/idegen/intellij-gen.sh b/tools/idegen/intellij-gen.sh
index d67c1f8..3c4efc5 100755
--- a/tools/idegen/intellij-gen.sh
+++ b/tools/idegen/intellij-gen.sh
@@ -32,13 +32,15 @@
 set -e
 
 progname=`basename $0`
-if [ $# -ne 1 ]
+if [ $# -lt 2 ]
 then
-    echo "Usage: $progname <module_name>"
+    echo "Usage: $progname project_dir module_dir <module_dir>..."
     exit 1
 fi
-module_name=$1
-
+project_dir=${PWD}/$1
+shift
+module_dirs=$@
+echo $module_dirs
 script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 root_dir=$PWD
 if [ ! -e $root_dir/.repo ]; then
@@ -52,7 +54,11 @@
 idegenjar=$script_dir/idegen.jar
 if [ ! -e $idegenjar ]; then
   # See if the jar is in the build directory.
-  idegenjar=$root_dir/out/host/linux-x86/framework/idegen.jar
+  platform="linux"
+  if [ "Darwin" = "$(uname)" ]; then
+    platform="darwin"
+  fi
+  idegenjar="$root_dir/out/host/$platform-x86/framework/idegen.jar"
 fi
 
 if [ ! -e "$index_file" ]; then
@@ -63,8 +69,8 @@
 
 echo "Checking for $idegenjar"
 if [ -e "$idegenjar" ]; then
-  echo "Generating project files for $module_name"
-  cmd="java -cp $idegenjar com.android.idegen.IntellijProject $index_file $module_name"
+  echo "Generating project files for $module_dirs"
+  cmd="java -cp $idegenjar com.android.idegen.IntellijProject $index_file $project_dir $module_dirs"
   echo $cmd
   $cmd
 else
diff --git a/tools/idegen/src/com/android/idegen/AggregatedModule.java b/tools/idegen/src/com/android/idegen/AggregatedModule.java
deleted file mode 100644
index 1497da7..0000000
--- a/tools/idegen/src/com/android/idegen/AggregatedModule.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.idegen;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- * Module while is a composition of many other modules.
- * <p>
- * This is needed since intellij does not allow two modules to share the same content root.
- */
-public class AggregatedModule extends Module {
-
-    private static final Logger logger = Logger.getLogger(AggregatedModule.class.getName());
-
-    private String aggregatedModuleName;
-    private Set<Module> modules;
-    private HashSet<String> directDependencies = Sets.newHashSet();
-
-    public AggregatedModule(String aggregatedName, Set<Module> modules) {
-        this.aggregatedModuleName = Preconditions.checkNotNull(aggregatedName);
-        this.modules = Preconditions.checkNotNull(modules);
-    }
-
-    public void build() throws IOException {
-        // Create an iml file that contains all the srcs of modules.
-        buildDependentModules();
-        buildDirectDependencies();
-        //buildImlFile();
-    }
-
-    @Override
-    protected File getDir() {
-        // All modules should be in the same directory so just pull the first.
-        return modules.iterator().next().getDir();
-    }
-
-    @Override
-    protected boolean isAndroidModule() {
-        for (Module module : modules) {
-            if (module.isAndroidModule()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    protected List<File> getIntermediatesDirs() {
-        List<File> result = Lists.newArrayList();
-        for (Module module : modules) {
-            Iterables.addAll(result, module.getIntermediatesDirs());
-        }
-        return result;
-    }
-
-    public void buildDirectDependencies() {
-        for (Module module : modules) {
-            Set<String> deps = module.getDirectDependencies();
-            directDependencies.addAll(deps);
-        }
-    }
-
-    @Override
-    public Set<String> getDirectDependencies() {
-        return directDependencies;
-    }
-
-    @Override
-    protected ImmutableList<File> getSourceDirs() {
-        ImmutableList.Builder<File> builder = ImmutableList.builder();
-        for (Module module : modules) {
-            builder.addAll(module.getSourceDirs());
-        }
-        return builder.build();
-    }
-
-
-    @Override
-    protected ImmutableList<File> getExcludeDirs() {
-        ImmutableList.Builder<File> builder = ImmutableList.builder();
-        for (Module module : modules) {
-            builder.addAll(module.getExcludeDirs());
-        }
-        return builder.build();
-    }
-
-    @Override
-    public Set<File> getAllDependentImlFiles() {
-        Set<File> result = Sets.newHashSet();
-        for (Module module : modules) {
-            result.addAll(module.getAllDependentImlFiles());
-        }
-        return result;
-    }
-
-    @Override
-    public File getRepoRoot() {
-        return modules.iterator().next().getRepoRoot();
-    }
-
-    @Override
-    public String getName() {
-        return aggregatedModuleName;
-    }
-
-}
diff --git a/tools/idegen/src/com/android/idegen/DirectorySearch.java b/tools/idegen/src/com/android/idegen/DirectorySearch.java
index 2ff23e3..c289ac2 100644
--- a/tools/idegen/src/com/android/idegen/DirectorySearch.java
+++ b/tools/idegen/src/com/android/idegen/DirectorySearch.java
@@ -23,6 +23,7 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FilenameFilter;
+import java.io.IOException;
 import java.net.URISyntaxException;
 import java.util.HashSet;
 import java.util.logging.Level;
@@ -37,7 +38,8 @@
 
     private static final Logger logger = Logger.getLogger(DirectorySearch.class.getName());
 
-    private static final HashSet<String> SOURCE_DIRS = Sets.newHashSet();
+    public static final HashSet<String> SOURCE_DIRS = Sets.newHashSet();
+
     static {
         SOURCE_DIRS.add("src");
         SOURCE_DIRS.add("java");
@@ -51,37 +53,71 @@
             + REL_TEMPLATE_DIR;
 
     /**
+     * Returns the previously initialized repo root.
+     */
+    public static File getRepoRoot() {
+        Preconditions.checkNotNull(repoRoot, "repoRoot has not been initialized yet.  Call "
+                + "findAndInitRepoRoot() first.");
+        return repoRoot;
+    }
+
+    /**
      * Find the repo root.  This is the root branch directory of a full repo checkout.
      *
      * @param file any file inside the root.
      * @return the root directory.
      */
-    public static File findRepoRoot(File file) {
+    public static void findAndInitRepoRoot(File file) {
         Preconditions.checkNotNull(file);
         if (repoRoot != null) {
-            return repoRoot;
+            return;
         }
 
         if (file.isDirectory()) {
             File[] files = file.listFiles(new FilenameFilter() {
                 @Override
                 public boolean accept(File dir, String name) {
-                   if (".repo".equals(name)) {
-                       return true;
-                   }
-                   return false;
+                    return ".repo".equals(name);
                 }
             });
             if (files.length > 0) {
                 repoRoot = file;
-                return file;
             }
         }
         File parent = file.getParentFile();
         if (parent == null) {
-            return null;
+            throw new IllegalStateException("Repo root not found from starting point " +
+                    file.getPath());
         }
-        return findRepoRoot(parent);
+        findAndInitRepoRoot(parent);
+    }
+
+    /**
+     * Searches up the parent chain to find the closes module root directory. A module root is one
+     * with an Android.mk file in it. <p> For example, the module root for directory
+     * <code>package/apps/Contacts/src</code> is <code>packages/apps/Contacts</code>
+     *
+     * @return the module root.
+     * @throws IOException when module root is not found.
+     */
+    public static File findModuleRoot(File path) throws IOException {
+        Preconditions.checkNotNull(path);
+        File dir;
+        if (path.isFile()) {
+            dir = path.getParentFile();
+        } else {
+            dir = path;
+        }
+        while (dir != null) {
+            File makeFile = new File(dir, "Android.mk");
+            if (makeFile.exists()) {
+                return dir;
+            } else {
+                dir = dir.getParentFile();
+            }
+        }
+        // At this point, there are no parents and we have not found a module. Error.
+        throw new IOException("Module root not found for path " + path.getCanonicalPath());
     }
 
     /**
@@ -105,10 +141,19 @@
         File[] children = file.listFiles();
         for (File child : children) {
             if (child.isDirectory()) {
-                if (SOURCE_DIRS.contains(child.getName())) {
-                    builder.add(child);
+                // Recurse further down the tree first to cover case of:
+                //
+                // src/java
+                //   or
+                // java/src
+                //
+                // In either of these cases, we don't want the parent.
+                ImmutableList<File> dirs = findSourceDirs(child);
+                if (dirs.isEmpty()) {
+                    if (SOURCE_DIRS.contains(child.getName())) {
+                        builder.add(child);
+                    }
                 } else {
-                    ImmutableList<File> dirs = findSourceDirs(child);
                     builder.addAll(dirs);
                 }
             }
@@ -151,20 +196,28 @@
     private static File templateDirCurrent = null;
     private static File templateDirRoot = null;
 
-    public static File findTemplateDir() throws FileNotFoundException {
+    public static File findTemplateDir() throws IOException {
         // Cache optimization.
-        if (templateDirCurrent != null && templateDirCurrent.exists()) return templateDirCurrent;
-        if (templateDirRoot != null && templateDirRoot.exists()) return templateDirRoot;
+        if (templateDirCurrent != null && templateDirCurrent.exists()) {
+            return templateDirCurrent;
+        }
+        if (templateDirRoot != null && templateDirRoot.exists()) {
+            return templateDirRoot;
+        }
 
         File currentDir = null;
         try {
-            currentDir = new File(IntellijProject.class.getProtectionDomain().getCodeSource()
-                    .getLocation().toURI().getPath()).getParentFile();
+            currentDir = new File(
+                    IntellijProject.class.getProtectionDomain().getCodeSource().getLocation()
+                            .toURI().getPath()).getParentFile();
         } catch (URISyntaxException e) {
             logger.log(Level.SEVERE, "Could not get jar location.", e);
             return null;
         }
-
+        // Support for program execution in intellij.
+        if (currentDir.getPath().endsWith("out/production")) {
+            return new File(currentDir.getParentFile().getParentFile(), REL_TEMPLATE_DIR);
+        }
         // First check relative to current run directory.
         templateDirCurrent = new File(currentDir, REL_TEMPLATE_DIR);
         if (templateDirCurrent.exists()) {
@@ -178,7 +231,7 @@
         }
         throw new FileNotFoundException(
                 "Unable to find template dir. Tried the following locations:\n" +
-                templateDirCurrent.getAbsolutePath() + "\n" +
-                templateDirRoot.getAbsolutePath());
+                        templateDirCurrent.getCanonicalPath() + "\n" +
+                        templateDirRoot.getCanonicalPath());
     }
 }
diff --git a/tools/idegen/src/com/android/idegen/FrameworkModule.java b/tools/idegen/src/com/android/idegen/FrameworkModule.java
index 8743925..47ea35a 100644
--- a/tools/idegen/src/com/android/idegen/FrameworkModule.java
+++ b/tools/idegen/src/com/android/idegen/FrameworkModule.java
@@ -16,33 +16,35 @@
 
 package com.android.idegen;
 
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 
 import java.io.File;
+import java.io.IOException;
 
 /**
  * Special module used for framework to build one off resource directory.
  */
-public class FrameworkModule extends StandardModule {
+public class FrameworkModule extends Module {
 
     // Framework needs a special constant for it's intermediates because it does not follow
     // normal conventions.
     private static final String FRAMEWORK_INTERMEDIATES = "framework-res_intermediates";
 
-    public FrameworkModule(String moduleName, String makeFile) {
-        super(IntellijProject.FRAMEWORK_MODULE, makeFile, true);
+    public FrameworkModule(File moduleDir) throws IOException {
+        super(Preconditions.checkNotNull(moduleDir), false);
     }
 
     @Override
-    protected String buildIntermediates() {
+    protected String buildIntermediates() throws IOException {
         StringBuilder sb = new StringBuilder();
-        File intermediates = new File(repoRoot,
+        File intermediates = new File(DirectorySearch.getRepoRoot(),
                 REL_OUT_APP_DIR + File.separator +  FRAMEWORK_INTERMEDIATES);
         ImmutableList<File> intermediateSrcDirs = DirectorySearch.findSourceDirs(intermediates);
         sb.append("    <content url=\"file://").append(intermediates).append("\">\n");
         for (File src : intermediateSrcDirs) {
             sb.append("      <sourceFolder url=\"file://")
-                    .append(src.getAbsolutePath()).append("\" isTestSource=\"false\" />\n");
+                    .append(src.getCanonicalPath()).append("\" isTestSource=\"false\" />\n");
         }
         sb.append("    </content>\n");
         return sb.toString();
diff --git a/tools/idegen/src/com/android/idegen/IntellijProject.java b/tools/idegen/src/com/android/idegen/IntellijProject.java
index e49a12b..e3b8d94 100644
--- a/tools/idegen/src/com/android/idegen/IntellijProject.java
+++ b/tools/idegen/src/com/android/idegen/IntellijProject.java
@@ -17,14 +17,14 @@
 package com.android.idegen;
 
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Sets;
+import com.google.common.collect.Lists;
 import com.google.common.io.Files;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Set;
 import java.util.logging.Logger;
 
 /**
@@ -32,7 +32,7 @@
  */
 public class IntellijProject {
 
-    public static final String FRAMEWORK_MODULE = "framework";
+    public static final String FRAMEWORK_MODULE_DIR = "frameworks/base";
     public static final Charset CHARSET = Charset.forName("UTF-8");
 
     private static final Logger logger = Logger.getLogger(IntellijProject.class.getName());
@@ -42,147 +42,116 @@
 
     ModuleCache cache = ModuleCache.getInstance();
 
+    boolean buildFramework;
     File indexFile;
-    File repoRoot;
-    File projectIdeaDir;
-    String moduleName;
+    File projectPath;
+    ArrayList<String> moduleDirs;
 
-    public IntellijProject(String indexFile, String moduleName) {
+    public IntellijProject(String indexFile, String projectPath, ArrayList<String> moduleDirs,
+            boolean buildFramework) {
         this.indexFile = new File(Preconditions.checkNotNull(indexFile));
-        this.moduleName = Preconditions.checkNotNull(moduleName);
-    }
-
-    private void init() throws IOException {
-        repoRoot = DirectorySearch.findRepoRoot(indexFile);
-        cache.init(indexFile);
+        this.projectPath = new File(Preconditions.checkNotNull(projectPath));
+        this.moduleDirs = Preconditions.checkNotNull(moduleDirs);
+        this.buildFramework = buildFramework;
+        DirectorySearch.findAndInitRepoRoot(this.indexFile);
     }
 
     public void build() throws IOException {
-        init();
-        buildFrameWorkModule();
-
-        // First pass, find all dependencies and cache them.
-        Module module = cache.getAndCache(moduleName);
-        if (module == null) {
-            logger.info("Module '" + moduleName + "' not found." +
-                    " Module names are case senstive.");
-            return;
-        }
-        projectIdeaDir = new File(module.getDir(), ".idea");
-        projectIdeaDir.mkdir();
-        copyTemplates();
-
-        // Second phase, build aggregate modules.
-        Set<String> deps = module.getAllDependencies();
-        for (String dep : deps) {
-            cache.buildAndCacheAggregatedModule(dep);
+        cache.init(indexFile);
+        File repoRoot = DirectorySearch.getRepoRoot();
+        if (buildFramework) {
+            File frameworkDir = new File(repoRoot, FRAMEWORK_MODULE_DIR);
+            // Some unbundled apps/branches do not include the framework.
+            if (frameworkDir.exists()) {
+                buildFrameWorkModule(new File(repoRoot, FRAMEWORK_MODULE_DIR));
+            }
         }
 
-        // Third phase, replace individual modules with aggregated modules
-        Iterable<Module> modules = cache.getModules();
-        for (Module mod : modules) {
-            replaceWithAggregate(mod);
+        for (String moduleDir : moduleDirs) {
+            // First pass, find all dependencies and cache them.
+            File dir = new File(repoRoot, moduleDir);
+            if (!dir.exists()) {
+                logger.info("Directory " + moduleDir + " does not exist in " + repoRoot +
+                        ". Are you sure the directory is correct?");
+                return;
+            }
+            Module module = cache.getAndCacheByDir(dir);
+            if (module == null) {
+                logger.info("Module '" + dir.getPath() + "' not found." +
+                        " Module names are case senstive.");
+                return;
+            }
         }
 
         // Finally create iml files for dependencies
+        Iterable<Module> modules = cache.getModules();
         for (Module mod : modules) {
             mod.buildImlFile();
         }
 
-        createModulesFile(module);
-        createVcsFile(module);
-        createNameFile(moduleName);
+        createProjectFiles();
     }
 
-    private void replaceWithAggregate(Module module) {
-        replaceWithAggregate(module.getDirectDependencies(), module.getName());
-        replaceWithAggregate(module.getAllDependencies(), module.getName());
-
-    }
-
-    private void replaceWithAggregate(Set<String> deps, String moduleName) {
-        for (String dep : Sets.newHashSet(deps)) {
-            String replacement = cache.getAggregateReplacementName(dep);
-            if (replacement != null) {
-
-                deps.remove(dep);
-                // There could be dependencies on self due to aggregation.
-                // Only add if the replacement is not self.
-                if (!replacement.equals(moduleName)) {
-                    deps.add(replacement);
-                }
-            }
-        }
+    private void createProjectFiles() throws IOException {
+        File ideaDir = new File(projectPath, ".idea");
+        ideaDir.mkdirs();
+        copyTemplates(ideaDir);
+        createModulesFile(ideaDir, cache.getModules());
+        createVcsFile(ideaDir, cache.getModules());
+        createNameFile(ideaDir, projectPath.getName());
     }
 
     /**
      * Framework module needs special handling due to one off resource path:
      * frameworks/base/Android.mk
      */
-    private void buildFrameWorkModule() throws IOException {
-        String makeFile = cache.getMakeFile(FRAMEWORK_MODULE);
-        if (makeFile == null) {
-            logger.warning("Unable to find framework module: " + FRAMEWORK_MODULE +
-                    ". Skipping.");
-        } else {
-            logger.info("makefile: " + makeFile);
-            StandardModule frameworkModule = new FrameworkModule(FRAMEWORK_MODULE,
-                    makeFile);
-            frameworkModule.build();
-            cache.put(frameworkModule);
-        }
+    private void buildFrameWorkModule(File frameworkModuleDir) throws IOException {
+        FrameworkModule frameworkModule = new FrameworkModule(frameworkModuleDir);
+        frameworkModule.build();
+        cache.put(frameworkModule);
     }
 
-    private void createModulesFile(Module module) throws IOException {
-        String modulesContent = Files.toString(
-                new File(DirectorySearch.findTemplateDir(),
-                        "idea" + File.separator + MODULES_TEMPLATE_FILE_NAME),
-                CHARSET);
+    private void createModulesFile(File ideaDir, Iterable<Module> modules) throws IOException {
+        String modulesContent = Files.toString(new File(DirectorySearch.findTemplateDir(),
+                "idea" + File.separator + MODULES_TEMPLATE_FILE_NAME), CHARSET);
         StringBuilder sb = new StringBuilder();
-        File moduleIml = module.getImlFile();
-        sb.append("      <module fileurl=\"file://").append(moduleIml.getAbsolutePath())
-                .append("\" filepath=\"").append(moduleIml.getAbsolutePath()).append("\" />\n");
-        for (String name : module.getAllDependencies()) {
-            Module mod = cache.getAndCache(name);
+        for (Module mod : modules) {
             File iml = mod.getImlFile();
-            sb.append("      <module fileurl=\"file://").append(iml.getAbsolutePath())
-                    .append("\" filepath=\"").append(iml.getAbsolutePath()).append("\" />\n");
+            sb.append("      <module fileurl=\"file://").append(iml.getCanonicalPath()).append(
+                    "\" filepath=\"").append(iml.getCanonicalPath()).append("\" />\n");
         }
         modulesContent = modulesContent.replace("@MODULES@", sb.toString());
 
-        File out = new File(projectIdeaDir, "modules.xml");
-        logger.info("Creating " + out.getAbsolutePath());
+        File out = new File(ideaDir, "modules.xml");
+        logger.info("Creating " + out.getCanonicalPath());
         Files.write(modulesContent, out, CHARSET);
     }
 
-    private void createVcsFile(Module module) throws IOException {
-        String vcsTemplate = Files.toString(
-                new File(DirectorySearch.findTemplateDir(),
-                        "idea" + File.separator + VCS_TEMPLATE_FILE_NAME),
-                CHARSET);
+    private void createVcsFile(File ideaDir, Iterable<Module> modules) throws IOException {
+        String vcsTemplate = Files.toString(new File(DirectorySearch.findTemplateDir(),
+                "idea" + File.separator + VCS_TEMPLATE_FILE_NAME), CHARSET);
 
         StringBuilder sb = new StringBuilder();
-        for (String name : module.getAllDependencies()) {
-            Module mod = cache.getAndCache(name);
+        for (Module mod : modules) {
             File dir = mod.getDir();
             File gitRoot = new File(dir, ".git");
             if (gitRoot.exists()) {
-                sb.append("    <mapping directory=\"").append(dir.getAbsolutePath())
-                        .append("\" vcs=\"Git\" />\n");
+                sb.append("    <mapping directory=\"").append(dir.getCanonicalPath()).append(
+                        "\" vcs=\"Git\" />\n");
             }
         }
         vcsTemplate = vcsTemplate.replace("@VCS@", sb.toString());
-        Files.write(vcsTemplate, new File(projectIdeaDir, "vcs.xml"), CHARSET);
+        Files.write(vcsTemplate, new File(ideaDir, "vcs.xml"), CHARSET);
     }
 
-    private void createNameFile(String name) throws IOException {
-        File out = new File(projectIdeaDir, ".name");
+    private void createNameFile(File ideaDir, String name) throws IOException {
+        File out = new File(ideaDir, ".name");
         Files.write(name, out, CHARSET);
     }
 
-    private void copyTemplates() throws IOException {
+    private void copyTemplates(File ideaDir) throws IOException {
         File templateDir = DirectorySearch.findTemplateDir();
-        copyTemplates(new File(templateDir, "idea"), projectIdeaDir);
+        copyTemplates(new File(templateDir, "idea"), ideaDir);
     }
 
     private void copyTemplates(File fromDir, File toDir) throws IOException {
@@ -191,11 +160,14 @@
         for (File file : files) {
             if (file.isDirectory()) {
                 File destDir = new File(toDir, file.getName());
+                if (!destDir.exists()) {
+                    destDir.mkdirs();
+                }
                 copyTemplates(file, destDir);
             } else {
                 File toFile = new File(toDir, file.getName());
-                logger.info("copying " + file.getAbsolutePath() + " to " +
-                        toFile.getAbsolutePath());
+                logger.info("copying " + file.getCanonicalPath() + " to " +
+                        toFile.getCanonicalPath());
                 Files.copy(file, toFile);
             }
         }
@@ -204,10 +176,32 @@
     public static void main(String[] args) {
         logger.info("Args: " + Arrays.toString(args));
 
-        String indexFile = args[0];
-        String module = args[1];
+        if (args.length < 3) {
+            logger.severe("Not enough input arguments. Aborting");
+            return;
+        }
 
-        IntellijProject intellij = new IntellijProject(indexFile, module);
+        boolean buildFramework = true;
+        int argIndex = 0;
+        String arg = args[argIndex];
+        while (arg.startsWith("--")) {
+            if  (arg.equals("--no-framework")) {
+                buildFramework = false;
+            }
+            argIndex++;
+            arg = args[argIndex];
+        }
+
+        String indexFile = args[argIndex++];
+        String projectPath = args[argIndex++];
+        // Remaining args are module directories
+        ArrayList<String> moduleDirs = Lists.newArrayList();
+        for (int i = argIndex; i < args.length; i++) {
+            moduleDirs.add(args[i]);
+        }
+
+        IntellijProject intellij = new IntellijProject(indexFile, projectPath, moduleDirs,
+                buildFramework);
         try {
             intellij.build();
         } catch (IOException e) {
diff --git a/tools/idegen/src/com/android/idegen/MakeFileParser.java b/tools/idegen/src/com/android/idegen/MakeFileParser.java
index 3594d50..9a41b09 100644
--- a/tools/idegen/src/com/android/idegen/MakeFileParser.java
+++ b/tools/idegen/src/com/android/idegen/MakeFileParser.java
@@ -22,6 +22,7 @@
 import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
 import com.google.common.io.Files;
 import com.google.common.io.LineProcessor;
 
@@ -29,7 +30,9 @@
 import java.io.IOException;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -41,16 +44,7 @@
     private static final Logger logger = Logger.getLogger(MakeFileParser.class.getName());
     public static final String VALUE_DELIMITER = "|";
 
-    private enum State {
-        NEW, CONTINUE
-    }
-    private enum ModuleNameKey {
-        LOCAL_PACKAGE_NAME,
-        LOCAL_MODULE
-    };
-
     private File makeFile;
-    private String moduleName;
     private HashMap<String, String> values;
 
     /**
@@ -59,11 +53,9 @@
      * A make file may contain multiple modules.
      *
      * @param makeFile The make file to parse.
-     * @param moduleName The module to extract.
      */
-    public MakeFileParser(File makeFile, String moduleName) {
+    public MakeFileParser(File makeFile) {
         this.makeFile = Preconditions.checkNotNull(makeFile);
-        this.moduleName = Preconditions.checkNotNull(moduleName);
     }
 
     public Iterable<String> getValues(String key) {
@@ -71,163 +63,214 @@
         if (str == null) {
             return null;
         }
-        return Splitter.on(VALUE_DELIMITER)
-                .trimResults()
-                .omitEmptyStrings()
-                .split(str);
+        return Splitter.on(VALUE_DELIMITER).trimResults().omitEmptyStrings().split(str);
     }
 
     /**
-     * Extracts the relevant portion of the make file and converts into key value pairs.
-     * <p>
-     * Since each make file may contain multiple build targets (modules), this method will determine
-     * which part is the correct portion for the given module name.
-     *
-     * @throws IOException
+     * Extracts the relevant portion of the make file and converts into key value pairs. <p> Since
+     * each make file may contain multiple build targets (modules), this method will determine which
+     * part is the correct portion for the given module name.
      */
     public void parse() throws IOException {
         values = Maps.newHashMap();
-        logger.info("Parsing " + makeFile.getAbsolutePath() + " for module " + moduleName);
+        logger.info("Parsing " + makeFile.getCanonicalPath());
 
-        Files.readLines(makeFile, Charset.forName("UTF-8"), new LineProcessor<Object>() {
-
-            private String key;
-
-            private State state = State.NEW;
-
-            @Override
-            public boolean processLine(String line) throws IOException {
-                String trimmed = line.trim();
-                if (Strings.isNullOrEmpty(trimmed)) {
-                    state = State.NEW;
-                    return true;
-                }
-                if (trimmed.equals("include $(CLEAR_VARS)")) {
-                    // See if we are in the right module.
-                    if (moduleName.equals(getModuleName())) {
-                        return false;
-                    } else {
-                        values.clear();
-                    }
-                } else {
-                    switch (state) {
-                        case NEW:
-                            trimmed = checkContinue(trimmed);
-                            if (trimmed.contains("=")) {
-                                String[] arr;
-                                if (trimmed.contains(":")) {
-                                    arr = trimmed.split(":=");
-                                } else {
-                                    arr = trimmed.split("\\+=");
-                                }
-                                if (arr.length > 2) {
-                                    logger.info("Malformed line " + line);
-                                } else {
-                                    // Store the key in case the line continues
-                                    this.key = arr[0].trim();
-                                    if (arr.length == 2) {
-                                        // There may be multiple values on one line.
-                                        List<String> valuesArr = tokenizeValue(arr[1].trim());
-                                        for (String value : valuesArr) {
-                                            appendValue(this.key, value);
-                                        }
-
-                                    }
-                                }
-                            } else {
-                                //logger.info("Skipping line " + line);
-                            }
-                            break;
-                        case CONTINUE:
-                            // append
-                            trimmed = checkContinue(trimmed);
-                            appendValue(key, trimmed);
-                            break;
-                        default:
-
-                    }
-                }
-                return true;
-            }
-
-            private List<String> tokenizeValue(String value) {
-                // Value may contain function calls such as "$(call all-java-files-under)".
-                // Tokens are separated by spaces unless it's between parens.
-                StringBuilder token = new StringBuilder();
-                ArrayList<String> tokens = Lists.newArrayList();
-                int parenCount = 0;
-                for (int i = 0; i < value.length(); i++) {
-                    char ch = value.charAt(i);
-                    if (parenCount == 0 && ch == ' ') {
-                        // Not in a paren and delimiter encountered.
-                        // end token
-                        if (token.length() > 0) {
-                            tokens.add(token.toString());
-                            token = new StringBuilder();
-                        }
-                    } else {
-                        token.append(ch);
-                    }
-                    if (ch == '(') {
-                        parenCount++;
-                    } else if (ch == ')') {
-                        parenCount--;
-                    }
-                }
-                // end of line check
-                if (token.length() > 0) {
-                    tokens.add(token.toString());
-                }
-                return tokens;
-            }
-
-            private String getModuleName() {
-                for (ModuleNameKey key : ModuleNameKey.values()) {
-                    String name = values.get(key.name());
-                    if (name != null) {
-                        return name;
-                    }
-                }
-                return null;
-            }
-
-            @Override
-            public Object getResult() {
-                return null;
-            }
-
-            private String checkContinue(String value) {
-                // Check for continuation character
-                if (value.charAt(value.length() - 1) == '\\') {
-                    state = State.CONTINUE;
-                    return value.substring(0, value.length() - 1);
-                }
-                state = State.NEW;
-                return value;
-            }
-
-            /**
-             * Add a value to the hash map. If the key already exists, will append instead of
-             * over-writing the existing value.
-             *
-             * @param key The hashmap key
-             * @param newValue The value to append.
-             */
-            private void appendValue(String key, String newValue) {
-                String value = values.get(key);
-                if (value == null) {
-                    values.put(key, newValue);
-                } else {
-                    values.put(key, value + VALUE_DELIMITER + newValue);
-                }
-            }
-        });
+        Files.readLines(makeFile, Charset.forName("UTF-8"), new MakeFileLineProcessor());
     }
 
     @Override
     public String toString() {
-        return Objects.toStringHelper(this)
-                .add("values", values)
-                .toString();
+        return Objects.toStringHelper(this).add("values", values).toString();
+    }
+
+    private class MakeFileLineProcessor implements LineProcessor<Object> {
+
+        private StringBuilder lineBuffer;
+
+        // Keep a list of LOCAL_ variables to clear when CLEAR_VARS is encountered.
+        private HashSet<String> localVars = Sets.newHashSet();
+
+        @Override
+        public boolean processLine(String line) throws IOException {
+            String trimmed = line.trim();
+            // Skip comments.
+            if (!trimmed.isEmpty() && trimmed.charAt(0) == '#') {
+                return true;
+            }
+            appendPartialLine(trimmed);
+
+            if (!trimmed.isEmpty() && trimmed.charAt(trimmed.length() - 1) == '\\') {
+                // This is a partial line.  Do not process yet.
+                return true;
+            }
+
+            String completeLine = lineBuffer.toString().trim();
+            // Reset the line buffer.
+            lineBuffer = null;
+
+            if (Strings.isNullOrEmpty(completeLine)) {
+                return true;
+            }
+
+            processKeyValuePairs(completeLine);
+            return true;
+        }
+
+        private void processKeyValuePairs(String line) {
+            if (line.contains("=")) {
+                String[] arr;
+                if (line.contains(":")) {
+                    arr = line.split(":=");
+                } else {
+                    arr = line.split("\\+=");
+                }
+                if (arr.length > 2) {
+                    logger.info("Malformed line " + line);
+                } else {
+                    // Store the key in case the line continues
+                    String key = arr[0].trim();
+                    if (arr.length == 2) {
+                        // There may be multiple values on one line.
+                        List<String> valuesArr = tokenizeValue(arr[1]);
+                        for (String value : valuesArr) {
+                            appendValue(key, value);
+                        }
+
+                    }
+                }
+            } else {
+                //logger.info("Skipping line " + line);
+            }
+        }
+
+        private void appendPartialLine(String line) {
+            if (lineBuffer == null) {
+                lineBuffer = new StringBuilder();
+            } else {
+                lineBuffer.append(" ");
+            }
+            if (line.endsWith("\\")) {
+                lineBuffer.append(line.substring(0, line.length() - 2).trim());
+            } else {
+                lineBuffer.append(line);
+            }
+        }
+
+        private List<String> tokenizeValue(String rawValue) {
+            String value = rawValue.trim();
+            ArrayList<String> result = Lists.newArrayList();
+            if (value.isEmpty()) {
+                return result;
+            }
+
+            // Value may contain function calls such as "$(call all-java-files-under)" or refer
+            // to variables such as "$(my_var)"
+            value = findVariables(value);
+
+            String[] tokens = value.split(" ");
+            Collections.addAll(result, tokens);
+            return result;
+        }
+
+        private String findVariables(String value) {
+
+            int variableStart = value.indexOf('$');
+            // Keep going until we substituted all variables.
+            while (variableStart > -1) {
+                StringBuilder sb = new StringBuilder();
+                sb.append(value.substring(0, variableStart));
+
+                // variable found
+                int variableEnd = findClosingParen(value, variableStart);
+                if (variableEnd > variableStart) {
+                    String result = substituteVariables(value.substring(variableStart + 2, variableEnd));
+                    sb.append(result);
+                } else {
+                    throw new IllegalArgumentException(
+                            "Malformed variable reference in make file: " + value);
+                }
+                if (variableEnd + 1 < value.length()) {
+                    sb.append(value.substring(variableEnd + 1));
+                }
+                value = sb.toString();
+                variableStart = value.indexOf('$');
+            }
+            return value;
+        }
+
+        private int findClosingParen(String value, int startIndex) {
+            int openParenCount = 0;
+            for (int i = startIndex; i < value.length(); i++) {
+                char ch = value.charAt(i);
+                if (ch == ')') {
+                    openParenCount--;
+                    if (openParenCount == 0) {
+                        return i;
+                    }
+                } else if (ch == '(') {
+                    openParenCount++;
+                }
+            }
+            return -1;
+        }
+
+        /**
+         * Look for and handle $(...) variables.
+         */
+        private String substituteVariables(String rawValue) {
+            if (rawValue.isEmpty()) {
+                return rawValue;
+            }
+            String value = rawValue;
+            if (value.startsWith("call all-java-files-under")) {
+                // Ignore the call and function, keep the args.
+                value = value.substring(25).trim();
+            } else if (value.startsWith("call")) {
+                value = value.substring(4).trim();
+            }
+
+            // Check for single variable
+            if (value.indexOf(' ') == -1) {
+                // Substitute.
+                value = values.get(value);
+                if (value == null) {
+                    value = "";
+                }
+                return value;
+            } else {
+                return findVariables(value);
+            }
+        }
+
+        @Override
+        public Object getResult() {
+            return null;
+        }
+
+        /**
+         * Add a value to the hash map. If the key already exists, will append instead of
+         * over-writing the existing value.
+         *
+         * @param key The hashmap key
+         * @param newValue The value to append.
+         */
+        private void appendValue(String key, String newValue) {
+            String value = values.get(key);
+            if (value == null) {
+                values.put(key, newValue);
+            } else {
+                values.put(key, value + VALUE_DELIMITER + newValue);
+            }
+        }
+    }
+
+    public static void main(String[] args) {
+        MakeFileParser parser = new MakeFileParser(new File(args[0]));
+        try {
+            parser.parse();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        System.out.println(parser.toString());
     }
 }
diff --git a/tools/idegen/src/com/android/idegen/Module.java b/tools/idegen/src/com/android/idegen/Module.java
index deb2281..4695ca3 100644
--- a/tools/idegen/src/com/android/idegen/Module.java
+++ b/tools/idegen/src/com/android/idegen/Module.java
@@ -17,24 +17,44 @@
 package com.android.idegen;
 
 import com.google.common.base.Objects;
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.common.io.Files;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Logger;
 
 /**
- * Super class for all modules.
+ * Module constructed from a make file.
+ *
+ * TODO: read the make file and understand included source dirs in addition to searching
+ * sub-directories.  Make files can include sources that are not sub-directories.  For example, the
+ * framework module includes sources from:
+ *
+ * external/libphonenumber/java/src
+ *
+ * to provide:
+ *
+ * com.android.i18n.phonenumbers.PhoneNumberUtil;
  */
-public abstract class Module {
+public class Module {
 
     private static final Logger logger = Logger.getLogger(Module.class.getName());
 
+    public static final String REL_OUT_APP_DIR = "out/target/common/obj/APPS";
+
     private static final String IML_TEMPLATE_FILE_NAME = "module-template.iml";
+    private static final String[] AUTO_DEPENDENCIES = new String[]{"framework", "libcore"};
+    private static final String[] DIRS_WITH_AUTO_DEPENDENCIES = new String[]{"packages", "vendor",
+            "frameworks/ex", "frameworks/opt", "frameworks/support"};
 
     /**
      * All possible attributes for the make file.
@@ -45,31 +65,155 @@
         LOCAL_SRC_FILES
     }
 
-    ModuleCache moduleCache = ModuleCache.getInstance();
+    private ModuleCache moduleCache = ModuleCache.getInstance();
 
     private File imlFile;
-
     private Set<String> allDependencies = Sets.newHashSet(); // direct + indirect
-
     private Set<File> allDependentImlFiles = Sets.newHashSet();
 
-    protected abstract void build() throws IOException;
+    private File makeFile;
+    private File moduleRoot;
+    private HashSet<File> sourceFiles = Sets.newHashSet();
 
-    protected abstract String getName();
+    // Module dependencies come from LOCAL_STATIC_JAVA_LIBRARIES or LOCAL_JAVA_LIBRARIES
+    Set<String> explicitModuleNameDependencies = Sets.newHashSet();
+    // Implicit module dependencies come from src files that fall outside the module root directory.
+    // For example, if packages/apps/Contacts includes src files from packages/apps/ContactsCommon,
+    // that is an implicit module dependency.  It's not a module dependency from the build
+    // perspective but it needs to be a separate module in intellij so that the src files can be
+    // shared by multiple intellij modules.
+    Set<File> implicitModulePathDependencies = Sets.newHashSet();
 
-    protected abstract File getDir();
+    String relativeIntermediatesDir;
+    MakeFileParser makeFileParser;
+    boolean parseMakeFileForSource;
 
-    protected abstract boolean isAndroidModule();
+    public Module(File moduleDir) throws IOException {
+        this(moduleDir, true);
+    }
 
-    protected abstract List<File> getIntermediatesDirs();
+    public Module(File moduleDir, boolean parseMakeFileForSource) throws IOException {
+        this.moduleRoot = Preconditions.checkNotNull(moduleDir);
+        this.makeFile = new File(moduleDir, "Android.mk");
+        this.relativeIntermediatesDir = calculateRelativePartToRepoRoot() + REL_OUT_APP_DIR +
+                File.separatorChar + getName() + "_intermediates" + File.separator + "src";
+        this.parseMakeFileForSource = parseMakeFileForSource;
 
-    public abstract Set<String> getDirectDependencies();
+        // TODO: auto-detect when framework dependency is needed instead of using coded list.
+        for (String dir : DIRS_WITH_AUTO_DEPENDENCIES) {
+            // length + 2 to account for slash
+            boolean isDir = makeFile.getCanonicalPath().startsWith(
+                    DirectorySearch.getRepoRoot() + "/" + dir);
+            if (isDir) {
+                Collections.addAll(this.explicitModuleNameDependencies, AUTO_DEPENDENCIES);
+            }
+        }
 
-    protected abstract ImmutableList<File> getSourceDirs();
+        makeFileParser = new MakeFileParser(makeFile);
+    }
 
-    protected abstract ImmutableList<File> getExcludeDirs();
+    private String calculateRelativePartToRepoRoot() throws IOException {
+        String rel = moduleRoot.getCanonicalPath().substring(
+                DirectorySearch.getRepoRoot().getCanonicalPath().length());
+        int count = 0;
+        // Count the number of slashes to determine how far back to go.
+        for (int i = 0; i < rel.length(); i++) {
+            if (rel.charAt(i) == '/') {
+                count++;
+            }
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < count; i++) {
+            sb.append("../");
+        }
+        return sb.toString();
+    }
 
-    public abstract File getRepoRoot();
+    public void build() throws IOException {
+        makeFileParser.parse();
+        buildDependencyList();
+        buildDependentModules();
+        logger.info("Done building module " + moduleRoot);
+        logger.info(toString());
+    }
+
+    public File getDir() {
+        return moduleRoot;
+    }
+
+    public String getName() {
+        return moduleRoot.getName();
+    }
+
+    private List<String> getRelativeIntermediatesDirs() throws IOException {
+        return Lists.newArrayList(relativeIntermediatesDir);
+    }
+
+    private ImmutableList<File> getSourceDirs() {
+        return ImmutableList.copyOf(sourceFiles);
+    }
+
+    private ImmutableList<File> getExcludeDirs() {
+        return DirectorySearch.findExcludeDirs(makeFile);
+    }
+
+    private boolean isAndroidModule() {
+        File manifest = new File(moduleRoot, "AndroidManifest.xml");
+        return manifest.exists();
+    }
+
+    private void findSourceFilesAndImplicitDependencies() throws IOException {
+        Iterable<String> values = makeFileParser.getValues(Key.LOCAL_SRC_FILES.name());
+        if (values != null) {
+            for (String value : values) {
+                File src = new File(moduleRoot, value);
+
+                // value may contain garbage at this point due to relaxed make file parsing.
+                // filter by existing file.
+                if (src.exists()) {
+                    // Look for directories outside the current module directory.
+                    if (value.contains("..")) {
+                        // Find the closest Android make file.
+                        File moduleRoot = DirectorySearch.findModuleRoot(src);
+                        implicitModulePathDependencies.add(moduleRoot);
+                    } else {
+                        if (parseMakeFileForSource) {
+                            // Check if source files are subdirectories of generic parent src
+                            // directories.  If so, no need to add since they are already included.
+                            boolean alreadyIncluded = false;
+                            for (String parentDir : DirectorySearch.SOURCE_DIRS) {
+                                if (value.startsWith(parentDir)) {
+                                    alreadyIncluded = true;
+                                    break;
+                                }
+                            }
+
+                            if (!alreadyIncluded) {
+                                sourceFiles.add(src);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        sourceFiles.addAll(DirectorySearch.findSourceDirs(moduleRoot));
+    }
+
+    private void buildDependencyList() throws IOException {
+        parseDirectDependencies(Key.LOCAL_STATIC_JAVA_LIBRARIES);
+        parseDirectDependencies(Key.LOCAL_JAVA_LIBRARIES);
+        findSourceFilesAndImplicitDependencies();
+    }
+
+    private void parseDirectDependencies(Key key) {
+        Iterable<String> names = makeFileParser.getValues(key.name());
+        if (names != null) {
+            for (String dependency : names) {
+                explicitModuleNameDependencies.add(dependency);
+            }
+        }
+    }
 
     public void buildImlFile() throws IOException {
         String imlTemplate = Files.toString(
@@ -82,19 +226,24 @@
         }
         imlTemplate = imlTemplate.replace("@FACETS@", facetXml);
 
-        String moduleDir = getDir().getAbsolutePath();
+        String moduleDir = getDir().getCanonicalPath();
 
         StringBuilder sourceDirectories = new StringBuilder();
         sourceDirectories.append("    <content url=\"file://$MODULE_DIR$\">\n");
         ImmutableList<File> srcDirs = getSourceDirs();
         for (File src : srcDirs) {
-            String relative = src.getAbsolutePath().substring(moduleDir.length());
+            String relative = src.getCanonicalPath().substring(moduleDir.length());
+            boolean isTestSource = false;
+            if (relative.startsWith("/test")) {
+                isTestSource = true;
+            }
             sourceDirectories.append("      <sourceFolder url=\"file://$MODULE_DIR$")
-                    .append(relative).append("\" isTestSource=\"false\" />\n");
+                    .append(relative).append("\" isTestSource=\"").append(isTestSource)
+                    .append("\" />\n");
         }
         ImmutableList<File> excludeDirs = getExcludeDirs();
         for (File src : excludeDirs) {
-            String relative = src.getAbsolutePath().substring(moduleDir.length());
+            String relative = src.getCanonicalPath().substring(moduleDir.length());
             sourceDirectories.append("      <excludeFolder url=\"file://$MODULE_DIR$")
                     .append(relative).append("\"/>\n");
         }
@@ -106,43 +255,62 @@
         imlTemplate = imlTemplate.replace("@SOURCES@", sourceDirectories.toString());
 
         StringBuilder moduleDependencies = new StringBuilder();
-        for (String dependency : getDirectDependencies()) {
+        for (String dependency : getAllDependencies()) {
+            Module module = moduleCache.getAndCacheByDir(new File(dependency));
             moduleDependencies.append("    <orderEntry type=\"module\" module-name=\"")
-                    .append(dependency).append("\" />\n");
+                    .append(module.getName()).append("\" />\n");
         }
         imlTemplate = imlTemplate.replace("@MODULE_DEPENDENCIES@", moduleDependencies.toString());
 
         imlFile = new File(moduleDir, getName() + ".iml");
-        logger.info("Creating " + imlFile.getAbsolutePath());
+        logger.info("Creating " + imlFile.getCanonicalPath());
         Files.write(imlTemplate, imlFile, IntellijProject.CHARSET);
     }
 
-    protected String buildIntermediates() {
+    protected String buildIntermediates() throws IOException {
         StringBuilder sb = new StringBuilder();
-        for (File intermediatesDir : getIntermediatesDirs()) {
-            sb.append("    <content url=\"file://").append(intermediatesDir).append("\">\n");
-            sb.append("      <sourceFolder url=\"file://")
-                    .append(intermediatesDir.getAbsolutePath())
+        for (String intermediatesDir : getRelativeIntermediatesDirs()) {
+            sb.append("    <content url=\"file://$MODULE_DIR$/").append(intermediatesDir)
+                    .append("\">\n");
+            sb.append("      <sourceFolder url=\"file://$MODULE_DIR$/")
+                    .append(intermediatesDir)
                     .append("\" isTestSource=\"false\" />\n");
             sb.append("    </content>\n");
         }
         return sb.toString();
     }
 
-    protected void buildDependentModules() throws IOException {
-        Set<String> directDependencies = getDirectDependencies();
-        String[] copy = directDependencies.toArray(new String[directDependencies.size()]);
-        for (String dependency : copy) {
+    private void buildDependentModules() throws IOException {
+        Set<String> moduleNameDependencies = explicitModuleNameDependencies;
 
-            Module child = moduleCache.getAndCache(dependency);
+        String[] copy = moduleNameDependencies.toArray(new String[moduleNameDependencies.size()]);
+        for (String dependency : copy) {
+            logger.info("Building dependency " + dependency);
+            Module child = moduleCache.getAndCacheByName(dependency);
             if (child == null) {
-                directDependencies.remove(dependency);
+                moduleNameDependencies.remove(dependency);
             } else {
-                addAllDependencies(dependency);
-                addAllDependencies(child.getAllDependencies());
+                allDependencies.add(child.getDir().getCanonicalPath());
+                //allDependencies.addAll(child.getAllDependencies());
                 //logger.info("Adding iml " + child.getName() + " " + child.getImlFile());
                 allDependentImlFiles.add(child.getImlFile());
-                allDependentImlFiles.addAll(child.getAllDependentImlFiles());
+                //allDependentImlFiles.addAll(child.getAllDependentImlFiles());
+            }
+        }
+        // Don't include self.  The current module may have been brought in by framework
+        // dependencies which will create a circular reference.
+        allDependencies.remove(this.getDir().getCanonicalPath());
+        allDependentImlFiles.remove(this.getImlFile());
+
+        // TODO: add implicit dependencies.  Convert all modules to be based on directory.
+        for (File dependency : implicitModulePathDependencies) {
+            Module child = moduleCache.getAndCacheByDir(dependency);
+            if (child != null) {
+                allDependencies.add(child.getDir().getCanonicalPath());
+                //allDependencies.addAll(child.getAllDependencies());
+                //logger.info("Adding iml " + child.getName() + " " + child.getImlFile());
+                allDependentImlFiles.add(child.getImlFile());
+                //allDependentImlFiles.addAll(child.getAllDependentImlFiles());
             }
         }
     }
@@ -155,29 +323,22 @@
         return allDependencies;
     }
 
-    public void addAllDependencies(String dependency) {
-        this.allDependencies.add(dependency);
-    }
-
-    public void addAllDependencies(Set<String> dependencies) {
-        this.allDependencies.addAll(dependencies);
-    }
-
     public Set<File> getAllDependentImlFiles() {
         return allDependentImlFiles;
     }
 
-    private String buildAndroidFacet() {
+    private String buildAndroidFacet() throws IOException {
         // Not sure how to handle android facet for multi-module since there could be more than
         // one intermediates directory.
-        String dir = getIntermediatesDirs().get(0).getAbsolutePath();
+        String dir = getRelativeIntermediatesDirs().get(0);
         String xml = ""
                 + "  <component name=\"FacetManager\">\n"
                 + "    <facet type=\"android\" name=\"Android\">\n"
                 + "      <configuration>\n"
-                + "        <option name=\"GEN_FOLDER_RELATIVE_PATH_APT\" value=\"" + dir + "\" />\n"
-                + "        <option name=\"GEN_FOLDER_RELATIVE_PATH_AIDL\" value=\"" + dir
-                + "\" />\n"
+                + "        <option name=\"GEN_FOLDER_RELATIVE_PATH_APT\" value=\"" +
+                dir + "\" />\n"
+                + "        <option name=\"GEN_FOLDER_RELATIVE_PATH_AIDL\" value=\"" +
+                dir + "\" />\n"
                 + "        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\""
                 + "/AndroidManifest.xml\" />\n"
                 + "        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/res\" />\n"
@@ -200,12 +361,33 @@
     }
 
     @Override
+    public int hashCode() {
+        return Objects.hashCode(getName());
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null || getClass() != obj.getClass()) {
+            return false;
+        }
+        Module other = (Module) obj;
+        return Objects.equal(getName(), other.getName());
+    }
+
+    @Override
     public String toString() {
-        return Objects.toStringHelper(Module.class)
+        return Objects.toStringHelper(this)
                 .add("name", getName())
                 .add("allDependencies", allDependencies)
-                .add("iml files", allDependentImlFiles)
-                .add("imlFile", imlFile)
+                .add("iml files", allDependentImlFiles).add("imlFile", imlFile)
+                .add("makeFileParser", makeFileParser)
+                .add("explicitModuleNameDependencies", Iterables.toString(
+                        explicitModuleNameDependencies))
+                .add("implicitModulePathDependencies", Iterables.toString(
+                        implicitModulePathDependencies))
                 .toString();
     }
 }
diff --git a/tools/idegen/src/com/android/idegen/ModuleCache.java b/tools/idegen/src/com/android/idegen/ModuleCache.java
index 093242a..eb12283 100644
--- a/tools/idegen/src/com/android/idegen/ModuleCache.java
+++ b/tools/idegen/src/com/android/idegen/ModuleCache.java
@@ -18,12 +18,10 @@
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
 
 import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
-import java.util.Set;
 import java.util.logging.Logger;
 
 /**
@@ -37,7 +35,9 @@
 
     ModuleIndexes indexes;
 
-    HashMap<String, Module> modulesByName = Maps.newHashMap();
+    // Mapping of canonical module directory to module.  Use string instead of File since File
+    // does not provide equality based on canonical path.
+    HashMap<String, Module> modulesByPath = Maps.newHashMap();
 
     private ModuleCache() {
     }
@@ -51,57 +51,48 @@
         indexes.build();
     }
 
-    public Module getAndCache(String moduleName) throws IOException {
-        Preconditions.checkState(indexes != null, "You must call init() first.");
+    public Module getAndCacheByDir(File moduleDir) throws IOException {
+        Preconditions.checkNotNull(moduleDir);
 
-        Module module = modulesByName.get(moduleName);
-        if (module == null) {
-            String makeFile = indexes.getMakeFile(moduleName);
-            if (makeFile == null) {
-                logger.warning("Unable to find make file for module: " + moduleName);
-            } else {
-                module = new StandardModule(moduleName, makeFile);
+        if (moduleDir.exists()) {
+            Module module = getModule(moduleDir);
+            if (module == null) {
+                module = new Module(moduleDir);
+                // Must put module before building it.  Otherwise infinite loop.
+                putModule(moduleDir, module);
                 module.build();
-                modulesByName.put(moduleName, module);
             }
+            return module;
         }
-        return module;
+        return null;
     }
 
-    public void buildAndCacheAggregatedModule(String moduleName) throws IOException {
-        if (indexes.isPartOfAggregatedModule(moduleName)) {
-            Set<String> moduleNames = indexes.getAggregatedModules(moduleName);
-            Set<Module> modules = Sets.newHashSet();
-            for (String name : moduleNames) {
-                Module m = modulesByName.get(name);
-                if (m != null) {
-                    modules.add(m);
-                }
-            }
-            String aggregatedName = indexes.getAggregateName(moduleName);
-            AggregatedModule module = new AggregatedModule(aggregatedName, modules);
-            module.build();
-            modulesByName.put(aggregatedName, module);
+    public Module getAndCacheByName(String moduleName) throws IOException {
+        Preconditions.checkState(indexes != null, "You must call init() first.");
+        Preconditions.checkNotNull(moduleName);
+
+        String makeFile = indexes.getMakeFile(moduleName);
+        if (makeFile == null) {
+            logger.warning("Unable to find make file for module: " + moduleName);
+            return null;
         }
+        return getAndCacheByDir(new File(makeFile).getParentFile());
+    }
+
+    private void putModule(File moduleDir, Module module) throws IOException {
+        modulesByPath.put(moduleDir.getCanonicalPath(), module);
+    }
+
+    private Module getModule(File moduleDir) throws IOException {
+        return modulesByPath.get(moduleDir.getCanonicalPath());
     }
 
     public Iterable<Module> getModules() {
-        return modulesByName.values();
+        return modulesByPath.values();
     }
 
-    public String getMakeFile(String moduleName) {
-        return indexes.getMakeFile(moduleName);
-    }
-
-    public void put(StandardModule module) {
+    public void put(Module module) throws IOException {
         Preconditions.checkNotNull(module);
-        modulesByName.put(module.getName(), module);
-    }
-
-    public String getAggregateReplacementName(String moduleName) {
-        if (indexes.isPartOfAggregatedModule(moduleName)) {
-            return indexes.getAggregateName(moduleName);
-        }
-        return null;
+        putModule(module.getDir(), module);
     }
 }
diff --git a/tools/idegen/src/com/android/idegen/ModuleIndexes.java b/tools/idegen/src/com/android/idegen/ModuleIndexes.java
index 890389f..371c2ba 100644
--- a/tools/idegen/src/com/android/idegen/ModuleIndexes.java
+++ b/tools/idegen/src/com/android/idegen/ModuleIndexes.java
@@ -49,7 +49,7 @@
 
         moduleNameToMakeFileMap = Maps.newHashMap();
         makeFileToModuleNamesMap = Maps.newHashMap();
-        logger.info("Building index from " + indexFile.getAbsolutePath());
+        logger.info("Building index from " + indexFile.getCanonicalPath());
         Files.readLines(indexFile, Charset.forName("UTF-8"),
                 new LineProcessor<Object>() {
                     int count = 0;
@@ -84,7 +84,7 @@
             makeFileToModuleNamesMap.put(makeFile, moduleNames);
         } else {
             // Create a aggregate module place holder.
-            //moduleNameToMakeFileMap.put(getAggregateName(moduleName), makeFile);
+            //moduleNameToMakeFileMap.put(getAggregateName(moduleDir), makeFile);
         }
         moduleNames.add(moduleName);
     }
@@ -92,31 +92,7 @@
     public String getMakeFile(String moduleName) {
         Preconditions.checkState(moduleNameToMakeFileMap != null,
                 "Index not built. Call build() first.");
+
         return moduleNameToMakeFileMap.get(moduleName);
     }
-
-    public Set<String> getAggregatedModules(String moduleName) {
-        Preconditions.checkState(makeFileToModuleNamesMap != null,
-                "Index not built. Call build() first.");
-        String makeFile = getMakeFile(moduleName);
-        return makeFileToModuleNamesMap.get(makeFile);
-    }
-
-    public boolean isPartOfAggregatedModule(String moduleName) {
-        String makeFile = getMakeFile(moduleName);
-        if (makeFile == null) {
-            return false;
-        }
-        Set<String> moduleNames = makeFileToModuleNamesMap.get(makeFile);
-        if (moduleNames == null) {
-            return false;
-        }
-        return moduleNames.size() > 1;
-    }
-
-    public String getAggregateName(String moduleName) {
-        String fileName = getMakeFile(moduleName);
-        File file = new File(fileName);
-        return file.getParentFile().getName() + "-aggregate";
-    }
 }
diff --git a/tools/idegen/src/com/android/idegen/StandardModule.java b/tools/idegen/src/com/android/idegen/StandardModule.java
deleted file mode 100644
index f7b24b0..0000000
--- a/tools/idegen/src/com/android/idegen/StandardModule.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.idegen;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Module constructed from a make file.
- *
- * TODO: read the make file and understand included source dirs in addition to searching
- * sub-directories.  Make files can include sources that are not sub-directories.  For example,
- * the framework module includes sources from:
- *
- *   external/libphonenumber/java/src
- *
- *   to provide:
- *
- *   com.android.i18n.phonenumbers.PhoneNumberUtil;
- */
-public class StandardModule extends Module {
-
-    static final String REL_OUT_APP_DIR = "out/target/common/obj/APPS";
-
-    private static final Logger logger = Logger.getLogger(StandardModule.class.getName());
-
-    private static final Pattern SRC_PATTERN = Pattern.compile(
-            ".*\\(call all-java-files-under, (.*)\\)");
-    private static final String[] AUTO_DEPENDENCIES = new String[]{
-            IntellijProject.FRAMEWORK_MODULE, "libcore"
-    };
-    private static final String[] DIRS_WITH_AUTO_DEPENDENCIES = new String[]{
-            "packages", "vendor", "frameworks/ex", "frameworks/opt", "frameworks/support"
-    };
-
-    String moduleName;
-    File makeFile;
-    File moduleRoot;
-    File repoRoot;
-
-    Set<String> directDependencies = Sets.newHashSet();
-
-    File intermediatesDir;
-    MakeFileParser makeFileParser;
-    boolean searchForSrc;
-
-    public StandardModule(String moduleName, String makeFile) {
-        this(moduleName, new File(makeFile), false);
-    }
-
-    public StandardModule(String moduleName, String makeFile, boolean searchForSrc) {
-        this(Preconditions.checkNotNull(moduleName), new File(Preconditions.checkNotNull(makeFile)),
-                searchForSrc);
-    }
-
-    public StandardModule(String moduleName, File makeFile, boolean searchForSrc) {
-        this.moduleName = moduleName;
-        this.makeFile = makeFile;
-        this.moduleRoot = makeFile.getParentFile();
-        this.repoRoot = DirectorySearch.findRepoRoot(makeFile);
-        this.intermediatesDir = new File(repoRoot.getAbsolutePath() + File.separator +
-                REL_OUT_APP_DIR + File.separator + getName() + "_intermediates" +
-                File.separator + "src");
-        this.searchForSrc = searchForSrc;
-
-        // TODO: auto-detect when framework dependency is needed instead of using coded list.
-        for (String dir : DIRS_WITH_AUTO_DEPENDENCIES) {
-            // length + 2 to account for slash
-            boolean isDir = makeFile.getAbsolutePath().startsWith(repoRoot + "/" + dir);
-            if (isDir) {
-                for (String dependency : AUTO_DEPENDENCIES) {
-                    this.directDependencies.add(dependency);
-                }
-            }
-        }
-
-        makeFileParser = new MakeFileParser(makeFile, moduleName);
-    }
-
-    protected void build() throws IOException {
-        makeFileParser.parse();
-        buildDependencyList();
-        buildDependentModules();
-        //buildImlFile();
-        logger.info("Done building module " + moduleName);
-        logger.info(toString());
-    }
-
-    @Override
-    protected File getDir() {
-        return moduleRoot;
-    }
-
-    @Override
-    protected String getName() {
-        return moduleName;
-    }
-
-    @Override
-    protected List<File> getIntermediatesDirs() {
-        return Lists.newArrayList(intermediatesDir);
-    }
-
-    @Override
-    public File getRepoRoot() {
-        return this.repoRoot;
-    }
-
-    public Set<String> getDirectDependencies() {
-        return this.directDependencies;
-    }
-
-    @Override
-    protected ImmutableList<File> getSourceDirs() {
-        ImmutableList<File> srcDirs;
-        if (searchForSrc) {
-            srcDirs = DirectorySearch.findSourceDirs(makeFile);
-        } else {
-            srcDirs = parseSourceFiles(makeFile);
-        }
-        return srcDirs;
-    }
-
-    @Override
-    protected ImmutableList<File> getExcludeDirs() {
-        return DirectorySearch.findExcludeDirs(makeFile);
-    }
-
-    @Override
-    protected boolean isAndroidModule() {
-        File manifest = new File(moduleRoot, "AndroidManifest.xml");
-        return manifest.exists();
-    }
-
-    private ImmutableList<File> parseSourceFiles(File root) {
-        ImmutableList.Builder<File> builder = ImmutableList.builder();
-        File rootDir;
-        if (root.isFile()) {
-            rootDir = root.getParentFile();
-        } else {
-            rootDir = root;
-        }
-
-        Iterable<String> values = makeFileParser.getValues(Key.LOCAL_SRC_FILES.name());
-        if (values != null) {
-            for (String value : values) {
-                Matcher matcher = SRC_PATTERN.matcher(value);
-                if (matcher.matches()) {
-                    String dir = matcher.group(1);
-                    builder.add(new File(rootDir, dir));
-                } else if (value.contains("/")) {
-                    // Treat as individual file.
-                    builder.add(new File(rootDir, value));
-                }
-            }
-        }
-        return builder.build();
-    }
-
-    private void buildDependencyList() {
-        parseDirectDependencies(Key.LOCAL_STATIC_JAVA_LIBRARIES);
-        parseDirectDependencies(Key.LOCAL_JAVA_LIBRARIES);
-    }
-
-    private void parseDirectDependencies(Key key) {
-        Iterable<String> names = makeFileParser.getValues(key.name());
-        if (names != null) {
-            for (String dependency : names) {
-                directDependencies.add(dependency);
-            }
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hashCode(getName());
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null || getClass() != obj.getClass()) {
-            return false;
-        }
-        StandardModule other = (StandardModule) obj;
-        return Objects.equal(getName(), other.getName());
-    }
-
-    @Override
-    public String toString() {
-        return Objects.toStringHelper(this)
-                .add("super", super.toString())
-                .add("makeFileParser", makeFileParser)
-                .add("directDependencies", Iterables.toString(directDependencies))
-                .toString();
-    }
-}
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-az-rAZ/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-az-rAZ/strings.xml
index 5f48a2d..3435573 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-az-rAZ/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Sistem güncəlləməsi quraşdırılır..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Silinir..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Əmr yoxdur."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Xəta!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-bn-rBD/strings.xml b/tools/recovery_l10n/res/values-bn-rBD/strings.xml
new file mode 100644
index 0000000..4d2e590
--- /dev/null
+++ b/tools/recovery_l10n/res/values-bn-rBD/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"সিস্টেম আপডেট ইনস্টল করা হচ্ছে…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"মোছা হচ্ছে…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"কোনো নির্দেশ নেই।"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"ত্রুটি!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-en-rIN/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-en-rIN/strings.xml
index 5f48a2d..b70d678c 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-en-rIN/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Installing system update…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Erasing…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"No command."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Error!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-et/strings.xml b/tools/recovery_l10n/res/values-et-rEE/strings.xml
similarity index 100%
rename from tools/recovery_l10n/res/values-et/strings.xml
rename to tools/recovery_l10n/res/values-et-rEE/strings.xml
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-eu-rES/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-eu-rES/strings.xml
index 5f48a2d..08d9c06 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-eu-rES/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Sistemaren eguneratzea instalatzen…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Ezabatzen…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Ez dago agindurik."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Errorea!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-fr-rCA/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-fr-rCA/strings.xml
index 5f48a2d..f2a85d8 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-fr-rCA/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Installation de la mise à jour du système en cours…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Effacement en cours…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Aucune commande."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Erreur!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-gl-rES/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-gl-rES/strings.xml
index 5f48a2d..7546fbd 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-gl-rES/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Instalando actualización do sistema..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Borrando..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Ningún comando"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Erro"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-hi/strings.xml b/tools/recovery_l10n/res/values-hi/strings.xml
index 3dfab3e..a470d12 100644
--- a/tools/recovery_l10n/res/values-hi/strings.xml
+++ b/tools/recovery_l10n/res/values-hi/strings.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"सिस्टम अपडेट इंस्टॉल कर रहा है…"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"सिस्टम के बारे में नई जानकारी मिल रही है…"</string>
     <string name="recovery_erasing" msgid="4612809744968710197">"मिटा रहा है…"</string>
     <string name="recovery_no_command" msgid="1915703879031023455">"कोई आदेश नहीं."</string>
     <string name="recovery_error" msgid="4550265746256727080">"त्रुटि!"</string>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-hy-rAM/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-hy-rAM/strings.xml
index 5f48a2d..7babe80 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-hy-rAM/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Համակարգի թարմացման տեղադրում…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Ջնջում…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Հրամանը տրված չէ:"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Սխալ"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-is-rIS/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-is-rIS/strings.xml
index 5f48a2d..926e851 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-is-rIS/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Setur upp kerfisuppfærslu…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Þurrkar út…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Engin skipun."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Villa!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-ka-rGE/strings.xml b/tools/recovery_l10n/res/values-ka-rGE/strings.xml
new file mode 100644
index 0000000..2d27c17
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ka-rGE/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"სისტემის განახლების დაყენება…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"მიმდინარეობს წაშლა…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"ბრძანება არ არის."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"შეცდომა!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-kk-rKZ/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-kk-rKZ/strings.xml
index 5f48a2d..3ca05b9 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-kk-rKZ/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Жүйе жаңартуларын орнатуда…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Өшіруде..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Пәрмен берілген жоқ."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Қате!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-km-rKH/strings.xml b/tools/recovery_l10n/res/values-km-rKH/strings.xml
new file mode 100644
index 0000000..0c1c272
--- /dev/null
+++ b/tools/recovery_l10n/res/values-km-rKH/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"កំពុង​ដំឡើង​បច្ចុប្បន្នភាព​ប្រព័ន្ធ…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"កំពុង​លុប…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"គ្មាន​ពាក្យ​បញ្ជា។"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"កំហុស!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-kn-rIN/strings.xml b/tools/recovery_l10n/res/values-kn-rIN/strings.xml
new file mode 100644
index 0000000..be25d7a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-kn-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"ಸಿಸ್ಟಂ ನವೀಕರಣವನ್ನು ಸ್ಥಾಪಿಸಲಾಗುತ್ತಿದೆ…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"ಅಳಿಸಲಾಗುತ್ತಿದೆ…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"ಯಾವುದೇ ಆದೇಶವಿಲ್ಲ."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"ದೋಷ!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-ky-rKG/strings.xml
similarity index 70%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-ky-rKG/strings.xml
index 5f48a2d..e2ced27 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-ky-rKG/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Системдик жаңыртууларды орнотуу…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Өчүрүлүүдө…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Буйрук берилген жок."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Ката!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-lo-rLA/strings.xml b/tools/recovery_l10n/res/values-lo-rLA/strings.xml
new file mode 100644
index 0000000..5880cca
--- /dev/null
+++ b/tools/recovery_l10n/res/values-lo-rLA/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"ກຳລັງຕິດຕັ້ງການອັບເດດລະບົບ..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"ກຳລັງລຶບ..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"ບໍ່ມີຄຳສັ່ງ."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"ຜິດພາດ!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-mk-rMK/strings.xml
similarity index 71%
rename from tools/recovery_l10n/res/values-be/strings.xml
rename to tools/recovery_l10n/res/values-mk-rMK/strings.xml
index 5f48a2d..d91a67c 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-mk-rMK/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Се инсталира ажурирање на системот..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Се брише..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Нема наредба."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Грешка!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-ml-rIN/strings.xml b/tools/recovery_l10n/res/values-ml-rIN/strings.xml
new file mode 100644
index 0000000..38ebcd1
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ml-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"സിസ്റ്റം അപ്‌ഡേറ്റ് ഇൻസ്റ്റാളുചെയ്യുന്നു…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"മായ്‌ക്കുന്നു…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"കമാൻഡ് ഒന്നുമില്ല."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"പിശക്!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-mn-rMN/strings.xml
similarity index 69%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-mn-rMN/strings.xml
index 5f48a2d..463cafe 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-mn-rMN/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Системийн шинэчлэлтийг суулгаж байна…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Арилгаж байна…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Команд байхгүй."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Алдаа!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-mr-rIN/strings.xml b/tools/recovery_l10n/res/values-mr-rIN/strings.xml
new file mode 100644
index 0000000..25c5d0c
--- /dev/null
+++ b/tools/recovery_l10n/res/values-mr-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"सिस्टम अद्यतन स्थापित करीत आहे..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"मिटवित आहे…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"कोणताही आदेश नाही."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"त्रुटी!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-ms/strings.xml b/tools/recovery_l10n/res/values-ms-rMY/strings.xml
similarity index 100%
rename from tools/recovery_l10n/res/values-ms/strings.xml
rename to tools/recovery_l10n/res/values-ms-rMY/strings.xml
diff --git a/tools/recovery_l10n/res/values-my-rMM/strings.xml b/tools/recovery_l10n/res/values-my-rMM/strings.xml
new file mode 100644
index 0000000..4091b19
--- /dev/null
+++ b/tools/recovery_l10n/res/values-my-rMM/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"စနစ်အား အဆင့်မြှင့်ခြင်း လုပ်ဆောင်နေသည်…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"ဖျက်နေသည် ..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"ညွှန်ကြားချက်မပေးထားပါ"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"မှားနေပါသည်!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-ne-rNP/strings.xml b/tools/recovery_l10n/res/values-ne-rNP/strings.xml
new file mode 100644
index 0000000..835f275
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ne-rNP/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"प्रणाली अद्यावधिक स्थापना गर्दै..."</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"मेटाइदै..."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"कुनै आदेश छैन।"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"त्रुटि!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-si-rLK/strings.xml b/tools/recovery_l10n/res/values-si-rLK/strings.xml
new file mode 100644
index 0000000..e717a97
--- /dev/null
+++ b/tools/recovery_l10n/res/values-si-rLK/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"පද්ධති යාවත්කාල ස්ථාපනය කරමින්…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"මකමින්...."</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"විධානයක් නොමැත."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"දෝෂය!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-ta-rIN/strings.xml b/tools/recovery_l10n/res/values-ta-rIN/strings.xml
new file mode 100644
index 0000000..f6f3e0e
--- /dev/null
+++ b/tools/recovery_l10n/res/values-ta-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"முறைமை புதுப்பிப்பை நிறுவுகிறது…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"அழிக்கிறது…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"கட்டளை இல்லை."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"பிழை!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-te-rIN/strings.xml b/tools/recovery_l10n/res/values-te-rIN/strings.xml
new file mode 100644
index 0000000..6d0d17a
--- /dev/null
+++ b/tools/recovery_l10n/res/values-te-rIN/strings.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="recovery_installing" msgid="7864047928003865598">"సిస్టమ్ నవీకరణను ఇన్‍స్టాల్ చేస్తోంది…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"ఎరేజ్ చేస్తోంది…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"ఆదేశం లేదు."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"లోపం!"</string>
+</resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-ur-rPK/strings.xml
similarity index 60%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-ur-rPK/strings.xml
index 5f48a2d..dc6eb6a 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-ur-rPK/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"سسٹم اپ ڈیٹ انسٹال ہو رہا ہے…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"صاف کر رہا ہے…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"کوئی کمانڈ نہیں ہے۔"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"خرابی!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-uz-rUZ/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-uz-rUZ/strings.xml
index 5f48a2d..2874484 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-uz-rUZ/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"Tizim yangilanishi o‘rnatilmoqda…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"Tozalanmoqda…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"Buyruq yo‘q."</string>
+    <string name="recovery_error" msgid="4550265746256727080">"Xato!"</string>
 </resources>
diff --git a/tools/recovery_l10n/res/values-be/strings.xml b/tools/recovery_l10n/res/values-zh-rHK/strings.xml
similarity index 61%
copy from tools/recovery_l10n/res/values-be/strings.xml
copy to tools/recovery_l10n/res/values-zh-rHK/strings.xml
index 5f48a2d..f615c7a 100644
--- a/tools/recovery_l10n/res/values-be/strings.xml
+++ b/tools/recovery_l10n/res/values-zh-rHK/strings.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="recovery_installing" msgid="7864047928003865598">"Усталёўка абнаўлення сістэмы..."</string>
-    <string name="recovery_erasing" msgid="4612809744968710197">"Выдаленне..."</string>
-    <string name="recovery_no_command" msgid="1915703879031023455">"Няма каманды"</string>
-    <string name="recovery_error" msgid="4550265746256727080">"Памылка"</string>
+    <string name="recovery_installing" msgid="7864047928003865598">"正在安裝系統更新…"</string>
+    <string name="recovery_erasing" msgid="4612809744968710197">"正在清除…"</string>
+    <string name="recovery_no_command" msgid="1915703879031023455">"沒有指令。"</string>
+    <string name="recovery_error" msgid="4550265746256727080">"錯誤!"</string>
 </resources>
diff --git a/tools/rmtypedefs/.gitignore b/tools/rmtypedefs/.gitignore
new file mode 100644
index 0000000..04d423f
--- /dev/null
+++ b/tools/rmtypedefs/.gitignore
@@ -0,0 +1,3 @@
+out
+.idea/workspace.xml
+.DS_Store
diff --git a/tools/rmtypedefs/.idea/compiler.xml b/tools/rmtypedefs/.idea/compiler.xml
new file mode 100644
index 0000000..217af47
--- /dev/null
+++ b/tools/rmtypedefs/.idea/compiler.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <option name="DEFAULT_COMPILER" value="Javac" />
+    <resourceExtensions />
+    <wildcardResourcePatterns>
+      <entry name="!?*.java" />
+      <entry name="!?*.form" />
+      <entry name="!?*.class" />
+      <entry name="!?*.groovy" />
+      <entry name="!?*.scala" />
+      <entry name="!?*.flex" />
+      <entry name="!?*.kt" />
+      <entry name="!?*.clj" />
+    </wildcardResourcePatterns>
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="false">
+        <processorPath useClasspath="true" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>
+
diff --git a/tools/rmtypedefs/.idea/copyright/profiles_settings.xml b/tools/rmtypedefs/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..3572571
--- /dev/null
+++ b/tools/rmtypedefs/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,5 @@
+<component name="CopyrightManager">
+  <settings default="">
+    <module2copyright />
+  </settings>
+</component>
\ No newline at end of file
diff --git a/tools/rmtypedefs/.idea/encodings.xml b/tools/rmtypedefs/.idea/encodings.xml
new file mode 100644
index 0000000..e206d70
--- /dev/null
+++ b/tools/rmtypedefs/.idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
diff --git a/tools/rmtypedefs/.idea/misc.xml b/tools/rmtypedefs/.idea/misc.xml
new file mode 100644
index 0000000..9732041
--- /dev/null
+++ b/tools/rmtypedefs/.idea/misc.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="EntryPointsManager">
+    <entry_points version="2.0" />
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>
+
diff --git a/tools/rmtypedefs/.idea/modules.xml b/tools/rmtypedefs/.idea/modules.xml
new file mode 100644
index 0000000..52f04c3
--- /dev/null
+++ b/tools/rmtypedefs/.idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/rmtypedefs.iml" filepath="$PROJECT_DIR$/rmtypedefs.iml" />
+    </modules>
+  </component>
+</project>
+
diff --git a/tools/rmtypedefs/.idea/scopes/scope_settings.xml b/tools/rmtypedefs/.idea/scopes/scope_settings.xml
new file mode 100644
index 0000000..922003b
--- /dev/null
+++ b/tools/rmtypedefs/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
diff --git a/tools/rmtypedefs/.idea/uiDesigner.xml b/tools/rmtypedefs/.idea/uiDesigner.xml
new file mode 100644
index 0000000..3b00020
--- /dev/null
+++ b/tools/rmtypedefs/.idea/uiDesigner.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>
+
diff --git a/tools/rmtypedefs/.idea/vcs.xml b/tools/rmtypedefs/.idea/vcs.xml
new file mode 100644
index 0000000..a5dd086
--- /dev/null
+++ b/tools/rmtypedefs/.idea/vcs.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+    <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
+  </component>
+</project>
+
diff --git a/tools/rmtypedefs/Android.mk b/tools/rmtypedefs/Android.mk
new file mode 100644
index 0000000..d79d2ff
--- /dev/null
+++ b/tools/rmtypedefs/Android.mk
@@ -0,0 +1,46 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+# We use copy-file-to-new-target so that the installed
+# script file's timestamp is at least as new as the
+# .jar file it wraps.
+
+# the execution script
+# ============================================================
+include $(CLEAR_VARS)
+LOCAL_IS_HOST_MODULE := true
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE := rmtypedefs
+
+#LOCAL_STATIC_JAVA_LIBRARIES := \
+#        asm-tools \
+#        guavalib
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(HOST_OUT_JAVA_LIBRARIES)/rmtypedefs$(COMMON_JAVA_PACKAGE_SUFFIX)
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/rmtypedefs | $(ACP)
+	@echo "Copy: $(PRIVATE_MODULE) ($@)"
+	$(copy-file-to-new-target)
+	$(hide) chmod 755 $@
+
+# the other stuff
+# ============================================================
+subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
+		src \
+	))
+
+include $(subdirs)
diff --git a/tools/rmtypedefs/README.txt b/tools/rmtypedefs/README.txt
new file mode 100644
index 0000000..9f3fb8b
--- /dev/null
+++ b/tools/rmtypedefs/README.txt
@@ -0,0 +1,13 @@
+Android TypeDef Remover 1.0
+
+This utility finds and removes all .class files that have been
+annotated with the @IntDef annotation (android.annotations.IntDef) or
+the @StringDef annotation (android.annotations.StringDef).
+
+It also makes sure that these annotations have source level retention
+(@Retention(RetentionPolicy.SOURCE)), since otherwise uses of the
+typedef will appear in .class files as well.
+
+This is intended to be used during the build to strip out any typedef
+annotation classes, since these are not needed (or desirable) in the
+system image.
diff --git a/tools/rmtypedefs/etc/manifest.txt b/tools/rmtypedefs/etc/manifest.txt
new file mode 100644
index 0000000..39f2e29
--- /dev/null
+++ b/tools/rmtypedefs/etc/manifest.txt
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: com.android.tools.rmtypedefs.RmTypeDefs
diff --git a/tools/rmtypedefs/etc/rmtypedefs b/tools/rmtypedefs/etc/rmtypedefs
new file mode 100755
index 0000000..bc0cbe2
--- /dev/null
+++ b/tools/rmtypedefs/etc/rmtypedefs
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Set up prog to be the path of this script, including following symlinks,
+# and set up progdir to be the fully-qualified pathname of its directory.
+prog="$0"
+while [ -h "${prog}" ]; do
+    newProg=`/bin/ls -ld "${prog}"`
+    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
+    if expr "x${newProg}" : 'x/' >/dev/null; then
+        prog="${newProg}"
+    else
+        progdir=`dirname "${prog}"`
+        prog="${progdir}/${newProg}"
+    fi
+done
+oldwd=`pwd`
+progdir=`dirname "${prog}"`
+cd "${progdir}"
+progdir=`pwd`
+prog="${progdir}"/`basename "${prog}"`
+cd "${oldwd}"
+
+libdir=`dirname $progdir`/framework
+
+javaOpts=""
+while expr "x$1" : 'x-J' >/dev/null; do
+    opt=`expr "$1" : '-J\(.*\)'`
+    javaOpts="${javaOpts} -${opt}"
+    shift
+done
+
+exec java $javaOpts -jar $libdir/rmtypedefs.jar "$@"
diff --git a/tools/rmtypedefs/rmtypedefs.iml b/tools/rmtypedefs/rmtypedefs.iml
new file mode 100644
index 0000000..6e0f0fc
--- /dev/null
+++ b/tools/rmtypedefs/rmtypedefs.iml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../../out/rmtypedefs" />
+    <output-test url="file://$MODULE_DIR$/../../../out/rmtypedefs" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/asm-tools/asm-4.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/asm-tools/src-4.0.zip!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/guava-tools/guava-13.0.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../prebuilts/tools/common/guava-tools/src.zip!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+  </component>
+</module>
+
diff --git a/tools/rmtypedefs/src/Android.mk b/tools/rmtypedefs/src/Android.mk
new file mode 100644
index 0000000..067a2e6
--- /dev/null
+++ b/tools/rmtypedefs/src/Android.mk
@@ -0,0 +1,31 @@
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+
+
+# rmtypedefs java library
+# ============================================================
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+LOCAL_JAR_MANIFEST := ../etc/manifest.txt
+LOCAL_STATIC_JAVA_LIBRARIES := \
+        asm-tools \
+        guava-tools
+
+LOCAL_MODULE:= rmtypedefs
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
diff --git a/tools/rmtypedefs/src/com/android/tools/rmtypedefs/RmTypeDefs.java b/tools/rmtypedefs/src/com/android/tools/rmtypedefs/RmTypeDefs.java
new file mode 100644
index 0000000..9375590
--- /dev/null
+++ b/tools/rmtypedefs/src/com/android/tools/rmtypedefs/RmTypeDefs.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.tools.rmtypedefs;
+
+import com.google.common.io.Files;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.objectweb.asm.Opcodes.ASM4;
+
+/**
+ * Finds and deletes typedef annotation classes (and also warns if their
+ * retention was wrong, such that uses embeds
+ */
+public class RmTypeDefs {
+
+    private static final String ANNOTATION = "java/lang/annotation/Annotation";
+    private static final String STRING_DEF = "android/annotation/StringDef";
+    private static final String INT_DEF = "android/annotation/IntDef";
+    private static final String INT_DEF_DESC = "L" + INT_DEF + ";";
+    private static final String STRING_DEF_DESC = "L" + STRING_DEF + ";";
+    private static final String RETENTION_DESC = "Ljava/lang/annotation/Retention;";
+    private static final String RETENTION_POLICY_DESC = "Ljava/lang/annotation/RetentionPolicy;";
+    private static final String SOURCE_RETENTION_VALUE = "SOURCE";
+
+    private boolean mQuiet;
+    private boolean mVerbose;
+    private boolean mHaveError;
+    private boolean mDryRun;
+
+    public static void main(String[] args) {
+        new RmTypeDefs().run(args);
+    }
+
+    private void run(String[] args) {
+        if (args.length == 0) {
+            usage(System.err);
+            System.exit(1);
+        }
+
+        List<File> dirs = new ArrayList<File>();
+        for (String arg : args) {
+            if (arg.equals("--help") || arg.equals("-h")) {
+                usage(System.out);
+                return;
+            } else if (arg.equals("-q") || arg.equals("--quiet") || arg.equals("--silent")) {
+                mQuiet = true;
+            } else if (arg.equals("-v") || arg.equals("--verbose")) {
+                mVerbose = true;
+            } else if (arg.equals("-n") || arg.equals("--dry-run")) {
+                mDryRun = true;
+            } else if (arg.startsWith("-")) {
+                System.err.println("Unknown argument " + arg);
+                usage(System.err);
+                System.exit(1);
+
+            } else {
+                // Other arguments should be file names
+                File file = new File(arg);
+                if (file.exists()) {
+                    dirs.add(file);
+                } else {
+                    System.err.println(file + " does not exist");
+                    usage(System.err);
+                    System.exit(1);
+                }
+            }
+        }
+
+        if (!mQuiet) {
+            System.out.println("Deleting @IntDef and @StringDef annotation class files");
+        }
+
+        for (File dir : dirs) {
+            find(dir);
+        }
+
+        System.exit(mHaveError ? -1 : 0);
+    }
+
+    private void find(File file) {
+        if (file.isDirectory()) {
+            File[] files = file.listFiles();
+            if (files != null) {
+                for (File f : files) {
+                    find(f);
+                }
+            }
+        } else if (file.isFile()) {
+            String path = file.getPath();
+            if (path.endsWith(".class")) {
+                checkClass(file);
+            } else if (path.endsWith(".jar")) {
+                System.err.println(path + ": Warning: Encountered .jar file; .class files "
+                        + "are not scanned and removed inside .jar files");
+            }
+        }
+    }
+
+    private void checkClass(File file) {
+        try {
+            byte[] bytes = Files.toByteArray(file);
+            ClassReader classReader = new ClassReader(bytes);
+            classReader.accept(new MyVisitor(file), 0);
+        } catch (IOException e) {
+            System.err.println("Could not read " + file + ": " + e.getLocalizedMessage());
+            System.exit(1);
+        }
+    }
+
+    /**
+     * Prints usage statement.
+     */
+    static void usage(PrintStream out) {
+        out.println("Android TypeDef Remover 1.0");
+        out.println("Copyright (C) 2013 The Android Open Source Project\n");
+        out.println("Usage: rmtypedefs folder1 [folder2 [folder3...]]\n");
+        out.println("Options:");
+        out.println("  -h,--help                  show this message");
+        out.println("  -q,--quiet                 quiet");
+        out.println("  -v,--verbose               verbose");
+        out.println("  -n,--dry-run               dry-run only, leaves files alone");
+    }
+
+    private class MyVisitor extends ClassVisitor {
+
+        /** Class file name */
+        private File mFile;
+
+        /** Class name */
+        private String mName;
+
+        /** Is this class an annotation? */
+        private boolean mAnnotation;
+
+        /** Is this annotation a typedef? Only applies if {@link #mAnnotation} */
+        private boolean mTypedef;
+
+        /** Does the annotation have source retention? Only applies if {@link #mAnnotation} */
+        private boolean mSourceRetention;
+
+        public MyVisitor(File file) {
+            super(ASM4);
+            mFile = file;
+        }
+
+        public void visit(
+                int version,
+                int access,
+                String name,
+                String signature,
+                String superName,
+                String[] interfaces) {
+            mName = name;
+            mAnnotation = interfaces != null && interfaces.length >= 1
+                    && ANNOTATION.equals(interfaces[0]);
+
+            // Special case: Also delete the actual @IntDef and @StringDef .class files.
+            // These have class file retention
+            mTypedef = name.equals(INT_DEF) || name.equals(STRING_DEF);
+        }
+
+        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            mTypedef = desc.equals(INT_DEF_DESC) || desc.equals(STRING_DEF_DESC);
+            if (desc.equals(RETENTION_DESC)) {
+                return new AnnotationVisitor(ASM4) {
+                    public void visitEnum(String name, String desc, String value) {
+                        if (desc.equals(RETENTION_POLICY_DESC)) {
+                            mSourceRetention = SOURCE_RETENTION_VALUE.equals(value);
+                        }
+                    }
+                };
+            }
+            return null;
+        }
+
+        public void visitEnd() {
+            if (mAnnotation && mTypedef) {
+                if (!mSourceRetention && !mName.equals(STRING_DEF) && !mName.equals(INT_DEF)) {
+                    System.err.println(mFile + ": Warning: Annotation should be annotated "
+                            + "with @Retention(RetentionPolicy.SOURCE)");
+                    mHaveError = true;
+                }
+                if (mVerbose) {
+                    if (mDryRun) {
+                        System.out.println("Would delete " + mFile);
+                    } else {
+                        System.out.println("Deleting " + mFile);
+                    }
+                }
+                if (!mDryRun) {
+                    boolean deleted = mFile.delete();
+                    if (!deleted) {
+                        System.err.println("Could not delete " + mFile);
+                        mHaveError = true;
+                    }
+                }
+            }
+        }
+    }
+}
+
diff --git a/tutorials/MoarRam/README.txt b/tutorials/MoarRam/README.txt
index 028389b..8f1a487 100644
--- a/tutorials/MoarRam/README.txt
+++ b/tutorials/MoarRam/README.txt
@@ -12,3 +12,6 @@
 
 Each allocation can be freed by clicking the corresponding free button in the
 UI.
+
+NOTE 09/16/2013
+A new feature is added to force a double free. Both debug libc and Valgrind can capture it.
diff --git a/tutorials/MoarRam/jni/Android.mk b/tutorials/MoarRam/jni/Android.mk
index 933cbdf..b1eec37 100644
--- a/tutorials/MoarRam/jni/Android.mk
+++ b/tutorials/MoarRam/jni/Android.mk
@@ -41,3 +41,12 @@
 LOCAL_SHARED_LIBRARIES += liblog
 
 include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE    := libmoarram-doublefree
+LOCAL_SRC_FILES := df.c
+LOCAL_SHARED_LIBRARIES += liblog
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/tutorials/MoarRam/jni/df.c b/tutorials/MoarRam/jni/df.c
new file mode 100644
index 0000000..bfea6b8
--- /dev/null
+++ b/tutorials/MoarRam/jni/df.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <jni.h>
+#include <cutils/log.h>
+
+#if defined(LOG_TAG)
+#undef LOG_TAG
+#define LOG_TAG "MOARRAM"
+#endif
+
+void
+Java_com_android_benchmark_moarram_MainActivity_forceDoubleFreeNative(
+    JNIEnv*  env,
+    jobject  this)
+{
+    char *ptr = (char *) malloc(4);
+    *ptr = 0;
+    ALOGW("About to double free %p", ptr);
+    free(ptr);
+    free(ptr);
+}
diff --git a/tutorials/MoarRam/res/layout/activity_main.xml b/tutorials/MoarRam/res/layout/activity_main.xml
index 8319bd7..50b6745 100644
--- a/tutorials/MoarRam/res/layout/activity_main.xml
+++ b/tutorials/MoarRam/res/layout/activity_main.xml
@@ -101,4 +101,19 @@
         android:layout_weight="1"
         android:onClick="freeVariableSizedBlocks" />
     </LinearLayout>
+
+    <LinearLayout
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:layout_weight="1"
+    android:orientation="horizontal">
+
+    <Button
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:text="@string/force_double_free"
+        android:layout_weight="1"
+        android:onClick="forceDoubleFree" />
+    </LinearLayout>
+
 </LinearLayout>
diff --git a/tutorials/MoarRam/res/values/strings.xml b/tutorials/MoarRam/res/values/strings.xml
index 0c0031d..e289fd8 100644
--- a/tutorials/MoarRam/res/values/strings.xml
+++ b/tutorials/MoarRam/res/values/strings.xml
@@ -13,4 +13,5 @@
     <string name="free_variable">Free 17 or 71 bytes</string>
     <string name="_17byte">17 bytes</string>
     <string name="_71byte">71 bytes</string>
+    <string name="force_double_free">Force a Double Free</string>
 </resources>
diff --git a/tutorials/MoarRam/src/com/android/benchmark/moarram/MainActivity.java b/tutorials/MoarRam/src/com/android/benchmark/moarram/MainActivity.java
index aa83b8c..0b7dcbc 100644
--- a/tutorials/MoarRam/src/com/android/benchmark/moarram/MainActivity.java
+++ b/tutorials/MoarRam/src/com/android/benchmark/moarram/MainActivity.java
@@ -14,6 +14,7 @@
         System.loadLibrary("moarram-32");
         System.loadLibrary("moarram-2M");
         System.loadLibrary("moarram-17_71");
+        System.loadLibrary("moarram-doublefree");
         setContentView(R.layout.activity_main);
     }
 
@@ -55,10 +56,15 @@
         freeVariableSizedBlocksNative(sizeId == R.id.radio17 ? 0 : 1);
     }
 
+    public void forceDoubleFree(View view) {
+        forceDoubleFreeNative();
+    }
+
     public native void add32ByteBlocksNative();
     public native void free32ByteBlocksNative();
     public native void add2MByteBlocksNative();
     public native void free2MByteBlocksNative();
     public native void addVariableSizedBlocksNative(int sizeId);
     public native void freeVariableSizedBlocksNative(int sizeId);
+    public native void forceDoubleFreeNative();
 }