Merge "Ensure that the copy notification is always cancelable." into mnc-dev
diff --git a/api/current.txt b/api/current.txt
index 41acac5..de3d2e1 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -566,6 +566,7 @@
     field public static final int fillViewport = 16843130; // 0x101017a
     field public static final int filter = 16843035; // 0x101011b
     field public static final int filterTouchesWhenObscured = 16843460; // 0x10102c4
+    field public static final int fingerprintDrawable = 16844025; // 0x10104f9
     field public static final int finishOnCloseSystemDialogs = 16843431; // 0x10102a7
     field public static final int finishOnTaskLaunch = 16842772; // 0x1010014
     field public static final int firstDayOfWeek = 16843581; // 0x101033d
@@ -12254,7 +12255,6 @@
     method public android.graphics.drawable.Drawable getCurrent();
     method public android.graphics.Rect getDirtyBounds();
     method public boolean getDither();
-    method public boolean getFilterBitmap();
     method public void getHotspotBounds(android.graphics.Rect);
     method public int getIntrinsicHeight();
     method public int getIntrinsicWidth();
@@ -12271,12 +12271,13 @@
     method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public void invalidateSelf();
     method public boolean isAutoMirrored();
+    method public boolean isFilterBitmap();
     method public boolean isStateful();
     method public final boolean isVisible();
     method public void jumpToCurrentState();
     method public android.graphics.drawable.Drawable mutate();
     method protected void onBoundsChange(android.graphics.Rect);
-    method public boolean onLayoutDirectionChange(int);
+    method public boolean onLayoutDirectionChanged(int);
     method protected boolean onLevelChange(int);
     method protected boolean onStateChange(int[]);
     method public static int resolveOpacity(int, int);
@@ -15909,6 +15910,7 @@
     field public static final java.lang.String MIMETYPE_AUDIO_AC3 = "audio/ac3";
     field public static final java.lang.String MIMETYPE_AUDIO_AMR_NB = "audio/3gpp";
     field public static final java.lang.String MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb";
+    field public static final java.lang.String MIMETYPE_AUDIO_EAC3 = "audio/eac3";
     field public static final java.lang.String MIMETYPE_AUDIO_FLAC = "audio/flac";
     field public static final java.lang.String MIMETYPE_AUDIO_G711_ALAW = "audio/g711-alaw";
     field public static final java.lang.String MIMETYPE_AUDIO_G711_MLAW = "audio/g711-mlaw";
@@ -28383,7 +28385,6 @@
   }
 
   public final deprecated class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
-    method public android.content.Context getContext();
     method public boolean isEncryptionRequired();
   }
 
@@ -29028,6 +29029,7 @@
     method public void bufferReceived(byte[]) throws android.os.RemoteException;
     method public void endOfSpeech() throws android.os.RemoteException;
     method public void error(int) throws android.os.RemoteException;
+    method public int getCallingUid();
     method public void partialResults(android.os.Bundle) throws android.os.RemoteException;
     method public void readyForSpeech(android.os.Bundle) throws android.os.RemoteException;
     method public void results(android.os.Bundle) throws android.os.RemoteException;
diff --git a/api/system-current.txt b/api/system-current.txt
index 0f6bd2a..e5f8396 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -640,6 +640,7 @@
     field public static final int fillViewport = 16843130; // 0x101017a
     field public static final int filter = 16843035; // 0x101011b
     field public static final int filterTouchesWhenObscured = 16843460; // 0x10102c4
+    field public static final int fingerprintDrawable = 16844025; // 0x10104f9
     field public static final int finishOnCloseSystemDialogs = 16843431; // 0x10102a7
     field public static final int finishOnTaskLaunch = 16842772; // 0x1010014
     field public static final int firstDayOfWeek = 16843581; // 0x101033d
@@ -12561,7 +12562,6 @@
     method public android.graphics.drawable.Drawable getCurrent();
     method public android.graphics.Rect getDirtyBounds();
     method public boolean getDither();
-    method public boolean getFilterBitmap();
     method public void getHotspotBounds(android.graphics.Rect);
     method public int getIntrinsicHeight();
     method public int getIntrinsicWidth();
@@ -12578,12 +12578,13 @@
     method public void inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public void invalidateSelf();
     method public boolean isAutoMirrored();
+    method public boolean isFilterBitmap();
     method public boolean isStateful();
     method public final boolean isVisible();
     method public void jumpToCurrentState();
     method public android.graphics.drawable.Drawable mutate();
     method protected void onBoundsChange(android.graphics.Rect);
-    method public boolean onLayoutDirectionChange(int);
+    method public boolean onLayoutDirectionChanged(int);
     method protected boolean onLevelChange(int);
     method protected boolean onStateChange(int[]);
     method public static int resolveOpacity(int, int);
@@ -17145,6 +17146,7 @@
     field public static final java.lang.String MIMETYPE_AUDIO_AC3 = "audio/ac3";
     field public static final java.lang.String MIMETYPE_AUDIO_AMR_NB = "audio/3gpp";
     field public static final java.lang.String MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb";
+    field public static final java.lang.String MIMETYPE_AUDIO_EAC3 = "audio/eac3";
     field public static final java.lang.String MIMETYPE_AUDIO_FLAC = "audio/flac";
     field public static final java.lang.String MIMETYPE_AUDIO_G711_ALAW = "audio/g711-alaw";
     field public static final java.lang.String MIMETYPE_AUDIO_G711_MLAW = "audio/g711-mlaw";
@@ -30409,7 +30411,6 @@
   }
 
   public final deprecated class KeyStoreParameter implements java.security.KeyStore.ProtectionParameter {
-    method public android.content.Context getContext();
     method public boolean isEncryptionRequired();
   }
 
@@ -31154,6 +31155,7 @@
     method public void bufferReceived(byte[]) throws android.os.RemoteException;
     method public void endOfSpeech() throws android.os.RemoteException;
     method public void error(int) throws android.os.RemoteException;
+    method public int getCallingUid();
     method public void partialResults(android.os.Bundle) throws android.os.RemoteException;
     method public void readyForSpeech(android.os.Bundle) throws android.os.RemoteException;
     method public void results(android.os.Bundle) throws android.os.RemoteException;
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 43678cc..62a1617 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1560,6 +1560,42 @@
     public static final String EXTRA_PACKAGE_NAME = "android.intent.extra.PACKAGE_NAME";
 
     /**
+     * Broadcast action that requests current permission granted information.  It will respond
+     * to the request by sending a broadcast with action defined by
+     * {@link #EXTRA_GET_PERMISSIONS_RESPONSE_INTENT}. The response will contain
+     * {@link #EXTRA_GET_PERMISSIONS_COUNT_RESULT} with contents described below or a null upon
+     * failure.
+     *
+     * <p>If {@link #EXTRA_PACKAGE_NAME} is included then the number of permissions granted and the
+     * number of permissions requested by that package will be calculated and included as the first
+     * and second elements respectively of an int[] in the response as
+     * {@link #EXTRA_GET_PERMISSIONS_COUNT_RESULT}.
+     *
+     * <p>If {@link #EXTRA_PACKAGE_NAME} is not included then the number of apps granted any runtime
+     * permissions and the total number of apps requesting runtime permissions will be the first
+     * and second elements respectively of an int[] in the response as
+     * {@link #EXTRA_GET_PERMISSIONS_COUNT_RESULT}.
+     *
+     * @hide
+     */
+    public static final String ACTION_GET_PERMISSIONS_COUNT
+            = "android.intent.action.GET_PERMISSIONS_COUNT";
+
+    /**
+     * Extra included in response to {@link #ACTION_GET_PERMISSIONS_COUNT}.
+     * @hide
+     */
+    public static final String EXTRA_GET_PERMISSIONS_COUNT_RESULT
+            = "android.intent.extra.GET_PERMISSIONS_COUNT_RESULT";
+
+    /**
+     * Required extra to be sent with {@link #ACTION_GET_PERMISSIONS_COUNT} broadcast.
+     * @hide
+     */
+    public static final String EXTRA_GET_PERMISSIONS_RESPONSE_INTENT
+            = "android.intent.extra.GET_PERMISSIONS_RESONSE_INTENT";
+
+    /**
      * Activity action: Launch UI to manage which apps have a given permission.
      * <p>
      * Input: {@link #EXTRA_PERMISSION_NAME} specifies the permission access
diff --git a/core/java/android/content/res/TypedArray.java b/core/java/android/content/res/TypedArray.java
index 1fca920..f0c3f2d 100644
--- a/core/java/android/content/res/TypedArray.java
+++ b/core/java/android/content/res/TypedArray.java
@@ -181,7 +181,26 @@
      *         not be coerced to a string.
      * @throws RuntimeException if the TypedArray has already been recycled.
      */
+    @Nullable
     public String getString(int index) {
+        return getString(index, true);
+    }
+
+    /**
+     * Returns a string representation of the value at the given index,
+     * optionally throwing a resource mismatch strict mode violation if the
+     * value must be coerced to a string.
+     *
+     * @param index the index of the attribute to retrieve
+     * @param strict {@code true} to throw a strict mode violation for string
+     *               coercion, {@code false} otherwise
+     * @return a string representation of the value at the given index, or
+     *         {@code null} if the resource could not be coerced to a string
+     * @see StrictMode#noteResourceMismatch(Object)
+     * @hide Used internally for view attribute inspection.
+     */
+    @Nullable
+    public String getString(int index, boolean strict) {
         if (mRecycled) {
             throw new RuntimeException("Cannot make calls to a recycled instance!");
         }
@@ -197,7 +216,9 @@
 
         final TypedValue v = mValue;
         if (getValueAt(index, v)) {
-            StrictMode.noteResourceMismatch(v);
+            if (strict) {
+                StrictMode.noteResourceMismatch(v);
+            }
             final CharSequence cs = v.coerceToString();
             return cs != null ? cs.toString() : null;
         }
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index e175e9a..3a3c47d 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -611,11 +611,11 @@
 
     /**
      * Retrieves the current preferred network type.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an integer representing the preferred network type
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * @deprecated Functionality has been removed as it no longer makes sense,
      *             with many more than two networks - we'd need an array to express
      *             preference.  Instead we use dynamic network properties of
@@ -631,12 +631,11 @@
      * You should always check {@link NetworkInfo#isConnected()} before initiating
      * network traffic. This may return {@code null} when there is no default
      * network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return a {@link NetworkInfo} object for the current default network
      *        or {@code null} if no default network is currently active
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      */
     public NetworkInfo getActiveNetworkInfo() {
         try {
@@ -652,12 +651,11 @@
      * network disconnects, the returned {@code Network} object will no longer
      * be usable.  This will return {@code null} when there is no default
      * network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return a {@link Network} object for the current default network or
      *        {@code null} if no default network is currently active
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      */
     public Network getActiveNetwork() {
         try {
@@ -671,13 +669,13 @@
      * Returns details about the currently active default data network
      * for a given uid.  This is for internal use only to avoid spying
      * other apps.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}
      *
      * @return a {@link NetworkInfo} object for the current default network
      *        for the given uid or {@code null} if no default network is
      *        available for the specified uid.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}
      * {@hide}
      */
     public NetworkInfo getActiveNetworkInfoForUid(int uid) {
@@ -691,6 +689,8 @@
     /**
      * Returns connection status information about a particular
      * network type.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param networkType integer specifying which networkType in
      *        which you're interested.
@@ -698,9 +698,6 @@
      *        network type or {@code null} if the type is not
      *        supported by the device.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
-     *
      * @deprecated This method does not support multiple connected networks
      *             of the same type. Use {@link #getAllNetworks} and
      *             {@link #getNetworkInfo(android.net.Network)} instead.
@@ -716,15 +713,14 @@
     /**
      * Returns connection status information about a particular
      * Network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param network {@link Network} specifying which network
      *        in which you're interested.
      * @return a {@link NetworkInfo} object for the requested
      *        network or {@code null} if the {@code Network}
      *        is not valid.
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      */
     public NetworkInfo getNetworkInfo(Network network) {
         try {
@@ -737,13 +733,12 @@
     /**
      * Returns connection status information about all network
      * types supported by the device.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of {@link NetworkInfo} objects.  Check each
      * {@link NetworkInfo#getType} for which type each applies.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
-     *
      * @deprecated This method does not support multiple connected networks
      *             of the same type. Use {@link #getAllNetworks} and
      *             {@link #getNetworkInfo(android.net.Network)} instead.
@@ -779,11 +774,10 @@
     /**
      * Returns an array of all {@link Network} currently tracked by the
      * framework.
-     *
-     * @return an array of {@link Network} objects.
-     *
      * <p>This method requires the caller to hold the permission
      * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
+     *
+     * @return an array of {@link Network} objects.
      */
     public Network[] getAllNetworks() {
         try {
@@ -812,13 +806,12 @@
      * You should always check {@link NetworkInfo#isConnected()} before initiating
      * network traffic. This may return {@code null} when there is no default
      * network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return a {@link NetworkInfo} object for the current default network
      *        or {@code null} if no default network is currently active
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
-     *
      * {@hide}
      */
     public NetworkInfo getProvisioningOrActiveNetworkInfo() {
@@ -831,13 +824,13 @@
 
     /**
      * Returns the IP information for the current default network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return a {@link LinkProperties} object describing the IP info
      *        for the current default network, or {@code null} if there
      *        is no current default network.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public LinkProperties getActiveLinkProperties() {
@@ -850,14 +843,14 @@
 
     /**
      * Returns the IP information for a given network type.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param networkType the network type of interest.
      * @return a {@link LinkProperties} object describing the IP info
      *        for the given networkType, or {@code null} if there is
      *        no current default network.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      * @deprecated This method does not support multiple connected networks
      *             of the same type. Use {@link #getAllNetworks},
@@ -875,10 +868,12 @@
     /**
      * Get the {@link LinkProperties} for the given {@link Network}.  This
      * will return {@code null} if the network is unknown.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param network The {@link Network} object identifying the network in question.
      * @return The {@link LinkProperties} for the network, or {@code null}.
-     **/
+     */
     public LinkProperties getLinkProperties(Network network) {
         try {
             return mService.getLinkProperties(network);
@@ -890,6 +885,8 @@
     /**
      * Get the {@link android.net.NetworkCapabilities} for the given {@link Network}.  This
      * will return {@code null} if the network is unknown.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param network The {@link Network} object identifying the network in question.
      * @return The {@link android.net.NetworkCapabilities} for the network, or {@code null}.
@@ -1493,11 +1490,11 @@
     /**
      * Get the set of tetherable, available interfaces.  This list is limited by
      * device configuration and current interface existence.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more Strings of tetherable interface names.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetherableIfaces() {
@@ -1510,11 +1507,11 @@
 
     /**
      * Get the set of tethered interfaces.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more String of currently tethered interface names.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetheredIfaces() {
@@ -1532,12 +1529,12 @@
      * may cause them to reset to the available state.
      * {@link ConnectivityManager#getLastTetherError} can be used to get more
      * information on the cause of the errors.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more String indicating the interface names
      *        which failed to tether.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetheringErroredIfaces() {
@@ -1570,12 +1567,12 @@
      * allowed between the tethered devices and this device, though upstream net
      * access will of course fail until an upstream network interface becomes
      * active.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      *
      * @param iface the interface name to tether.
      * @return error a {@code TETHER_ERROR} value indicating success or failure type
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      * {@hide}
      */
     public int tether(String iface) {
@@ -1588,12 +1585,12 @@
 
     /**
      * Stop tethering the named interface.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      *
      * @param iface the interface name to untether.
      * @return error a {@code TETHER_ERROR} value indicating success or failure type
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      * {@hide}
      */
     public int untether(String iface) {
@@ -1608,11 +1605,11 @@
      * Check if the device allows for tethering.  It may be disabled via
      * {@code ro.tether.denied} system property, Settings.TETHER_SUPPORTED or
      * due to device configuration.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return a boolean - {@code true} indicating Tethering is supported.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public boolean isTetheringSupported() {
@@ -1627,12 +1624,12 @@
      * Get the list of regular expressions that define any tetherable
      * USB network interfaces.  If USB tethering is not supported by the
      * device, this list should be empty.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more regular expression Strings defining
      *        what interfaces are considered tetherable usb interfaces.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetherableUsbRegexs() {
@@ -1647,12 +1644,12 @@
      * Get the list of regular expressions that define any tetherable
      * Wifi network interfaces.  If Wifi tethering is not supported by the
      * device, this list should be empty.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more regular expression Strings defining
      *        what interfaces are considered tetherable wifi interfaces.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetherableWifiRegexs() {
@@ -1667,12 +1664,12 @@
      * Get the list of regular expressions that define any tetherable
      * Bluetooth network interfaces.  If Bluetooth tethering is not supported by the
      * device, this list should be empty.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return an array of 0 or more regular expression Strings defining
      *        what interfaces are considered tetherable bluetooth interfaces.
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public String[] getTetherableBluetoothRegexs() {
@@ -1689,12 +1686,12 @@
      * attempt to switch to Rndis and subsequently tether the resulting
      * interface on {@code true} or turn off tethering and switch off
      * Rndis on {@code false}.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      *
      * @param enable a boolean - {@code true} to enable tethering
      * @return error a {@code TETHER_ERROR} value indicating success or failure type
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      * {@hide}
      */
     public int setUsbTethering(boolean enable) {
@@ -1731,13 +1728,13 @@
     /**
      * Get a more detailed error code after a Tethering or Untethering
      * request asynchronously failed.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param iface The name of the interface of interest
      * @return error The error code of the last error tethering or untethering the named
      *               interface
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * {@hide}
      */
     public int getLastTetherError(String iface) {
@@ -1751,12 +1748,11 @@
     /**
      * Report network connectivity status.  This is currently used only
      * to alter status bar UI.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#STATUS_BAR}.
      *
      * @param networkType The type of network you want to report on
      * @param percentage The quality of the connection 0 is bad, 100 is good
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#STATUS_BAR}.
      * {@hide}
      */
     public void reportInetCondition(int networkType, int percentage) {
@@ -1886,12 +1882,11 @@
      * for typical HTTP proxies - they are general network dependent.  However if you're
      * doing something unusual like general internal filtering this may be useful.  On
      * a private network where the proxy is not accessible, you may break HTTP using this.
-     *
-     * @param p The a {@link ProxyInfo} object defining the new global
-     *        HTTP proxy.  A {@code null} value will clear the global HTTP proxy.
-     *
      * <p>This method requires the caller to hold the permission
      * android.Manifest.permission#CONNECTIVITY_INTERNAL.
+     *
+     * @param p A {@link ProxyInfo} object defining the new global
+     *        HTTP proxy.  A {@code null} value will clear the global HTTP proxy.
      * @hide
      */
     public void setGlobalProxy(ProxyInfo p) {
@@ -1958,12 +1953,12 @@
      * hardware supports it.  For example a GSM phone without a SIM
      * should still return {@code true} for mobile data, but a wifi only
      * tablet would return {@code false}.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param networkType The network type we'd like to check
      * @return {@code true} if supported, else {@code false}
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      * @hide
      */
     public boolean isNetworkSupported(int networkType) {
@@ -1980,12 +1975,11 @@
      * battery/performance issues. You should check this before doing large
      * data transfers, and warn the user or delay the operation until another
      * network is available.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @return {@code true} if large transfers should be avoided, otherwise
      *        {@code false}.
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      */
     public boolean isActiveNetworkMetered() {
         try {
@@ -2015,13 +2009,12 @@
     /**
      * Signal that the captive portal check on the indicated network
      * is complete and whether its a captive portal or not.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
      *
      * @param info the {@link NetworkInfo} object for the networkType
      *        in question.
      * @param isCaptivePortal true/false.
-     *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
      * {@hide}
      */
     public void captivePortalCheckCompleted(NetworkInfo info, boolean isCaptivePortal) {
@@ -2093,11 +2086,11 @@
 
     /**
      * Set the value for enabling/disabling airplane mode
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
      *
      * @param enable whether to enable airplane mode or not
      *
-     * <p>This method requires the caller to hold the permission
-     * {@link android.Manifest.permission#CONNECTIVITY_INTERNAL}.
      * @hide
      */
     public void setAirplaneMode(boolean enable) {
@@ -2438,6 +2431,8 @@
      * Status of the request can be followed by listening to the various
      * callbacks described in {@link NetworkCallback}.  The {@link Network}
      * can be used to direct traffic to the network.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      *
      * @param request {@link NetworkRequest} describing this request.
      * @param networkCallback The {@link NetworkCallback} to be utilized for this
@@ -2457,6 +2452,8 @@
      * network is not found within the given time (in milliseconds) the
      * {@link NetworkCallback#unavailable} callback is called.  The request must
      * still be released normally by calling {@link releaseNetworkRequest}.
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      * @param request {@link NetworkRequest} describing this request.
      * @param networkCallback The callbacks to be utilized for this request.  Note
      *                        the callbacks must not be shared - they uniquely specify
@@ -2522,7 +2519,8 @@
      * <p>
      * The request may be released normally by calling
      * {@link #releaseNetworkRequest(android.app.PendingIntent)}.
-     *
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#CHANGE_NETWORK_STATE}.
      * @param request {@link NetworkRequest} describing this request.
      * @param operation Action to perform when the network is available (corresponds
      *                  to the {@link NetworkCallback#onAvailable} call.  Typically
@@ -2563,6 +2561,8 @@
      * Registers to receive notifications about all networks which satisfy the given
      * {@link NetworkRequest}.  The callbacks will continue to be called until
      * either the application exits or {@link #unregisterNetworkCallback} is called
+     * <p>This method requires the caller to hold the permission
+     * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
      *
      * @param request {@link NetworkRequest} describing this request.
      * @param networkCallback The {@link NetworkCallback} that the system will call as suitable
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 11043b3..a81b83f 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -177,7 +177,8 @@
     /**
      * Specifies if a user is disallowed from configuring VPN.
      * The default value is <code>false</code>.
-     * This restriction has no effect in a managed profile.
+     * This restriction has an effect in a managed profile only from
+     * {@link android.os.Build.VERSION_CODES#MNC}
      *
      * <p/>Key for user restrictions.
      * <p/>Type: Boolean
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index 8ff56f8..4bbaaa1 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -939,4 +939,6 @@
     public static final String OWNER_INFO_KEY = "OwnerInfo";
     /** @hide */
     public static final String PATTERN_VISIBLE_KEY = "PatternVisible";
+    /** @hide */
+    public static final String PASSWORD_VISIBLE_KEY = "PasswordVisible";
 }
diff --git a/core/java/android/preference/RingtonePreference.java b/core/java/android/preference/RingtonePreference.java
index 488a0c4..a76bb09 100644
--- a/core/java/android/preference/RingtonePreference.java
+++ b/core/java/android/preference/RingtonePreference.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.TypedArray;
+import android.media.AudioAttributes;
 import android.media.RingtoneManager;
 import android.net.Uri;
 import android.provider.Settings.System;
@@ -169,6 +170,8 @@
         ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, mShowSilent);
         ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, mRingtoneType);
         ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TITLE, getTitle());
+        ringtonePickerIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_AUDIO_ATTRIBUTES_FLAGS,
+                AudioAttributes.FLAG_BYPASS_INTERRUPTION_POLICY);
     }
     
     /**
diff --git a/core/java/android/service/chooser/ChooserTargetService.java b/core/java/android/service/chooser/ChooserTargetService.java
index 0d1834a..a3bfece 100644
--- a/core/java/android/service/chooser/ChooserTargetService.java
+++ b/core/java/android/service/chooser/ChooserTargetService.java
@@ -44,7 +44,7 @@
  * the {@link android.Manifest.permission#BIND_CHOOSER_TARGET_SERVICE} permission
  * and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:</p>
  * <pre>
- *     &lt;service android:name=".ChooserTargetService"
+ *     &lt;service android:name=".MyChooserTargetService"
  *             android:label="&#64;string/service_name"
  *             android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
  *         &lt;intent-filter>
@@ -69,7 +69,7 @@
  *             &lt;action android:name="android.intent.action.SEND" />
  *         &lt;/intent-filter>
  *         &lt;meta-data android:name="android.service.chooser.chooser_target_service"
- *                 android:value=".ChooserTargetService" />
+ *                 android:value=".MyChooserTargetService" />
  *     &lt;/activity>
  * </pre>
  */
diff --git a/core/java/android/service/gatekeeper/GateKeeperResponse.aidl b/core/java/android/service/gatekeeper/GateKeeperResponse.aidl
new file mode 100644
index 0000000..966606e
--- /dev/null
+++ b/core/java/android/service/gatekeeper/GateKeeperResponse.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.gatekeeper;
+
+/**
+ * Response object for a GateKeeper verification request.
+ * @hide
+ */
+parcelable GateKeeperResponse;
+
diff --git a/core/java/android/service/gatekeeper/GateKeeperResponse.java b/core/java/android/service/gatekeeper/GateKeeperResponse.java
new file mode 100644
index 0000000..a512957
--- /dev/null
+++ b/core/java/android/service/gatekeeper/GateKeeperResponse.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.gatekeeper;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Response object for a GateKeeper verification request.
+ * @hide
+ */
+public final class GateKeeperResponse implements Parcelable {
+
+    public static final int RESPONSE_ERROR = -1;
+    public static final int RESPONSE_OK = 0;
+    public static final int RESPONSE_RETRY = 1;
+
+    private final int mResponseCode;
+
+    private int mTimeout;
+    private byte[] mPayload;
+    private boolean mShouldReEnroll;
+
+    private GateKeeperResponse(int responseCode) {
+        mResponseCode = responseCode;
+    }
+
+    private GateKeeperResponse(int responseCode, int timeout) {
+        mResponseCode = responseCode;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Parcelable.Creator<GateKeeperResponse> CREATOR
+            = new Parcelable.Creator<GateKeeperResponse>() {
+        @Override
+        public GateKeeperResponse createFromParcel(Parcel source) {
+            int responseCode = source.readInt();
+            GateKeeperResponse response = new GateKeeperResponse(responseCode);
+            if (responseCode == RESPONSE_RETRY) {
+                response.setTimeout(source.readInt());
+            } else if (responseCode == RESPONSE_OK) {
+                response.setShouldReEnroll(source.readInt() == 1);
+                int size = source.readInt();
+                if (size > 0) {
+                    byte[] payload = new byte[size];
+                    source.readByteArray(payload);
+                    response.setPayload(payload);
+                }
+            }
+            return response;
+        }
+
+        @Override
+        public GateKeeperResponse[] newArray(int size) {
+            return new GateKeeperResponse[size];
+        }
+
+    };
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(mResponseCode);
+        if (mResponseCode == RESPONSE_RETRY) {
+            dest.writeInt(mTimeout);
+        } else if (mResponseCode == RESPONSE_OK) {
+            dest.writeInt(mShouldReEnroll ? 1 : 0);
+            if (mPayload != null) {
+                dest.writeInt(mPayload.length);
+                dest.writeByteArray(mPayload);
+            }
+        }
+    }
+
+    public byte[] getPayload() {
+        return mPayload;
+    }
+
+    public int getTimeout() {
+        return mTimeout;
+    }
+
+    public boolean getShouldReEnroll() {
+        return mShouldReEnroll;
+    }
+
+    public int getResponseCode() {
+        return mResponseCode;
+    }
+
+    private void setTimeout(int timeout) {
+        mTimeout = timeout;
+    }
+
+    private void setShouldReEnroll(boolean shouldReEnroll) {
+        mShouldReEnroll = shouldReEnroll;
+    }
+
+    private void setPayload(byte[] payload) {
+        mPayload = payload;
+    }
+
+}
diff --git a/core/java/android/service/gatekeeper/IGateKeeperService.aidl b/core/java/android/service/gatekeeper/IGateKeeperService.aidl
index 4f46701..6db2110 100644
--- a/core/java/android/service/gatekeeper/IGateKeeperService.aidl
+++ b/core/java/android/service/gatekeeper/IGateKeeperService.aidl
@@ -16,6 +16,8 @@
 
 package android.service.gatekeeper;
 
+import android.service.gatekeeper.GateKeeperResponse;
+
 /**
  * Interface for communication with GateKeeper, the
  * secure password storage daemon.
@@ -34,9 +36,9 @@
      *                        If provided, must verify against the currentPasswordHandle.
      * @param desiredPassword The new desired password, for which a handle will be returned
      *                        upon success.
-     * @return the handle corresponding to desiredPassword, or null
+     * @return an EnrollResponse or null on failure
      */
-    byte[] enroll(int uid, in byte[] currentPasswordHandle, in byte[] currentPassword,
+    GateKeeperResponse enroll(int uid, in byte[] currentPasswordHandle, in byte[] currentPassword,
             in byte[] desiredPassword);
 
     /**
@@ -45,10 +47,10 @@
      * @param enrolledPasswordHandle The handle against which the provided password will be
      *                               verified.
      * @param The plaintext blob to verify against enrolledPassword.
-     * @return True if the authentication was successful
+     * @return a VerifyResponse, or null on failure.
      */
-    boolean verify(int uid, in byte[] enrolledPasswordHandle,
-            in byte[] providedPassword);
+    GateKeeperResponse verify(int uid, in byte[] enrolledPasswordHandle, in byte[] providedPassword);
+
     /**
      * Verifies an enrolled handle against a provided, plaintext blob.
      * @param uid The Android user ID associated to this enrollment
@@ -58,9 +60,9 @@
      * @param enrolledPasswordHandle The handle against which the provided password will be
      *                               verified.
      * @param The plaintext blob to verify against enrolledPassword.
-     * @return an opaque attestation of authentication on success, or null.
+     * @return a VerifyResponse with an attestation, or null on failure.
      */
-    byte[] verifyChallenge(int uid, long challenge, in byte[] enrolledPasswordHandle,
+    GateKeeperResponse verifyChallenge(int uid, long challenge, in byte[] enrolledPasswordHandle,
             in byte[] providedPassword);
 
     /**
diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java
index 1e42913..dd3cedc 100644
--- a/core/java/android/service/notification/ZenModeConfig.java
+++ b/core/java/android/service/notification/ZenModeConfig.java
@@ -16,6 +16,7 @@
 
 package android.service.notification;
 
+import android.app.ActivityManager;
 import android.app.NotificationManager.Policy;
 import android.content.ComponentName;
 import android.content.Context;
@@ -23,6 +24,7 @@
 import android.net.Uri;
 import android.os.Parcel;
 import android.os.Parcelable;
+import android.os.UserHandle;
 import android.provider.Settings.Global;
 import android.text.TextUtils;
 import android.text.format.DateFormat;
@@ -728,6 +730,7 @@
         return new Uri.Builder().scheme(Condition.SCHEME)
                 .authority(SYSTEM_AUTHORITY)
                 .appendPath(EVENT_PATH)
+                .appendQueryParameter("userId", Long.toString(event.userId))
                 .appendQueryParameter("calendar", Long.toString(event.calendar))
                 .appendQueryParameter("reply", Integer.toString(event.reply))
                 .build();
@@ -745,6 +748,7 @@
                 && conditionId.getPathSegments().get(0).equals(EVENT_PATH);
         if (!isEvent) return null;
         final EventInfo rt = new EventInfo();
+        rt.userId = tryParseInt(conditionId.getQueryParameter("userId"), UserHandle.USER_NULL);
         rt.calendar = tryParseLong(conditionId.getQueryParameter("calendar"),
                 EventInfo.ANY_CALENDAR);
         rt.reply = tryParseInt(conditionId.getQueryParameter("reply"), 0);
@@ -758,6 +762,7 @@
         public static final int REPLY_YES_OR_MAYBE = 1;
         public static final int REPLY_YES = 2;
 
+        public int userId = UserHandle.USER_NULL;  // USER_NULL = unspecified - use current user
         public long calendar = ANY_CALENDAR;  // CalendarContract.Calendars._ID, or ANY_CALENDAR
         public int reply;
 
@@ -770,16 +775,23 @@
         public boolean equals(Object o) {
             if (!(o instanceof EventInfo)) return false;
             final EventInfo other = (EventInfo) o;
-            return calendar == other.calendar
+            return userId == other.userId
+                    && calendar == other.calendar
                     && reply == other.reply;
         }
 
         public EventInfo copy() {
             final EventInfo rt = new EventInfo();
+            rt.userId = userId;
             rt.calendar = calendar;
             rt.reply = reply;
             return rt;
         }
+
+        public static int resolveUserId(int userId) {
+            return userId == UserHandle.USER_NULL ? ActivityManager.getCurrentUser() : userId;
+
+        }
     }
 
     // ==== End built-in system conditions ====
diff --git a/core/java/android/speech/RecognitionService.java b/core/java/android/speech/RecognitionService.java
index dcdbba78..3e74d22 100644
--- a/core/java/android/speech/RecognitionService.java
+++ b/core/java/android/speech/RecognitionService.java
@@ -21,6 +21,7 @@
 import android.app.Service;
 import android.content.Intent;
 import android.content.pm.PackageManager;
+import android.os.Binder;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
@@ -78,7 +79,7 @@
             switch (msg.what) {
                 case MSG_START_LISTENING:
                     StartListeningArgs args = (StartListeningArgs) msg.obj;
-                    dispatchStartListening(args.mIntent, args.mListener);
+                    dispatchStartListening(args.mIntent, args.mListener, args.mCallingUid);
                     break;
                 case MSG_STOP_LISTENING:
                     dispatchStopListening((IRecognitionListener) msg.obj);
@@ -93,7 +94,8 @@
         }
     };
 
-    private void dispatchStartListening(Intent intent, final IRecognitionListener listener) {
+    private void dispatchStartListening(Intent intent, final IRecognitionListener listener,
+            int callingUid) {
         if (mCurrentCallback == null) {
             if (DBG) Log.d(TAG, "created new mCurrentCallback, listener = " + listener.asBinder());
             try {
@@ -107,7 +109,7 @@
                 Log.e(TAG, "dead listener on startListening");
                 return;
             }
-            mCurrentCallback = new Callback(listener);
+            mCurrentCallback = new Callback(listener, callingUid);
             RecognitionService.this.onStartListening(intent, mCurrentCallback);
         } else {
             try {
@@ -155,10 +157,12 @@
         public final Intent mIntent;
 
         public final IRecognitionListener mListener;
+        public final int mCallingUid;
 
-        public StartListeningArgs(Intent intent, IRecognitionListener listener) {
+        public StartListeningArgs(Intent intent, IRecognitionListener listener, int callingUid) {
             this.mIntent = intent;
             this.mListener = listener;
+            this.mCallingUid = callingUid;
         }
     }
 
@@ -227,9 +231,11 @@
      */
     public class Callback {
         private final IRecognitionListener mListener;
+        private final int mCallingUid;
 
-        private Callback(IRecognitionListener listener) {
+        private Callback(IRecognitionListener listener, int callingUid) {
             mListener = listener;
+            mCallingUid = callingUid;
         }
 
         /**
@@ -314,6 +320,14 @@
         public void rmsChanged(float rmsdB) throws RemoteException {
             mListener.onRmsChanged(rmsdB);
         }
+
+        /**
+         * Return the Linux uid assigned to the process that sent you the current transaction that
+         * is being processed. This is obtained from {@link Binder#getCallingUid()}.
+         */
+        public int getCallingUid() {
+            return mCallingUid;
+        }
     }
 
     /** Binder of the recognition service */
@@ -331,7 +345,7 @@
             if (service != null && service.checkPermissions(listener)) {
                 service.mHandler.sendMessage(Message.obtain(service.mHandler,
                         MSG_START_LISTENING, service.new StartListeningArgs(
-                                recognizerIntent, listener)));
+                                recognizerIntent, listener, Binder.getCallingUid())));
             }
         }
 
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 3962b70..81f9f99 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4457,47 +4457,60 @@
 
     private static SparseArray<String> getAttributeMap() {
         if (mAttributeMap == null) {
-            mAttributeMap = new SparseArray<String>();
+            mAttributeMap = new SparseArray<>();
         }
         return mAttributeMap;
     }
 
-    private void saveAttributeData(AttributeSet attrs, TypedArray a) {
-        int length = ((attrs == null ? 0 : attrs.getAttributeCount()) + a.getIndexCount()) * 2;
-        mAttributes = new String[length];
+    private void saveAttributeData(@Nullable AttributeSet attrs, @NonNull TypedArray t) {
+        final int attrsCount = attrs == null ? 0 : attrs.getAttributeCount();
+        final int indexCount = t.getIndexCount();
+        final String[] attributes = new String[(attrsCount + indexCount) * 2];
 
         int i = 0;
-        if (attrs != null) {
-            for (i = 0; i < attrs.getAttributeCount(); i += 2) {
-                mAttributes[i] = attrs.getAttributeName(i);
-                mAttributes[i + 1] = attrs.getAttributeValue(i);
-            }
 
+        // Store raw XML attributes.
+        for (int j = 0; j < attrsCount; ++j) {
+            attributes[i] = attrs.getAttributeName(j);
+            attributes[i + 1] = attrs.getAttributeValue(j);
+            i += 2;
         }
 
-        SparseArray<String> attributeMap = getAttributeMap();
-        for (int j = 0; j < a.length(); ++j) {
-            if (a.hasValue(j)) {
+        // Store resolved styleable attributes.
+        final Resources res = t.getResources();
+        final SparseArray<String> attributeMap = getAttributeMap();
+        for (int j = 0; j < indexCount; ++j) {
+            final int index = t.getIndex(j);
+            if (!t.hasValueOrEmpty(index)) {
+                // Value is undefined. Skip it.
+                continue;
+            }
+
+            final int resourceId = t.getResourceId(index, 0);
+            if (resourceId == 0) {
+                // Value is not a reference. Skip it.
+                continue;
+            }
+
+            String resourceName = attributeMap.get(resourceId);
+            if (resourceName == null) {
                 try {
-                    int resourceId = a.getResourceId(j, 0);
-                    if (resourceId == 0) {
-                        continue;
-                    }
-
-                    String resourceName = attributeMap.get(resourceId);
-                    if (resourceName == null) {
-                        resourceName = a.getResources().getResourceName(resourceId);
-                        attributeMap.put(resourceId, resourceName);
-                    }
-
-                    mAttributes[i] = resourceName;
-                    mAttributes[i + 1] = a.getText(j).toString();
-                    i += 2;
+                    resourceName = res.getResourceName(resourceId);
                 } catch (Resources.NotFoundException e) {
-                    // if we can't get the resource name, we just ignore it
+                    resourceName = "0x" + Integer.toHexString(resourceId);
                 }
+                attributeMap.put(resourceId, resourceName);
             }
+
+            attributes[i] = resourceName;
+            attributes[i + 1] = t.getString(index, false);
+            i += 2;
         }
+
+        // Trim to fit contents.
+        final String[] trimmed = new String[i];
+        System.arraycopy(attributes, 0, trimmed, 0, i);
+        mAttributes = trimmed;
     }
 
     public String toString() {
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 41f906a..89b91f1 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -66,6 +66,7 @@
 import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener;
 import android.view.accessibility.AccessibilityManager.HighTextContrastChangeListener;
 import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
 import android.view.accessibility.AccessibilityNodeProvider;
 import android.view.accessibility.IAccessibilityInteractionConnection;
 import android.view.accessibility.IAccessibilityInteractionConnectionCallback;
@@ -2786,7 +2787,9 @@
             return false;
         }
 
+        // Transform the rect into window-relative coordinates.
         final AttachInfo attachInfo = mAttachInfo;
+        bounds.offset(0, attachInfo.mViewRootImpl.mScrollY);
         bounds.offset(-attachInfo.mWindowLeft, -attachInfo.mWindowTop);
         bounds.intersect(0, 0, attachInfo.mViewRootImpl.mWidth, attachInfo.mViewRootImpl.mHeight);
         return !bounds.isEmpty();
@@ -6354,16 +6357,18 @@
      *              {@link AccessibilityEvent#TYPE_WINDOW_CONTENT_CHANGED}
      */
     private void handleWindowContentChangedEvent(AccessibilityEvent event) {
-        // No virtual view focused, nothing to do here.
-        if (mAccessibilityFocusedHost == null || mAccessibilityFocusedVirtualView == null) {
+        final View focusedHost = mAccessibilityFocusedHost;
+        if (focusedHost == null || mAccessibilityFocusedVirtualView == null) {
+            // No virtual view focused, nothing to do here.
             return;
         }
 
-        // If we have a node but no provider, abort.
-        final AccessibilityNodeProvider provider =
-                mAccessibilityFocusedHost.getAccessibilityNodeProvider();
+        final AccessibilityNodeProvider provider = focusedHost.getAccessibilityNodeProvider();
         if (provider == null) {
-            // TODO: Should we clear the focused virtual view?
+            // Error state: virtual view with no provider. Clear focus.
+            mAccessibilityFocusedHost = null;
+            mAccessibilityFocusedVirtualView = null;
+            focusedHost.clearAccessibilityFocusNoCallbacks();
             return;
         }
 
@@ -6410,10 +6415,23 @@
         final Rect oldBounds = mTempRect;
         mAccessibilityFocusedVirtualView.getBoundsInScreen(oldBounds);
         mAccessibilityFocusedVirtualView = provider.createAccessibilityNodeInfo(focusedChildId);
-        final Rect newBounds = mAccessibilityFocusedVirtualView.getBoundsInScreen();
-        if (!oldBounds.equals(newBounds)) {
-            oldBounds.union(newBounds);
+        if (mAccessibilityFocusedVirtualView == null) {
+            // Error state: The node no longer exists. Clear focus.
+            mAccessibilityFocusedHost = null;
+            focusedHost.clearAccessibilityFocusNoCallbacks();
+
+            // This will probably fail, but try to keep the provider's internal
+            // state consistent by clearing focus.
+            provider.performAction(focusedChildId,
+                    AccessibilityAction.ACTION_CLEAR_ACCESSIBILITY_FOCUS.getId(), null);
             invalidateRectOnScreen(oldBounds);
+        } else {
+            // The node was refreshed, invalidate bounds if necessary.
+            final Rect newBounds = mAccessibilityFocusedVirtualView.getBoundsInScreen();
+            if (!oldBounds.equals(newBounds)) {
+                oldBounds.union(newBounds);
+                invalidateRectOnScreen(oldBounds);
+            }
         }
     }
 
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 9903b7e..e963f53 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -2568,7 +2568,13 @@
         selectorRect.right += mSelectionRightPadding;
         selectorRect.bottom += mSelectionBottomPadding;
 
-        // Update the selector drawable.
+        // Update the child enabled state prior to updating the selector.
+        final boolean isChildViewEnabled = sel.isEnabled();
+        if (mIsChildViewEnabled != isChildViewEnabled) {
+            mIsChildViewEnabled = isChildViewEnabled;
+        }
+
+        // Update the selector drawable's state and position.
         final Drawable selector = mSelector;
         if (selector != null) {
             if (positionChanged) {
@@ -2588,14 +2594,6 @@
                 selector.setHotspot(x, y);
             }
         }
-
-        final boolean isChildViewEnabled = mIsChildViewEnabled;
-        if (sel.isEnabled() != isChildViewEnabled) {
-            mIsChildViewEnabled = !isChildViewEnabled;
-            if (getSelectedItemPosition() != INVALID_POSITION) {
-                refreshDrawableState();
-            }
-        }
     }
 
     @Override
diff --git a/core/java/com/android/internal/view/FloatingActionMode.java b/core/java/com/android/internal/view/FloatingActionMode.java
index 0195208..93d2a1d 100644
--- a/core/java/com/android/internal/view/FloatingActionMode.java
+++ b/core/java/com/android/internal/view/FloatingActionMode.java
@@ -121,11 +121,7 @@
     public void updateViewLocationInWindow() {
         checkToolbarInitialized();
         mOriginatingView.getLocationInWindow(mViewPosition);
-        mViewRect.set(
-                mViewPosition[0],
-                mViewPosition[1],
-                mViewPosition[0] + mOriginatingView.getWidth(),
-                mViewPosition[1] + mOriginatingView.getHeight());
+        mOriginatingView.getGlobalVisibleRect(mViewRect);
         repositionToolbar();
     }
 
diff --git a/core/java/com/android/internal/widget/ButtonBarLayout.java b/core/java/com/android/internal/widget/ButtonBarLayout.java
index f58ab03..39613e8 100644
--- a/core/java/com/android/internal/widget/ButtonBarLayout.java
+++ b/core/java/com/android/internal/widget/ButtonBarLayout.java
@@ -33,9 +33,6 @@
     /** Whether the current configuration allows stacking. */
     private final boolean mAllowStacking;
 
-    /** Whether the layout is currently stacked. */
-    private boolean mStacked;
-
     private int mLastWidthSize = -1;
 
     public ButtonBarLayout(Context context, AttributeSet attrs) {
@@ -44,15 +41,14 @@
         final TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.ButtonBarLayout);
         mAllowStacking = ta.getBoolean(R.styleable.ButtonBarLayout_allowStacking, false);
         ta.recycle();
-
-        mStacked = getOrientation() == VERTICAL;
     }
 
     @Override
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+
         if (mAllowStacking) {
-            final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
-            if (widthSize > mLastWidthSize && mStacked) {
+            if (widthSize > mLastWidthSize && isStacked()) {
                 // We're being measured wider this time, try un-stacking.
                 setStacked(false);
             }
@@ -60,18 +56,37 @@
             mLastWidthSize = widthSize;
         }
 
-        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        boolean needsRemeasure = false;
 
-        if (mAllowStacking && !mStacked) {
+        // If we're not stacked, make sure the measure spec is AT_MOST rather
+        // than EXACTLY. This ensures that we'll still get TOO_SMALL so that we
+        // know to stack the buttons.
+        final int initialWidthMeasureSpec;
+        if (!isStacked() && MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) {
+            initialWidthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.AT_MOST);
+
+            // We'll need to remeasure again to fill excess space.
+            needsRemeasure = true;
+        } else {
+            initialWidthMeasureSpec = widthMeasureSpec;
+        }
+
+        super.onMeasure(initialWidthMeasureSpec, heightMeasureSpec);
+
+        if (mAllowStacking && !isStacked()) {
             final int measuredWidth = getMeasuredWidthAndState();
             final int measuredWidthState = measuredWidth & MEASURED_STATE_MASK;
             if (measuredWidthState == MEASURED_STATE_TOO_SMALL) {
                 setStacked(true);
 
                 // Measure again in the new orientation.
-                super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+                needsRemeasure = true;
             }
         }
+
+        if (needsRemeasure) {
+            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+        }
     }
 
     private void setStacked(boolean stacked) {
@@ -89,7 +104,9 @@
         for (int i = childCount - 2; i >= 0; i--) {
             bringChildToFront(getChildAt(i));
         }
+    }
 
-        mStacked = stacked;
+    private boolean isStacked() {
+        return getOrientation() == LinearLayout.VERTICAL;
     }
 }
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java
index b7a53b0..3cff59a 100644
--- a/core/java/com/android/internal/widget/FloatingToolbar.java
+++ b/core/java/com/android/internal/widget/FloatingToolbar.java
@@ -26,6 +26,7 @@
 import android.graphics.Rect;
 import android.graphics.Region;
 import android.graphics.drawable.ColorDrawable;
+import android.text.TextUtils;
 import android.util.Size;
 import android.view.Gravity;
 import android.view.LayoutInflater;
@@ -44,6 +45,7 @@
 import android.widget.ArrayAdapter;
 import android.widget.Button;
 import android.widget.ImageButton;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ListView;
 import android.widget.PopupWindow;
@@ -902,7 +904,7 @@
             boolean isFirstItem = true;
             while (!remainingMenuItems.isEmpty()) {
                 final MenuItem menuItem = remainingMenuItems.peek();
-                Button menuItemButton = createMenuItemButton(mContext, menuItem);
+                View menuItemButton = createMenuItemButton(mContext, menuItem);
 
                 // Adding additional start padding for the first button to even out button spacing.
                 if (isFirstItem) {
@@ -926,8 +928,7 @@
                 menuItemButton.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
                 int menuItemButtonWidth = Math.min(menuItemButton.getMeasuredWidth(), toolbarWidth);
                 if (menuItemButtonWidth <= availableWidth) {
-                    menuItemButton.setTag(menuItem);
-                    menuItemButton.setOnClickListener(mMenuItemButtonOnClickListener);
+                    setButtonTagAndClickListener(menuItemButton, menuItem);
                     mContentView.addView(menuItemButton);
                     ViewGroup.LayoutParams params = menuItemButton.getLayoutParams();
                     params.width = menuItemButtonWidth;
@@ -936,7 +937,7 @@
                     remainingMenuItems.pop();
                 } else {
                     if (mOpenOverflowButton == null) {
-                        mOpenOverflowButton = (ImageButton) LayoutInflater.from(mContext)
+                        mOpenOverflowButton = LayoutInflater.from(mContext)
                                 .inflate(R.layout.floating_popup_open_overflow_button, null);
                         mOpenOverflowButton.setOnClickListener(new View.OnClickListener() {
                             @Override
@@ -980,6 +981,15 @@
             mContentView.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
             return new Size(mContentView.getMeasuredWidth(), mContentView.getMeasuredHeight());
         }
+
+        private void setButtonTagAndClickListener(View menuItemButton, MenuItem menuItem) {
+            View button = menuItemButton;
+            if (isIconOnlyMenuItem(menuItem)) {
+                button = menuItemButton.findViewById(R.id.floating_toolbar_menu_item_image_button);
+            }
+            button.setTag(menuItem);
+            button.setOnClickListener(mMenuItemButtonOnClickListener);
+        }
     }
 
 
@@ -1141,10 +1151,34 @@
                     ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
             overflowListView.setDivider(null);
             overflowListView.setDividerHeight(0);
+
+            final int viewTypeCount = 2;
+            final int stringLabelViewType = 0;
+            final int iconOnlyViewType = 1;
             final ArrayAdapter overflowListViewAdapter =
                     new ArrayAdapter<MenuItem>(context, 0) {
                         @Override
+                        public int getViewTypeCount() {
+                            return viewTypeCount;
+                        }
+
+                        @Override
+                        public int getItemViewType(int position) {
+                            if (isIconOnlyMenuItem(getItem(position))) {
+                                return iconOnlyViewType;
+                            }
+                            return stringLabelViewType;
+                        }
+
+                        @Override
                         public View getView(int position, View convertView, ViewGroup parent) {
+                            if (getItemViewType(position) == iconOnlyViewType) {
+                                return getIconOnlyView(position, convertView);
+                            }
+                            return getStringTitleView(position, convertView);
+                        }
+
+                        private View getStringTitleView(int position, View convertView) {
                             TextView menuButton;
                             if (convertView != null) {
                                 menuButton = (TextView) convertView;
@@ -1157,6 +1191,22 @@
                             menuButton.setMinimumWidth(mOverflowWidth);
                             return menuButton;
                         }
+
+                        private View getIconOnlyView(int position, View convertView) {
+                            View menuButton;
+                            if (convertView != null) {
+                                menuButton = convertView;
+                            } else {
+                                menuButton = LayoutInflater.from(context).inflate(
+                                        R.layout.floating_popup_overflow_image_list_item, null);
+                            }
+                            MenuItem menuItem = getItem(position);
+                            ((ImageView) menuButton
+                                    .findViewById(R.id.floating_toolbar_menu_item_image_button))
+                                    .setImageDrawable(menuItem.getIcon());
+                            menuButton.setMinimumWidth(mOverflowWidth);
+                            return menuButton;
+                        }
                     };
             overflowListView.setAdapter(overflowListViewAdapter);
             return overflowListView;
@@ -1208,11 +1258,30 @@
         }
     }
 
+    /**
+     * @return {@code true} if the menu item does not not have a string title but has an icon.
+     *   {@code false} otherwise.
+     */
+    private static boolean isIconOnlyMenuItem(MenuItem menuItem) {
+        if (TextUtils.isEmpty(menuItem.getTitle()) && menuItem.getIcon() != null) {
+            return true;
+        }
+        return false;
+    }
 
     /**
      * Creates and returns a menu button for the specified menu item.
      */
-    private static Button createMenuItemButton(Context context, MenuItem menuItem) {
+    private static View createMenuItemButton(Context context, MenuItem menuItem) {
+        if (isIconOnlyMenuItem(menuItem)) {
+            View imageMenuItemButton = LayoutInflater.from(context)
+                    .inflate(R.layout.floating_popup_menu_image_button, null);
+            ((ImageButton) imageMenuItemButton
+                    .findViewById(R.id.floating_toolbar_menu_item_image_button))
+                    .setImageDrawable(menuItem.getIcon());
+            return imageMenuItemButton;
+        }
+
         Button menuItemButton = (Button) LayoutInflater.from(context)
                 .inflate(R.layout.floating_popup_menu_button, null);
         menuItemButton.setText(menuItem.getTitle());
diff --git a/core/java/com/android/internal/widget/ILockSettings.aidl b/core/java/com/android/internal/widget/ILockSettings.aidl
index bfafff6..dfb7c50 100644
--- a/core/java/com/android/internal/widget/ILockSettings.aidl
+++ b/core/java/com/android/internal/widget/ILockSettings.aidl
@@ -16,6 +16,8 @@
 
 package com.android.internal.widget;
 
+import com.android.internal.widget.VerifyCredentialResponse;
+
 /** {@hide} */
 interface ILockSettings {
     void setBoolean(in String key, in boolean value, in int userId);
@@ -25,11 +27,11 @@
     long getLong(in String key, in long defaultValue, in int userId);
     String getString(in String key, in String defaultValue, in int userId);
     void setLockPattern(in String pattern, in String savedPattern, int userId);
-    boolean checkPattern(in String pattern, int userId);
-    byte[] verifyPattern(in String pattern, long challenge, int userId);
+    VerifyCredentialResponse checkPattern(in String pattern, int userId);
+    VerifyCredentialResponse verifyPattern(in String pattern, long challenge, int userId);
     void setLockPassword(in String password, in String savedPassword, int userId);
-    boolean checkPassword(in String password, int userId);
-    byte[] verifyPassword(in String password, long challenge, int userId);
+    VerifyCredentialResponse checkPassword(in String password, int userId);
+    VerifyCredentialResponse verifyPassword(in String password, long challenge, int userId);
     boolean checkVoldPassword(int userId);
     boolean havePattern(int userId);
     boolean havePassword(int userId);
diff --git a/core/java/com/android/internal/widget/LockPatternChecker.java b/core/java/com/android/internal/widget/LockPatternChecker.java
index ac0f5fe..4880664 100644
--- a/core/java/com/android/internal/widget/LockPatternChecker.java
+++ b/core/java/com/android/internal/widget/LockPatternChecker.java
@@ -2,6 +2,8 @@
 
 import android.os.AsyncTask;
 
+import com.android.internal.widget.LockPatternUtils.RequestThrottledException;
+
 import java.util.List;
 
 /**
@@ -16,8 +18,10 @@
          * Invoked when a security check is finished.
          *
          * @param matched Whether the PIN/Password/Pattern matches the stored one.
+         * @param throttleTimeoutMs The amount of time in ms to wait before reattempting
+         * the call. Only non-0 if matched is false.
          */
-        void onChecked(boolean matched);
+        void onChecked(boolean matched, int throttleTimeoutMs);
     }
 
     /**
@@ -28,8 +32,10 @@
          * Invoked when a security verification is finished.
          *
          * @param attestation The attestation that the challenge was verified, or null.
+         * @param throttleTimeoutMs The amount of time in ms to wait before reattempting
+         * the call. Only non-0 if attestation is null.
          */
-        void onVerified(byte[] attestation);
+        void onVerified(byte[] attestation, int throttleTimeoutMs);
     }
 
     /**
@@ -47,14 +53,21 @@
             final int userId,
             final OnVerifyCallback callback) {
         AsyncTask<Void, Void, byte[]> task = new AsyncTask<Void, Void, byte[]>() {
+            private int mThrottleTimeout;
+
             @Override
             protected byte[] doInBackground(Void... args) {
-                return utils.verifyPattern(pattern, challenge, userId);
+                try {
+                    return utils.verifyPattern(pattern, challenge, userId);
+                } catch (RequestThrottledException ex) {
+                    mThrottleTimeout = ex.getTimeoutMs();
+                    return null;
+                }
             }
 
             @Override
             protected void onPostExecute(byte[] result) {
-                callback.onVerified(result);
+                callback.onVerified(result, mThrottleTimeout);
             }
         };
         task.execute();
@@ -74,14 +87,21 @@
             final int userId,
             final OnCheckCallback callback) {
         AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>() {
+            private int mThrottleTimeout;
+
             @Override
             protected Boolean doInBackground(Void... args) {
-                return utils.checkPattern(pattern, userId);
+                try {
+                    return utils.checkPattern(pattern, userId);
+                } catch (RequestThrottledException ex) {
+                    mThrottleTimeout = ex.getTimeoutMs();
+                    return false;
+                }
             }
 
             @Override
             protected void onPostExecute(Boolean result) {
-                callback.onChecked(result);
+                callback.onChecked(result, mThrottleTimeout);
             }
         };
         task.execute();
@@ -103,14 +123,21 @@
             final int userId,
             final OnVerifyCallback callback) {
         AsyncTask<Void, Void, byte[]> task = new AsyncTask<Void, Void, byte[]>() {
+            private int mThrottleTimeout;
+
             @Override
             protected byte[] doInBackground(Void... args) {
-                return utils.verifyPassword(password, challenge, userId);
+                try {
+                    return utils.verifyPassword(password, challenge, userId);
+                } catch (RequestThrottledException ex) {
+                    mThrottleTimeout = ex.getTimeoutMs();
+                    return null;
+                }
             }
 
             @Override
             protected void onPostExecute(byte[] result) {
-                callback.onVerified(result);
+                callback.onVerified(result, mThrottleTimeout);
             }
         };
         task.execute();
@@ -130,14 +157,21 @@
             final int userId,
             final OnCheckCallback callback) {
         AsyncTask<Void, Void, Boolean> task = new AsyncTask<Void, Void, Boolean>() {
+            private int mThrottleTimeout;
+
             @Override
             protected Boolean doInBackground(Void... args) {
-                return utils.checkPassword(password, userId);
+                try {
+                    return utils.checkPassword(password, userId);
+                } catch (RequestThrottledException ex) {
+                    mThrottleTimeout = ex.getTimeoutMs();
+                    return false;
+                }
             }
 
             @Override
             protected void onPostExecute(Boolean result) {
-                callback.onChecked(result);
+                callback.onChecked(result, mThrottleTimeout);
             }
         };
         task.execute();
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index e5ef60c..aee0ff6 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -60,24 +60,12 @@
     private static final boolean DEBUG = false;
 
     /**
-     * The maximum number of incorrect attempts before the user is prevented
-     * from trying again for {@link #FAILED_ATTEMPT_TIMEOUT_MS}.
-     */
-    public static final int FAILED_ATTEMPTS_BEFORE_TIMEOUT = 5;
-
-    /**
      * The number of incorrect attempts before which we fall back on an alternative
      * method of verifying the user, and resetting their lock pattern.
      */
     public static final int FAILED_ATTEMPTS_BEFORE_RESET = 20;
 
     /**
-     * How long the user is prevented from trying again after entering the
-     * wrong pattern too many times.
-     */
-    public static final long FAILED_ATTEMPT_TIMEOUT_MS = 30000L;
-
-    /**
      * The interval of the countdown for showing progress of the lockout.
      */
     public static final long FAILED_ATTEMPT_COUNTDOWN_INTERVAL_MS = 1000L;
@@ -109,6 +97,7 @@
     @Deprecated
     public final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently";
     public final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline";
+    public final static String LOCKOUT_ATTEMPT_TIMEOUT_MS = "lockscreen.lockoutattempttimeoutmss";
     public final static String PATTERN_EVER_CHOSEN_KEY = "lockscreen.patterneverchosen";
     public final static String PASSWORD_TYPE_KEY = "lockscreen.password_type";
     @Deprecated
@@ -144,6 +133,23 @@
     private DevicePolicyManager mDevicePolicyManager;
     private ILockSettings mLockSettingsService;
 
+
+    public static final class RequestThrottledException extends Exception {
+        private int mTimeoutMs;
+        public RequestThrottledException(int timeoutMs) {
+            mTimeoutMs = timeoutMs;
+        }
+
+        /**
+         * @return The amount of time in ms before another request may
+         * be executed
+         */
+        public int getTimeoutMs() {
+            return mTimeoutMs;
+        }
+
+    }
+
     public DevicePolicyManager getDevicePolicyManager() {
         if (mDevicePolicyManager == null) {
             mDevicePolicyManager =
@@ -239,9 +245,23 @@
      * @param challenge The challenge to verify against the pattern
      * @return the attestation that the challenge was verified, or null.
      */
-    public byte[] verifyPattern(List<LockPatternView.Cell> pattern, long challenge, int userId) {
+    public byte[] verifyPattern(List<LockPatternView.Cell> pattern, long challenge, int userId)
+            throws RequestThrottledException {
         try {
-            return getLockSettings().verifyPattern(patternToString(pattern), challenge, userId);
+            VerifyCredentialResponse response =
+                getLockSettings().verifyPattern(patternToString(pattern), challenge, userId);
+            if (response == null) {
+                // Shouldn't happen
+                return null;
+            }
+
+            if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
+                return response.getPayload();
+            } else if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_RETRY) {
+                throw new RequestThrottledException(response.getTimeout());
+            } else {
+                return null;
+            }
         } catch (RemoteException re) {
             return null;
         }
@@ -253,9 +273,19 @@
      * @param pattern The pattern to check.
      * @return Whether the pattern matches the stored one.
      */
-    public boolean checkPattern(List<LockPatternView.Cell> pattern, int userId) {
+    public boolean checkPattern(List<LockPatternView.Cell> pattern, int userId)
+            throws RequestThrottledException {
         try {
-            return getLockSettings().checkPattern(patternToString(pattern), userId);
+            VerifyCredentialResponse response =
+                    getLockSettings().checkPattern(patternToString(pattern), userId);
+
+            if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
+                return true;
+            } else if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_RETRY) {
+                throw new RequestThrottledException(response.getTimeout());
+            } else {
+                return false;
+            }
         } catch (RemoteException re) {
             return true;
         }
@@ -270,9 +300,19 @@
      * @param challenge The challenge to verify against the password
      * @return the attestation that the challenge was verified, or null.
      */
-    public byte[] verifyPassword(String password, long challenge, int userId) {
+    public byte[] verifyPassword(String password, long challenge, int userId)
+            throws RequestThrottledException {
         try {
-            return getLockSettings().verifyPassword(password, challenge, userId);
+            VerifyCredentialResponse response =
+                    getLockSettings().verifyPassword(password, challenge, userId);
+
+            if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
+                return response.getPayload();
+            } else if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_RETRY) {
+                throw new RequestThrottledException(response.getTimeout());
+            } else {
+                return null;
+            }
         } catch (RemoteException re) {
             return null;
         }
@@ -284,9 +324,17 @@
      * @param password The password to check.
      * @return Whether the password matches the stored one.
      */
-    public boolean checkPassword(String password, int userId) {
+    public boolean checkPassword(String password, int userId) throws RequestThrottledException {
         try {
-            return getLockSettings().checkPassword(password, userId);
+            VerifyCredentialResponse response =
+                    getLockSettings().checkPassword(password, userId);
+            if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
+                return true;
+            } else if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_RETRY) {
+                throw new RequestThrottledException(response.getTimeout());
+            } else {
+                return false;
+            }
         } catch (RemoteException re) {
             return true;
         }
@@ -957,6 +1005,29 @@
     }
 
     /**
+     * Set whether the visible password is enabled for cryptkeeper screen.
+     */
+    public void setVisiblePasswordEnabled(boolean enabled, int userId) {
+        // Update for crypto if owner
+        if (userId != UserHandle.USER_OWNER) {
+            return;
+        }
+
+        IBinder service = ServiceManager.getService("mount");
+        if (service == null) {
+            Log.e(TAG, "Could not find the mount service to update the user info");
+            return;
+        }
+
+        IMountService mountService = IMountService.Stub.asInterface(service);
+        try {
+            mountService.setField(StorageManager.PASSWORD_VISIBLE_KEY, enabled ? "1" : "0");
+        } catch (RemoteException e) {
+            Log.e(TAG, "Error changing password visible state", e);
+        }
+    }
+
+    /**
      * @return Whether tactile feedback for the pattern is enabled.
      */
     public boolean isTactileFeedbackEnabled() {
@@ -969,9 +1040,10 @@
      * pattern until the deadline has passed.
      * @return the chosen deadline.
      */
-    public long setLockoutAttemptDeadline(int userId) {
-        final long deadline = SystemClock.elapsedRealtime() + FAILED_ATTEMPT_TIMEOUT_MS;
+    public long setLockoutAttemptDeadline(int userId, int timeoutMs) {
+        final long deadline = SystemClock.elapsedRealtime() + timeoutMs;
         setLong(LOCKOUT_ATTEMPT_DEADLINE, deadline, userId);
+        setLong(LOCKOUT_ATTEMPT_TIMEOUT_MS, timeoutMs, userId);
         return deadline;
     }
 
@@ -982,8 +1054,9 @@
      */
     public long getLockoutAttemptDeadline(int userId) {
         final long deadline = getLong(LOCKOUT_ATTEMPT_DEADLINE, 0L, userId);
+        final long timeoutMs = getLong(LOCKOUT_ATTEMPT_TIMEOUT_MS, 0L, userId);
         final long now = SystemClock.elapsedRealtime();
-        if (deadline < now || deadline > (now + FAILED_ATTEMPT_TIMEOUT_MS)) {
+        if (deadline < now || deadline > (now + timeoutMs)) {
             return 0L;
         }
         return deadline;
diff --git a/core/java/com/android/internal/widget/VerifyCredentialResponse.aidl b/core/java/com/android/internal/widget/VerifyCredentialResponse.aidl
new file mode 100644
index 0000000..59a4bba
--- /dev/null
+++ b/core/java/com/android/internal/widget/VerifyCredentialResponse.aidl
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.internal.widget;
+
+/**
+ * Response object for an ILockSettings verification request.
+ * @hide
+ */
+parcelable VerifyCredentialResponse;
+
diff --git a/core/java/com/android/internal/widget/VerifyCredentialResponse.java b/core/java/com/android/internal/widget/VerifyCredentialResponse.java
new file mode 100644
index 0000000..48109ca
--- /dev/null
+++ b/core/java/com/android/internal/widget/VerifyCredentialResponse.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2015 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.internal.widget;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Response object for a ILockSettings credential verification request.
+ * @hide
+ */
+public final class VerifyCredentialResponse implements Parcelable {
+
+    public static final int RESPONSE_ERROR = -1;
+    public static final int RESPONSE_OK = 0;
+    public static final int RESPONSE_RETRY = 1;
+
+    public static final VerifyCredentialResponse OK = new VerifyCredentialResponse();
+    public static final VerifyCredentialResponse ERROR
+            = new VerifyCredentialResponse(RESPONSE_ERROR, 0, null);
+
+    private int mResponseCode;
+    private byte[] mPayload;
+    private int mTimeout;
+
+    public static final Parcelable.Creator<VerifyCredentialResponse> CREATOR
+            = new Parcelable.Creator<VerifyCredentialResponse>() {
+        @Override
+        public VerifyCredentialResponse createFromParcel(Parcel source) {
+            int responseCode = source.readInt();
+            VerifyCredentialResponse response = new VerifyCredentialResponse(responseCode, 0, null);
+            if (responseCode == RESPONSE_RETRY) {
+                response.setTimeout(source.readInt());
+            } else if (responseCode == RESPONSE_OK) {
+                int size = source.readInt();
+                if (size > 0) {
+                    byte[] payload = new byte[size];
+                    source.readByteArray(payload);
+                    response.setPayload(payload);
+                }
+            }
+            return response;
+        }
+
+        @Override
+        public VerifyCredentialResponse[] newArray(int size) {
+            return new VerifyCredentialResponse[size];
+        }
+
+    };
+
+    public VerifyCredentialResponse() {
+        mResponseCode = RESPONSE_OK;
+        mPayload = null;
+    }
+
+
+    public VerifyCredentialResponse(byte[] payload) {
+        mPayload = payload;
+        mResponseCode = RESPONSE_OK;
+    }
+
+    public VerifyCredentialResponse(int timeout) {
+        mTimeout = timeout;
+        mResponseCode = RESPONSE_RETRY;
+        mPayload = null;
+    }
+
+    private VerifyCredentialResponse(int responseCode, int timeout, byte[] payload) {
+        mResponseCode = responseCode;
+        mTimeout = timeout;
+        mPayload = payload;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(mResponseCode);
+        if (mResponseCode == RESPONSE_RETRY) {
+            dest.writeInt(mTimeout);
+        } else if (mResponseCode == RESPONSE_OK) {
+            if (mPayload != null) {
+                dest.writeInt(mPayload.length);
+                dest.writeByteArray(mPayload);
+            }
+        }
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public byte[] getPayload() {
+        return mPayload;
+    }
+
+    public int getTimeout() {
+        return mTimeout;
+    }
+
+    public int getResponseCode() {
+        return mResponseCode;
+    }
+
+    private void setTimeout(int timeout) {
+        mTimeout = timeout;
+    }
+
+    private void setPayload(byte[] payload) {
+        mPayload = payload;
+    }
+}
diff --git a/core/res/res/drawable-hdpi/dialog_background_mtrl_mult.9.png b/core/res/res/drawable-hdpi/dialog_background_mtrl_mult.9.png
deleted file mode 100644
index 0c3c3b4..0000000
--- a/core/res/res/drawable-hdpi/dialog_background_mtrl_mult.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_fingerprint_light_overlay.png b/core/res/res/drawable-hdpi/ic_fingerprint_light_overlay.png
new file mode 100644
index 0000000..0253c77
--- /dev/null
+++ b/core/res/res/drawable-hdpi/ic_fingerprint_light_overlay.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_calendar.png b/core/res/res/drawable-hdpi/perm_group_calendar.png
deleted file mode 100644
index 1ef032f..0000000
--- a/core/res/res/drawable-hdpi/perm_group_calendar.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_camera.png b/core/res/res/drawable-hdpi/perm_group_camera.png
deleted file mode 100644
index fb5a2f5..0000000
--- a/core/res/res/drawable-hdpi/perm_group_camera.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_location.png b/core/res/res/drawable-hdpi/perm_group_location.png
deleted file mode 100644
index 6989b16..0000000
--- a/core/res/res/drawable-hdpi/perm_group_location.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_messages.png b/core/res/res/drawable-hdpi/perm_group_messages.png
deleted file mode 100644
index 21929b6..0000000
--- a/core/res/res/drawable-hdpi/perm_group_messages.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_microphone.png b/core/res/res/drawable-hdpi/perm_group_microphone.png
deleted file mode 100644
index 9f8a681..0000000
--- a/core/res/res/drawable-hdpi/perm_group_microphone.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_phone_calls.png b/core/res/res/drawable-hdpi/perm_group_phone_calls.png
deleted file mode 100644
index 8fa802e..0000000
--- a/core/res/res/drawable-hdpi/perm_group_phone_calls.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/perm_group_social_info.png b/core/res/res/drawable-hdpi/perm_group_social_info.png
deleted file mode 100644
index dcf67e4..0000000
--- a/core/res/res/drawable-hdpi/perm_group_social_info.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/dialog_background_mtrl_mult.9.png b/core/res/res/drawable-mdpi/dialog_background_mtrl_mult.9.png
deleted file mode 100644
index 8322ae3..0000000
--- a/core/res/res/drawable-mdpi/dialog_background_mtrl_mult.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_fingerprint_light_overlay.png b/core/res/res/drawable-mdpi/ic_fingerprint_light_overlay.png
new file mode 100644
index 0000000..5a1c61e
--- /dev/null
+++ b/core/res/res/drawable-mdpi/ic_fingerprint_light_overlay.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_calendar.png b/core/res/res/drawable-mdpi/perm_group_calendar.png
deleted file mode 100644
index d2ad9d6..0000000
--- a/core/res/res/drawable-mdpi/perm_group_calendar.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_camera.png b/core/res/res/drawable-mdpi/perm_group_camera.png
deleted file mode 100644
index 1727cf1..0000000
--- a/core/res/res/drawable-mdpi/perm_group_camera.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_location.png b/core/res/res/drawable-mdpi/perm_group_location.png
deleted file mode 100644
index 7ad1e02..0000000
--- a/core/res/res/drawable-mdpi/perm_group_location.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_messages.png b/core/res/res/drawable-mdpi/perm_group_messages.png
deleted file mode 100644
index 12c5d88..0000000
--- a/core/res/res/drawable-mdpi/perm_group_messages.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_microphone.png b/core/res/res/drawable-mdpi/perm_group_microphone.png
deleted file mode 100644
index f6015b5..0000000
--- a/core/res/res/drawable-mdpi/perm_group_microphone.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_phone_calls.png b/core/res/res/drawable-mdpi/perm_group_phone_calls.png
deleted file mode 100644
index e373c2c..0000000
--- a/core/res/res/drawable-mdpi/perm_group_phone_calls.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/perm_group_social_info.png b/core/res/res/drawable-mdpi/perm_group_social_info.png
deleted file mode 100644
index 4ca0767..0000000
--- a/core/res/res/drawable-mdpi/perm_group_social_info.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/dialog_background_mtrl_mult.9.png b/core/res/res/drawable-xhdpi/dialog_background_mtrl_mult.9.png
deleted file mode 100644
index e6c0047..0000000
--- a/core/res/res/drawable-xhdpi/dialog_background_mtrl_mult.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_fingerprint_light_overlay.png b/core/res/res/drawable-xhdpi/ic_fingerprint_light_overlay.png
new file mode 100644
index 0000000..5f0c362
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/ic_fingerprint_light_overlay.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_calendar.png b/core/res/res/drawable-xhdpi/perm_group_calendar.png
deleted file mode 100644
index 9821c27..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_calendar.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_camera.png b/core/res/res/drawable-xhdpi/perm_group_camera.png
deleted file mode 100644
index 23b7167..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_camera.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_location.png b/core/res/res/drawable-xhdpi/perm_group_location.png
deleted file mode 100644
index d949cdb..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_location.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_messages.png b/core/res/res/drawable-xhdpi/perm_group_messages.png
deleted file mode 100644
index dbb9aba..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_messages.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_microphone.png b/core/res/res/drawable-xhdpi/perm_group_microphone.png
deleted file mode 100644
index 8887a41..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_microphone.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_phone_calls.png b/core/res/res/drawable-xhdpi/perm_group_phone_calls.png
deleted file mode 100644
index 9e1d2ca..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_phone_calls.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/perm_group_social_info.png b/core/res/res/drawable-xhdpi/perm_group_social_info.png
deleted file mode 100644
index 842662c..0000000
--- a/core/res/res/drawable-xhdpi/perm_group_social_info.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/dialog_background_mtrl_mult.9.png b/core/res/res/drawable-xxhdpi/dialog_background_mtrl_mult.9.png
deleted file mode 100644
index bb9debb..0000000
--- a/core/res/res/drawable-xxhdpi/dialog_background_mtrl_mult.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_fingerprint_light_overlay.png b/core/res/res/drawable-xxhdpi/ic_fingerprint_light_overlay.png
new file mode 100644
index 0000000..f4cf906
--- /dev/null
+++ b/core/res/res/drawable-xxhdpi/ic_fingerprint_light_overlay.png
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_calendar.png b/core/res/res/drawable-xxhdpi/perm_group_calendar.png
deleted file mode 100644
index 08f0474..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_calendar.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_camera.png b/core/res/res/drawable-xxhdpi/perm_group_camera.png
deleted file mode 100644
index 88a3d0e..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_camera.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_location.png b/core/res/res/drawable-xxhdpi/perm_group_location.png
deleted file mode 100644
index 3a83d8b..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_location.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_messages.png b/core/res/res/drawable-xxhdpi/perm_group_messages.png
deleted file mode 100644
index 9e2ef73..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_messages.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_microphone.png b/core/res/res/drawable-xxhdpi/perm_group_microphone.png
deleted file mode 100644
index 65a6bf2..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_microphone.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_phone_calls.png b/core/res/res/drawable-xxhdpi/perm_group_phone_calls.png
deleted file mode 100644
index e4daafb..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_phone_calls.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/perm_group_social_info.png b/core/res/res/drawable-xxhdpi/perm_group_social_info.png
deleted file mode 100644
index 076fd19..0000000
--- a/core/res/res/drawable-xxhdpi/perm_group_social_info.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/ic_fingerprint_light_overlay.png b/core/res/res/drawable-xxxhdpi/ic_fingerprint_light_overlay.png
new file mode 100644
index 0000000..dcdbed9
--- /dev/null
+++ b/core/res/res/drawable-xxxhdpi/ic_fingerprint_light_overlay.png
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_calendar.png b/core/res/res/drawable-xxxhdpi/perm_group_calendar.png
deleted file mode 100644
index d6243b1..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_calendar.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_camera.png b/core/res/res/drawable-xxxhdpi/perm_group_camera.png
deleted file mode 100644
index fdc4b44..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_camera.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_location.png b/core/res/res/drawable-xxxhdpi/perm_group_location.png
deleted file mode 100644
index a1019b2..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_location.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_messages.png b/core/res/res/drawable-xxxhdpi/perm_group_messages.png
deleted file mode 100644
index f7165fe..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_messages.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_microphone.png b/core/res/res/drawable-xxxhdpi/perm_group_microphone.png
deleted file mode 100644
index a85e4cd..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_microphone.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_phone_calls.png b/core/res/res/drawable-xxxhdpi/perm_group_phone_calls.png
deleted file mode 100644
index f4e6b9f..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_phone_calls.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxxhdpi/perm_group_social_info.png b/core/res/res/drawable-xxxhdpi/perm_group_social_info.png
deleted file mode 100644
index 3b17e39..0000000
--- a/core/res/res/drawable-xxxhdpi/perm_group_social_info.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/ic_fingerprint_dark.xml b/core/res/res/drawable/ic_fingerprint_dark.xml
new file mode 100644
index 0000000..6eb6ada
--- /dev/null
+++ b/core/res/res/drawable/ic_fingerprint_dark.xml
@@ -0,0 +1,37 @@
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="32.0dp"
+        android:height="32.0dp"
+        android:viewportWidth="32.0"
+        android:viewportHeight="32.0">
+    <path
+        android:fillColor="?attr/colorControlNormal"
+        android:pathData="M23.7,5.9c-0.1,0.0 -0.2,0.0 -0.3,-0.1C21.0,4.5 18.6,3.9 16.0,3.9c-2.5,0.0 -4.6,0.6 -6.9,1.9C8.8,6.0 8.3,5.9 8.1,5.5C7.9,5.2 8.0,4.7 8.4,4.5c2.5,-1.4 4.9,-2.1 7.7,-2.1c2.8,0.0 5.4,0.7 8.0,2.1c0.4,0.2 0.5,0.6 0.3,1.0C24.2,5.7 24.0,5.9 23.7,5.9z"/>
+    <path
+        android:fillColor="?attr/colorControlNormal"
+        android:pathData="M5.3,13.2c-0.1,0.0 -0.3,0.0 -0.4,-0.1c-0.3,-0.2 -0.4,-0.7 -0.2,-1.0c1.3,-1.9 2.9,-3.4 4.9,-4.5c4.1,-2.2 9.3,-2.2 13.4,0.0c1.9,1.1 3.6,2.5 4.9,4.4c0.2,0.3 0.1,0.8 -0.2,1.0c-0.3,0.2 -0.8,0.1 -1.0,-0.2c-1.2,-1.7 -2.6,-3.0 -4.3,-4.0c-3.7,-2.0 -8.3,-2.0 -12.0,0.0c-1.7,0.9 -3.2,2.3 -4.3,4.0C5.7,13.1 5.5,13.2 5.3,13.2z"/>
+    <path
+        android:fillColor="?attr/colorControlNormal"
+        android:pathData="M13.3,29.6c-0.2,0.0 -0.4,-0.1 -0.5,-0.2c-1.1,-1.2 -1.7,-2.0 -2.6,-3.6c-0.9,-1.7 -1.4,-3.7 -1.4,-5.9c0.0,-4.1 3.3,-7.4 7.4,-7.4c4.1,0.0 7.4,3.3 7.4,7.4c0.0,0.4 -0.3,0.7 -0.7,0.7s-0.7,-0.3 -0.7,-0.7c0.0,-3.3 -2.7,-5.9 -5.9,-5.9c-3.3,0.0 -5.9,2.7 -5.9,5.9c0.0,2.0 0.4,3.8 1.2,5.2c0.8,1.6 1.4,2.2 2.4,3.3c0.3,0.3 0.3,0.8 0.0,1.0C13.7,29.5 13.5,29.6 13.3,29.6z"/>
+    <path
+        android:fillColor="?attr/colorControlNormal"
+        android:pathData="M22.6,27.1c-1.6,0.0 -2.9,-0.4 -4.1,-1.2c-1.9,-1.4 -3.1,-3.6 -3.1,-6.0c0.0,-0.4 0.3,-0.7 0.7,-0.7s0.7,0.3 0.7,0.7c0.0,1.9 0.9,3.7 2.5,4.8c0.9,0.6 1.9,1.0 3.2,1.0c0.3,0.0 0.8,0.0 1.3,-0.1c0.4,-0.1 0.8,0.2 0.8,0.6c0.1,0.4 -0.2,0.8 -0.6,0.8C23.4,27.1 22.8,27.1 22.6,27.1z"/>
+    <path
+        android:fillColor="?attr/colorControlNormal"
+        android:pathData="M20.0,29.9c-0.1,0.0 -0.1,0.0 -0.2,0.0c-2.1,-0.6 -3.4,-1.4 -4.8,-2.9c-1.8,-1.9 -2.8,-4.4 -2.8,-7.1c0.0,-2.2 1.8,-4.1 4.1,-4.1c2.2,0.0 4.1,1.8 4.1,4.1c0.0,1.4 1.2,2.6 2.6,2.6c1.4,0.0 2.6,-1.2 2.6,-2.6c0.0,-5.1 -4.2,-9.3 -9.3,-9.3c-3.6,0.0 -6.9,2.1 -8.4,5.4C7.3,17.1 7.0,18.4 7.0,19.8c0.0,1.1 0.1,2.7 0.9,4.9c0.1,0.4 -0.1,0.8 -0.4,0.9c-0.4,0.1 -0.8,-0.1 -0.9,-0.4c-0.6,-1.8 -0.9,-3.6 -0.9,-5.4c0.0,-1.6 0.3,-3.1 0.9,-4.4c1.7,-3.8 5.6,-6.3 9.8,-6.3c5.9,0.0 10.7,4.8 10.7,10.7c0.0,2.2 -1.8,4.1 -4.1,4.1s-4.0,-1.8 -4.0,-4.1c0.0,-1.4 -1.2,-2.6 -2.6,-2.6c-1.4,0.0 -2.6,1.2 -2.6,2.6c0.0,2.3 0.9,4.5 2.4,6.1c1.2,1.3 2.4,2.0 4.2,2.5c0.4,0.1 0.6,0.5 0.5,0.9C20.6,29.7 20.3,29.9 20.0,29.9z"/>
+</vector>
diff --git a/core/res/res/drawable/ic_fingerprint_light.xml b/core/res/res/drawable/ic_fingerprint_light.xml
new file mode 100644
index 0000000..223d16b
--- /dev/null
+++ b/core/res/res/drawable/ic_fingerprint_light.xml
@@ -0,0 +1,28 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape android:shape="oval">
+            <solid android:color="?attr/colorAccent"/>
+            <size
+                android:width="40dp"
+                android:height="40dp"/>
+        </shape>
+    </item>
+    <item>
+        <bitmap android:src="@drawable/ic_fingerprint_light_overlay"/>
+    </item>
+</layer-list>
diff --git a/core/res/res/drawable/perm_group_calendar.xml b/core/res/res/drawable/perm_group_calendar.xml
new file mode 100644
index 0000000..a0f9dd2
--- /dev/null
+++ b/core/res/res/drawable/perm_group_calendar.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M34.0,24.0L24.0,24.0l0.0,10.0l10.0,0.0L34.0,24.0zM32.0,2.0l0.0,4.0L16.0,6.0L16.0,2.0l-4.0,0.0l0.0,4.0l-2.0,0.0c-2.21,0.0 -3.98,1.79 -3.98,4.0L6.0,38.0c0.0,2.21 1.79,4.0 4.0,4.0l28.0,0.0c2.21,0.0 4.0,-1.79 4.0,-4.0L42.0,10.0c0.0,-2.21 -1.79,-4.0 -4.0,-4.0l-2.0,0.0L36.0,2.0l-4.0,0.0zm6.0,36.0L10.0,38.0L10.0,16.0l28.0,0.0l0.0,22.0z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_camera.xml b/core/res/res/drawable/perm_group_camera.xml
new file mode 100644
index 0000000..30d31ce
--- /dev/null
+++ b/core/res/res/drawable/perm_group_camera.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M18.8,21.0l9.53,-16.51C26.94,4.18 25.49,4.0 24.0,4.0c-4.8,0.0 -9.19,1.69 -12.64,4.51l7.33,12.6 0.11,-0.2zm24.28,-3.0c-1.84,-5.85 -6.3,-10.52 -11.99,-12.68L23.77,18.0l19.31,0.0zm0.52,2.0L28.62,20.0l0.58,1.0 9.53,16.5C41.99,33.94 44.0,29.21 44.0,24.0c0.0,-1.37 -0.14,-2.71 -0.4,-4.0zm-26.53,4.0l-7.8,-13.5C6.01,14.06 4.0,18.79 4.0,24.0c0.0,1.3 0.14,2.7 0.4,4.0l14.98,0.0l-2.31,-4.0zM4.92,30.0c1.84,5.85 6.3,10.52 11.99,12.68L24.23,30.0L4.92,30.0zm22.54,0.0l-7.8,13.51c1.0,0.31 2.8,0.49 4.3,0.49 4.8,0.0 9.19,-1.69 12.64,-4.51L29.31,26.8 27.46,30.0z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_location.xml b/core/res/res/drawable/perm_group_location.xml
new file mode 100644
index 0000000..4184cf9
--- /dev/null
+++ b/core/res/res/drawable/perm_group_location.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M24.0,16.0c-4.42,0.0 -8.0,3.58 -8.0,8.0s3.58,8.0 8.0,8.0 8.0,-3.58 8.0,-8.0 -3.58,-8.0 -8.0,-8.0zm17.88,6.0C40.96,13.66 34.34,7.04 26.0,6.12L26.0,2.0l-4.0,0.0l0.0,4.12C13.66,7.04 7.04,13.66 6.12,22.0L2.0,22.0l0.0,4.0l4.12,0.0c0.92,8.34 7.54,14.96 15.88,15.88L22.0,46.0l4.0,0.0l0.0,-4.12c8.34,-0.92 14.96,-7.54 15.88,-15.88L46.0,26.0l0.0,-4.0l-4.12,0.0zM24.0,38.0c-7.73,0.0 -14.0,-6.27 -14.0,-14.0s6.27,-14.0 14.0,-14.0 14.0,6.27 14.0,14.0 -6.27,14.0 -14.0,14.0z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_messages.xml b/core/res/res/drawable/perm_group_messages.xml
new file mode 100644
index 0000000..4140e6c
--- /dev/null
+++ b/core/res/res/drawable/perm_group_messages.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M40.0,4.0L8.0,4.0C5.79,4.0 4.02,5.79 4.02,8.0L4.0,44.0l8.0,-8.0l28.0,0.0c2.21,0.0 4.0,-1.79 4.0,-4.0L44.0,8.0c0.0,-2.21 -1.79,-4.0 -4.0,-4.0zm-4.0,24.0L12.0,28.0l0.0,-4.0l16.0,0.0l0.0,4.0zm0.0,-6.0L12.0,22.0l0.0,-4.0l24.0,0.0l0.0,4.0zm0.0,-6.0L12.0,16.0l0.0,-4.0l24.0,0.0l0.0,4.0z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_microphone.xml b/core/res/res/drawable/perm_group_microphone.xml
new file mode 100644
index 0000000..670ef98
--- /dev/null
+++ b/core/res/res/drawable/perm_group_microphone.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M24.0,28.0c3.31,0.0 5.98,-2.69 5.98,-6.0L30.0,10.0c0.0,-3.32 -2.68,-6.0 -6.0,-6.0 -3.31,0.0 -6.0,2.68 -6.0,6.0l0.0,12.0c0.0,3.31 2.69,6.0 6.0,6.0zm10.6,-6.0c0.0,6.0 -5.07,10.2 -10.6,10.2 -5.52,0.0 -10.6,-4.2 -10.6,-10.2L10.0,22c0.0,6.83 5.44,12.47 12.0,13.44L22.0,42.0l4.0,0.0l0.0,-6.56c6.56,-0.97 12.0,-6.61 12.0,-13.44l-3.4,0.0z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_phone_calls.xml b/core/res/res/drawable/perm_group_phone_calls.xml
new file mode 100644
index 0000000..04ac6b9
--- /dev/null
+++ b/core/res/res/drawable/perm_group_phone_calls.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M13.25,21.59c2.88,5.66 7.51,10.29 13.18,13.17l4.4,-4.41c0.55,-0.55 1.34,-0.71 2.03,-0.49C35.1,30.6 37.51,31.0 40.0,31.0c1.11,0.0 2.0,0.89 2.0,2.0l0.0,7.0c0.0,1.11 -0.89,2.0 -2.0,2.0C21.22,42.0 6.0,26.78 6.0,8.0c0.0,-1.1 0.9,-2.0 2.0,-2.0l7.0,0.0c1.11,0.0 2.0,0.89 2.0,2.0 0.0,2.4 0.4,4.9 1.14,7.1 0.2,0.6 0.06,1.48 -0.49,2.03l-4.4,4.42z"/>
+</vector>
diff --git a/core/res/res/drawable/perm_group_social_info.xml b/core/res/res/drawable/perm_group_social_info.xml
new file mode 100644
index 0000000..f0f7a90
--- /dev/null
+++ b/core/res/res/drawable/perm_group_social_info.xml
@@ -0,0 +1,24 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="48.0"
+        android:viewportHeight="48.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M32.0,22.0c3.31,0.0 5.98,-2.69 5.98,-6.0s-2.67,-6.0 -5.98,-6.0c-3.31,0.0 -6.0,2.69 -6.0,6.0s2.69,6.0 6.0,6.0zm-16.0,0.0c3.31,0.0 5.98,-2.69 5.98,-6.0s-2.67,-6.0 -5.98,-6.0c-3.31,0.0 -6.0,2.69 -6.0,6.0s2.69,6.0 6.0,6.0zm0.0,4.0c-4.67,0.0 -14.0,2.34 -14.0,7.0l0.0,5.0l28.0,0.0l0.0,-5.0c0.0,-4.66 -9.33,-7.0 -14.0,-7.0zm16.0,0.0c-0.58,0.0 -1.2,0.04 -1.9,0.11C32.39,27.78 34.0,30.03 34.0,33.0l0.0,5.0l12.0,0.0l0.0,-5.0c0.0,-4.66 -9.33,-7.0 -14.0,-7.0z"/>
+</vector>
diff --git a/core/res/res/layout/floating_popup_menu_image_button.xml b/core/res/res/layout/floating_popup_menu_image_button.xml
new file mode 100644
index 0000000..5934136
--- /dev/null
+++ b/core/res/res/layout/floating_popup_menu_image_button.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* Copyright 2015, 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="@dimen/floating_toolbar_menu_button_minimum_width"
+    android:layout_height="@dimen/floating_toolbar_height"
+    android:minWidth="@dimen/floating_toolbar_menu_button_minimum_width"
+    android:minHeight="@dimen/floating_toolbar_height"
+    android:focusable="false"
+    android:focusableInTouchMode="false"
+    android:importantForAccessibility="no">
+    <ImageButton
+        android:id="@+id/floating_toolbar_menu_item_image_button"
+        android:layout_width="@dimen/floating_toolbar_menu_button_minimum_width"
+        android:layout_height="@dimen/floating_toolbar_height"
+        android:scaleType="centerInside"
+        android:background="?attr/selectableItemBackground" />
+</LinearLayout>
diff --git a/core/res/res/layout/floating_popup_overflow_image_list_item.xml b/core/res/res/layout/floating_popup_overflow_image_list_item.xml
new file mode 100644
index 0000000..9988ad5
--- /dev/null
+++ b/core/res/res/layout/floating_popup_overflow_image_list_item.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/* Copyright 2015, 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="@dimen/floating_toolbar_menu_button_minimum_width"
+    android:layout_height="@dimen/floating_toolbar_height"
+    android:minWidth="@dimen/floating_toolbar_menu_button_minimum_width"
+    android:minHeight="@dimen/floating_toolbar_height"
+    android:focusable="false"
+    android:focusableInTouchMode="false"
+    android:importantForAccessibility="no">
+    <ImageView
+        android:id="@+id/floating_toolbar_menu_item_image_button"
+        android:layout_width="@dimen/floating_toolbar_menu_button_minimum_width"
+        android:layout_height="@dimen/floating_toolbar_height"
+        android:layout_marginStart="18dp"
+        android:scaleType="centerInside"/>
+</LinearLayout>
diff --git a/core/res/res/layout/notification_template_material_base.xml b/core/res/res/layout/notification_template_material_base.xml
index ea22b15..94bbec8 100644
--- a/core/res/res/layout/notification_template_material_base.xml
+++ b/core/res/res/layout/notification_template_material_base.xml
@@ -19,6 +19,7 @@
     android:id="@+id/status_bar_latest_event_content"
     android:layout_width="match_parent"
     android:layout_height="64dp"
+    android:tag="base"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/layout/notification_template_material_big_base.xml b/core/res/res/layout/notification_template_material_big_base.xml
index 2a3ee90..a13dc85 100644
--- a/core/res/res/layout/notification_template_material_big_base.xml
+++ b/core/res/res/layout/notification_template_material_big_base.xml
@@ -19,6 +19,7 @@
     android:id="@+id/status_bar_latest_event_content"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:tag="big"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/layout/notification_template_material_big_media.xml b/core/res/res/layout/notification_template_material_big_media.xml
index 93acdbf..7fd93de 100644
--- a/core/res/res/layout/notification_template_material_big_media.xml
+++ b/core/res/res/layout/notification_template_material_big_media.xml
@@ -20,6 +20,7 @@
     android:layout_width="match_parent"
     android:layout_height="128dp"
     android:background="#00000000"
+    android:tag="bigMedia"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/layout/notification_template_material_big_media_narrow.xml b/core/res/res/layout/notification_template_material_big_media_narrow.xml
index 21e5ff8..807cfaf 100644
--- a/core/res/res/layout/notification_template_material_big_media_narrow.xml
+++ b/core/res/res/layout/notification_template_material_big_media_narrow.xml
@@ -21,6 +21,7 @@
     android:layout_width="match_parent"
     android:layout_height="128dp"
     android:background="#00000000"
+    android:tag="bigMediaNarrow"
     >
     <ImageView android:id="@+id/icon"
         android:layout_width="128dp"
diff --git a/core/res/res/layout/notification_template_material_big_picture.xml b/core/res/res/layout/notification_template_material_big_picture.xml
index f1a9549..f3768b5 100644
--- a/core/res/res/layout/notification_template_material_big_picture.xml
+++ b/core/res/res/layout/notification_template_material_big_picture.xml
@@ -19,6 +19,7 @@
     android:id="@+id/status_bar_latest_event_content"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:tag="bigPicture"
     >
     <ImageView
         android:id="@+id/big_picture"
diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml
index f657f04..b677a98 100644
--- a/core/res/res/layout/notification_template_material_big_text.xml
+++ b/core/res/res/layout/notification_template_material_big_text.xml
@@ -19,6 +19,7 @@
     android:id="@+id/status_bar_latest_event_content"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:tag="bigText"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index a8d2ee3..c109225 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -19,6 +19,7 @@
     android:id="@+id/status_bar_latest_event_content"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:tag="inbox"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/layout/notification_template_material_media.xml b/core/res/res/layout/notification_template_material_media.xml
index 0292d28..f6c22c8 100644
--- a/core/res/res/layout/notification_template_material_media.xml
+++ b/core/res/res/layout/notification_template_material_media.xml
@@ -21,6 +21,7 @@
     android:layout_height="64dp"
     android:orientation="horizontal"
     android:background="#00000000"
+    android:tag="media"
     >
     <include layout="@layout/notification_template_icon_group"
         android:layout_width="@dimen/notification_large_icon_width"
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index c2411ab..78c67bd 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"No s\'ha pogut processar l\'empremta digital. Torna-ho a provar."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"El sensor d\'empremtes digitals està brut. Neteja\'l i torna-ho a provar."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"El dit s\'ha mogut massa ràpid. Torna-ho a provar."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"El dit s\'ha mogut massa lentament. Torna-ho a provar."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"El maquinari per a empremtes digitals no està disponible."</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index cf57ec2..54072ed 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -429,8 +429,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Zpracování otisku prstu se nezdařilo. Zkuste to znovu."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Senzor otisků prstů je znečištěn. Vyčistěte jej a zkuste to znovu."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Pohyb prstem byl příliš rychlý. Zkuste to znovu."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Pohyb prstem byl příliš pomalý. Zkuste to znovu."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Není k dispozici hardware ke snímání otisků prstů."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index d45777d..d685561 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Fingerabdruck konnte nicht verarbeitet werden. Versuchen Sie es erneut."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Fingerabdrucksensor ist verschmutzt. Reinigen Sie ihn und versuchen Sie es erneut."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Finger zu schnell bewegt. Versuchen Sie es erneut."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Finger zu langsam bewegt. Versuchen Sie es erneut."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Fingerabdruckhardware nicht verfügbar"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index e6d037d..c129eb8 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"No se pudo procesar la huella digital. Vuelve a intentarlo."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"El sensor de huellas digitales está sucio. Limpia el sensor y vuelve a intentarlo."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Moviste el dedo muy rápido. Vuelve a intentarlo."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Moviste el dedo muy lento. Vuelve a intentarlo."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"El hardware para detectar huellas digitales no está disponible."</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 2632cf6..d5e14ed 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"No se ha podido procesar la huella digital. Vuelve a intentarlo."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"El sensor de huellas digitales está sucio. Límpialo y vuelve a intentarlo."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Has quitado el dedo demasiado rápido. Vuelve a intentarlo."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Has movido el dedo demasiado despacio. Vuelve a intentarlo."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"El hardware de huella digital no está disponible."</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 3bf6752..eea68df 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"اثرانگشت پردازش نشد. لطفاً دوباره امتحان کنید."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"حسگر اثر انگشت کثیف است. لطفاً آن را تمیز کنید و دوباره امتحان نمایید."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"حرکت انگشت خیلی سریع بود. لطفاً دوباره امتحان کنید."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"حرکت انگشت خیلی آهسته بود. لطفاً دوباره امتحان کنید."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"سخت‌افزار اثرانگشت در دسترس نیست."</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 9d9563f..5b9170c 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Sormenjäljen käsittely epäonnistui. Yritä uudelleen."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Sormenjälkitunnistin on likainen. Puhdista tunnistin ja yritä uudelleen."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Liikutit sormea liian nopeasti. Yritä uudelleen."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Liikutit sormea liian hitaasti. Yritä uudelleen."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Sormenjälkilaitteisto ei ole käytettävissä."</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index 03c3d83..04d916e 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Impossible de traiter les empreintes digitales. Veuillez essayer de nouveau."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Le capteur d\'empreintes digitales est sale. Veuillez le nettoyer et essayer de nouveau."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Vous avez déplacé votre doigt trop rapidement. Veuillez réessayer."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Vous avez déplacé votre doigt trop lentement. Veuillez réessayer."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Matériel d\'empreinte numérique indisponible."</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index d93ded6..0a57621 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -428,8 +428,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Obrada otiska prsta nije uspjela. Pokušajte ponovo."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Senzor otiska prsta nije čist. Očistite ga i pokušajte ponovo."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Prebrzo pomicanje prsta. Pokušajte ponovo."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Presporo pomicanje prsta. Pokušajte ponovo."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Hardver za otisak prsta nije dostupan."</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index e44bc44..b7447cd 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"指紋を処理できませんでした。もう一度お試しください。"</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"指紋センサーに汚れがあります。汚れを落としてもう一度お試しください。"</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"指の動きが速すぎました。もう一度お試しください。"</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"指の動きが遅すぎました。もう一度お試しください。"</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"指紋ハードウェアは使用できません。"</string>
diff --git a/core/res/res/values-ka-rGE/strings.xml b/core/res/res/values-ka-rGE/strings.xml
index 0b2e413..b1033a7 100644
--- a/core/res/res/values-ka-rGE/strings.xml
+++ b/core/res/res/values-ka-rGE/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"თითის ანაბეჭდი ვერ მუშავდება. გთხოვთ, სცადოთ ხელახლა."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"თითის ანაბეჭდის სენსორი დაბინძურებულია. გთხოვთ, გაასუფთაოთ და სცადოთ ხელახლა."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"თითის აღება მეტისმეტად სწრაფად მოხდა. გთხოვთ, სცადოთ ხელახლა."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"თითის აღება მეტისმეტად ნელა მოხდა. გთხოვთ, სცადოთ ხელახლა."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"თითის ანაბეჭდის აპარატურა არ არის ხელმისაწვდომი."</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index f679436..855e08d 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"지문을 인식할 수 없습니다. 다시 시도해 주세요."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"지문 센서를 깨끗이 닦고 다시 시도하세요."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"손가락을 너무 빨리 움직였습니다. 다시 시도해 주세요."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"손가락을 너무 느리게 움직였습니다. 다시 시도해 주세요."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"지문 인식 하드웨어를 사용할 수 없습니다."</string>
diff --git a/core/res/res/values-ky-rKG/strings.xml b/core/res/res/values-ky-rKG/strings.xml
index 27fb058..35df085 100644
--- a/core/res/res/values-ky-rKG/strings.xml
+++ b/core/res/res/values-ky-rKG/strings.xml
@@ -554,8 +554,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Манжа изи иштелбей койду. Кайра аракет кылыңыз."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Манжа изинин сенсору кирдеп калган. Тазалап, кайра аракет кылыңыз."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Манжа өтө тез жылдырылды. Кайра аракет кылыңыз."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">".Манжа өтө акырын жылдырылды. Кайра аракет кылыңыз."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Манжа изинин аппараттык камсыздоосу жеткиликтүү эмес."</string>
diff --git a/core/res/res/values-ms-rMY/strings.xml b/core/res/res/values-ms-rMY/strings.xml
index 4e870f7..c8ea6ae 100644
--- a/core/res/res/values-ms-rMY/strings.xml
+++ b/core/res/res/values-ms-rMY/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Tidak dapat memproses cap jari. Sila cuba lagi."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Penderia cap jari kotor. Sila bersihkan dan cuba lagi."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Jari digerakkan terlalu cepat. Sila cuba lagi."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Jari digerakkan terlalu perlahan. Sila cuba lagi."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Perkakasan cap jari tidak tersedia."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index c7b47e1..db7febf 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Não foi possível processar a impressão digital. Tente novamente."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"O sensor de impressão digital está sujo. Limpe-o e tente novamente."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"O dedo foi retirado rápido demais. Tente novamente."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"O movimento do dedo está muito lento. Tente novamente."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Hardware de impressão digital não disponível."</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 15ac3c7..304118f 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -428,8 +428,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Amprenta nu a putut fi procesată. Încercați din nou."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Senzorul pentru amprente este murdar. Curățați-l și încercați din nou."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Ați mișcat degetul prea repede. Încercați din nou."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Ați mișcat degetul prea lent. Încercați din nou."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Hardware-ul pentru amprentă nu este disponibil."</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index d4ce526..29e05f8 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -429,8 +429,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Не удалось распознать отпечаток. Повторите попытку."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Очистите сканер и повторите попытку."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Вы слишком быстро убрали палец. Повторите попытку."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Вы перемещали палец слишком медленно. Повторите попытку."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Сканер недоступен"</string>
diff --git a/core/res/res/values-si-rLK/strings.xml b/core/res/res/values-si-rLK/strings.xml
index 003747b..46c0761 100644
--- a/core/res/res/values-si-rLK/strings.xml
+++ b/core/res/res/values-si-rLK/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"ඇඟිලි සලකුණ පිරිසැකසීමට නොහැකි විය. කරුණාකර නැවත උත්සාහ කරන්න."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"ඇඟිලි සලකුණු සංවේදකය අපිරිසිදුයි. කරුණාකර පිරිසිදු කර නැවත උත්සාහ කරන්න."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"ඇඟිල්ල ඉතා වේගයෙන් ගෙන යන ලදී. කරුණාකර නැවත උත්සාහ කරන්න."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"ඇඟිල්ල වඩා සෙමෙන් ගෙන යන ලදි. කරුණාකර නැවත උත්සාහ කරන්න."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"ඇඟිලි සලකුණු දෘඪාංගය ලද නොහැකිය."</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 6178dd5..973e90c 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -428,8 +428,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Није успела обрада отиска прста. Покушајте поново."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Сензор за отиске прстију је прљав. Очистите га и покушајте поново."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Пребрзо сте померили прст. Покушајте поново."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Превише споро сте померили прст. Покушајте поново."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Хардвер за отиске прстију није доступан."</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index f48e418..5cc6d0b 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Parmak izi işlenemedi. Lütfen tekrar deneyin."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Parmak izi sensörü kirli. Lütfen temizleyin ve tekrar deneyin."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Parmak hareketi çok hızlıydı. Lütfen tekrar deneyin."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Parmak hareketi çok yavaştı. Lütfen tekrar deneyin."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Parmak izi donanımı kullanılamıyor."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 318ca95..a27afc0 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -429,8 +429,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"Не вдалось обробити відбиток. Повторіть спробу."</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"Датчик відбитків забруднився. Очистьте його та повторіть спробу."</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"Ви забрали палець надто швидко. Повторіть спробу."</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"Ви провели пальцем надто повільно. Повторіть спробу."</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"Апаратне забезпечення для сканування відбитка недоступне."</string>
diff --git a/core/res/res/values-ur-rPK/strings.xml b/core/res/res/values-ur-rPK/strings.xml
index 146f00c..33639bf 100644
--- a/core/res/res/values-ur-rPK/strings.xml
+++ b/core/res/res/values-ur-rPK/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"فنگر پرنٹ پر کارروائی نہیں کی جا سکی۔ براہ کرم دوبارہ کوشش کریں۔"</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"فنگر پرنٹ سینسر گندا ہے۔ براہ کرم صاف کریں اور دوبارہ کوشش کریں۔"</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"انگلی کو کافی تیزی سے ہٹا لیا گیا۔ براہ کرم دوبارہ کوشش کریں۔"</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"انگلی کو بہت آہستہ ہٹایا گیا۔ براہ کرم دوبارہ کوشش کریں۔"</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"فنگر پرنٹ ہارڈ ویئر دستیاب نہیں ہے۔"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index cdb2b7e2..58053aa8 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"无法处理指纹,请重试。"</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"指纹传感器有脏污。请擦拭干净,然后重试。"</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"手指移动太快,请重试。"</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"手指移动太慢,请重试。"</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"指纹硬件无法使用。"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index dc700ff..f980c2a 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -427,8 +427,7 @@
     <string name="fingerprint_acquired_insufficient" msgid="4596546021310923214">"無法處理指紋,請再試一次。"</string>
     <string name="fingerprint_acquired_imager_dirty" msgid="1087209702421076105">"指紋感應器有髒汙。請清潔感應器,然後再試一次。"</string>
     <string name="fingerprint_acquired_too_fast" msgid="6470642383109155969">"手指移動速度過快,請再試一次。"</string>
-    <!-- no translation found for fingerprint_acquired_too_slow (59250885689661653) -->
-    <skip />
+    <string name="fingerprint_acquired_too_slow" msgid="59250885689661653">"手指移動速度過慢,請再試一次。"</string>
   <string-array name="fingerprint_acquired_vendor">
   </string-array>
     <string name="fingerprint_error_hw_not_available" msgid="7955921658939936596">"指紋硬體無法使用。"</string>
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index 5bc0e03..d5c2d19 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -231,8 +231,6 @@
        <item>@drawable/ic_voice_search_api_holo_light</item>
        <item>@drawable/dialog_bottom_holo_dark</item>
        <item>@drawable/dialog_bottom_holo_light</item>
-       <item>@drawable/dialog_full_holo_dark</item>
-       <item>@drawable/dialog_full_holo_light</item>
        <item>@drawable/dialog_middle_holo_dark</item>
        <item>@drawable/dialog_middle_holo_light</item>
        <item>@drawable/dialog_top_holo_dark</item>
@@ -263,13 +261,9 @@
        <item>@drawable/fastscroll_track_holo_dark</item>
        <item>@drawable/fastscroll_track_pressed_holo_dark</item>
        <item>@drawable/fastscroll_track_default_holo_dark</item>
-       <item>@drawable/fastscroll_label_left_holo_dark</item>
-       <item>@drawable/fastscroll_label_right_holo_dark</item>
        <item>@drawable/fastscroll_track_holo_light</item>
        <item>@drawable/fastscroll_track_pressed_holo_light</item>
        <item>@drawable/fastscroll_track_default_holo_light</item>
-       <item>@drawable/fastscroll_label_left_holo_light</item>
-       <item>@drawable/fastscroll_label_right_holo_light</item>
        <item>@drawable/editbox_dropdown_background_dark</item>
        <item>@drawable/textfield_searchview_holo_dark</item>
        <item>@drawable/textfield_searchview_right_holo_dark</item>
@@ -310,7 +304,6 @@
        <item>@drawable/cab_background_bottom_material</item>
        <item>@drawable/cab_background_top_material</item>
        <item>@drawable/dialog_background_material</item>
-       <item>@drawable/dialog_background_shadow_material</item>
        <item>@drawable/edit_text_material</item>
        <item>@drawable/expander_group_material</item>
        <item>@drawable/fastscroll_label_left_material</item>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 21c4a8d..46e1e5e 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -568,6 +568,9 @@
              preference fragment. -->
         <attr name="detailsElementBackground" format="reference" />
 
+        <!-- Drawable that should be used to indicate that an app is waiting for a fingerprint scan. -->
+        <attr name="fingerprintDrawable" format="reference" />
+
         <!-- ============ -->
         <!-- Panel styles -->
         <!-- ============ -->
diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml
index 842c72e..fca1285 100644
--- a/core/res/res/values/ids.xml
+++ b/core/res/res/values/ids.xml
@@ -94,6 +94,7 @@
   <item type="id" name="redo" />
   <item type="id" name="replaceText" />
   <item type="id" name="shareText" />
+  <item type="id" name="floating_toolbar_menu_item_image_button" />
 
   <!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_SHOW_ON_SCREEN}. -->
   <item type="id" name="accessibilityActionShowOnScreen" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index b60a333..1600e97 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2689,4 +2689,5 @@
   <public type="attr" name="supportsLaunchVoiceAssistFromKeyguard" />
   <public type="attr" name="scrollIndicators" />
   <public type="attr" name="hyphenationFrequency" />
+  <public type="attr" name="fingerprintDrawable" />
 </resources>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 165d1f8..56eafe1 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -489,8 +489,6 @@
     <!-- Alert dialog button bar button -->
     <style name="Widget.Material.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.Borderless.Colored">
         <item name="minWidth">64dp</item>
-        <item name="singleLine">true</item>
-        <item name="ellipsize">none</item>
         <item name="minHeight">@dimen/alert_dialog_button_bar_height</item>
     </style>
 
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 4b57a47..e3033e7 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2243,11 +2243,14 @@
   <java-symbol type="drawable" name="ic_usb_48dp" />
 
   <!-- Floating toolbar -->
+  <java-symbol type="id" name="floating_toolbar_menu_item_image_button" />
   <java-symbol type="layout" name="floating_popup_container" />
   <java-symbol type="layout" name="floating_popup_menu_button" />
   <java-symbol type="layout" name="floating_popup_open_overflow_button" />
   <java-symbol type="layout" name="floating_popup_close_overflow_button" />
+  <java-symbol type="layout" name="floating_popup_menu_image_button" />
   <java-symbol type="layout" name="floating_popup_overflow_list_item" />
+  <java-symbol type="layout" name="floating_popup_overflow_image_list_item" />
   <java-symbol type="dimen" name="floating_toolbar_height" />
   <java-symbol type="dimen" name="floating_toolbar_menu_button_side_padding" />
   <java-symbol type="dimen" name="floating_toolbar_overflow_side_padding" />
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 3f8071f..f01e3f8 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -303,6 +303,7 @@
         <item name="preferenceFragmentListStyle">@style/PreferenceFragmentList.Material</item>
         <item name="preferenceFragmentPaddingSide">@dimen/preference_fragment_padding_side_material</item>
         <item name="detailsElementBackground">?attr/colorBackground</item>
+        <item name="fingerprintDrawable">@drawable/ic_fingerprint_dark</item>
 
         <!-- Search widget styles -->
         <item name="searchWidgetCorpusItemBackground">@color/search_widget_corpus_item_background</item>
@@ -656,6 +657,7 @@
         <item name="preferenceFragmentListStyle">@style/PreferenceFragmentList.Material</item>
         <item name="preferenceFragmentPaddingSide">@dimen/preference_fragment_padding_side_material</item>
         <item name="detailsElementBackground">?attr/colorBackground</item>
+        <item name="fingerprintDrawable">@drawable/ic_fingerprint_light</item>
 
         <!-- PreferenceFrameLayout attributes -->
         <item name="preferenceFrameLayoutStyle">@style/Widget.Material.PreferenceFrameLayout</item>
diff --git a/docs/html-ndk/ndk/downloads/downloads_toc.cs b/docs/html-ndk/ndk/downloads/downloads_toc.cs
index fca91bc..dbe8aec 100644
--- a/docs/html-ndk/ndk/downloads/downloads_toc.cs
+++ b/docs/html-ndk/ndk/downloads/downloads_toc.cs
@@ -6,12 +6,16 @@
        localized titles are added in the language order specified below.
 ?>
 
-
 <ul id="nav">
-  <li class="nav-section">
-    <div class="nav-section-header empty"><a href="/ndk/downloads/index.html"><span class="en">
-      NDK Download</span></a>
-  </li>
+   <li class="nav-section">
+      <div class="nav-section-header empty"><a href="/ndk/downloads/index.html"><span class="en">
+      Downloads</span></a></div>
+   </li>
+
+   <li class="nav-section">
+      <div class="nav-section-header empty"><a href="/ndk/downloads/revision_history.html">
+      <span class="en">Revision History</span></a></div>
+   </li>
 </ul>
 
 
diff --git a/docs/html-ndk/ndk/downloads/index.jd b/docs/html-ndk/ndk/downloads/index.jd
index fdbc083..94e9ae9 100644
--- a/docs/html-ndk/ndk/downloads/index.jd
+++ b/docs/html-ndk/ndk/downloads/index.jd
@@ -323,26 +323,59 @@
 </div>
 
  <div id="qv-wrapper">
-    <div id="qv">
-      <h2>In this document</h2>
 
-      <ol>
-        <li><a href="#Downloads">Downloads</a></li>
-        <li><a href="#rel">Release Notes</a></li>
-      </ol>
-    </div>
   </div>
 
-  <p>Select, from the table below, the NDK package suitable for your development platform.</p>
+  <p>Select, from the table below, the NDK package for your development platform. For information
+  about the changes in the newest version of the NDK, see <a href="#rel">Release Notes</a>. For
+  information about earlier revisions, see <a href="{@docRoot}ndk/downloads/revision_history.html">
+  NDK Revision History.</a></p>
 
 
-<h2 id="Downloads">Downloads</h2>
+<h2 id="Downloads">Downloading</h2>
 
 
 <script>
 $('#Downloads').after($('#download-table'));
 </script>
 
+  <h2 id="extract">Extraction</h2>
+  <p>The NDK package is a self-extracting binary. To unpack it, follow the procedure for your
+  development platform:</p>
+       <ul>
+       <li>On Linux and Mac OS X (Darwin):
+          <ul>
+          <ol>
+          <li>Download the appropriate package from this page.</li>
+          <li>Open a terminal window.</li>
+          <li>Go to the directory to which you downloaded the package.</li>
+          <li>Run <code>chmod a+x</code> on the downloaded package.</li>
+          <li>Execute the package. For example:
+          <pre class="no-pretty-print">
+ndk$ chmod a+x android-ndk-r10c-darwin-x86_64.bin
+ndk$ ./android-ndk-r10c-darwin-x86_64.bin
+          </pre></li>
+          <p>The folder containing the NDK extracts itself.</p>
+          <p>You can also use a program like 7z to extract the package.</p>
+          </ol>
+          </ul>
+       </li>
+    <li>On Windows:</li>
+       <ul>
+       <ol>
+       <li>Download the appropriate package from this page.</li>
+       <li>Navigate to the folder to which you downloaded the package.</li>
+       <li>Double-click the downloaded file. The folder containing the NDK extracts itself.</li>
+       </ol>
+       </ul>
+     </ul>When uncompressed, the NDK files are contained in a directory called
+    <code>android-ndk-&lt;version&gt;</code>. You can rename the NDK directory if necessary and you
+    can move it to any location on your computer. This documentation refers to the NDK directory as
+    <code>&lt;ndk&gt;</code>.
+
+
+  <p>You are now ready to start working with the NDK.</p>
+
 <h2 id="rel">Release Notes</h2>
 
  <p>Android NDK, Revision 10e</a> <em>(May 2015)</em></p>
diff --git a/docs/html-ndk/ndk/downloads/revision_history.jd b/docs/html-ndk/ndk/downloads/revision_history.jd
new file mode 100644
index 0000000..a32b814
--- /dev/null
+++ b/docs/html-ndk/ndk/downloads/revision_history.jd
@@ -0,0 +1,3237 @@
+page.title=NDK Revision History
+@jd:body
+
+<p>This page provides information on previous releases of the NDK, enumerating the changes that
+took place in each new version.</p>
+
+<div class="toggle-content closed">
+<a name="10d"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 10d</a> <em>(December 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+      <ul>
+        <li>Made GCC 4.8 the default for all 32-bit ABIs.  Deprecated GCC 4.6, and
+            will remove it next release. To restore previous behavior, either add
+            <code>NDK_TOOLCHAIN_VERSION=4.6</code> to ndk-build, or
+            add <code>--toolchain=arm-linux-androideabi-4.6</code> when executing
+            <code>make-standalone-toolchain.sh</code> on the command line. GCC 4.9 remains the
+            default for 64-bit ABIs.</li>
+
+         <li>Stopped all x86[_64] toolchains from adding <code>-mstackrealign</code> by default. The
+             NDK toolchain assumes a 16-byte stack alignment. The tools and options used by default
+             enforce this rule. A user writing assembly code must make sure to preserve stack
+             alignment, and ensure that other compilers also comply with this rule.
+             (GCC bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496">38496</a>)</li>
+
+         <li>Added Address Sanitizer functionality to Clang 3.5 support to the ARM and x86 ABIs.
+             For more information on this change, see the
+             <a href="https://code.google.com/p/address-sanitizer/wiki/Android">Address
+             Sanitizer</a> project.</li>
+
+         <li>Introduced the requirement, starting from API level 21, to use <code>-fPIE -pie
+             </code> when building. In API levels 16 and higher, ndk-build uses <code>PIE</code>
+             when building. This change has a number of implications, which are discussed in
+             <a href="https://code.google.com/p/android-developer-preview/issues/detail?id=888">
+             Developer Preview Issue 888</a>.
+             These implications do not apply to shared libraries.</li>
+      </ul>
+      </dd>
+   <dl>
+
+
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+        <li>Made more fixes related to
+            <a href="https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00906.html">
+            A53 Errata #835769</a> in the aarch64-linux-android-4.9 linker. As part of this, GCC
+            passes a new option, <code>--fix-cortex-a53-835769</code>, when
+            <code>-mfix-cortex-a53-835769</code> (enabled by default) is specified.
+            For more information, see this
+            <a href="https://sourceware.org/ml/binutils/2014-10/msg00198.html">binutils message</a>
+            and this
+            <a href="https://sourceware.org/ml/binutils/2014-11/msg00287.html">binutils message</a>.
+            </li>
+
+        <li>Documented a fix to a libc++ <code>sscanf/vsscanf</code> hang that occurred in API level
+            21. The fix itself had been implemented in r10c.
+            (Issue <a href="http://b.android.com/77988">77988</a>)</li>
+
+        <li>Fixed an AutoFDO (<code>-fauto-profile</code>) crash that occurred with GCC 4.9 when
+            <code>-Os</code> was specified. (Issue <a href="http://b.android.com/77571">77571</a>)</li>
+     </ul>
+     </dd>
+
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+        <li>Made the following header and library fixes:</li>
+           <ul>
+        <li>Added <code>posix_memalign</code> to API level 16. Also, added a prototype in
+            <code>stdlib.h</code> to API levels 16 to 19.
+            (Issue <a href="http://b.android.com/77861">77861</a>)</li>
+        <li>Fixed <code>stdatomic.h</code> so that it includes <code>&lt;atomic&gt;</code> only for
+            C++11.</li>
+        <li>Modified the following headers for standalone use: <code>sys/user.h</code>, and
+            <code>gl2ext.h</code>, <code>dlext.h</code>, <code>fts.h</code>, <code>sgidefs.h</code>
+            for API level 21.</li>
+        <li>Modified <code>sys/user.h</code> to rename <code>mxcsr_mask</code> as <code>mxcr_mask</code>,
+            and to change the data type for <code>u_ar0</code></li> from <code>unsigned long</code>
+            to </code>struct user_regs_struct*</code>.
+        <li>Changed <code>sysconf()</code> return value type from <code>int</code> to
+            <code>long</code>.</li>
+           </ul>
+
+        <li>Fixed ndk-build's handling of <code>thumb</code> for <code>LOCAL_ARM_MODE</code>: In
+            r10d, ndk-build adds <code>LOCAL_LDFLAGS+=-mthumb</code> by default, unless one of the
+            following conditions applies:</li>
+          <ul>
+            <li>You have set <code>LOCAL_ARM_MODE</code> equal to <code>arm</code>.</li>
+            <li>You are doing a debug build (with settings such as <code>APP_OPTIM=debug</code> and
+            <code>AndroidManifest.xml</code> containing <code>android:debuggable="true"</code>),
+            where ARM mode is the default in order to retain compatibility with earlier toolchains.
+            (Issue <a href="http://b.android.com/74040">74040</a>)</li>
+          </ul>
+
+        <li>Fixed <code>LOCAL_SRC_FILES</code> in ndk-build to use Windows absolute paths.
+            (Issue <a href="http://b.android.com/74333">74333</a>)</li>
+
+        <li>Removed bash-specific code from ndk-gdb. (Issue <a href="http://b.android.com/73338">73338</a>)</li>
+
+        <li>Removed bash-specific code from <code>make-standalone-toolchain.sh</code>.
+            (Issue <a href="http://b.android.com/74145">74145)</a></li>
+
+        <li>Revised documentation concerning a fix for <code>System.loadLibrary()</code> transitive
+            dependencies. (Issue <a href="http://b.android.com/41790">41790</a>)</li>
+
+        <li>Fixed a problem that was preventing 64-bit packages from extracting on Ubuntu 14.04 and
+            OS X 10.10 (Yosemite). (Issue <a href="http://b.android.com/78148">78148</a>)</li>
+
+        <li>Fixed an issue with <code>LOCAL_PCH</code> to improve Clang support. (Issue
+            <a href="http://b.android.com/77575">77575</a>)</li>
+
+        <li>Clarified "requires executable stack" warning from ld.gold. (Issue
+            <a href="http://b.android.com/79115">79115</a>)</li>
+     </ul>
+     </dd>
+
+   </dl>
+ </div>
+</div>
+
+
+
+
+
+
+
+<div class="toggle-content closed">
+<a name="10c"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 10c</a> <em>(October 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+      <ul>
+ <li>Made the following changes to download structure:</li>
+       <ul>
+       <li>Each package now contains both the 32- and the 64-bit headers, libraries, and tools for
+       its respective platform.</li>
+       <li>STL libraries with debugging info no longer need be downloaded separately.</li>
+       </ul>
+  <li>Changed everything previously called <code>Android-L</code> to the official release
+  designation: <code>android-21</code>.</li>
+  <li>Updated GCC 4.9 by rebasing to the <code>google</code> branch
+  of the GCC repository. Major differences from the upstream version of GCC 4.9 include:</li>
+
+  <ul>
+  <li>The <code>-O2</code> option now turns on vectorization, without loop peeling but with more
+  aggressive unrolling.</li>
+  <li>Enhancements to FDO and <a href="https://gcc.gnu.org/wiki/LightweightIpo#LIPO_-_Profile_Feedback_Based_Lightweight_IPO">
+  LIPO</a></li>
+  <p>For more detailed information, see <em>Important bug fixes</em> below.</p>
+  </ul>
+
+  <li>Added Clang 3.5 support to all hosts: <code>NDK_TOOLCHAIN_VERSION=clang</code>
+  now picks Clang 3.5. Note that:</li>
+  <ul>
+
+  <li>ARM and x86 default to using the integrated assembler. If this causes issues, use
+  <code>-fno-integrated-as</code> as a workaround.</code>
+  <li>Clang 3.5 issues more warnings for unused flags, such as the <code>-finline-functions</code>
+  option that GCC supports.</li>
+  <p>When migrating from projects using GCC, you can use
+  <code>-Wno-invalid-command-line-argument</code> and <code>-Wno-unused-command-line-argument</code>
+  to ignore the unused flags until you're able decide on what to do with them longer-term.</p>
+
+     </ul>
+  <li>Made it possible to enter ART debugging mode, when debugging on an Android 5.0 device using
+  ART as its virtual machine, by specifying the <code>art-on</code> option. For more information,
+  see <code>prebuilt/common/gdb/common.setup</code> in the directory containing the NDK.</li>
+  <li>Removed support for Clang 3.3.</li>
+  <li>Deprecated GCC 4.6, and may remove it from future releases.</li>
+  <li>Updated mclinker to 2.8 with Identical Code Folding ("ICF") support. Specify ICF using the
+  <code>--icf</code> option.</li>
+  <li>Broadened <code>arm_neon.h</code> support in x86 and x86_64, attaining coverage of ~93% of
+  NEON intrinsics. For more information about NEON support:
+     <ul>
+     <li>Navigate to the NDK Programmer's Guide (<code>docs/Programmers_Guide/html/</code>), and see
+     Architectures and CPUs > Neon.</li>
+     <li>Examine the updated <code>hello-neon</code> sample in <code>samples/</code>.
+     <li>See Intel's guide to <a href="https://software.intel.com/en-us/blogs/2012/12/12/from-arm-neon-to-intel-mmxsse-automatic-porting-solution-tips-and-tricks"> porting from ARM NEON to Intel SSE.</a></li>
+     </ul>
+  <li>Documented support for <code>_FORTIFY_SOURCE</code> in <code>headers/libs/android-21</code>,
+  which appeared in r10 (when <code>android-21</code> was still called <code>Android-L</code>),
+  but had no documentation.</li>
+      </ul>
+      </dd>
+   <dl>
+
+
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Fixed an internal compiler error with GCC4.9/aarch64 that was causing the following
+       error message (Issue <a href="http://b.android.com/77564">77564</a>):</li>
+<pre>
+internal compiler error: in simplify_const_unary_operation, at simplify-rtx.c:1539
+</pre>
+       <li>Fixed incorrect code generation from GCC4.9/arm. (Issue
+       <a href="http://b.android.com/77567">77567<a>)</li>
+       <li>Fixed an internal compiler error with GCC4.9/mips involving inline-assembly. (Issue
+       <a href="http://b.android.com/77568">77568</a>)</li>
+       <li>Fixed incorrect code that GCC4.9/arm was generating for <code>x = (cond) ? y : x</code>.
+       (Issue <a href="http://b.android.com/77569">77569</a>)</li>
+       <li>Fixed GCC4.9/aarch64 and Clang3.5/aarch64 to work around the
+       <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141006/116322.html">
+       Cortex-A53 erratum (835769)</a>  by default.  Disable the workaround by specifying
+       <code>-mno-fix-cortex-a53-835769</code>.</li>
+     </ul>
+     </dd>
+
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+     <li>Made the following header and library fixes to <code>android-21</code>:
+        <ul>
+
+        <li>Added more TV keycodes: <code>android/keycodes.h</code></li>
+        <li>Added more constants and six new sensor functions to <code>android/sensor.h</code>:
+        <code>ASensorManager_getDefaultSensorEx</code>, <code>ASensor_getFifoMaxEventCount</code>,
+        <code>ASensor_getFifoReservedEventCount</code>, <code>ASensor_getStringType</code>,
+        <code>ASensor_getReportingMode</code>, and <code>ASensor_isWakeUpSensor</code>.</li>
+        <li>Fixed <code>stdatomic.h</code> to improve compatibility with GCC 4.6, and provide support
+        for the <code>&lt;atomic&gt;</code> header.</li>
+        <li>Added <code>sys/ucontext.h</code> and <code>sys/user.h</code> to all API levels. The
+        <code>signal.h</code> header now includes <code>&lt;sys/ucontext.h&gt;</code>.  You may
+        remove any existing definition of <code>struct ucontext</code>.</li>
+        <li>Added <code>posix_memalign</code> to API levels 17, 18, and 19.</li>
+        <li>Added the following functions to all architectures:
+        <code>android_set_abort_message</code>, <code>posix_fadvise</code>,
+        <code>posix_fadvise64</code>, <code>pthread_gettid_np</code>.</li>
+        <li>Added the required permissions to the <code>native-media/AndroidManifest.xml</code>
+        sample.
+        (Issue <a href="https://android-review.googlesource.com/#/c/106640/">106640</a>)</li>
+        <li>Added <code>clock_nanosleep</code> and <code>clock_settime</code> to API level 21. (Issue
+        <a href="http://b.android.com/77372">77372</a>)
+        <li>Removed the following symbols from all architectures:
+        <code>get_malloc_leak_info</code>, <code>free_malloc_leak_info</code>,
+        <code>__srget</code>, <code>__swbuf</code>, <code>__srefill</code>, <code>__swsetup</code>,
+        <code>__sdidinit</code>, <code>__sflags</code>, <code>__sfp</code>,
+        <code>__sinit</code>, <code>__smakebuf</code>, <code>__sflush</code>, <code>__sread</code>,
+        <code>__swrite</code>, <code>__sseek</code>, <code>__sclose</code>,
+        <code>_fwalk</code>, <code>__sglue</code>, <code>__get_thread</code>, <code>__wait4</code>,
+        <code>__futex_wake</code>, <code>__open</code>, <code>__get_tls</code>,
+        <code>__getdents64</code>, and <code>dlmalloc</code>.</li>
+        <li>Removed the following functions from the 64-bit architectures: <code>basename_r</code>,
+        <code>dirname_r</code>, <code>__isthreaded</code>, <code>_flush_cache</code> (mips64).</li>
+        <li>Removed the following function from the 32-bit architectures:
+        <code>__signalfd4</code>.</li>
+        <li>Changed the type of the third argument from <code>size_t</code> to <code>int</code> in
+        the following functions: <code>strtoll_l</code>, <code>strtoull_l</code>,
+        <code>wcstoll_l</code>, and <code>wcstoull_l</code>.</li>
+        <li>Restored the following functions to the 64-bit architecture: <code>arc4random</code>,
+        <code>arc4random_buf</code>, and <code>arc4random_uniform</code>.</li>
+        <li>Moved <code>cxa_*</code> and the <code>new</code> and <code>delete</code> operators back
+        to <code>libstdc++.so</code>. This change restores r9d behavior; previous versions of r10
+        contained dummy files.</li>
+
+        </ul>
+     <li>Restored MXU support in GCC 4.8 and 4.9 for mips. This support had been absent from
+     r10 and r10b because those versions of GCC had been compiled with binutils-2.24, which did
+     not support MXU. It now does.</li>
+     <li>Fixed <code>--toolchain=</code> in <code>make-standalone-toolchain.sh</code> so that it
+     now properly supports use of a suffix specifying a version of Clang.</li>
+     <li>Fixed the libc++/armeabi <code>strtod()</code> functions.</li>
+     <li>Made fixes to NDK documentation in <code>docs/</code>.</li>
+     </ul>
+     </dd>
+
+     <dt>Other changes:</dt>
+     <dd>
+       <ul>
+       <li>Enhanced <code>cpu-features</code> to detect ARMv8 support for the following
+       instruction sets: AES, CRC32, SHA2, SHA1, and 64-bit PMULL/PMULL2. (Issue
+       <a href="https://android-review.googlesource.com/#/c/106360/">106360</a>)</li>
+
+       <li>Modified ndk-build to use <code>*-gcc-ar</code>, which is available in GCC 4.8, GCC 4.9, and
+       Clang. Clang specifies it, instead of <code>*-ar</code>. This setting brings improved LTO
+       support.</li>
+
+       <li>Removed the <code>include-fixed/linux/a.out.h</code> and
+       <code>include-fixed/linux/compiler.h</code> headers from the GCC compiler.
+       (Issue <a href ="http://b.android.com/73728">73728</a>)</li>
+
+       <li>Fixed an issue related to <code>-flto</code> with GCC 4.8 on Mac OS X. The error message
+       read:</li>
+
+       <pre>
+.../ld: error: .../libexec/gcc/arm-linux-androideabi/4.9/liblto_plugin.so
+Symbol not found: _environ
+</pre>
+
+       <li>Fixed a typo in <code>build-binary.mk.</code> (Issue
+       <a href="http://b.android.com/76992">76992</a>)</li>
+     </ul>
+     </dd>
+
+   <dt>Important known issues:</dt>
+     <dd>
+     <ul>
+     <li>Specifying -Os (<code>-fauto-profile</code>) in GCC4.9 may cause crashing.
+     (Issue <a href="http://b.android.com/77571">77571</a>)</li>
+     </ul>
+     </dd>
+
+   </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+<a name="10b"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 10b</a> <em>(September 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+   <dl>
+
+        <dt>Important notes:</dt>
+     <dd>
+     <ul>
+      <li>Because of the 512MB size restriction on downloadable packages, the following 32-bit items are not in the 32-bit NDK download packages. Instead, they reside in the 64-bit ones:</li>
+      <ul>
+      <li>Android-L headers</li>
+      <li>GCC 4.9</li>
+      </ul>
+     <li>Currently, the only Renderscript support provided by the NDK is for 32-bit Renderscript with Android 4.4 (API level 19). You cannot build HelloComputeNDK (the only Renderscript sample) with any other combination of Renderscript (32- or 64-bit) and Android version.</li>
+     <li>To compile native-codec, you must use a 64-bit NDK package, which is where all the Android-L headers are located. </li>
+     </ul>
+     </dd>
+
+
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+     <li>Fixed gdb 7.6 in GCC 4.8/4.9. (Issues <a href="http://b.android.com/74112">74112</a> and <a href="http://b.android.com/74371">74371</a>.)</li>
+     <li>Fixed GCC 4.8/4.9 for x86, so that they no longer enable <code>-msse4.2</code> and <code>-mpopcnt</code> by default. (Issue <a href="http://b.android.com/73843">73843</a>.)</li>
+     </ul>
+     </dd>
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+     <li>Removed <code>stdio.h</code> from the <code>include-fixed/</code> directories of all versions of GCC. (Issue <a href="http://b.android.com/73728">73728</a>.)</li>
+     <li>Removed duplicate header files from the Windows packages in the <code>platforms/android-L/arch-*/usr/include/linux/netfilter*/</code> directories. (Issue <a href="https://code.google.com/p/android/issues/detail?id=73704">73704</a>.)</li>
+     <li>Fixed a problem that prevented Clang from building HelloComputeNDK.</li>
+     <li>Fixed atexit. (Issue <a href="http://b.android.com/66595">66595</a>.)</li>
+     <li>Made various fixes to the docs in <code>docs/</code> and <code>sources/third_party/googletest/README.NDK</code>. (Issue <a href="http://b.android.com/74069">74069</a>.)</li>
+     <li>Made the following fixes to the Android-L headers:</li>
+     <ol>
+     <li>Added the following functions to <code>ctype.h</code> and <code>wchar.h</code>: <code>dn_expand()</code>, <code>grantpt()</code>, <code> inet_nsap_addr()</code>, <code>inet_nsap_ntoa()</code>, <code>insque()</code>, <code>nsdispatch()</code>, <code>posix_openpt()</code>, <code>__pthread_cleanup_pop()</code>, <code>__pthread_cleanup_push()</code>, <code>remque()</code>, <code>setfsgid()</code>, <code>setfsuid()</code>, <code>splice()</code>, <code>tee()</code>, <code>twalk()</code> (Issue <a href = "http://b.android.com/73719">73719</a>), and 42 <code>*_l()</code> functions.</li>
+
+    <li>Renamed <code>cmsg_nxthdr</code> to <code>__cmsg_nxthdr</code>.</li>
+
+    <li>Removed <code>__libc_malloc_dispatch</code>.</li>
+
+    <li>Changed the <code>ptrace()</code> prototype to <code>long ptrace(int, ...);</code>.</li>
+
+    <li>Removed <code>sha1.h</code>.</li>
+
+    <li>Extended <code>android_dlextinfo</code> in <code>android/dlext.h</code>.</li>
+
+    <li>Annotated <code>__NDK_FPABI__</code> for functions receiving or returning float- or double-type values in <code>stdlib.h</code>, <code>time.h</code>, <code>wchar.h</code>, and <code>complex.h</code>.</li>
+    </ol>
+     </ul>
+     </dd>
+
+     <dt>Other changes:</dt>
+     <dd>
+     <ul>
+        <li>Updated <code>mipsel-linux-android-4.9</code> and <code>mips64el-linux-android-4.9</code>, implementing a new multilib directory layout, and providing support for gdb-7.7</li>
+        <li>Enhanced <code>cpu-features</code> to detect more arm64 features.  (Change list <a href="https://android-review.googlesource.com/#/c/100339">100339</a>.)</li>
+     </dd>
+     </ul>
+
+   </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+<a name="10"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 10</a> <em>(July 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+      <ul>
+        <li>Added 3 new ABIs, all 64-bit: arm64-v8a, x86_64, mips64.</li> Note that:
+        <ul>
+           <li>GCC 4.9 is the default compiler for 64-bit ABIs. Clang is currently version 3.4.
+<code>NDK_TOOLCHAIN_VERSION=clang</code>
+      may not work for arm64-v8a and mips64.</li>
+           <li>Android-L is the first level with 64-bit support.  Note that this API
+level is a temporary one, and only for L-preview. An actual API level number will replace it at
+L-release.</li>
+           <li>This release includes now includes <code>all32</code> and <code>all64</code>
+settings for <code>APP_ABI</code>.
+              <ul>
+              <li><code>APP_ABI=all32</code> is equivalent to
+<code>APP_ABI=armeabi,armeabi-v7a,x86,mips</code>.</li>
+              <li><code>APP_ABI=all64</code> is equivalent to
+<code>APP_ABI=arm64-v8a,x86_64,mips64</code>.</li>
+              <li><code>APP_ABI=all</code> selects all ABIs.</li>
+              </ul>
+           <li>The new GNU libstdc++ in Android-L contains all <code>&lt;tr1/cmath&gt;</code>
+Before defining your own math function, check <code>_GLIBCXX_USE_C99_MATH_TR1</code> to see a
+function with that name already exists, in order to avoid "multiple definition" errors from the
+linker.</li>
+           <li>The cpu-features library has been updated for the ARMv8 kernel.  The existing
+cpu-features library may fail to detect the presence of NEON on the ARMv8 platform. Recompile your
+code with the new version.</li>
+        </ul>
+        <li>Added a new <code>platforms/android-L/</code> API directory. It includes:</li>
+        <ul>
+           <li>Updated Bionic headers, which had not changed from Android API levels 3
+(Cupcake) to 19 (KitKat). This new version, for level L, is to be synchronized with AOSP.</li>
+           <li>New media APIs and a native-codec sample.</li>
+           <li>An updated <code>Android.h</code> header for SLES/OpenSLES, enabling support for
+single-precision, floating-point audio format in AudioPlayer.</li>
+           <li>GLES 3.1 and AEP extensions to <code>libGLESv3.so.</code></li>
+           <li>GLES2 and GLES3 headers updated to the latest official Khronos versions.</li>
+        </ul>
+        <li>Added GCC 4.9 compilers to the 32-/64-bit ABIs.  GCC 4.9 is the default (only) compiler
+for 64-bit ABIs, as previously mentioned.  For 32-bit ABIs, you must explcitly enable GCC 4.9, as
+GCC 4.6 is still the default.</li>
+        <ul>
+           <li>For ndk-build, enable 32-bit, GCC 4.9 building either by adding
+<code>NDK_TOOLCHAIN_VERSION=4.9</code> to <code>Application.mk</code>, or exporting it as an
+environment variable from the command line.</li>
+           <li>For a standalone toolchain, use the <code>--toolchain=</code> option in the
+<code>make-standalone-toolchain.sh</code> script. For example: <code>--toolchain=arm-linux-androideabi-4.9.</code></li>
+        </ul>
+        <li>Upgraded GDB to version 7.6 in GCC 4.8/4.9 and x86*. Since GDB is still at version GDB-7.3.x in
+GCC 4.6 (the default for ARM and MIPS), you must set
+<code>NDK_TOOLCHAIN_VERSION=4.8</code> or <code>4.9</code> to enable ndk-gdb to select GDB 7.6.</li>
+        <li>Added the <code>-mssse3</code> build option to provide SSSE3 support, and made it the default for ABI x86
+(upgrading from SSE3). The image released by Google does not contain SSSE3 instructions.</li>
+        <li>Updated GCC 4.8 to 4.8.3.</li>
+        <li>Improved ARM libc++ EH support by switching from gabi++ to libc++abi. For details, see the "C++ Support" section of the documentation.
+  Note that:</li>
+        <ul>
+           <li>All tests except for locale now pass for Clang 3.4 and GCC 4.8. For more
+information, see the "C++ Support" section of the documentation.</li>
+           <li>The libc++ libraries for X86 and MIPS libc++ still use gabi++.</li>
+           <li>GCC 4.7 and later can now use &lt;atomic&gt;.</li>
+           <li>You must add <code>-fno-strict-aliasing</code> if you use <code> &lt;list&gt;</code>, because <code>__list_imp::_end</code>_ breaks
+      TBAA rules.  (Issue <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61571">61571</a>.)</li>
+           <li>As of GCC 4.6, LIBCXX_FORCE_REBUILD:=true no longer rebuilds libc++. Rebuilding it
+requires the use of a different compiler. Note that Clang 3.3 is untested.</li>
+        </ul>
+        <li>mclinker is now version 2.7, and has aarch64 Linux support.</li>
+        <li>Added precompiled header support for headers specified by <code>LOCAL_PCH</code>.  (Issue <a href="http://b.android.com/25412">25412</a>).</li>
+      </dd>
+   <dl>
+
+
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Fixed libc++ so that it now compiles <code>std::feof</code>, etc. (Issue <a
+href="http://b.android.com/66668">66668</a>).</li>
+       <li>Fixed a Clang 3.3/3.4 atomic library call that caused crashes in some of the libc++
+tests for ABI armeabi.</li>
+       <li>Fixed Clang 3.4 crashes that were occurring on reading precompiled headers. (Issue <a
+href="http://b.android.com/66657">66657</a>).</li>
+       <li>Fixed the Clang 3.3/3.4 <code>-O3</code> assert on:</li>
+       <code>llvm-3.2/llvm/include/llvm/MDBuilder.h:64: llvm::MDNode*
+llvm::MDBuilder::createBranchWeights(llvm::ArrayRef<unsigned int>): Assertion Weights.size() >= 2
+&& "Need at least two branch weights!"</code> (Issue <a href="http://b.android.com/57381">57381</a>).
+       <li>Fixed the following Clang 3.3/3.4 crash:</li>
+       <code>Assertion failed: (!Fn && "cast failed but able to resolve overload expression!!"), function CheckCXXCStyleCast, file
+Volumes/data/ndk-toolchain/src/llvm-3.3/llvm/tools/clang/lib/Sema/SemaCast.cpp, line 2018</code>.
+(Issue <a href="http://b.android.com/66950">66950</a>).
+     </ul>
+     </dd>
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Fixed headers:</li>
+       <ul>
+          <li>Fixed 32-bit <code>ssize_t</code> to be <code>int</code> instead of <code>long
+int</code>.</li>
+          <li>Fixed <code>WCHAR_MIN</code> and <code>WCHAR_MAX</code> so that they they take
+appropriate signs according to the architecture they're running on:</li>
+          <ul>
+             <li>X86/MIPS: signed.
+             <li>ARM: unsigned.
+             <li>To force X86/MIPS to default to unsigned, use
+<code>-D__WCHAR_UNSIGNED__</code>.</li>
+             <li>To force <code>wchar_t</code> to be 16 bits, use <code>-fshort-wchar</code>.</li>
+          </ul>
+          <li>Removed non-existent symbols from 32-bit <code>libc.so</code>, and added <code>pread64</code>,
+<code>pwrite64</code>, <code>ftruncate64</code> for
+Android API level 12 and higher. (Issue <a href="http://b.android.com/69319">69319</a>). For more
+information, see the commit message accompanying AOSP change list
+     <a href="https://android-review.googlesource.com/#/c/94137">94137</a>.</li>
+       </ul>
+       <li>Fixed GCC warning about redefinition of <code>putchar</code>. Warning message reads:</li>
+       <code>include/stdio.h:236:5: warning: conflicts with previous declaration here
+[-Wattributes] int  putchar(int);</code> (Change list <a
+href="https://android-review.googlesource.com/#/c/91185">91185</a>).
+       <li>Fixed <code>make-standalone-toolchain.sh --stl=libc++</code> so that it:</li>
+       <ul>
+          <li>Copies <code>cxxabi.h</code>. (Issue <a
+href="http://b.android.com/68001">68001</a>).</li>
+          <li>Runs in directories other than the NDK install directory. (Issues <a
+href="http://b.android.com/67690">67690</a> and <a href="http://b.android.com/68647">68647</a>).</li>
+       </ul>
+       <li>Fixed GCC/Windows to quote arguments only when necessary for spawning processes in
+external programs. This change decreases the likelihood of exceeding the 32K length limit.</li>
+       <li>Fixed an issue that made it impossible to adjust the <code>APP_PLATFORM</code>
+environment variable.</li>
+       <li>Fixed the implementation of <code>IsSystemLibrary()</code> in crazy_linker so that it
+uses <code>strrchr()</code>
+  instead of <code>strchr()</code> to find the library path's true basename.</li>
+       <li>Fixed native-audio's inability to build in debug mode.</li>
+       <li>Fixed gdb's inability to print extreme floating-point numbers. (Issue <a
+href="http://b.android.com/69203">69203</a>).</li>
+       <li>Fixed Clang 3.4 inability to compile with <code>-Wl,-shared</code> (as opposed to
+<code>-shared</code>, which
+  had no compilation issues).  The problem was that Clang added <code>-pie</code> for Android
+targets if neither <code>-shared</code> nor <code>-static</code> existed. This behavior, which was
+incorrect, caused the linker to complain that <code>-shared</code> and <code>-pie</code> could not
+co-exist.</li>
+
+     </ul>
+     </dd>
+
+
+     <dt>Other changes:</dt>
+     <dd>
+     <ul>
+        <li>Added <code>arm_neon.h</code> to the x86 toolchain so that it now emulates ~47% of
+Neon. There is currently no support for 64-bit types. For more information, see the section on ARM
+Neon intrinsics support in the x86 documentation.</li>
+        <li>Ported ARM/GOT_PREL optimization (present in GCC 4.6 built from the GCC google branch) to
+ARM GCC 4.8/4.9.  This optimization sometimes reduces instruction count when accessing global
+variables.  As an example, see the build.sh script in
+<code>$NDK/tests/build/b14811006-GOT_PREL-optimization/</code>.</li>
+        <li>Added ARM version for STL gabi++, stlport, and libc++. They now have both it and Thumb
+mode.</li>
+        <li>It is now possible to call the make-standalone-toolchain.sh script with
+<code>--toolchain=x86_64-linux-android-4.9</code>, which is equivalent to
+<code>--toolchain=x86_64-4.9</code>.</li>
+     </dd>
+     </ul>
+   </dl>
+ </div>
+</div>
+
+
+<div class="toggle-content closed">
+<a name="9d"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 9d</a> <em>(March 2014)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+      <ul>
+        <li>Added support for the Clang 3.4 compiler. The
+<code>NDK_TOOLCHAIN_VERSION=clang</code> option now picks Clang 3.4. GCC 4.6 is
+still the default compiler.</li>
+        <li>Added <code>APP_ABI=armeabi-v7a-hard</code>, with
+additional multilib option <code>-mfloat-abi=hard</code>. These options are for
+use with ARM GCC 4.6/4.8 and Clang 3.3/3.4 (which use 4.8's assembler, linker,
+and libs). When using these options, note the following changes:</li>
+        <ul>
+           <li> When executing the <code>ndk-build</code> script, add the
+following options for armeabi-v7a target:
+<pre>TARGET_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
+TARGET_LDFLAGS += -Wl,--no-warn-mismatch -lm_hard</pre>
+The built library is copied to <code>libs/armeabi-v7a</code>. For make to
+behave as expected, you cannot specify both <code>armeabi-v7a</code> and
+<code>armeabi-v7a-hard</code> as make targets (i.e., on the APP_ABI= line).
+Doing so causes one of them to be ignored. Note that <code>APP_ABI=all</code>
+is still equivalent to
+<code>armeabi armeabi-v7a x86 mips</code>.</li>
+           <li>The <code>make-standalone-toolchain.sh</code> script copies
+additional libaries under <code>/hard</code> directories.
+      Add the above <code>CFLAGS</code> and <code>LFLAGS</code> to your
+makefile to enable GCC or Clang to link with
+      libraries in <code>/hard</code>.</li>
+        </ul>
+        <li>Added the yasm assembler, as well as <code>LOCAL_ASMFLAGS</code>
+and <code>EXPORT_ASMFLAGS</code> flags for x86
+targets. The <code>ndk-build</code> script uses
+<code>prebuilts/*/bin/yasm*</code> to build <code>LOCAL_SRC_FILES</code> that
+have the <code>.asm</code> extension.</li>
+        <li>Updated MClinker to 2.6.0, which adds <code>-gc-sections</code>
+support.</li>
+        <li>Added experimental libc++ support (upstream r201101).  Use this new
+feature by following these steps:
+        <ul>
+           <li>Add <code>APP_STL := c++_static</code> or <code>APP_STL :=
+c++_shared</code> in <code>Application.mk</code>.
+      You may rebuild from source via <code>LIBCXX_FORCE_REBUILD :=
+true</code></li>
+           <li>Execute <code>make-standalone-toolchain.sh --stl=libc++</code>
+to create a standalone toolchain with libc++ headers/lib.</li>
+        </ul>
+        For more information, see
+<code>CPLUSPLUS-SUPPORT.html</code>.
+(Issue <a href="http://b.android.com/36496">36496</a>)</li>
+      </ul>
+      </dd>
+   <dl>
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Fixed an uncaught throw from an unexpected
+exception handler for GCC 4.6/4.8 ARM EABI. (GCC Issue <a
+href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59392">59392</a>)</li>
+       <li>Fixed GCC 4.8 so that it now correctly resolves partial
+specialization of a template with
+  a dependent, non-type template argument. (GCC Issue <a
+href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59052">59052</a>)</li>
+       <li>Added more modules to prebuilt python (Issue <a
+href="http://b.android.com/59902">59902</a>):
+               <ul>
+                 <li>Mac OS X: <code>zlib</code>, <code>bz2</code>,
+<code>_curses</code>, <code>_curses_panel</code>, <code>_hashlib</code>,
+<code>_ssl</code></li>
+                 <li>Linux: <code>zlib</code>, <code>nis</code>,
+<code>crypt</code>, <code>_curses</code>, and <code>_curses_panel</code></li>
+               </ul>
+       <li>Fixed the x86 and MIPS gdbserver
+<code>event_getmsg_helper</code>.</li>
+       <li>Fixed numerous issues in the RenderScript NDK toolchain, including
+issues with compatibility across older devices and C++ reflection.</li>
+<br>
+     </ul>
+     </dd>
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Header fixes:
+         <ul>
+           <li>Fixed a missing <code>#include &lt;sys/types.h&gt;</code> in
+<code>android/asset_manager.h</code> for Android API level 13 and higher.
+     (Issue <a href="http://b.android.com/64988">64988</a>)</li>
+           <li>Fixed a missing <code>#include <stdint.h></code> in
+<code>android/rect_manager.h</code> for Android API level 14 and higher.</li>
+           <li>Added <code>JNICALL</code> to <code>JNI_OnLoad</code> and
+<code>JNI_OnUnload</code> in <code>jni.h</code>. Note that <code>JNICALL</code>
+ is defined as <code>__NDK_FPABI__</code> For more information, see
+<code>sys/cdefs.h</code>.</li>
+           <li>Updated the following headers so that they can be included
+without the need to
+manually include their dependencies (Issue <a
+href="http://b.android.com/64679">64679</a>):</li>
+<pre>
+android/tts.h
+EGL/eglext.h
+fts.h
+GLES/glext.h
+GLES2/gl2ext.h
+OMXAL/OpenMAXSL_Android.h
+SLES/OpenSLES_Android.h
+sys/prctl.h
+sys/utime.h
+</pre>
+           <li>Added <code>sys/cachectl.h</code> for all architectures. MIPS
+developers can now include this header instead of writing <code>#ifdef
+__mips__</code>.</li>
+           <li></code>Fixed <code>platforms/android-18/include/android/input.h
+</code> by adding <code>__NDK_FPABI__</code> to functions taking or returning
+float or double values.</li>
+           <li>Fixed MIPS <code>struct stat</code>, which was incorrectly set
+to its 64-bit counterpart for Android API level 12 and later. This wrong
+setting was a
+regression introduced in release r9c.</li>
+           <li>Defined <code>__PTHREAD_MUTEX_INIT_VALUE</code>,
+<code>__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE</code>,
+     and <code>__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE</code> for Android API
+level 9 and lower.</li>
+           <li>Added <code>scalbln</code>, <code>scalblnf</code>, and
+<code>scalblnl</code> to x86 <code>libm.so</code> for APIs 18 and later.</li>
+           <li>Fixed a typo in
+<code>sources/android/support/include/iconv.h</code>.
+     (Issue <a href="http://b.android.com/63806">63806</a>)</li>
+
+         </ul>
+       </li>
+       <li>Fixed gabi++ <code>std::unexpected()</code> to call
+<code>std::terminate()</code> so that
+  a user-defined <code>std::terminate()</code> handler has a chance to run.
+</li>
+       <li>Fixed gabi++ to catch <code>std::nullptr</code>.</li>
+       <li>Fixed samples Teapot and MoreTeapots:
+         <ul>
+      <li>Solved a problem with Tegra 2 and 3 chips by changing specular
+variables to use medium precision. Values for specular power can now be less
+than 1.0. </li>
+      <li>Changed the samples so that pressing the volume button restores
+immersive mode and invalidates
+<code>SYSTEM_UI_FLAG_IMMERSIVE_STICKY</code>. Screen rotation does not
+trigger <code>onSystemUiVisibilityChange</code>, and so does not restore
+immersive mode.</li>
+         </ul>
+        </li>
+        <li>Fixed the <code>ndk-build</code> script to add
+<code>-rpath-link=$SYSROOT/usr/lib</code> and
+<code>-rpath-link=$TARGET_OUT</code> in order to use <code>ld.bfd</code> to
+link executables. (Issue  <a href="http://b.android.com/64266">64266</a>)</li>
+        <li>Removed <code>-Bsymbolic</code> from all STL builds.</li>
+        <li>Fixed <code>ndk-gdb-py.cmd</code> by setting <code>SHELL</code> as
+an environment variable
+instead of passing it to
+  <code>python.exe</code>, which ignores the setting.
+  (Issue <a href="http://b.android.com/63054">63054</a>)</li>
+        <li>Fixed the <code>make-standalone-toolchain.sh</code> script so that
+the <code>--stl=stlport</code> option copies the gabi++ headers instead of
+symlinking them; the <code>cmd.exe</code> and MinGW shells do not understand
+symlinks created by cygwin.</li>
+     </ul>
+     </dd>
+
+     <dt>Other changes:</dt>
+     <dd>
+     <ul>
+        <li>Applied execution permissions to all <code>*cmd</code> scripts
+previously intended for use only in the <code>cmd.exe</code> shell, in case
+developers prefer to use <code>ndk-build.cmd</code> in cygwin instead of the
+recommended <code>ndk-build</code> script.</li>
+        <li>Improved the speed of the <code>make-standalone-toolchain.sh</code>
+script by moving instead of copying if the specified destination directory does
+not exist.</li>
+     </dd>
+     </ul>
+   </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+<a name="9c"></a>
+ <p>
+   <a href="#" onclick="return toggleContent(this)"> <img
+     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+   >Android NDK, Revision 9c</a> <em>(December 2013)</em>
+ </p>
+ <div class="toggle-content-toggleme">
+<p>This is a bug-fix-only release.</p>
+   <dl>
+     <dt>Important bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Fixed a problem with GCC 4.8 ARM, in which the stack pointer is
+restored too early. This problem prevented the frame pointer from reliably
+accessing a variable in the stack frame. (GCC Issue <a
+href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854">58854</a>)</li>
+<li>Fixed a problem with GCC 4.8 libstdc++, in which a bug in
+std::nth_element was causing generation of code that produced a random
+segfault. (Issue <a
+href="https://code.google.com/p/android/issues/detail?id=62910">62910</a>)</li>
+           <li>Fixed GCC 4.8 ICE in cc1/cc1plus with
+<code>-fuse-ld=mcld</code>, so that the following error no longer occurs:
+<pre>cc1: internal compiler error: in common_handle_option, at
+opts.c:1774</pre></li>
+           <li>Fixed <code>-mhard-float</code> support for
+<code>__builtin</code> math functions. For ongoing information on fixes for
+<code>-mhard-float</code> with STL, please follow Issue <a
+href="http://b.android.com/61784">61784</a>.</li>
+     </ul>
+     </dd>
+
+     <dt>Other bug fixes:</dt>
+     <dd>
+     <ul>
+       <li>Header fixes:
+         <ul>
+           <li>Changed prototype of <code>poll</code> to <code>poll(struct
+pollfd *, nfds_t, int);</code> in <code>poll.h</code>.</li>
+           <li>Added <code>utimensat</code> to <code>libc.so</code> for Android
+API levels 12 and 19. These libraries are now included for all Android API
+levels 12 through 19.</li>
+<li>Introduced <code>futimens</code> into <code>libc.so</code>, for Android API
+level 19.</li>
+<li>Added missing <code>clock_settime()</code> and
+<code>clock_nanosleep()</code> to <code>time.h</code> for Android API level 8
+and higher.</li>
+<li>Added <code>CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE,
+CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM,</code> and
+<code>CLOCK_BOOTTIME_ALARM</code> in <code>time.h.</code></li>
+<li>Removed obsolete <code>CLOCK_REALTIME_HR</code> and
+<code>CLOCK_MONOTONIC_HR.</code></li>
+         </ul>
+       </li>
+       <li>In samples Teapot, MoreTeapots, and
+<code>source/android/ndk_helper</code>:
+         <ul>
+<li>Changed them so that they now use a hard-float abi for armeabi-v7a.</li>
+<li>Updated them to use immersive mode on Android API level 19 and
+higher.</li>
+<li>Fixed a problem with <code>Check_ReleaseStringUTFChars</code> in
+<code>/system/lib/libdvm.so</code> that was causing crashes on x86 devices.</li>
+         </ul>
+        </li>
+<li>Fixed <code>ndk-build</code> fails that happen in cygwin when the NDK
+package is
+referenced via symlink.</li>
+<li>Fixed <code>ndk-build.cmd</code> fails that happen in windows
+<code>cmd.exe</code> when
+<code>LOCAL_SRC_FILES</code> contains absolute paths. (Issue <a
+href="https://android-review.googlesource.com/#/c/69992">69992</a>)</li>
+<li>Fixed the <code>ndk-stack</code> script to proceed even when it can't parse
+a frame due to inability to find a routine, filename, or line number. In any of
+these cases, it prints <code>??</code>.</li>
+<li>Fixed the <code>ndk-stack</code> stack for windows-x64_64 targets so that
+it no longer erroneously matches a frame line with a line in the
+<code>stack:</code> section that doesn't contain <code>pc</code>,
+<code>eip</code>, or <code>ip</code>. For example:
+<pre>I/DEBUG   ( 1151):     #00  5f09db68  401f01c4
+/system/lib/libc.so</pre></li>
+<li>Fixed gabi++ so that it:
+     <ul>
+         <li>Does not use malloc() to allocate C++ thread-local
+  objects.</li>
+         <li>Avoids deadlocks in gabi++ in cases where libc.debug.malloc is
+non-zero in userdebug/eng Android platform builds.</li>
+     </ul>
+     </ul>
+     </dd>
+
+     <dt>Other changes:</dt>
+     <dd>
+     <ul>
+       <li>Added <code>LOCAL_EXPORT_LDFLAGS</code>.</li>
+<li>Introduced the <code>NDK_PROJECT_PATH=null</code> setting for use in an
+integrated build system where options are explicitly passed to
+<code>ndk-build</code>. With this setting, <code>ndk-build</code> makes no
+attempt to look for <code>NDK_PROJECT_PATH.</code> This setting also prevents
+variables from deriving default settings from NDK_PROJECT_PATH. As a result,
+the following variables must now be explicitly specified (with their default
+values if such exist): <code>NDK_OUT, NDK_LIBS_OUT, APP_BUILD_SCRIPT,
+NDK_DEBUG</code> (optional, default to 0), and other <code>APP_*</code>'s
+contained in <code>Application.mk</code>.</li>
+<li><code>APP_ABI</code> can now be enumerated in a comma-delimited list. For
+example:
+<pre>APP_ABI := "armeabi,armeabi-v7a"</pre></li>
+<li>Provided the ability to rebuild all of STL with debugging info in an
+optional, separate package called
+<code>android-ndk-r9c-cxx-stl-libs-with-debugging-info.zip</code>, using the
+<code>-g</code> option. This option
+helps the <code>ndk-stack</code> script provide better a stack dump across STL.
+This change should not affect the code/size of the final, stripped file.</li>
+<li>Enhanced <code>hello-jni</code> samples to report <code>APP_ABI</code> at
+compilation.</li>
+<li>Used the <code>ar</code> tool in Deterministic mode (option
+<code>-D</code>) to build static libraries.  (Issue <a
+href="http://b.android.com/60705">60705</a>)</li>
+     </ul>
+     </dd>
+
+   </dl>
+ </div>
+</div>
+
+<div class="toggle-content closed">
+<a name="9b"></a>
+  <p>
+    <a href="#" onclick="return toggleContent(this)"> <img
+      src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+    >Android NDK, Revision 9b</a> <em>(October 2013)</em>
+  </p>
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+      <ul>
+        <li>Updated {@code include/android/*h} and {@code math.h} for all Android API levels up to
+          18, including the addition of levels 13, 15, 16 and 17.
+          For information on added APIs, see commit messages for Changes
+          <a href="https://android-review.googlesource.com/68012">68012</a> and
+          <a href="https://android-review.googlesource.com/68014">68014</a>.
+          (Issues <a href="http://b.android.com/47150">47150</a>,
+           <a href="http://b.android.com/58528">58528</a>, and
+           <a href="http://b.android.com/38423">38423</a>)</li>
+        <li>Added support for Android API level 19, including Renderscript binding.</li>
+        <li>Added support for <code>-mhard-float</code> in the existing armeabi-v7a ABI. For more
+          information and current restrictions on Clang, see
+          {@code tests/device/hard-float/jni/Android.mk}.</li>
+        <li>Migrated from GNU Compiler Collection (GCC) 4.8 to 4.8.2, and added diagnostic color
+          support. To enable diagnostic colors, set <code>-fdiagnostics-color=auto</code>,
+          <code>-fdiagnostics-color=always,</code> or export {@code GCC_COLORS} as shown below:
+<pre>
+GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+</pre>
+          For more information, see
+          <a href="http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html">GCC
+          Language Independent Options</a>.
+        </li>
+        <li>Added two new samples to demonstrate OpenGL ES 3.0 features: Teapot and MoreTeapots.
+          These samples run on devices with Android 4.1 (API level 16) and higher.</li>
+        <li>Deprecated GCC 4.7 and Clang 3.2 support, which will be removed in the next
+          release.</li>
+      </ul>
+      </dd>
+
+      <dt>Important bug fixes:</dt>
+      <dd>
+      <ul>
+        <li>Fixed problem with ARM GCC 4.6 {@code thumb2} failing to generate 16-bit relative jump
+          tables. (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48328">GCC Issue</a>)</li>
+        <li>Fixed GCC 4.8 internal compiler error (ICE) on
+          {@code g++.dg/cpp0x/lambda/lambda-defarg3.C}.
+          (<a href="https://android-review.googlesource.com/62770">Change 62770</a>,
+          <a href="http://gcc.gnu.org/ml/gcc/2013-07/msg00424.html">GCC Issue</a>)</li>
+        <li>Fixed a problem with Windows 32-bit {@code *-gdb.exe} executables failing to launch.
+          (<a href="http://b.android.com/58975">Issue 58975</a>)</li>
+        <li>Fixed GCC 4.8 ICE when building bullet library. The error message is as follows:
+          <pre>internal compiler error: verify_flow_info failed</pre>
+          (<a href="http://b.android.com/58916">Issue 58916</a>,
+           <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58165">GCC Issue</a>)</li>
+        <li>Modified GDB/ARM build to skip {@code ARM.exidx} data for unwinding in prologue code and
+          added a command ({@code set arm exidx-unwinding}) to control exidx-based stack unwinding.
+          (<a href="http://b.android.com/55826">Issue 55826</a>)</li>
+        <li>Fixed Clang 3.3 MIPS compiler problem where HI and LO registers are incorrectly
+          reused.</li>
+        <li>Fixed issue with MIPS 4.7 ICE in {@code dbx_reg_number}. The error message is as
+follows:
+<pre>
+external/icu4c/i18n/decimfmt.cpp:1322:1:
+internal compiler error: in dbx_reg_number, at dwarf2out.c:10185
+</pre>
+          (<a href="http://gcc.gnu.org/ml/gcc-patches/2012-12/msg00830.html">GCC Patch</a>)
+
+        </li>
+
+      </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+      <dd>
+      <ul>
+        <li>Header fixes
+          <ul>
+            <li>Fixed the ARM {@code WCHAR_MIN} and {@code WCHAR_MAX} to be unsigned according to
+              spec (the X86/MIPS versions are signed). Define {@code _WCHAR_IS_ALWAYS_SIGNED} to
+              restore old behavior. (<a href="http://b.android.com/57749">Issue 57749</a>)</li>
+            <li>Fixed {@code include/netinet/tcp.h} to contain {@code TCP_INFO} state enum.
+              (<a href="http://b.android.com/38881">Issue 38881</a>)</li>
+            <li>Fixed the {@code cdefs_elh.h} macro {@code _C_LABEL_STRING} to stop generating
+               warnings in the GCC 4.8 toolchain when using c++11 mode.
+              (<a href="http://b.android.com/58135">Issue 58135</a>,
+               <a href="http://b.android.com/58652">Issue 58652</a>)</li>
+            <li>Removed non-existent functions {@code imaxabs} and {@code imaxdiv} from header
+              {@code inttypes.h}.</li>
+            <li>Fixed issue with {@code pthread_exit()} return values and {@code pthread_self()}.
+                 (<a href="http://b.android.com/60686">Issue 60686</a>)</li>
+            <li>Added missing {@code mkdtemp()} function, which already exists in {@code bionic}
+              header {@code stdlib.h}.</li>
+          </ul>
+        </li>
+        <li>Fixed problem building {@code samples/gles3jni} with Clang on Android API level 11.</li>
+        <li>Fixed MCLinker to allow multiple occurrences of the following options:
+          {@code -gc-sections} and {@code --eh-frame-hdr}.</li>
+        <li>Fixed MCLinker to accept the {@code --no-warn-mismatch} option.</li>
+        <li>Modified {@code cpu-features} option to not assume all VFPv4 devices support IDIV.
+          Now this option only adds IDIV to white-listed devices, including Nexus 4.
+          (<a href="http://b.android.com/57637">Issue 57637</a>)</li>
+        <li>Fixed problem with {@code android_native_app_glue.c} erroneously logging errors on event
+          predispatch operations.</li>
+        <li>Fixed all operations on {@code gabi++} terminate and unexpected_handler to be
+          thread-safe.</li>
+        <li>Fixed several issues with Clang <code>-integrated-as</code> option so it can pass
+          tests for {@code ssax-instructions} and {@code fenv}.</li>
+        <li>Fixed GCC 4.6/4.7/4.8 compiler to pass the linker option {@code --eh-frame-hdr} even
+          for static executables. For more information, see the
+          <a href="http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00969.html">GCC patch</a>.</li>
+        <li>Fixed extra apostrophe in <code>CPU-ARCH-ABIS.html</code>. For more information, see
+          <code>NDK-DEPENDS.html</code>. (<a href="http://b.android.com/60142">Issue 60142</a>)</li>
+        <li>Fixed extra quotes in ndk-build output on Windows.
+          (<a href="http://b.android.com/60649">Issue 60649</a>)</li>
+        <li>Fixed Clang 3.3 to compile ARM's built-in, atomic operations such as
+          {@code __atomic_fetch_add}, {@code __atomic_fetch_sub}, and {@code __atomic_fetch_or}.
+          </li>
+        <li>Fixed Clang 3.3 ICE with customized {@code vfprintf}.
+          (<a href="http://llvm.org/bugs/show_bug.cgi?id=16344">Clang issue</a>)
+        </li>
+      </ul>
+      </dd>
+
+      <dt>Other changes:</dt>
+      <dd>
+      <ul>
+        <li>Enabled OpenMP for all GCC builds. To use this feature, add the following flags to your
+          build settings:
+<pre>
+LOCAL_CFLAGS += -fopenmp
+LOCAL_LDFLAGS += -fopenmp
+</pre>
+          For code examples, see {@code tests/device/test-openmp}</li>
+        <li>Reduced the size of {@code ld.mcld} significantly (1.5MB vs. {@code ld.bfd} 3.5MB and
+          {@code ld.gold} 7.5MB), resulting in a speed improvement of approximately 20%.</li>
+        <li>Added <code>LOCAL_CONLYFLAGS</code> and <code>APP_CONLYFLAGS</code> to specify
+          options applicable to C only but not C++. The existing <code>LOCAL_CFLAGS</code>
+          and <code>APP_CFLAGS</code> are also used for C++ compilation (to save trouble of
+          specifying most options twice), so options such as <code>-std=gnu99</code> may fail in
+          g++ builds with a warning and clang++ builds with an error.</li>
+        <li>Added {@code gabi++} array helper functions.</li>
+        <li>Modified GCC builds so that all {@code libgcc.a} files are built with
+          <code>-funwind-tables</code> to allow the stack to be unwound past previously blocked
+          points, such as <code>__aeabi_idiv0</code>.</li>
+        <li>Added Ingenic MXU support in MIPS GCC4.6/4.7/4.8 with new <code>-mmxu</code>
+option.</li>
+        <li>Extended MIPS GCC4.6/4.7/4.8 <code>-mldc1-sdc1</code> to control ldxc1/sdxc1 too</li>
+        <li>Added crazy linker. For more information, see
+          {@code sources/android/crazy_linker/README.TXT}.</li>
+        <li>Fixed {@code bitmap-plasma} to draw to full screen rather than a 200x200 pixel
+area.</li>
+        <li>Reduced linux and darwin toolchain sizes by 25% by creating symlinks to identical files.
+          </li>
+      </ul>
+      </dd>
+
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+<a name="9"></a>
+  <p>
+    <a href="#" onclick="return toggleContent(this)"> <img
+      src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+    >Android NDK, Revision 9</a> <em>(July 2013)</em>
+  </p>
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+        <ul>
+          <li>Added support for Android 4.3 (API level 18). For more information, see
+            {@code STABLE-APIS.html} and new code examples in {@code samples/gles3jni/README}.
+          <li>Added headers and libraries for OpenGL ES 3.0, which is supported by Android 4.3
+            (API level 18) and higher.</li>
+          <li>Added GNU Compiler Collection (GCC) 4.8 compiler to the NDK. Since GCC 4.6 is still
+            the default, you must explicitly enable this option:
+            <ul>
+              <li>For {@code ndk-build} builds, export {@code NDK_TOOLCHAIN_VERSION=4.8} or
+                add it in {@code Application.mk}.</li>
+              <li>For standalone builds, use the {@code --toolchain=} option in
+                {@code make-standalone-toolchain.sh}, for example:<br>
+                {@code --toolchain=arm-linux-androideabi-4.8}</li>
+            </ul>
+            <p class="note"><strong>Note:</strong>
+            The {@code -Wunused-local-typedefs} option is enabled by {@code -Wall}. Be
+            sure to add {@code __attribute__((unused))} if you use compile-time asserts like
+            {@code sources/cxx-stl/stlport/stlport/stl/config/features.h}, line #311. For more
+            information, see
+            <a href="https://android-review.googlesource.com/#/c/55460">Change 55460</a></p>
+            <p class="note"><strong>Note:</strong>
+            In the GCC 4.7 release and later, ARM compilers generate unaligned access code by
+            default for ARMv6 and higher build targets. You may need to add the
+            {@code -mno-unaligned-access} build option when building for kernels that do not support
+            this feature.</p>
+          </li>
+          <li>Added Clang 3.3 support. The {@code NDK_TOOLCHAIN_VERSION=clang} build option
+            now picks Clang 3.3 by default.
+            <p class="note"><strong>Note:</strong>
+             Both GCC 4.4.3 and Clang 3.1 are deprecated, and will be removed from the next NDK
+             release.</p></li>
+          <li>Updated GNU Project Debugger (GDB) to support python 2.7.5.</li>
+          <li>Added MCLinker to support Windows hosts. Since {@code ld.gold}
+            is the default where available, you must add {@code -fuse-ld=mcld} in
+            {@code LOCAL_LDFLAGS} or {@code APP_LDFLAGS} to enable MCLinker.</li>
+          <li>Added {@code ndk-depends} tool which prints ELF library dependencies.
+            For more information, see {@code NDK-DEPENDS.html}.
+            (<a href="http://b.android.com/53486">Issue 53486</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Important bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>Fixed potential event handling issue in {@code android_native_app_glue}.
+            (<a href="http://b.android.com/41755">Issue 41755</a>)</li>
+          <li>Fixed ARM/GCC-4.7 build to generate sufficient alignment for NEON load and store
+            instructions VST and VLD.
+            (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271">GCC Issue 57271</a>)</li>
+          <li>Fixed a GCC 4.4.3/4.6/4.7 internal compiler error (ICE) for a constant negative index
+            value on a string literal.
+            (<a href="http://b.android.com/54623">Issue 54623</a>)</li>
+          <li>Fixed GCC 4.7 segmentation fault for constant initialization with an object address.
+            (<a href="http://b.android.com/56508">Issue 56508</a>)</li>
+          <li>Fixed GCC 4.6 ARM segmentation fault for <code>-O</code> values when using Boost
+            1.52.0. (<a href="http://b.android.com/42891">Issue 42891</a>)
+          <li>Fixed {@code libc.so} and {@code libc.a} to support the {@code wait4()} function.
+            (<a href="http://b.android.com/19854">Issue 19854</a>)</li>
+          <li>Updated the x86 libc.so and libc.a files to include the {@code clone()}
+            function.</li>
+          <li>Fixed {@code LOCAL_SHORT_COMMANDS} bug where the {@code linker.list} file is
+            empty or not used.</li>
+          <li>Fixed GCC MIPS build on Mac OS to use CFI directives, without which
+            {@code ld.mcld --eh-frame-hdr} fails frequently.</li>
+          <li>Fixed Clang 3.2 X86/MIPS internal compiler error in {@code llvm/lib/VMCore/Value.cpp}.
+            (<a href="https://android-review.googlesource.com/#/c/59021">Change 59021</a>)</li>
+          <li>Fixed GCC 4.7 64-bit Windows assembler crash. (Error: {@code out of memory allocating
+            4294967280 bytes}).</li>
+          <li>Updated {@code ndk-gdb} script so that the {@code --start} or {@code --launch} actions
+            now wait for the GNU Debug Server, so that it can more reliably hit breakpoints set
+            early in the execution path (such as breakpoints in JNI code).
+            (<a href="http://b.android.com/41278">Issue 41278</a>)
+            <p class="note"><strong>Note:</strong>
+              This feature requires jdb and produces warning about pending breakpoints.
+              Specify the {@code --nowait} option to restore previous behavior.
+            </p>
+          </li>
+          <li>Fixed GDB crash when library list is empty.</li>
+          <li>Fixed GDB crash when using a {@code stepi} command past a {@code bx pc} or
+            {@code blx pc} Thumb instruction.
+            (<a href="http://b.android.com/56962">Issue 56962</a>,
+             <a href="http://b.android.com/36149">Issue 36149</a>)</li>
+          <li>Fixed MIPS {@code gdbserver} to look for {@code DT_MIPS_RLD_MAP} instead of
+            {@code DT_DEBUG}. (<a href="http://b.android.com/56586">Issue 56586</a>)</li>
+          <li>Fixed a circular dependency in the ndk-build script, for example: If A-&gt;B and
+            B-&gt;B, then B was dropped from build.
+            (<a href="http://b.android.com/56690">Issue 56690</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>Fixed the {@code ndk-build} script to enable you to specify a version of Clang as a
+            command line option (e.g., {@code NDK_TOOLCHAIN_VERSION=clang3.2}). Previously, only
+            specifying the version as an environment variable worked.</li>
+          <li>Fixed gabi++ size of {@code _Unwind_Exception} to be 24 for MIPS build targets when
+            using the Clang compiler.
+            (<a href="https://android-review.googlesource.com/#/c/54141">Change 54141</a>)</li>
+          <li>Fixed the {@code ndk-build} script to ensure that built libraries are actually
+            removed from projects that include prebuilt static libraries when using the
+            {@code ndk-build clean} command.
+            (<a href="https://android-review.googlesource.com/#/c/54461">Change 54461</a>,
+             <a href="https://android-review.googlesource.com/#/c/54480">Change 54480</a>)</li>
+          <li>Modified the {@code NDK_ANALYZE=1} option to be less verbose.</li>
+          <li>Fixed {@code gnu-libstdc++/Android.mk} to include a {@code backward/} path for builds
+            that use backward compability.
+            (<a href="http://b.android.com/53404">Issue 53404</a>)</li>
+          <li>Fixed a problem where {@code stlport new} sometimes returned random values.</li>
+          <li>Fixed {@code ndk-gdb} to match the order of {@code CPU_ABIS}, not {@code APP_ABIS}.
+            (<a href="http://b.android.com/54033">Issue 54033</a>)</li>
+          <li>Fixed a problem where the NDK 64-bit build on MacOSX choses the wrong path for
+            compiler.
+            (<a href="http://b.android.com/53769">Issue 53769</a>)</li>
+          <li>Fixed build scripts to detect 64-bit Windows Vista.
+            (<a href="http://b.android.com/54485">Issue 54485</a>)</li>
+          <li>Fixed x86 {@code ntonl/swap32} error: {@code invalid 'asm': operand number
+            out of range}.
+            (<a href="http://b.android.com/54465">Issue 54465</a>,
+             <a href="https://android-review.googlesource.com/#/c/57242">Change 57242</a>)</li>
+          <li>Fixed {@code ld.gold} to merge string literals.</li>
+          <li>Fixed {@code ld.gold} to handle large symbol alignment.</li>
+          <li>Updated {@code ld.gold} to enable the {@code --sort-section=name} option.</li>
+          <li>Fixed GCC 4.4.3/4.6/4.7 to suppress the {@code -export-dynamic} option for
+            statically linked programs. GCC no longer adds an {@code .interp} section for statically
+            linked programs.</li>
+          <li>Fixed GCC 4.4.3 {@code stlport} compilation error about inconsistent {@code typedef}
+            of {@code _Unwind_Control_Block}.
+            (<a href="http://b.android.com/54426">Issue 54426</a>)</li>
+          <li>Fixed {@code awk} scripts to handle {@code AndroidManifest.xml} files created on
+            Windows which may contain trailing {@code \r} characters and cause build errors.
+            (<a href="http://b.android.com/42548">Issue 42548</a>)</li>
+          <li>Fixed {@code make-standalone-toolchain.sh} to probe the {@code prebuilts/}
+            directory to detect if the host is 32 bit or 64 bit.</li>
+          <li>Fixed the Clang 3.2 {@code -integrated-as} option.</li>
+          <li>Fixed the Clang 3.2 ARM EHABI compact model {@code pr1} and {@code pr2} handler data.
+            </li>
+          <li>Added Clang {@code -mllvm -arm-enable-ehabi} option to fix the following Clang error:
+            <pre>clang: for the -arm-enable-ehabi option: may only occur zero or one times!</pre>
+            </li>
+          <li>Fixed build failure when there is no {@code uses-sdk} element in application
+            manifest. (<a href="http://b.android.com/57015">Issue 57015</a>)</li>
+        </ul>
+
+      </dd>
+      <dt>Other changes:</dt>
+      <dd>
+        <ul>
+          <li>Header Fixes
+            <ul>
+              <li>Modified headers to make {@code __set_errno} an inlined function, since
+                {@code __set_errno} in {@code errno.h} is deprecated, and {@code libc.so} no longer
+                exports it.</li>
+              <li>Modified {@code elf.h} to include {@code stdint.h}.
+                (<a href="http://b.android.com/55443">Issue 55443</a>)</li>
+              <li>Fixed {@code sys/un.h} to be included independently of other headers.
+                (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
+              <li>Fixed all of the {@code MotionEvent_getHistorical} API family to take the
+                {@code const AInputEvent* motion_event}.
+                (<a href="http://b.android.com/55873">Issue 55873</a>)</li>
+              <li>Fixed {@code malloc_usable_size} to take {@code const void*}.
+                (<a href="http://b.android.com/55725">Issue 55725</a>)</li>
+              <li>Fixed stdint.h to be more compatible with C99.
+                (<a href="https://android-review.googlesource.com/#/c/46821">Change 46821</a>)</li>
+              <li>Modified {@code wchar.h} to not redefine {@code WCHAR_MAX} and
+                {@code WCHAR_MIN}</li>
+              <li>Fixed {@code &lt;inttypes.h&gt;} declaration for pointer-related {@code PRI} and
+                {@code SCN} macros. (<a href="http://b.android.com/57218">Issue 57218</a>)</li>
+              <li>Changed the {@code sys/cdefs.h} header so that {@code __WCHAR_TYPE__} is 32-bit
+                for API levels less than 9, which means that {@code wchat_t} is 32-bit for all
+                API levels. To restore the previous behavior, define the {@code _WCHAR_IS_8BIT}
+                boolean variable. (<a href="http://b.android.com/57267">Issue 57267</a>)</li>
+            </ul>
+          </li>
+          <li>Added more formatting in NDK {@code docs/} and miscellaneous documentation fixes.
+            </li>
+          <li>Added support for a thin archive technique when building static libraries.
+            (<a href="http://b.android.com/40303">Issue 40303</a>)</li>
+          <li>Updated script {@code make-standalone-toolchain.sh} to support the {@code stlport}
+            library in addition to {@code gnustl}, when you specify the option
+            {@code --stl=stlport}. For more information, see {@code STANDALONE-TOOLCHAIN.html}.</li>
+          <li>Updated the {@code make-standalone-toolchain.sh} script so that the
+            {@code --llvm-version=} option creates the {@code $TOOLCHAIN_PREFIX-clang} and
+            {@code $TOOLCHAIN_PREFIX-clang++} scripts in addition to {@code clang} and
+            {@code clang++}, to avoid using the host's clang and clang++ definitions by accident.
+            </li>
+          <li>Added two flags to re-enable two optimizations in upstream Clang but disabled in
+              NDK for better compatibility with code compiled by GCC:
+            <ul>
+              <li>Added a {@code -fcxx-missing-return-semantics} flag to re-enable <em>missing
+return
+                semantics</em> in Clang 3.2+. Normally, all paths should terminate with a return
+                statement for a value-returning function. If this is not the case, clang inserts
+                an undefined instruction (or trap in debug mode) at the path without a return
+                statement. If you are sure your code is correct, use this flag to allow the
+                optimizer to take advantage of the undefined behavior. If you are not sure, do not
+                use this flag. The caller may still receive a random incorrect value, but the
+                optimizer will not exploit it and make your code harder to debug.</li>
+              <li>Added a {@code -fglobal-ctor-const-promotion} flag to re-enable
+                promoting global variables with static constructor to be constants. With this flag,
+                the global variable optimization pass of LLVM tries to evaluate the global
+                variables with static constructors and promote them to global constants. Although
+                this optimization is correct, it may cause some incompatability with code compiled
+                by GCC. For example, code may do {@code const_cast} to cast the constant to mutable
+                and modify it. In GCC, the variable is in read-write and the code is run by
+                accident. In Clang, the const variable is in read-only memory and may cause your
+                application to crash.</li>
+            </ul>
+          </li>
+          <li>Added {@code -mldc1-sdc1} to the MIPS GCC and Clang compilers. By default, compilers
+            align 8-byte objects properly and emit the {@code ldc1} and {@code sdc1} instructions
+            to move them around. If your app uses a custom allocator that does not always align
+            with a new object's 8-byte boundary in the same way as the default allocator, your app
+            may crash due to {@code ldc1} and {@code sdc1} operations on unaligned memory. In this
+            case, use the {@code -mno-ldc1-sdc1} flag to workaround the problem.</li>
+          <li>Downgraded the event severity from warning to info if {@code APP_PLATFORM_LEVEL} is
+            larger than {@code APP_MIN_PLATFORM_LEVEL}. The {@code APP_PLATFORM_LEVEL} may be lower
+            than {@code APP_PLATFORM} in {@code jni/Application.mk} because the NDK does not have
+            headers for all levels. In this case, the actual level is shifted downwards. The
+            {@code APP_MIN_PLATFORM_LEVEL} is specified by the {@code android:minSdkVersion} in
+            your application's manifest.
+            (<a href="http://b.android.com/39752">Issue 39752</a>)</li>
+          <li>Added the {@code android_getCpuIdArm()} and {@code android_setCpuArm()} methods to
+            {@code cpu-features.c}. This addition enables easier retrieval of the ARM CPUID
+            information. (<a href="http://b.android.com/53689">Issue 53689</a>)</li>
+          <li>Modified {@code ndk-build} to use GCC 4.7's {@code as/ld} for Clang compiling.
+            <p class="note"><strong>Note:</strong>
+              In GCC 4.7, {@code monotonic_clock} and {@code is_monotonic} have been renamed to
+              {@code steady_clock} and {@code is_steady}, respectively.</p></li>
+          <li>Added the following new warnings to the {@code ndk-build} script:
+            <ul>
+              <li>Added warnings if {@code LOCAL_LDLIBS/LDFLAGS} are used in static library
+                modules.</li>
+              <li>Added a warning if a configuration has no module to build.</li>
+              <li>Added a warning for non-system libraries being used in
+                {@code LOCAL_LDLIBS/LDFLAGS} of a shared library or executable modules.</li>
+            </ul>
+          </li>
+          <li>Updated build scripts, so that if {@code APP_MODULES} is not defined and only static
+            libraries are listed in {@code Android.mk}, the script force-builds all of them.
+            (<a href="http://b.android.com/53502">Issue 53502</a>)</li>
+          <li>Updated {@code ndk-build} to support absolute paths in {@code LOCAL_SRC_FILES}.</li>
+          <li>Removed the {@code *-gdbtui} executables, which are duplicates of the {@code *-gdb}
+            executables with the {@code -tui} option enabled.</li>
+          <li>Updated the build scripts to warn you when the Edison Design Group (EDG) compiler
+            front-end turns {@code _STLP_HAS_INCLUDE_NEXT} back on.
+            (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
+          <li>Added the environment variable {@code NDK_LIBS_OUT} to allow overriding of the
+            path for {@code libraries/gdbserver} from the default {@code $PROJECT/libs}.
+            For more information, see {@code OVERVIEW.html}.</li>
+          <li>Changed ndk-build script defaults to compile code with format string protection
+            {@code -Wformat -Werror=format-security}. You may set
+            {@code LOCAL_DISABLE_FORMAT_STRING_CHECKS=true} to disable it.
+            For more information, see {@code ANDROID-MK.html}</li>
+          <li>Added STL pretty-print support in {@code ndk-gdb-py}. For more information, see
+            {@code NDK-GDB.html}.</li>
+          <li>Added tests based on the googletest frameworks.</li>
+          <li>Added a notification to the toolchain build script that warns you if the current shell
+            is not {@code bash}.</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+<a name="lower"></a>
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 8e</a> <em>(March 2013)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+        <ul>
+          <li>Added 64-bit host toolchain set (package name suffix {@code *-x86_64.*}). For more
+            information, see {@code CHANGES.HTML} and {@code NDK-BUILD.html}.</li>
+          <li>Added Clang 3.2 compiler. GCC 4.6 is still the default. For information on using the
+            Clang compiler, see {@code CHANGES.HTML}.</li>
+          <li>Added static code analyzer for Linux/MacOSX hosts. For information on using the
+            analyzer, see {@code CHANGES.HTML}.</li>
+          <li>Added MCLinker for Linux/MacOSX hosts as an experimental feature. The {@code ld.gold}
+            linker is the default where available, so you must explicitly enable it. For more
+            information, see {@code CHANGES.HTML}.</li>
+          <li>Updated ndk-build to use topological sort for module dependencies, which means the
+            build automatically sorts out the order of libraries specified in
+            {@code LOCAL_STATIC_LIBRARIES}, {@code LOCAL_WHOLE_STATIC_LIBRARIES} and
+            {@code LOCAL_SHARED_LIBRARIES}. For more information, see {@code CHANGES.HTML}.
+            (<a href="http://b.android.com/39378">Issue 39378</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Important bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>Fixed build script to build all toolchains in {@code -O2}. Toolchains in previous
+            releases were incorrectly built without optimization.</li>
+          <li>Fixed build script which unconditionally builds Clang/llvm for MacOSX in 64-bit.</li>
+          <li>Fixed GCC 4.6/4.7 internal compiler error:
+            {@code gen_thumb_movhi_clobber at config/arm/arm.md:5832}.
+            (<a href="http://b.android.com/52732">Issue 52732</a>)</li>
+          <li>Fixed build problem where GCC/ARM 4.6/4.7 fails to link code using 64-bit atomic
+            built-in functions.
+            (<a href="http://b.android.com/41297">Issue 41297</a>)</li>
+          <li>Fixed GCC 4.7 linker DIV usage mismatch errors.
+          (<a href="http://sourceware.org/ml/binutils/2012-12/msg00202.html">Sourceware Issue</a>)
+          <li>Fixed GCC 4.7 internal compiler error {@code build_data_member_initialization, at
+            cp/semantics.c:5790}.</li>
+          <li>Fixed GCC 4.7 internal compiler error {@code redirect_eh_edge_1, at tree-eh.c:2214}.
+            (<a href="http://b.android.com/52909">Issue 52909</a>)</li>
+          <li>Fixed a GCC 4.7 segfault.
+            (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245">GCC Issue</a>)</li>
+          <li>Fixed {@code &lt;chrono&gt;} clock resolution and enabled {@code steady_clock}.
+            (<a href="http://b.android.com/39680">Issue 39680</a>)</li>
+          <li>Fixed toolchain to enable {@code _GLIBCXX_HAS_GTHREADS} for GCC 4.7 libstdc++.
+            (<a href="http://b.android.com/41770">Issue 41770</a>,
+             <a href="http://b.android.com/41859">Issue 41859</a>)</li>
+          <li>Fixed problem with the X86 MXX/SSE code failing to link due to missing
+            {@code posix_memalign}.
+            (<a href="https://android-review.googlesource.com/#/c/51872">Change 51872</a>)</li>
+          <li>Fixed GCC4.7/X86 segmentation fault in {@code i386.c}, function
+            {@code distance_non_agu_define_in_bb()}.
+            (<a href="https://android-review.googlesource.com/#/c/50383">Change 50383</a>)</li>
+          <li>Fixed GCC4.7/X86 to restore earlier {@code cmov} behavior.
+            (<a href="http://gcc.gnu.org/viewcvs?view=revision&revision=193554">GCC Issue</a>)</li>
+          <li>Fixed handling NULL return value of {@code setlocale()} in libstdc++/GCC4.7.
+            (<a href="http://b.android.com/46718">Issue 46718</a>)
+          <li>Fixed {@code ld.gold} runtime undefined reference to {@code __exidx_start} and
+            {@code __exidx_start_end}.
+            (<a href="https://android-review.googlesource.com/#/c/52134">Change 52134</a>)</li>
+          <li>Fixed Clang 3.1 internal compiler error when using Eigen library.
+            (<a href="http://b.android.com/41246">Issue 41246</a>)</li>
+          <li>Fixed Clang 3.1 internal compiler error including {@code &lt;chrono&gt;} in C++11
+mode.
+            (<a href="http://b.android.com/39600">Issue 39600</a>)</li>
+          <li>Fixed Clang 3.1 internal compiler error when generating object code for a method
+            call to a uniform initialized {@code rvalue}.
+            (<a href="http://b.android.com/41387">Issue 41387</a>)</li>
+          <li>Fixed Clang 3.1/X86 stack realignment.
+            (<a href="https://android-review.googlesource.com/#/c/52154">Change 52154</a>)</li>
+          <li>Fixed problem with GNU Debugger (GDB) SIGILL when debugging on Android 4.1.2.
+            (<a href="http://b.android.com/40941">Issue 40941</a>)</li>
+          <li>Fixed problem where GDB cannot set {@code source:line} breakpoints when symbols
+contain
+            long, indirect file paths.
+            (<a href="http://b.android.com/42448">Issue 42448</a>)</li>
+          <li>Fixed GDB {@code read_program_header} for MIPS PIE executables.
+            (<a href="https://android-review.googlesource.com/#/c/49592">Change 49592</a>)</li>
+          <li>Fixed {@code STLport} segmentation fault in {@code uncaught_exception()}.
+            (<a href="https://android-review.googlesource.com/#/c/50236">Change 50236</a>)</li>
+          <li>Fixed {@code STLport} bus error in exception handling due to unaligned access of
+            {@code DW_EH_PE_udata2}, {@code DW_EH_PE_udata4}, and {@code DW_EH_PE_udata8}.</li>
+          <li>Fixed Gabi++ infinite recursion problem with {@code nothrow new[]} operator.
+            (<a href="http://b.android.com/52833">Issue 52833</a>)</li>
+          <li>Fixed Gabi++ wrong offset to exception handler pointer.
+            (<a href="https://android-review.googlesource.com/#/c/53446">Change 53446</a>)</li>
+          <li>Removed Gabi++ redundant free on exception object
+            (<a href="https://android-review.googlesource.com/#/c/53447">Change 53447</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>Fixed NDK headers:
+            <ul>
+              <li>Removed redundant definitions of {@code size_t}, {@code ssize_t}, and
+                {@code ptrdiff_t}.</li>
+              <li>Fixed MIPS and ARM {@code fenv.h} header.</li>
+              <li>Fixed {@code stddef.h} to not redefine {@code offsetof} since it already exists
+                in the toolchain.</li>
+              <li>Fixed {@code elf.h} to contain {@code Elf32_auxv_t} and {@code Elf64_auxv_t}.
+                (<a href="http://b.android.com/38441">Issue 38441</a>)
+                </li>
+              <li>Fixed the {@code #ifdef} C++ definitions in the
+                {@code OpenSLES_AndroidConfiguration.h} header file.
+                (<a href="http://b.android.com/53163">Issue 53163</a>)
+                </li>
+            </ul>
+          </li>
+          <li>Fixed {@code STLport} to abort after out of memory error instead of silently exiting.
+            </li>
+          <li>Fixed system and Gabi++ headers to be able to compile with API level 8 and lower.</li>
+          <li>Fixed {@code cpufeatures} to not parse {@code /proc/self/auxv}.
+            (<a href="http://b.android.com/43055">Issue 43055</a>)</li>
+          <li>Fixed {@code ld.gold} to not depend on host libstdc++ and on Windows platforms,
+            to not depend on the {@code libgcc_sjlj_1.dll} library.</li>
+          <li>Fixed Clang 3.1 which emits inconsistent register list in {@code .vsave} and fails
+            assembler.
+            (<a href="https://android-review.googlesource.com/#/c/49930">Change 49930</a>)</li>
+          <li>Fixed Clang 3.1 to be able to compile libgabi++ and pass the {@code test-stlport}
+            tests for MIPS build targets.
+            (<a href="https://android-review.googlesource.com/#/c/51961">Change 51961</a>)</li>
+          <li>Fixed Clang 3.1 to only enable exception by default for C++, not for C.</li>
+          <li>Fixed several issues in Clang 3.1 to pass most GNU exception tests.</li>
+          <li>Fixed scripts {@code clang} and {@code clang++} in standalone NDK compiler to detect
+            {@code -cc1} and to not specify {@code -target} when found.</li>
+          <li>Fixed {@code ndk-build} to observe {@code NDK_APP_OUT} set in {@code Application.mk}.
+            </li>
+          <li>Fixed X86 {@code libc.so} and {@code lib.a} which were missing the {@code sigsetjmp}
+            and {@code siglongjmp} functions already declared in {@code setjmp.h}.
+            (<a href="http://b.android.com/19851">Issue 19851</a>)</li>
+          <li>Patched GCC 4.4.3/4.6/4.7 libstdc++ to work with Clang in C++ 11.
+            (<a href="http://clang.llvm.org/cxx_status.html">Clang Issue</a>)</li>
+          <li>Fixed cygwin path in argument passed to {@code HOST_AWK}.</li>
+          <li>Fixed {@code ndk-build} script warning in windows when running from project's JNI
+            directory.
+            (<a href="http://b.android.com/40192">Issue 40192</a>)</li>
+          <li>Fixed problem where the {@code ndk-build} script does not build if makefile has
+            trailing whitespace in the {@code LOCAL_PATH} definition.
+            (<a href="http://b.android.com/42841">Issue 42841</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Other changes:</dt>
+      <dd>
+        <ul>
+          <li>Enabled threading support in GCC/MIPS toolchain.</li>
+          <li>Updated GCC exception handling helpers {@code __cxa_begin_cleanup} and
+            {@code __cxa_type_match} to have <em>default</em> visibility from the previous
+            <em>hidden</em> visibility in GNU libstdc++. For more information, see
+            {@code CHANGES.HTML}.</li>
+          <li>Updated build scripts so that Gabi++ and STLport static libraries are now built with
+            hidden visibility except for exception handling helpers.</li>
+          <li>Updated build so that {@code STLport} is built for ARM in Thumb mode.</li>
+          <li>Added support for {@code std::set_new_handler} in Gabi++.
+            (<a href="http://b.android.com/52805">Issue 52805</a>)</li>
+          <li>Enabled {@code FUTEX} system call in GNU libstdc++.</li>
+          <li>Updated {@code ndk-build} so that it  no longer copies prebuilt static library to
+            a project's {@code obj/local/&lt;abi&gt;/} directory.
+            (<a href="http://b.android.com/40302">Issue 40302</a>)</li>
+          <li>Removed {@code __ARM_ARCH_5*__} from ARM {@code toolchains/*/setup.mk} script.
+            (<a href="http://b.android.com/21132">Issue 21132</a>)</li>
+          <li>Built additional GNU libstdc++ libraries in thumb for ARM.</li>
+          <li>Enabled MIPS floating-point {@code madd/msub/nmadd/nmsub/recip/rsqrt}
+            instructions with 32-bit FPU.</li>
+          <li>Enabled graphite loop optimizer in GCC 4.6 and 4.7 to allow more optimizations:
+            {@code -fgraphite}, {@code -fgraphite-identity}, {@code -floop-block}, {@code
+-floop-flatten},
+            {@code -floop-interchange}, {@code -floop-strip-mine}, {@code -floop-parallelize-all},
+            and {@code -ftree-loop-linear}.
+            (<a href="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html">info</a>)</li>
+          <li>Enabled {@code polly} for Clang 3.1 on Linux and Max OS X 32-bit hosts which analyzes
+            and optimizes memory access. (<a href="http://polly.llvm.org">info</a>)</li>
+          <li>Enabled {@code -flto} in GCC 4.7, 4.6, Clang 3.2 and Clang 3.1 on linux (Clang LTO
+            via LLVMgold.so). MIPS compiler targets are not supported because {@code ld.gold}
+            is not available.</li>
+          <li>Enabled {@code --plugin} and {@code --plugin-opt} for {@code ld.gold} in GCC 4.6/4.7.
+            </li>
+          <li>Enabled {@code --text-reorder} for {@code ld.gold} in GCC 4.7.</li>
+          <li>Configured GNU libstdc++ with {@code _GLIBCXX_USE_C99_MATH} which undefines the
+            {@code isinf} script in the bionic header. For more information, see
+            {@code CHANGES.html}.</li>
+          <li>Added {@code APP_LDFLAGS} to the build scripts. For more information, see
+            {@code ANDROID-MK.html}.</li>
+          <li>Updated build scripts to allow {@code NDK_LOG=0} to disable the {@code NDK_LOG}.</li>
+          <li>Updated build scripts to allow {@code NDK_HOST_32BIT=0} to disable the host developer
+            environment 32-bit toolchain.</li>
+          <li>Changed the default GCC/X86 flags {@code -march=} and {@code -mtune=} from
+            {@code pentiumpro} and {@code generic} to {@code i686} and {@code atom}.</li>
+          <li>Enhanced toolchain build scripts:
+            <ul>
+              <li>Fixed a race condition in {@code build-gcc.sh} for the {@code mingw} build type
+                which was preventing a significant amount of parallel build processing.</li>
+              <li>Updated {@code build-gabi++.sh} and {@code build-stlport.sh} so they can now run
+                from the NDK package.
+                (<a href="http://b.android.com/52835">Issue 52835</a>)
+                </li>
+              <li>Fixed {@code run-tests.sh} in the {@code MSys} utilities collection.</li>
+              <li>Improved 64-bit host toolchain and Canadian Cross build support.</li>
+              <li>Updated {@code build-mingw64-toolchain.sh} script to more recent version.</li>
+              <li>Added option to build {@code libgnustl_static.a} and {@code stlport_static.a}
+                without hidden visibility.</li>
+            </ul>
+          </li>
+        </ul>
+
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 8d</a> <em>(December 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+      <dd>
+        <ul>
+          <li>Added the GNU Compiler Collection (GCC) 4.7 compiler to the NDK. The GCC 4.6 compiler
+            is still the default, so you must to explicitly enable the new version as follows:
+            <ul>
+              <li>For {@code ndk-build}, export the {@code NDK_TOOLCHAIN_VERSION=4.7} variable
+                <em>or</em> add it to {@code Application.mk}.</li>
+              <li>For standalone builds, add the {@code --toolchain=} option to
+                {@code make-standalone-toolchain.sh}, for example:
+                <pre>--toolchain=arm-linux-androideabi-4.7</pre></li>
+            </ul>
+            <p class="note">
+              <strong>Note:</strong> This feature is experimental. Please try it and
+              <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p>
+          </li>
+          <li>Added {@code stlport} exception support via gabi++.  Note that the new gabi++
+            depends on {@code dlopen} and related code, meaning that:
+            <ul>
+              <li>You can no longer build a <em>static</em> executable using the {@code -static}
+                option or include {@code libstlport_static.a} using
+                {@code APP_STL := stlport_static}. (You can still use the {@code -static} option
+                with a standalone toolchain.) Compiling a <em>dynamic</em> executable using
+                {@code include $(BUILD_EXECUTABLE)} continues to work because the compiler
+                automatically adds the {@code -ldl} option.</li>
+              <li>If your project links using {@code -nostdlib} and {-Wl,--no-undefined}, you
+                must manually include the {@code -ldl} option.</li>
+            </ul>
+              For more information, see {@code CPLUSPLUS-SUPPORT.html}.
+
+              <p class="note">
+                <strong>Note:</strong> This feature is experimental and works better with the GCC
+                4.6/4.7 compilers than with GCC 4.4.3 or Clang 3.1. Please try it and
+                <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p>
+          </li>
+          <li>Added a {@code -mstack-protector-guard=} option for x86 to choose between a
+            <em>global</em> default path which is compatible with older Android C library (bionic)
+            and a new <em>tls</em> path (%gs:20) for {@code -fstack-protector},
+            {@code -fstack-protector-all} and {@code -fstack-protector-strong} using the GCC 4.6
+            and higher compilers.
+
+            <p class="note">
+              <strong>Note:</strong> The {@code -mstack-protector-guard} setting itself does not
+              enable any {@code -fstack-protector*} options.</p>
+          </li>
+          <li>Added {@code android_setCpu()} function to
+            {@code sources/android/cpufeatures/cpu-features.c} for use when auto-detection via
+            {@code /proc} is not possible in Android 4.1 and higher.
+            (<a href="http://code.google.com/p/chromium/issues/detail?id=164154">Chromium Issue
+            164154</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Important bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>Fixed unnecessary rebuild of object files when using the {@code ndk-build} script.
+            (<a href="http://b.android.com/39810">Issue 39810</a>)</li>
+          <li>Fixed a linker failure with the NDK 8c release for Mac OS X 10.6.x that produced the
+            following error:
+            <pre>
+dyld: lazy symbol binding failed: Symbol not found: _memmem
+Referenced from: ...../arm-linux-androideabi/bin/ld
+Expected in: /usr/lib/libSystem.B.dylib</pre>
+            This problem was caused by building on Mac OS X 10.7, which produced binaries that were
+            not compatible with Mac OS 10.6.x and the NDK.
+          </li>
+          <li>Removed the {@code -x c++} options from the Clang++ standalone build script.
+          (<a href="http://b.android.com/39089">Issue 39089</a>)</li>
+          <li>Fixed issues using the {@code NDK_TOOLCHAIN_VERSION=clang3.1} option in Cygwin.
+           (<a href="http://b.android.com/39585">Issue 39585</a>)</li>
+          <li>Fixed the {@code make-standalone-toolchain.sh} script to allow generation of a
+            standalone toolchain using the Cygwin or MinGW environments. The resulting toolchain
+            can be used in Cygwin, MingGW or CMD.exe environments.
+            (<a href="http://b.android.com/39915">Issue 39915</a>,
+            <a href="http://b.android.com/39585">Issue 39585</a>)</li>
+          <li>Added missing {@code SL_IID_ANDROIDBUFFERQUEUESOURCE} option in android-14 builds for
+            ARM and X86.
+            (<a href="http://b.android.com/40625">Issue 40625</a>)</li>
+          <li>Fixed x86 CPU detection for the {@code ANDROID_CPU_X86_FEATURE_MOVBE} feature.
+            (<a href="http://b.android.com/39317">Issue 39317</a>)</li>
+          <li>Fixed an issue preventing the Standard Template Library (STL) from using C++
+            sources that do not have a {@code .cpp} file extension.</li>
+          <li>Fixed GCC 4.6 ARM internal compiler error <em>at reload1.c:1061</em>.
+            (<a href="http://b.android.com/20862">Issue 20862</a>)</li>
+          <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at emit-rtl.c:1954</em>.
+            (<a href="http://b.android.com/22336">Issue 22336</a>)</li>
+          <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at postreload.c:396</em>.
+            (<a href="http://b.android.com/22345">Issue 22345</a>)</li>
+          <li>Fixed problem with GCC 4.6/4.7 skipping lambda functions.
+            (<a href="http://b.android.com/35933">Issue 35933</a>)</li>
+        </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+      <dd>
+        <ul>
+          <li>NDK header file fixes:
+            <ul>
+              <li>Fixed {@code __WINT_TYPE__} and {@code wint_t} to be the same type.</li>
+              <li>Corrected typo in {@code android/bitmap.h}.
+                (<a href="http://b.android.com/15134">Issue 15134</a>)
+              </li>
+              <li>Corrected typo in {@code errno.h}.</li>
+              <li>Added check for the presence of {@code __STDC_VERSION__} in {@code sys/cdefs.h}.
+                (<a href="http://b.android.com/14627">Issue 14627</a>)
+              </li>
+              <li>Reorganized headers in {@code byteswap.h} and {@code dirent.h}.</li>
+              <li>Fixed {@code limits.h} to include {@code page.h} which provides {@code PAGE_SIZE}
+                settings.
+                (<a href="http://b.android.com/39983">Issue 39983</a>)
+              </li>
+              <li>Fixed return type of {@code glGetAttribLocation()} and
+                {@code glGetUniformLocation()} from {@code int} to {@code GLint}.</li>
+              <li>Fixed {@code __BYTE_ORDER} constant for x86 builds.
+                (<a href="http://b.android.com/39824">Issue 39824</a>)
+              </li>
+            </ul>
+          </li>
+          <li>Fixed {@code ndk-build} script to not overwrite {@code -Os} with {@code -O2} for ARM
+            builds.</li>
+          <li>Fixed build scripts to allow overwriting of {@code HOST_AWK}, {@code HOST_SED}, and
+            {@code HOST_MAKE} settings.</li>
+          <li>Fixed issue for {@code ld.gold} on {@code fsck_msdos} builds linking objects built by
+            the Intel C/C++ compiler (ICC).</li>
+          <li>Fixed ARM EHABI support in Clang to conform to specifications.</li>
+          <li>Fixed GNU Debugger (GDB) to shorten the time spent on walking the target's link map
+            during {@code solib} events.
+            (<a href="http://b.android.com/38402">Issue 38402</a>)</li>
+          <li>Fixed missing {@code libgcc.a} file when linking shared libraries.</li>
+        </ul>
+      </dd>
+
+      <dt>Other changes:</dt>
+      <dd>
+        <ul>
+          <li>Backported 64-bit built-in atomic functions for ARM to GCC 4.6.</li>
+          <li>Added documentation for audio output latency, along with other documentation and
+            fixes.</li>
+          <li>Fixed debug builds with Clang so that non-void functions now raise a {@code SIGILL}
+            signal for paths without a return statement.</li>
+          <li>Updated {@code make-standalone-toolchain.sh} to accept the suffix {@code -clang3.1}
+            which is equivalent to adding {@code --llvm-version=3.1} to the GCC 4.6 toolchain.</li>
+          <li>Updated GCC and Clang bug report URL to:
+            <a
+href="http://source.android.com/source/report-bugs.html">http://source.android.com/source/report-bug
+s.html</a></li>
+          <li>Added ARM ELF support to {@code llvm-objdump}.</li>
+          <li>Suppressed <em>treating c input as c++</em> warning for Clang builds.</li>
+          <li>Updated build so that only the 32-bit version of {@code libiberty.a} is built and
+            placed in {@code lib32/}.</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 8c</a> <em>(November 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Important changes:</dt>
+
+      <dd>
+        <ul>
+          <li>Added the Clang 3.1 compiler to the NDK. The GNU Compiler Collection (GCC) 4.6 is
+          still the default, so you must explicitly enable the Clang compiler option as follows:
+            <ul>
+              <li>For {@code ndk-build}, export {@code NDK_TOOLCHAIN_VERSION=clang3.1} <em>or</em>
+                add this environment variable setting to {@code Application.mk}.</li>
+              <li>For standalone builds, add {@code --llvm-version=3.1} to
+                {@code make-standalone-toolchain.sh} and replace {@code CC} and {@code CXX} in your
+                makefile with {@code &lt;tool-path&gt;/bin/clang} and
+                {@code &lt;tool-path&gt;/bin/clang++}. See {@code STANDALONE-TOOLCHAIN.html} for
+                details.</li>
+            </ul>
+            <p class="note"><strong>Note:</strong> This feature is experimental. Please try it and
+            <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p></li>
+          <li>Added Gold linker {@code ld.gold} for the Windows toolchain. Gold linker is also the
+            default for ARM and X86 on all hosts. You may override it to use the {@code ld.bfd}
+            linker by adding {@code LOCAL_LDFLAGS += -fuse-ld=bfd} to {@code Android.mk}, or by
+passing
+            {@code -fuse-ld=bfd} to the g++/clang++ command line that does the linking.</li>
+          <li>Added checks for spaces in the NDK path to the {@code ndk-build[.cmd]} and
+            {@code ndk-gdb} scripts, to prevent build errors that are difficult to diagnose.</li>
+          <li>Made the following changes to API level handling:
+            <ul>
+              <li>Modified build logic so that projects that specify {@code android-10} through
+                {@code android-13} in {@code APP_PLATFORM}, {@code project.properties} or
+                {@code default.properties} link against {@code android-9} instead of
+                {@code android-14}.
+              <li>Updated build so that executables using android-16 (Jelly Bean) or higher are
+                compiled with the {@code -fPIE} option for position-independent executables (PIE).
+                A new {@code APP_PIE} option allows you to control this behavior. See {@code
+                APPLICATION-MK.html} for details.
+                <p class="note">
+                  <strong>Note:</strong> All API levels above 14 still link against {@code
+                  platforms/android-14} and no new {@code platforms/android-N} have been added.
+                </p></li>
+              <li>Modified {@code ndk-build} to provide warnings if the adjusted API level is larger
+              than {@code android:minSdkVersion} in the project's {@code AndroidManifest.xml}.</li>
+            </ul>
+          </li>
+          <li>Updated the {@code cpu-features} helper library to include more ARM-specific features.
+          See {@code sources/android/cpufeatures/cpu-features.h} for details.</li>
+          <li>Modified the long double on the X86 platform to be 8 bytes. This data type is now the
+          same size as a double, but is still treated as a distinct type.</li>
+          <li>Updated build for {@code APP_ABI=armeabi-v7a}:
+            <ul>
+              <li>Modified this build type to pass the {@code -march=armv7-a} parameter
+              to the linker. This change ensures that v7-specific libraries and {@code crt*.o} are
+              linked correctly.</li>
+              <li>Added {@code -mfpu=vfpv3-d16} to {@code ndk-build} instead of the
+              {@code -mfpu=vfp} option used in previous releases.</li>
+            </ul>
+          </li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Important bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed an issue where running {@code make-standalone-toolchain.sh} with root privileges
+            resulted in the stand alone tool chain being inaccessible to some users.
+            (<a href="http://b.android.com/35279">Issue 35279</a>)
+            <ul>
+              <li>All files and executables in the NDK release package are set to have read and
+                execute permissions for all.</li>
+              <li>The ownership/group of {@code libstdc++.a} is now preserved when copied.</li>
+            </ul>
+          </li>
+          <li>Removed redundant {@code \r} from Windows prebuilt {@code echo.exe}. The redundant
+          {@code \r} caused {@code gdb.setup} to fail in the GNU Debugger (GDB) because it
+          incorrectly became part of the path.
+          (<a href="http://b.android.com/36054">Issue 36054</a>)</li>
+          <li>Fixed Windows parallel builds that sometimes failed due to timing issues in the
+          {@code host-mkdir} implementation.
+          (<a href="http://b.android.com/25875">Issue 25875</a>)</li>
+          <li>Fixed GCC 4.4.3 GNU {@code libstdc++} to <em>not</em> merge {@code typeinfo} names by
+          default. For more details, see
+          {@code toolchain repo gcc/gcc-4.4.3/libstdc++-v3/libsupc++/typeinfo}.
+          (<a href="http://b.android.com/22165">Issue 22165</a>)</li>
+          <li>Fixed problem on {@code null} context in GCC 4.6
+          {@code cp/mangle.c::write_unscoped_name}, where GCC may crash when the context is
+          {@code null} and dereferenced in {@code TREE_CODE}.</li>
+          <li>Fixed GCC 4.4.3 crashes on ARM NEON-specific type definitions for floats.
+          (<a href="http://b.android.com/34613">Issue 34613</a>)</li>
+          <li>Fixed the {@code STLport} internal {@code _IteWrapper::operator*()} implementation
+          where a stale stack location holding the dereferenced value was returned and caused
+          runtime crashes.
+          (<a href="http://b.android.com/38630">Issue 38630</a>)</li>
+
+          <li>ARM-specific fixes:
+            <ul>
+              <li>Fixed ARM GCC 4.4.3/4.6 {@code g++} to not warn that the <em>mangling of
+              &lt;va_list&gt; was changed in GCC 4.4</em>. The workaround using the
+              {@code -Wno-psabi} switch to avoid this warning is no longer required.</li>
+              <li>Fixed an issue when a project with {@code .arm} or {@code .neon} suffixes in
+              {@code LOCAL_SRC_FILES} also used {@code APP_STL}. With {@code APP_STL}, the
+              {@code ndk-build} script searches for C++ files in {@code LOCAL_SRC_FILES} before
+              adding STL {@code header/lib} paths to compilation. Modified {@code ndk-build} to
+              filter out {@code .arm} and {@code .neon} suffixes before the search, otherwise items
+              in {@code LOCAL_SRC_FILES} like {@code myfile.cpp.arm.neon} won't be compiled as C++
+              code.</li>
+              <li>Fixed {@code binutils-2.21/ld.bfd} to be capable of linking object from older
+              binutils without {@code tag_FP_arch}, which was producing <em>assertion fail</em>
+              error messages in GNU Binutils.
+              (<a href="http://b.android.com/35209">Issue 35209</a>)
+              </li>
+              <li>Removed <em>Unknown EABI object attribute 44</em> warning when
+              {@code binutils-2.19/ld} links prebuilt object by newer {@code binutils-2.21}</li>
+              <li>Fixed an issue in GNU {@code stdc++} compilation with both {@code -mthumb} and
+              {@code -march=armv7-a}, by modifying {@code make-standalone-toolchain.sh} to populate
+              {@code headers/libs} in sub-directory {@code armv7-a/thumb}.
+              (<a href="http://b.android.com/35616">Issue 35616</a>)
+              </li>
+              <li>Fixed <em>unresolvable R_ARM_THM_CALL relocation</em> error.
+              (<a href="http://b.android.com/35342">Issue 35342</a>)
+              </li>
+              <li>Fixed internal compiler error at {@code reload1.c:3633}, caused by the ARM
+              back-end expecting the wrong operand type when sign-extend from {@code char}.
+              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50099">GCC Issue 50099</a>)</li>
+              <li>Fixed internal compiler error with negative shift amount.
+              (<a href="http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00594.html">GCC Issue</a>)</li>
+            </ul>
+          </li>
+
+          <li>Fixed {@code -fstack-protector} for X86, which is also the default for the
+          {@code ndk-build} x86 ABI target.</li>
+
+          <li>MIPS-specific fixes:
+            <ul>
+              <li>Fixed {@code STLport} endian-ness by setting {@code _STLP_LITTLE_ENDIAN} to 1 when
+              compiling MIPS {@code libstlport_*}.</li>
+              <li>Fixed GCC {@code __builtin_unreachable} issue when compiling LLVM.
+              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54369">GCC Issue 54369</a>)</li>
+              <li>Backported fix for {@code cc1} compile process consuming 100% CPU.
+              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50380">GCC Issue 50380</a>)</li>
+            </ul>
+          </li>
+
+          <li>GNU Debugger-specific fixes:
+            <ul>
+              <li>Disabled Python support in gdb-7.x at build, otherwise the gdb-7.x configure
+              function may pick up whatever Python version is available on the host and build
+              {@code gdb} with a hard-wired dependency on a specific version of Python.
+              (<a href="http://b.android.com/36120">Issue 36120</a>)
+              </li>
+              <li>Fixed {@code ndk-gdb} when {@code APP_ABI} contains {@code all} and matchs none
+              of the known architectures.
+              (<a href="http://b.android.com/35392">Issue 35392</a>)
+              </li>
+              <li>Fixed Windows pathname support, by keeping the {@code :} character if it looks
+              like it could be part of a Windows path starting with a drive letter.
+              (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12843">GDB Issue 12843</a>)
+              </li>
+              <li>Fixed adding of hardware breakpoint support for ARM in {@code gdbserver}.
+              (<a href="http://sourceware.org/ml/gdb-patches/2011-09/msg00200.html">GDB Issue</a>)
+              </li>
+              <li>Added fix to only read the current {@code solibs} when the linker is consistent.
+              This change speeds up {@code solib} event handling.
+              (<a href="http://b.android.com/37677">Issue 37677</a>)
+              </li>
+              <li>Added fix to make repeated attempts to find {@code solib} breakpoints. GDB now
+              retries {@code enable_break()} during every call to {@code svr4_current_sos()} until
+              it succeeds.
+              (<a href="https://android-review.googlesource.com/#/c/43563">Change 43563</a>)</li>
+              <li>Fixed an issue where {@code gdb} would not stop on breakpoints placed in
+              {@code dlopen-ed} libraries.
+              (<a href="http://b.android.com/34856">Issue 34856</a>)
+              </li>
+              <li>Fixed {@code SIGILL} in dynamic linker when calling {@code dlopen()}, on system
+              where {@code /system/bin/linker} is stripped of symbols and
+              {@code rtld_db_dlactivity()} is implemented as {@code Thumb}, due to not preserving
+              {@code LSB} of {@code sym_addr}.
+              (<a href="http://b.android.com/37147">Issue 37147</a>)
+              </li>
+            </ul>
+          </li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Other bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed NDK headers:
+            <ul>
+              <li>Fixed {@code arch-mips/include/asm/*} code that was incorrectly removed from
+              original kernel. (<a href="https://android-review.googlesource.com/#/c/43335">Change
+              43335</a>)</li>
+              <li>Replaced struct member data {@code __unused} with {@code __linux_unused} in
+              {@code linux/sysctl.h} and {@code linux/icmp.h} to avoid conflict with
+              {@code #define __unused} in {@code sys/cdefs.h}.</li>
+              <li>Fixed {@code fenv.h} for enclosed C functions with {@code __BEGIN_DECLS} and
+              {@code __END_DECLS}.</li>
+              <li>Removed unimplemented functions in {@code malloc.h}.</li>
+              <li>Fixed {@code stdint.h} defintion of {@code uint64_t} for ANSI compilers.
+              (<a href="http://b.android.com/1952">Issue 1952</a>)</li>
+              <li>Fixed preprocessor macros in {@code &lt;arch&gt;/include/machine/*}.</li>
+              <li>Replaced {@code link.h} for MIPS with new version supporting all platforms.</li>
+              <li>Removed {@code linux-unistd.h}</li>
+              <li>Move GLibc-specific macros {@code LONG_LONG_MIN}, {@code LONG_LONG_MAX} and
+              {@code ULONG_LONG_MAX} from {@code &lt;pthread.h&gt;} to {@code
+&lt;limits.h&gt;}.</li>
+            </ul>
+          </li>
+          <li>Fixed a buffer overflow in {@code ndk-stack-parser}.</li>
+          <li>Fixed {@code _STLP_USE_EXCEPTIONS}, when not defined, to omit all declarations
+          and uses of {@code __Named_exception}. Compiling and use of {@code __Named_exception}
+          settings only occurs when {@code STLport} is allowed to use exceptions.</li>
+          <li>Fixed building of Linux-only NDK packages without also building Windows code. Use the
+          following settings to perform this type of build:
+          <pre>./build/tools/make-release.sh --force --systems=linux-x86</pre></li>
+          <li>Fixed {@code libc.so} so it does not export {@code atexit()} and {@code __do_handler}.
+          These symbols are exported for ARM builds by the system version of the C library to
+          support legacy native libraries. NDK-generated should never reference them directly.
+          Instead, each shared library or executable should embed its own version of these symbols,
+          provided by {@code crtbegin_*.o}.
+          <p>If your project is linked with the {@code -nostdlib -Wl,--no-undefined} options, you
+          must provide your own {@code __dso_handle} because {@code crtbegin_so.o} is not linked in
+          this case. The content of {@code __dso_handle} does not matter, as shown in the following
+          example code:</p>
+<pre>
+extern "C" {
+  extern void *__dso_handle __attribute__((__visibility__ ("hidden")));
+  void *__dso_handle;
+}
+</pre>
+          </li>
+          <li>Fixed symbol decoder for ARM used in {@code objdump} for {@code plt} entries to
+          generate a more readable form {@code function@plt}.</li>
+          <li>Removed the following symbols, introduced in GCC 4.6 {@code libgcc.a}, from
+          the X86 platform {@code libc.so} library: {@code __aeabi_idiv0}, {@code __aeabi_ldiv0},
+          {@code __aeabi_unwind_cpp_pr1}, and {@code __aeabi_unwind_cpp_pr2}.</li>
+          <li>Removed unused {@code .ctors}, {@code .dtors}, and {@code .eh_frame} in MIPS
+          {@code crt*_so.S}.</li>
+          <li>Updated {@code ndk-gdb} so that it only takes the last line of output for
+          {@code ndk-build} {@code DUMP_XXXX}. This change ensures that if {@code Application.mk} or
+          {@code Android.mk} print something with {@code $(info ...)} syntax, it does not get
+          injected into the result of {@code DUMP_XXXX}.
+          (<a href="https://groups.google.com/d/msg/android-ndk/-/ew0lTWGr1UEJ">More info</a>)</li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Other changes:</dt>
+
+      <dd>
+        <ul>
+          <li>Removed {@code arch-x86} and {@code arch-mips} headers from
+          {@code platforms/android-[3,4,5,8]}. Those headers were incomplete, since both X86 and
+          MIPS ABIs are only supported at API 9 or higher.</li>
+          <li>Simplified c++ include path in standalone packages, as shown below.
+          (<a href="http://b.android.com/35279">Issue 35279</a>)
+<pre>
+&lt;path&gt;/arm-linux-androideabi/include/c++/4.6.x-google
+  to:
+&lt;path&gt;/include/c++/4.6/
+</pre></li>
+          <li>Fixed {@code ndk-build} to recognize more C++ file extensions by default:
+          {@code .cc .cp .cxx .cpp .CPP .c++ .C}. You may still use {@code LOCAL_CPP_EXTENSION} to
+          overwrite these extension settings.</li>
+          <li>Fixed an issue in {@code samples/san-angeles} that caused a black screen or freeze
+          frame on re-launch.</li>
+          <li>Replaced deprecated APIs in NDK samples.
+          (<a href="http://b.android.com/20017">Issue 20017</a>)
+            <ul>
+              <li>{@code hello-gl2} from android-5 to android-7</li>
+              <li>{@code native-activity} from android-9 to android-10</li>
+              <li>{@code native-audio} from android-9 to android-10</li>
+              <li>{@code native-plasma} from android-9 to android-10</li>
+            </ul>
+          </li>
+          <li>Added new branding for Android executables with a simpler scheme in section
+          {@code .note.android.ident} (defined in {@code crtbegin_static/dynamic.o}) so that
+          debugging tools can act accordingly. The structure member and values are defined as
+          follows:
+<pre>
+static const struct {
+  int32_t namesz;  /* = 8,  sizeof ("Android") */
+  int32_t descsz;  /* = 1 * sizeof(int32_t) */
+  int32_t type;    /* = 1, ABI_NOTETYPE */
+  char name[sizeof "Android"];  /* = "Android" */
+  int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */
+}
+</pre>
+            <p>The previous branding options in section {@code .note.ABI-tag} are deprecated.</p>
+          </li>
+          <li>Added a new script {@code run-tests-all.sh} which calls {@code run-tests.sh} and
+          {@code standalone/run.sh} with various conditions. The script {@code run-tests.sh} runs
+          without the {@code --abi} option, and is enhanced to compile most of the tests for all
+          supported ABIs and run on all attached devices</li>
+        </ul>
+      </dd>
+    </dl>
+
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 8b</a> <em>(July 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>The main features of this release are a new GNU Compiler Collection (GCC) 4.6 toolchain and
+GNU Debugger (GDB) 7.3.x which adds debugging support for the Android 4.1 (API Level 16) system
+image.</p>
+
+    <dl>
+      <dt>Important bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed {@code LOCAL_SHORT_COMMANDS} issues on Mac OS, Windows Cygwin environments for
+static libraries. List file generation is faster, and it is not regenerated to avoid repeated
+project rebuilds.</li>
+          <li>Fixed several issues in {@code ndk-gdb}:
+            <ul>
+              <li>Updated tool to pass flags {@code -e}, {@code -d} and {@code -s} to adb more
+consistently.</li>
+              <li>Updated tool to accept device serial names containing spaces.</li>
+              <li>Updated tool to retrieve {@code /system/bin/link} information, so {@code gdb} on
+the host can set a breakpoint in {@code __dl_rtld_db_dlactivity} and be aware of linker activity
+(e.g., rescan {@code solib} symbols when {@code dlopen()} is called).</li>
+            </ul>
+          </li>
+          <li>Fixed {@code ndk-build clean} on Windows, which was failing to remove
+{@code ./libs/*/lib*.so}.</li>
+          <li>Fixed {@code ndk-build.cmd} to return a non-zero {@code ERRORLEVEL} when {@code make}
+fails.</li>
+          <li>Fixed {@code libc.so} to stop incorrectly exporting the {@code __exidx_start} and
+{@code __exidx_end} symbols.</li>
+          <li>Fixed {@code SEGV} when unwinding the stack past {@code __libc_init} for ARM and
+MIPS.</li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Important changes:</dt>
+
+      <dd>
+        <ul>
+          <li>Added GCC 4.6 toolchain ({@code binutils} 2.21 with {@code gold} and GDB 7.3.x) to
+co-exist with the original GCC 4.4.3 toolchain ({@code binutils} 2.19 and GDB 6.6).
+            <ul>
+              <li>GCC 4.6 is now the default toolchain. You may set {@code
+NDK_TOOLCHAIN_VERSION=4.4.3} in {@code Application.mk} to select the original one.</li>
+              <li>Support for the {@code gold} linker is only available for ARM and x86
+architectures on Linux and Mac OS hosts. This support is disabled by default. Add {@code
+LOCAL_LDLIBS += -fuse-ld=gold} in {@code Android.mk} to enable it.</li>
+              <li>Programs compiled with {@code -fPIE} require the new {@code GDB} for debugging,
+including binaries in Android 4.1 (API Level 16) system images.</li>
+              <li>The {@code binutils} 2.21 {@code ld} tool contains back-ported fixes from
+version 2.22:
+                <ul>
+                  <li>Fixed {@code ld --gc-sections}, which incorrectly retains zombie references to
+external libraries. (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=13177">more
+info</a>).</li>
+                  <li>Fixed ARM {@code strip} command to preserve the original {@code p_align} and
+{@code p_flags} in {@code GNU_RELRO} section if they are valid. Without this fix, programs
+built with {@code -fPIE} could not be debugged. (<a
+href="http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.552&r2=1.553">mor
+e info</a>)</li>
+                </ul>
+              </li>
+              <li>Disabled {@code sincos()} optimization for compatibility with older
+                platforms.</li>
+            </ul>
+          </li>
+
+          <li>Updated build options to enable the Never eXecute (NX) bit and {@code relro}/{@code
+bind_now} protections by default:
+            <ul>
+              <li>Added {@code --noexecstack} to assembler and {@code -z noexecstack} to linker
+that provides NX protection against buffer overflow attacks by enabling NX bit on stack and
+heap.</li>
+              <li>Added {@code -z relro} and  {@code -z now} to linker for hardening of internal
+data sections after linking to guard against security vulnerabilities caused by memory corruption.
+(more info: <a href="http://www.akkadia.org/drepper/nonselsec.pdf">1</a>,
+<a href="http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html">2</a>)</li>
+
+              <li>These features can be disabled using the following options:
+                <ol>
+                  <li>Disable NX protection by setting the {@code --execstack} option for the
+assembler and {@code -z execstack} for the linker.</li>
+                  <li>Disable hardening of internal data by setting the {@code -z norelro} and
+{@code -z lazy} options for the linker.</li>
+                  <li>Disable these protections in the NDK {@code jni/Android.mk} by setting the
+following options:
+<pre>
+LOCAL_DISABLE_NO_EXECUTE=true  # disable "--noexecstack" and "-z noexecstack"
+DISABLE_RELRO=true             # disable "-z relro" and "-z now"
+</pre>
+                  </li>
+                </ol>
+                <p>See {@code docs/ANDROID-MK.html} for more details.</p>
+              </li>
+            </ul>
+          </li>
+
+          <li>Added branding for Android executables with the {@code .note.ABI-tag} section (in
+{@code crtbegin_static/dynamic.o}) so that debugging tools can act accordingly. The structure
+member and values are defined as follows:
+<pre>
+static const struct {
+  int32_t namesz;  /* = 4,  sizeof ("GNU") */
+  int32_t descsz;  /* = 6 * sizeof(int32_t) */
+  int32_t type;    /* = 1 */
+  char  name[sizeof "GNU"];  /* = "GNU" */
+  int32_t os;      /* = 0 */
+  int32_t major;   /* = 2 */
+  int32_t minor;   /* = 6 */
+  int32_t teeny;   /* = 15 */
+  int32_t os_variant;  /* = 1 */
+  int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */
+}</pre>
+          </li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Other bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed {@code mips-linux-gnu} relocation truncated to fit {@code R_MIPS_TLS_LDM} issue.
+            (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12637">more info</a>)</li>
+          <li>Fixed {@code ld} tool segfaults when using {@code --gc-sections}.
+            (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12845">more info</a>)
+          </li>
+          <li>Fixed MIPS {@code GOT_PAGE} counting issue.
+            (<a href="http://sourceware.org/ml/binutils/2011-05/msg00198.html">more info</a>)</li>
+          <li>Fixed follow warning symbol link for {@code mips_elf_count_got_symbols}.</li>
+          <li>Fixed follow warning symbol link for {@code mips_elf_allocate_lazy_stub}.</li>
+          <li>Moved MIPS {@code .dynamic} to the data segment, so that it is writable.</li>
+          <li>Replaced hard-coded values for symbols with correct segment sizes for MIPS.</li>
+          <li>Removed the {@code -mno-shared} option from the defaults in the MIPS toolchain.
+The default for Android toolchain is {@code -fPIC} (or {@code -fpic} if supported). If you do not
+explicitly specify {@code -mshared}, {@code -fpic}, {@code -fPIC}, {@code -fpie}, or {@code -fPIE},
+the MIPS compiler adds {@code -mno-shared} that turns off PIC. Fixed compiler not to add
+{@code -mno-shared} in this case.</li>
+          <li>Fixed wrong package names in samples {@code hello-jni} and {@code two-libs} so that
+the {@code tests} project underneath it can compile.</li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Other Changes:</dt>
+
+      <dd>
+        <ul>
+          <li>Changed locations of binaries:
+            <ul>
+              <li>Moved {@code gdbserver} from
+{@code toolchain/&lt;arch-os-ver&gt;/prebuilt/gdbserver} to
+{@code prebuilt/android-&lt;arch&gt;/gdbserver/gdbserver}.</li>
+              <li>Renamed x86 toolchain prefix from {@code i686-android-linux-} to
+{@code i686-linux-android-}.</li>
+              <li>Moved {@code sources/cxx-stl/gnu-libstdc++/include} and {@code lib} to
+{@code sources/cxx-stl/gnu-libstdc++/4.6} when compiled with GCC 4.6, or
+{@code sources/cxx-stl/gnu-libstdc++/4.4.3} when compiled with GCC 4.4.3.</li>
+              <li>Moved {@code libbfd.a} and {@code libintl.a} from {@code lib/} to {@code
+lib32/}.</li>
+            </ul>
+          </li>
+
+          <li>Added and improved various scripts in the rebuild and test NDK toolchain:
+            <ul>
+              <li>Added {@code build-mingw64-toolchain.sh} to generate a new Linux-hosted toolchain
+that generates Win32 and Win64 executables.</li>
+              <li>Improved speed of {@code download-toolchain-sources.sh} by using the {@code
+clone} command and only using {@code checkout} for the directories that are needed to build the NDK
+toolchain binaries.</li>
+              <li>Added {@code build-host-gcc.sh} and {@code build-host-gdb.sh} scripts.</li>
+              <li>Added {@code tests/check-release.sh} to check the content of a given NDK
+installation directory, or an existing NDK package.</li>
+              <li>Rewrote the {@code tests/standalone/run.sh} standalone tests .</li>
+            </ul>
+          </li>
+          <li>Removed {@code if_dl.h} header from all platforms and architectures. The {@code
+AF_LINK} and {@code sockaddr_dl} elements it describes are specific to BSD (i.e., they don't exist
+in Linux).</li>
+        </ul>
+      </dd>
+    </dl>
+
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 8</a> <em>(May 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>This release of the NDK includes support for MIPS ABI and a few additional fixes.</p>
+
+    <dl>
+      <dt>New features:</dt>
+
+      <dd>
+        <ul>
+          <li>Added support for the MIPS ABI, which allows you to generate machine code that runs on
+            compatible MIPS-based Android devices. Major features for MIPS include MIPS-specific
+            toolchains, system headers, libraries and debugging support. For more details regarding
+            MIPS support, see {@code docs/CPU-MIPS.html} in the NDK package.
+
+              <p>By default, code is generated for ARM-based devices. You can add {@code mips} to
+              your {@code APP_ABI} definition in your {@code Application.mk} file to build
+              for MIPS platforms. For example, the following line instructs {@code ndk-build}
+              to build your code for three distinct ABIs:</p>
+
+              <pre>APP_ABI := armeabi armeabi-v7a <strong>mips</strong></pre>
+
+              <p>Unless you rely on architecture-specific assembly sources, such as ARM assembly
+              code, you should not need to touch your {@code Android.mk} files to build MIPS
+              machine code.</p>
+          </li>
+
+          <li>You can build a standalone MIPS toolchain using the {@code --arch=mips}
+          option when calling <code>make-standalone-toolchain.sh</code>. See
+          {@code docs/STANDALONE-TOOLCHAIN.html} for more details.
+          </li>
+        </ul>
+
+        <p class="note"><strong>Note:</strong> To ensure that your applications are available
+to users only if their devices are capable of running them, Google Play filters applications based
+on the instruction set information included in your application ? no action is needed on your part
+to enable the filtering. Additionally, the Android system itself also checks your application at
+install time and allows the installation to continue only if the application provides a library that
+is compiled for the device's CPU architecture.</p>
+      </dd>
+
+      <dt>Important bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed a typo in GAbi++ implementation where the result of {@code
+          dynamic_cast&lt;D&gt;(b)} of base class object {@code b} to derived class {@code D} is
+          incorrectly adjusted in the opposite direction from the base class.
+          (<a href="http://b.android.com/28721">Issue 28721</a>)
+          </li>
+          <li>Fixed an issue in which {@code make-standalone-toolchain.sh} fails to copy
+          {@code libsupc++.*}.</li>
+        </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed {@code ndk-build.cmd} to ensure that {@code ndk-build.cmd} works correctly even
+          if the user has redefined the {@code SHELL} environment variable, which may be changed
+          when installing a variety of development tools in Windows environments.
+          </li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 7c</a> <em>(April 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>This release of the NDK includes an important fix for Tegra2-based devices, and a few
+additional fixes and improvements:</p>
+
+    <dl>
+      <dt>Important bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed GNU STL armeabi-v7a binaries to not crash on non-NEON
+  devices. The files provided with NDK r7b were not configured properly,
+  resulting in crashes on Tegra2-based devices and others when trying to use
+  certain floating-point functions (e.g., {@code cosf}, {@code sinf}, {@code expf}).</li>
+        </ul>
+      </dd>
+
+      <dt>Important changes:</dt>
+
+      <dd>
+        <ul>
+          <li>Added support for custom output directories through the {@code NDK_OUT}
+  environment variable. When defined, this variable is used to store all
+  intermediate generated files, instead of {@code $PROJECT_PATH/obj}. The variable is
+  also recognized by {@code ndk-gdb}. </li>
+          <li>Added support for building modules with hundreds or even thousands of source
+  files by defining {@code LOCAL_SHORT_COMMANDS} to {@code true} in your {@code Android.mk}.
+            <p>This change forces the NDK build system to put most linker or archiver options
+  into list files, as a work-around for command-line length limitations.
+  See {@code docs/ANDROID-MK.html} for details.</p>
+          </li>
+        </ul>
+      </dd>
+
+      <dt>Other bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Fixed {@code android_getCpuCount()} implementation in the {@code cpufeatures}
+helper library. On certain devices, where cores are enabled dynamically by the system, the previous
+implementation would report the total number of <em>active</em> cores the first time the function
+was called, rather than the total number of <em>physically available</em> cores.</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 7b</a> <em>(February 2012)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other
+      improvements:</p>
+
+    <dl>
+      <dt>Important bug fixes:</dt>
+
+      <dd>
+        <ul>
+          <li>Updated {@code sys/atomics.h} to avoid correctness issues
+            on some multi-core ARM-based devices. Rebuild your unmodified sources with this
+            version of the NDK and this problem should be completely eliminated.
+            For more details, read {@code docs/ANDROID-ATOMICS.html}.</li>
+          <li>Reverted to {@code binutils} 2.19 to fix debugging issues that
+            appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li>
+          <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version
+            of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li>
+          <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not
+            affected. The fixes include:
+            <ul>
+              <li>Removed an infinite loop / stack overflow bug that happened when trying
+                to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of
+                your project path (e.g., in any sub-directory of it).</li>
+              <li>Fixed a problem where the auto-generated dependency files were ignored. This
+                meant that updating a header didn't trigger recompilation of sources that included
+                it.</li>
+              <li>Fixed a problem where special characters in files or paths, other than spaces and
+                quotes, were not correctly handled.</li>
+            </ul>
+          </li>
+          <li>Fixed the standalone toolchain to generate proper binaries when using
+            {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You
+            should use {@code -lgnustl_shared} if you want to link against the shared library
+            version or {@code -lstdc++} for the static version.
+
+            <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p>
+          </li>
+          <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find
+            {@code libsupc++.a} even though the file was at the right location.</li>
+          <li>Fixed Cygwin C++ link when not using any specific C++ runtime through
+            {@code APP_STL}.</li>
+        </ul>
+      </dd>
+    </dl>
+
+    <dl>
+      <dt>Other changes:</dt>
+
+      <dd>
+        <ul>
+          <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will
+            no longer forcibly enable exceptions and RTTI. This change results in smaller code.
+            <p>If you need these features, you must do one of the following:</p>
+            <ul>
+              <li>Enable exceptions and/or RTTI explicitly in your modules or
+                {@code Application.mk}. (recommended)</li>
+              <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'},
+                {@code 'rtti'} or both in your {@code Application.mk}. See
+                {@code docs/APPLICATION-MK.html} for more details.</li>
+            </ul>
+          </li>
+          <li>{@code ndk-gdb} now works properly when your application has private services
+            running in independent processes. It debugs the main application process, instead of the
+            first process listed by {@code ps}, which is usually a service process.</li>
+          <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value
+            and always compile certain source files (but not all) to 32-bit instructions.</li>
+          <li>{@code STLport}: Refresh the sources to match the Android platform version. This
+            update fixes a few minor bugs:
+            <ul>
+               <li>Fixed instantiation of an incomplete type</li>
+               <li>Fixed minor "==" versus "=" typo</li>
+               <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li>
+               <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN},
+                 etc.</li>
+             </ul>
+             <p>For complete details, see the commit log.</p>
+          </li>
+          <li>{@code STLport}: Removed 5 unnecessary static initializers from the library.</li>
+          <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for
+            armeabi instead. This change had no impact on correctness, but using the right
+            ABI should provide slightly better performance.</li>
+          <li>The {@code cpu-features} helper library was updated to report three optional
+            x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See
+            {@code docs/CPU-FEATURES.html} for more details.</li>
+          <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead
+            of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li>
+          <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current
+            directory when invoked.</li>
+          <li>Cygwin: Added better automatic dependency detection. In the previous version, it
+            didn't work properly in the following cases:
+            <ul>
+              <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li>
+              <li>When using drive-less mounts, for example, when Cygwin would translate
+                {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li>
+            </ul>
+          </li>
+          <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under
+            {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 7</a> <em>(November 2011)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>This release of the NDK includes new features to support the Android 4.0 platform as well
+    as many other additions and improvements:</p>
+
+    <dl>
+      <dt>New features</dt>
+
+      <dd>
+        <ul>
+          <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following
+          native features to the platform:
+
+            <ul>
+              <li>Added native multimedia API based on the Khronos Group OpenMAX AL? 1.0.1
+              standard. The new <code>&lt;OMXAL/OpenMAXAL.h&gt;</code> and
+              <code>&lt;OMXAL/OpenMAXAL_Android.h&gt;</code> headers allow applications targeting
+              API level 14 to perform multimedia output directly from native code by using a new
+              Android-specific buffer queue interface. For more details, see
+              <code>docs/openmaxal/index.html</code> and <a href=
+              "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li>
+
+              <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1?
+              standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC,
+              Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and
+              <a href=
+              "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li>
+            </ul>
+          </li>
+
+          <li>Added CCache support. To speed up large rebuilds, define the
+          <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to
+          your <code>ccache</code> binary). When declared, the NDK build system automatically
+          uses CCache when compiling any source file. For example:
+            <pre>
+export NDK_CCACHE=ccache
+</pre>
+          <p class="note"><strong>Note:</strong> CCache is not included in the NDK release
+          so you must have it installed prior to using it. For more information about CCache, see
+          <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p>
+          </li>
+
+          <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that
+          you want to build your NDK modules for all the ABIs supported by your given NDK
+          release. This means that either one of the following two lines in your
+          <code>Application.mk</code> are equivalent with this release:
+            <pre>
+APP_ABI := all
+APP_ABI := armeabi armeabi-v7a x86
+</pre>
+
+            <p>This also works if you define <code>APP_ABI</code> when calling
+            <code>ndk-build</code> from the command-line, which is a quick way to check that your
+            project builds for all supported ABIs without changing the project's
+            <code>Application.mk file</code>. For example:</p>
+            <pre>
+ndk-build APP_ABI=all
+</pre>
+          </li>
+
+          <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that
+          allows you to declare which C++ features (RTTI or Exceptions) your module uses. This
+          ensures that the final linking works correctly if you have prebuilt modules that depend
+          on these features. See <code>docs/ANDROID-MK.html</code> and
+          <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li>
+
+          <li>Shortened paths to source and object files that are used in build commands. When
+          invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source,
+          object, and binary files that are passed to the build commands are significantly
+          shorter now, because they are passed relative to the current directory. This is useful
+          when building projects with a lot of source files, to avoid limits on the maximum
+          command line length supported by your host operating system. The behavior is unchanged
+          if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if
+          you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li>
+        </ul>
+      </dd>
+
+      <dt>Experimental features</dt>
+
+      <dd>
+        You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the
+        <code>ndk-build.cmd</code> script from the command line from your project path. The
+        script takes exactly the same arguments as the original <code>ndk-build</code> script.
+        The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other
+        tools required by the build. You should not need to install anything else to get a
+        working build system.
+
+        <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on
+        Windows, so you still need Cygwin to debug.</p>
+
+        <p>This feature is still experimental, so feel free to try it and report issues on the
+        <a href="http://b.android.com">public bug database</a> or <a href=
+        "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests
+        shipped with the NDK succesfully compile with this feature.</p>
+      </dd>
+
+      <dt>Important bug fixes</dt>
+
+      <dd>
+        <ul>
+          <li>Imported shared libraries are now installed by default to the target installation
+          location (<code>libs/&lt;abi&gt;</code>) if <code>APP_MODULES</code> is not defined in
+          your <code>Application.mk</code>. For example, if a top-level module <code>foo</code>
+          imports a module <code>bar</code>, then both <code>libfoo.so</code> and
+          <code>libbar.so</code> are copied to the install location. Previously, only
+          <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your
+          <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the
+          behavior is unchanged.</li>
+
+          <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in
+          their MAIN intent filters.</li>
+
+          <li>Static library imports are now properly transitive. For example, if a top-level
+          module <code>foo</code> imports static library <code>bar</code> that imports static
+          library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both
+          <code>libbar.a</code> and <code>libzoo.a</code>.</li>
+        </ul>
+      </dd>
+
+      <dt>Other changes</dt>
+
+      <dd>
+        <ul>
+          <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be
+          9, not 8 for native activities.</li>
+
+          <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a
+          supported stable API, starting from API level 9.</li>
+
+          <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain
+          sources from <a href="http://android.googlesource.com">android.googlesource.com</a>,
+          which is the new location for the AOSP servers.</li>
+
+          <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it
+          are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li>
+
+          <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds
+          to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at
+          <code>docs/CPLUSPLUS-SUPPORT.html</code></li>
+
+          <li>Added support for RTTI in the STLport C++ runtimes (no support for
+          exceptions).</li>
+
+          <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For
+          example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources,
+          declare the following:
+            <pre>
+LOCAL_CPP_EXTENSION := .cpp .cxx
+</pre>
+          </li>
+
+          <li>Removed many unwanted exported symbols from the link-time shared system libraries
+          provided by the NDK. This ensures that code generated with the standalone toolchain
+          doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a
+          symbol that changes each time the toolchain used to build the platform is changed)</li>
+
+          <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note
+          that this does <em>not</em> change the NDK ABIs for the corresponding libraries,
+          because each extension must be probed at runtime by the client application.
+
+            <p>The extensions that are available depend on your actual device and GPU drivers,
+            not the platform version the device runs on. The header changes simply add new
+            constants and types to make it easier to use the extensions when they have been
+            probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The
+            following list describes the newly supported extensions:</p>
+
+            <dl>
+              <dt>GLES 1.x</dt>
+
+              <dd>
+                <ul>
+                  <li><code>GL_OES_vertex_array_object</code></li>
+
+                  <li><code>GL_OES_EGL_image_external</code></li>
+
+                  <li><code>GL_APPLE_texture_2D_limited_npot</code></li>
+
+                  <li><code>GL_EXT_blend_minmax</code></li>
+
+                  <li><code>GL_EXT_discard_framebuffer</code></li>
+
+                  <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+                  <li><code>GL_EXT_read_format_bgra</code></li>
+
+                  <li><code>GL_EXT_texture_filter_anisotropic</code></li>
+
+                  <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+                  <li><code>GL_EXT_texture_lod_bias</code></li>
+
+                  <li><code>GL_IMG_read_format</code></li>
+
+                  <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+                  <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li>
+
+                  <li><code>GL_IMG_user_clip_plane</code></li>
+
+                  <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+                  <li><code>GL_NV_fence</code></li>
+
+                  <li><code>GL_QCOM_driver_control</code></li>
+
+                  <li><code>GL_QCOM_extended_get</code></li>
+
+                  <li><code>GL_QCOM_extended_get2</code></li>
+
+                  <li><code>GL_QCOM_perfmon_global_mode</code></li>
+
+                  <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+                  <li><code>GL_QCOM_tiled_rendering</code></li>
+                </ul>
+              </dd>
+
+              <dt>GLES 2.0</dt>
+
+              <dd>
+                <ul>
+                  <li><code>GL_OES_element_index_uint</code></li>
+
+                  <li><code>GL_OES_get_program_binary</code></li>
+
+                  <li><code>GL_OES_mapbuffer</code></li>
+
+                  <li><code>GL_OES_packed_depth_stencil</code></li>
+
+                  <li><code>GL_OES_texture_3D</code></li>
+
+                  <li><code>GL_OES_texture_float</code></li>
+
+                  <li><code>GL_OES_texture_float_linear</code></li>
+
+                  <li><code>GL_OES_texture_half_float_linear</code></li>
+
+                  <li><code>GL_OES_texture_npot</code></li>
+
+                  <li><code>GL_OES_vertex_array_object</code></li>
+
+                  <li><code>GL_OES_EGL_image_external</code></li>
+
+                  <li><code>GL_AMD_program_binary_Z400</code></li>
+
+                  <li><code>GL_EXT_blend_minmax</code></li>
+
+                  <li><code>GL_EXT_discard_framebuffer</code></li>
+
+                  <li><code>GL_EXT_multi_draw_arrays</code></li>
+
+                  <li><code>GL_EXT_read_format_bgra</code></li>
+
+                  <li><code>GL_EXT_texture_format_BGRA8888</code></li>
+
+                  <li><code>GL_EXT_texture_compression_dxt1</code></li>
+
+                  <li><code>GL_IMG_program_binary</code></li>
+
+                  <li><code>GL_IMG_read_format</code></li>
+
+                  <li><code>GL_IMG_shader_binary</code></li>
+
+                  <li><code>GL_IMG_texture_compression_pvrtc</code></li>
+
+                  <li><code>GL_IMG_multisampled_render_to_texture</code></li>
+
+                  <li><code>GL_NV_coverage_sample</code></li>
+
+                  <li><code>GL_NV_depth_nonlinear</code></li>
+
+                  <li><code>GL_QCOM_extended_get</code></li>
+
+                  <li><code>GL_QCOM_extended_get2</code></li>
+
+                  <li><code>GL_QCOM_writeonly_rendering</code></li>
+
+                  <li><code>GL_QCOM_tiled_rendering</code></li>
+                </ul>
+              </dd>
+
+              <dt>EGL</dt>
+
+              <dd>
+                <ul>
+                  <li><code>EGL_ANDROID_recordable</code></li>
+
+                  <li><code>EGL_NV_system_time</code></li>
+                </ul>
+              </dd>
+            </dl>
+          </li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 6b</a> <em>(August 2011)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>This release of the NDK does not include any new features compared to r6. The r6b release
+      addresses the following issues in the r6 release:</p>
+      <dl>
+        <dt>Important bug fixes</dt>
+        <dd>
+          <ul>
+            <li>Fixed the build when <code>APP_ABI="armeabi x86"</code> is used for
+            multi-architecture builds.</li>
+            <li>Fixed the location of prebuilt STLport binaries in the NDK release package.
+            A bug in the packaging script placed them in the wrong location.</li>
+            <li>Fixed <code>atexit()</code> usage in shared libraries with the x86standalone
+            toolchain.</li>
+            <li>Fixed <code>make-standalone-toolchain.sh --arch=x86</code>. It used to fail
+            to copy the proper GNU libstdc++ binaries to the right location.</li>
+            <li>Fixed the standalone toolchain linker warnings about missing the definition and
+            size for the <code>__dso_handle</code> symbol (ARM only).</li>
+            <li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds.
+            See the <a href="http://b.android.com/18540">bug</a> for
+            more information.</li>
+            <li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in
+            x86-specific systems when they are used with the x86 standalone toolchain.</li>
+          </ul>
+        </dd>
+      </dl>
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 6</a> <em>(July 2011)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>This release of the NDK includes support for the x86 ABI and other minor changes.
+      For detailed information describing the changes in this release, read the
+      <code>CHANGES.HTML</code> document included in the NDK package.
+      </p>
+      <dl>
+        <dt>General notes:</dt>
+        <dd>
+          <ul>
+            <li>Adds support for the x86 ABI, which allows you to generate machine code
+            that runs on compatible x86-based Android devices. Major features for x86
+            include x86-specific toolchains, system headers, libraries and
+            debugging support. For all of the details regarding x86 support,
+            see <code>docs/CPU-X86.html</code> in the NDK package.
+
+              <p>By default, code is generated for ARM-based devices, but you can add x86 to your
+              <code>APP_ABI</code> definition in your <code>Application.mk</code> file to build
+              for x86 platforms. For example, the following line instructs <code>ndk-build</code>
+              to build your code for three distinct ABIs:</p>
+
+              <pre>APP_ABI := armeabi armeabi-v7a x86</pre>
+
+              <p>Unless you rely on ARM-based assembly sources, you shouldn't need to touch
+              your <code>Android.mk</code> files to build x86 machine code.</p>
+
+            </li>
+
+            <li>You can build a standalone x86 toolchain using the
+<code>--toolchain=x86-4.4.3</code>
+            option when calling <code>make-standalone-toolchain.sh</code>. See
+            <code>docs/STANDALONE-TOOLCHAIN.html</code> for more details.
+            </li>
+            <li>The new <code>ndk-stack</code> tool lets you translate stack traces in
+            <code>logcat</code> that are generated by native code. The tool translates
+            instruction addresses into a readable format that contains things such
+            as the function, source file, and line number corresponding to each stack frame.
+            For more information and a usage example, see <code>docs/NDK-STACK.html</code>.
+            </li>
+          </ul>
+        </dd>
+        <dt>Other changes:</dt>
+        <dd><code>arm-eabi-4.4.0</code>, which had been deprecated since NDK r5, has been
+        removed from the NDK distribution.</dd>
+
+      </dl>
+    </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 5c</a> <em>(June 2011)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+    <p>This release of the NDK does not include any new features compared to r5b. The r5c release
+    addresses the following problems in the r5b release:</p>
+    <dl>
+      <dt>Important bug fixes:</dt>
+      <dd>
+        <ul>
+          <li><code>ndk-build</code>: Fixed a rare bug that appeared when trying to perform parallel
+          builds of debuggable projects.</li>
+
+          <li>Fixed a typo that prevented <code>LOCAL_WHOLE_STATIC_LIBRARIES</code> to work
+          correctly with the new toolchain and added documentation for this in
+          <code>docs/ANDROID-MK.html</code>.</li>
+
+          <li>Fixed a bug where code linked against <code>gnustl_static</code> crashed when run on
+          platform releases older than API level 8 (Android 2.2).</li>
+
+          <li><code>ndk-gdb</code>: Fixed a bug that caused a segmentation fault when debugging
+Android 3.0
+          or newer devices.</li>
+
+          <li><code>&lt;android/input.h&gt;</code>: Two functions that were introduced in API level
+          9 (Android 2.3) were incorrect and are fixed. While this breaks the source API, the
+          binary interface to the system is unchanged. The incorrect functions were missing a
+          <code>history_index</code> parameter, and the correct definitions are shown below:
+<pre>
+float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event,
+                                           size_t pointer_index,
+                                           size_t history_index);
+
+float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event,
+                                           size_t pointer_index,
+                                           size_t history_index);
+</pre>
+          </li>
+
+          <li>Updated the C library ARM binary for API level 9 (Android 2.3) to correctly expose at
+          link time new functions that were added in that API level (for example,
+          <code>pthread_rwlock_init</code>).</li>
+
+        </ul>
+      </dd>
+
+      <dt>Minor improvements and fixes:</dt>
+      <dd>
+        <ul>
+          <li>Object files are now always linked in the order they appear in
+          <code>LOCAL_SRC_FILES</code>. This was not the case previously because the files were
+          grouped by source extensions instead.</li>
+
+          <li>When <code>import-module</code> fails, it now prints the list of directories that
+          were searched. This is useful to check that the <code>NDK_MODULE_PATH</code> definition
+          used by the build system is correct.</li>
+
+          <li>When <code>import-module</code> succeeds, it now prints the directory where the
+          module was found to the log (visible with <code>NDK_LOG=1</code>).</li>
+
+          <li>Increased the build speed of debuggable applications when there is a very large number
+          of include directories in the project.</li>
+
+          <li><code>ndk-gdb</code>: Better detection of <code>adb shell</code> failures and improved
+          error messages.</li>
+
+          <li><code>&lt;pthread.h&gt;</code>: Fixed the definition of
+          <code>PTHREAD_RWLOCK_INITIALIZER</code> for API level 9 (Android 2.3) and higher.</li>
+
+          <li>Fixed an issue where a module could import itself, resulting in an infinite loop in
+          GNU Make.</li>
+
+          <li>Fixed a bug that caused the build to fail if <code>LOCAL_ARM_NEON</code> was set to
+          true (typo in <code>build/core/build-binary.mk</code>).</li>
+
+          <li>Fixed a bug that prevented the compilation of <code>.s</code> assembly files
+          (<code>.S</code> files were okay).</li>
+        </ul>
+      </dd>
+    </dl>
+  </div>
+</div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 5b</a> <em>(January 2011)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>This release of the NDK does not include any new features compared to r5. The r5b release
+addresses the
+      following problems in the r5 release:
+      </p>
+      <ul>
+    <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special
+    toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on
+Ubuntu 8.04 or higher. </li>
+    <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain.
+    The previous binary generated invalid thumb instruction sequences when
+    dealing with signed chars.</li>
+    <li>Adds missing documentation for the
+    "gnustl_static" value for APP_STL, that allows you to link against
+    a static library version of GNU libstdc++. </li> the
+    <li>Fixed the following <code>ndk-build</code> issues:
+      <ul>
+        <li>A bug that created inconsistent dependency files when a
+        compilation error occured on Windows. This prevented a proper build after
+        the error was fixed in the source code.</li>
+        <li>A Cygwin-specific bug where using very short paths for
+        the Android NDK installation or the project path led to the
+        generation of invalid dependency files. This made incremental builds
+        impossible.</li>
+        <li>A typo that prevented the cpufeatures library from working correctly
+        with the new NDK toolchain.</li>
+        <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code>
+        from GNU Make for every source or object file, which caused problems
+        with very large source trees. In case this doesn't work properly, define
+<code>NDK_USE_CYGPATH=1</code> in your
+        environment to use <code>cygpath -m</code> again.</li>
+        <li>The Cygwin installation now notifies the user of invalid installation paths that
+contain spaces. Previously, an invalid path
+        would output an error that complained about an incorrect version of GNU Make, even if the
+right one was installed.
+      </ul>
+    </li>
+  <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from
+working properly when
+  it contained multiple directories separated with a colon. </li>
+  <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit
+  generated machine code, instead of relying on the host tag, which
+  allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts
+now also support
+  using a 32-bit host toolchain.</li>
+  <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to
+<code>&lt;netinet/in.h&gt;</code>.</li>
+  <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and
+<code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code>&lt;netinet/in6.h&gt;</code>.</li>
+  <li>'asm' was replaced with '__asm__' in <code>&lt;asm/byteorder.h&gt;</code> to allow
+compilation with <code>-std=c99</code>.</li>
+  </ul>
+  </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 5</a> <em>(December 2010)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>This release of the NDK includes many new APIs, most of which are introduced to
+         support the development of games and similar applications that make extensive use
+         of native code. Using the APIs, developers have direct native access to events, audio,
+         graphics and window management, assets, and storage. Developers can also implement the
+         Android application lifecycle in native code with help from the new
+         {@link android.app.NativeActivity} class. For detailed information describing the changes
+in this
+         release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK
+package.
+      </p>
+      <dl>
+        <dt>General notes:</dt>
+        <dd>
+          <ul>
+            <li>Adds support for native activities, which allows you to implement the
+            Android application lifecycle in native code.</li>
+
+            <li>Adds native support for the following:
+
+              <ul>
+
+                <li>Input subsystem (such as the keyboard and touch screen)</li>
+
+                <li>Access to sensor data (accelerometer, compass, gyroscope, etc).</li>
+
+                <li>Event loop APIs to wait for things such as input and sensor events.</li>
+
+                <li>Window and surface subsystem</li>
+
+                <li>Audio APIs based on the OpenSL ES standard that support playback and recording
+                as well as control over platform audio effects</li>
+
+                <li>Access to assets packaged in an <code>.apk</code> file.</li>
+
+              </ul>
+            </li>
+
+            <li>Includes a new toolchain (based on GCC 4.4.3), which generates better code, and can
+also now
+            be used as a standalone cross-compiler, for people who want to build their stuff with
+            <code>./configure &amp;&amp; make</code>. See
+            docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still
+provided,
+            but the 4.2.1 binaries were removed.</li>
+
+            <li>Adds support for prebuilt static and shared libraries (docs/PREBUILTS.html) and
+module
+            exports and imports to make sharing and reuse of third-party modules much easier
+            (docs/IMPORT-MODULE.html explains why).</li>
+
+            <li>Provides a default C++ STL implementation (based on STLport) as a helper module. It
+can be used either
+            as a static or shared library (details and usage examples are in
+sources/android/stlport/README). Prebuilt
+            binaries for STLport (static or shared) and GNU libstdc++ (static only) are also
+provided if you choose to
+            compile against those libraries instead of the default C++ STL implementation.
+            C++ Exceptions and RTTI are not supported in the default STL implementation. For more
+information, see
+            docs/CPLUSPLUS-SUPPORT.HTML.</li>
+
+            <li>Includes improvements to the <code>cpufeatures</code> helper library that improves
+reporting
+            of the CPU type (some devices previously reported ARMv7 CPU when the device really was
+an ARMv6). We
+            recommend developers that use this library to rebuild their applications then
+            upload to Google Play to benefit from the improvements.</li>
+
+            <li>Adds an EGL library that lets you create and manage OpenGL ES textures and
+              services.</li>
+
+            <li>Adds new sample applications, <code>native-plasma</code> and
+<code>native-activity</code>,
+            to demonstrate how to write a native activity.</li>
+
+            <li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a
+more
+              detailed list of changes.</li>
+          </ul>
+        </dd>
+      </dl>
+    </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 4b</a> <em>(June 2010)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <dl>
+        <dt>NDK r4b notes:</dt>
+
+        <dd>
+          <p>Includes fixes for several issues in the NDK build and debugging scripts &mdash; if
+          you are using NDK r4, we recommend downloading the NDK r4b build. For detailed
+          information describing the changes in this release, read the CHANGES.TXT document
+          included in the downloaded NDK package.</p>
+        </dd>
+      </dl>
+
+      <dl>
+        <dt>General notes:</dt>
+
+        <dd>
+          <ul>
+            <li>Provides a simplified build system through the new <code>ndk-build</code> build
+            command.</li>
+
+            <li>Adds support for easy native debugging of generated machine code on production
+            devices through the new <code>ndk-gdb</code> command.</li>
+
+            <li>Adds a new Android-specific ABI for ARM-based CPU architectures,
+            <code>armeabi-v7a</code>. The new ABI extends the existing <code>armeabi</code> ABI to
+            include these CPU instruction set extensions:
+
+              <ul>
+                <li>Thumb-2 instructions</li>
+
+                <li>VFP hardware FPU instructions (VFPv3-D16)</li>
+
+                <li>Optional support for ARM Advanced SIMD (NEON) GCC intrinsics and VFPv3-D32.
+                Supported by devices such as Verizon Droid by Motorola, Google Nexus One, and
+                others.</li>
+              </ul>
+            </li>
+
+            <li>Adds a new <code>cpufeatures</code> static library (with sources) that lets your
+            app detect the host device's CPU features at runtime. Specifically, applications can
+            check for ARMv7-A support, as well as VFPv3-D32 and NEON support, then provide separate
+            code paths as needed.</li>
+
+            <li>Adds a sample application, <code>hello-neon</code>, that illustrates how to use the
+            <code>cpufeatures</code> library to check CPU features and then provide an optimized
+            code path using NEON instrinsics, if supported by the CPU.</li>
+
+            <li>Lets you generate machine code for either or both of the instruction sets supported
+            by the NDK. For example, you can build for both ARMv5 and ARMv7-A architectures at the
+            same time and have everything stored to your application's final
+            <code>.apk</code>.</li>
+
+            <li>To ensure that your applications are available to users only if their devices are
+            capable of running them, Google Play now filters applications based on the
+            instruction set information included in your application &mdash; no action is needed on
+            your part to enable the filtering. Additionally, the Android system itself also checks
+            your application at install time and allows the installation to continue only if the
+            application provides a library that is compiled for the device's CPU architecture.</li>
+
+            <li>Adds support for Android 2.2, including a new stable API for accessing the pixel
+            buffers of {@link android.graphics.Bitmap} objects from native code.</li>
+          </ul>
+        </dd>
+      </dl>
+    </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 3</a> <em>(March 2010)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <dl>
+        <dt>General notes:</dt>
+
+        <dd>
+          <ul>
+            <li>Adds OpenGL ES 2.0 native library support.</li>
+
+            <li>Adds a sample application,<code>hello-gl2</code>, that illustrates the use of
+            OpenGL ES 2.0 vertex and fragment shaders.</li>
+
+            <li>The toolchain binaries have been refreshed for this release with GCC 4.4.0, which
+            should generate slightly more compact and efficient machine code than the previous one
+            (4.2.1). The NDK also still provides the 4.2.1 binaries, which you can optionally use
+            to build your machine code.</li>
+          </ul>
+        </dd>
+      </dl>
+    </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 2</a> <em>(September 2009)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>Originally released as "Android 1.6 NDK, Release 1".</p>
+
+      <dl>
+        <dt>General notes:</dt>
+
+        <dd>
+          <ul>
+            <li>Adds OpenGL ES 1.1 native library support.</li>
+
+            <li>Adds a sample application, <code>san-angeles</code>, that renders 3D graphics
+            through the native OpenGL ES APIs, while managing activity lifecycle with a {@link
+            android.opengl.GLSurfaceView} object.</li>
+          </ul>
+        </dd>
+      </dl>
+    </div>
+  </div>
+
+<div class="toggle-content closed">
+  <p><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
+      alt="">Android NDK, Revision 1</a> <em>(June 2009)</em>
+  </p>
+
+  <div class="toggle-content-toggleme">
+      <p>Originally released as "Android 1.5 NDK, Release 1".</p>
+
+      <dl>
+        <dt>General notes:</dt>
+
+        <dd>
+          <ul>
+            <li>Includes compiler support (GCC) for ARMv5TE instructions, including Thumb-1
+            instructions.</li>
+
+            <li>Includes system headers for stable native APIs, documentation, and sample
+            applications.</li>
+          </ul>
+        </dd>
+      </dl>
+    </div>
+  </div>
+
+
+
+
+
+<!-- ####################### END OF RELEASE NOTES ####################### -->
diff --git a/docs/html-ndk/ndk/guides/abis.jd b/docs/html-ndk/ndk/guides/abis.jd
index 81604b5..ee55898 100644
--- a/docs/html-ndk/ndk/guides/abis.jd
+++ b/docs/html-ndk/ndk/guides/abis.jd
@@ -14,7 +14,7 @@
   </div>
 
 <p>Different Android handsets use different CPUs, which in turn support different instruction sets.
-Each combination of CPU and instruction set(s) has its own Application Binary Interface, or
+Each combination of CPU and instruction sets has its own Application Binary Interface, or
 <i>ABI</i>. The ABI defines, with great precision, how an application's machine code is supposed to
 interact with the system at runtime. You must specify an ABI for each CPU architecture you want
 your app to work with.</p>
@@ -59,7 +59,7 @@
 </tr>
 
 <tr>
-<td><a href="#v7a">{@code armeabi-v7a}</a></td>
+<td><a href="#v7a">{@code armeabi-v7a} ({@code armeabi-v7a-hard)}</a></td>
 <td>
 <li>armeabi</li>
 <li>Thumb-2</li>
@@ -158,7 +158,8 @@
 <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0210c/CACBCAAE.html">
 Thumb (a.k.a. Thumb-1) instruction set</a>. The NDK generates Thumb
 code by default unless you specify different behavior using the
-<code>LOCAL_ARM_MODE</code> variable in your <a href="android_mk.html"><code>Android.mk</code></a>
+<code>LOCAL_ARM_MODE</code> variable in your
+<a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a>
 file.</p>
 
 <h3 id="v7a">armeabi-v7a (armeabi-v7a-hard)</h3>
@@ -186,7 +187,7 @@
 instruction sets on x86 CPUs.</p>
 
 <p>For information about how to perform these runtime checks, refer to
-<a href="{@docRoot}ndk/guides/cpu-features.html">CPU Features</a>.
+<a href="{@docRoot}ndk/guides/cpu-features.html">The {@code cpufeatures} Library</a>.
 Also, for information about the NDK's support for building
 machine code for NEON, see
 <a href="{@docRoot}ndk/guides/cpu-arm-neon.html">NEON Support</a>.</p>
@@ -250,7 +251,7 @@
 CPUs.</p>
 <p> For more information on compiler flags, particularly related to performance optimization,
 refer to <a href="http://software.intel.com/blogs/2012/09/26/gcc-x86-performance-hints">GCC
-x86 Performance</a>.</p>
+x86 performance hints</a>.</p>
 </li>
 <li>Use of the standard Linux x86 32-bit calling convention, as opposed to the one for SVR. For
 more information, see section 6, "Register Usage", of
@@ -377,7 +378,7 @@
 <h2 id="gc">Generating Code for a Specific ABI</h2>
 <p>By default, the NDK generates machine code for the armeabi ABI. You can
 generate ARMv7-a-compatible machine code, instead, by adding the following line
-to your <a href="{docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file.</p>
+to your <a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file.</p>
 <pre class="no-pretty-print">
 APP_ABI := armeabi-v7a
 </pre>
@@ -391,7 +392,7 @@
 
 <p>This setting tells the NDK to build two versions of your machine code: one
 for each ABI listed on this line. For more information on the values you can specify for the
-{@code APP_ABI} variable, see <a href="{docRoot}ndk/guides/android_mk.html">Android.mk</a>.
+{@code APP_ABI} variable, see <a href="{@docRoot}ndk/guides/android_mk.html">Android.mk</a>.
 </p>
 
 <p>When you build multiple machine-code versions, the build system copies the libraries to your
@@ -490,4 +491,4 @@
 {@code data} directory ({@code data/data/&lt;package_name&gt;/lib/}).</p>
 
 <p>If there is no shared-object file at all, the application builds and installs, but crashes at
-runtime.</p>
\ No newline at end of file
+runtime.</p>
diff --git a/docs/html-ndk/ndk/guides/android_mk.jd b/docs/html-ndk/ndk/guides/android_mk.jd
index da94679..8d0a8b1 100644
--- a/docs/html-ndk/ndk/guides/android_mk.jd
+++ b/docs/html-ndk/ndk/guides/android_mk.jd
@@ -9,9 +9,7 @@
         <li><a href="#over">Overview</a></li>
         <li><a href="#basics">Basics</a></li>
         <li><a href="#var">Variables and Macros</a></li>
-        <li><a href="#npv">NDK-provided variables</a></li>
-        <li><a href="#npfm">NDK-provided function macros</a></li>
-        <li><a href="#mdv">Module-description variables</a></li>
+        <li><a href="#mdv">Module-Description Variables</a></li>
       </ol>
     </div>
   </div>
@@ -24,7 +22,8 @@
 <p>The {@code Android.mk} file resides in a subdirectory of your project's {@code jni/} directory,
 and describes your sources and shared libraries to the build system. It is really a tiny GNU
 makefile fragment that the build system parses once or more. The {@code Android.mk} file is useful
-for defining project-wide settings that {@code Application.mk}, the build system, and your
+for defining project-wide settings that <a href="{@docRoot}ndk/guides/application_mk.html">{@code
+Application.mk}</a>, the build system, and your
 environment variables leave undefined. It can also override project-wide settings for specific
 <i>modules</i>.</p>
 
@@ -84,7 +83,7 @@
 
 <p>Each module name must be unique and not contain any spaces. The build system, when it
 generates the final shared-library file, automatically adds the proper prefix and suffix to
-the name that you assign to {@code LOCAL_MODULE|. For example, the example that appears above
+the name that you assign to {@code LOCAL_MODULE}. For example, the example that appears above
 results in generation of a library called {@code libhello-jni.so}.</p>
 
 <p class="note"><strong>Note:</strong> If your module's name already starts with {@code lib}, the
@@ -114,10 +113,10 @@
 script determines what to build, and how to do it.</p>
 
 <p>There are more complex examples in the samples directories, with commented
-{@code Android.mk} files that you can look at. In addition, the
-<a href="{@docRoot}ndk/guides/native-activity.html">walkthrough</a> of the native-activity sample
-disucsses that sample's {@code Android.mk} file in some detail. Finally, the next section explains
-the variables from this section in a bit more detail.
+{@code Android.mk} files that you can look at. In addition,
+<a href="{@docRoot}ndk/guides/sample_na.html">Sample: native-activity</a> provides
+a detailed explanation of that sample's {@code Android.mk} file. Finally, <a href="#var">
+Variables and Macros</a> provides further information on the variables from this section.
 
 
 <h2 id="var">Variables and Macros</h2>
@@ -155,7 +154,7 @@
 you provided in your {@code LOCAL_XXX} variables, and determines how to build a target shared
 library from the sources you listed. Note that using this script requires that you have already
 assigned values to {@code LOCAL_MODULE} and {@code LOCAL_SRC_FILES}, at a minimum (for more
-information about these variables, see <a href = "#mdv">Module-description variables</a>).</p>
+information about these variables, see <a href = "#mdv">Module-Description Variables</a>).</p>
 
 <p>The syntax for using this variable is:</p>
 
@@ -190,23 +189,14 @@
 </pre>
 
 <p>You can also reference a prebuilt library in another module by using the
-{@code LOCAL_PREBUILTS} variable. The following example shows an example of using
-{@code LOCAL_PREBUILTS}:
-
-<!--
-<pre class="no-pretty-print">
-(TODO: Example of referencing prebuilt library from another, using LOCAL_PREBUILTS.)
-</pre>
--->
-
-<p>For more information about using prebuilts, see <a href="{@docRoot}ndk/guides/prebuilts.html">
-NDK Prebuilt Library Support</a>.</p>
+{@code LOCAL_PREBUILTS} variable. For more information about using prebuilts, see
+<a href="{@docRoot}ndk/guides/prebuilts.html">Using Prebuilt Libraries</a>.</p>
 
 
 <h4>PREBUILT_STATIC_LIBRARY</h4>
 <p>The same as {@code PREBUILT_SHARED_LIBRARY}, but for a prebuilt static library. For more
-information about using prebuilts, see <a href="{@docRoot}ndk/guides/prebuilts.html">NDK Prebuilt
-Library Support</a>.</p>
+information about using prebuilts, see <a href="{@docRoot}ndk/guides/prebuilts.html">Using Prebuilt
+Libraries</a>.</p>
 
 <h4>TARGET_ARCH</h4>
 <p>The name of the target CPU architecture as the Android Open Source Project specifies it.
@@ -214,14 +204,13 @@
 ABI (see TARGET_ARCH_ABI, below).</p>
 
 <p>The value of this variable is taken from the APP_ABI variable that you define in the
-<a href="{docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a> file, which the system
-reads ahead of parsing the {@code Android.mk} file.</p>
+{@code Android.mk} file, which the system reads ahead of parsing the {@code Android.mk} file.</p>
 
 <h4>TARGET_PLATFORM</h4>
 <p>The Android API level number for the build system to target.
 For example, the Android 5.1 system images correspond to Android API level 22: {@code android-22}.
 For a complete list of platform names and corresponding Android system
-images, see <a href="{@docRoot}ndk/guides/stable_apis.html">Android NDK Stable APIs</a>.
+images, see <a href="{@docRoot}ndk/guides/stable_apis.html">Android NDK Native APIs</a>.
 The following example shows the syntax for using this variable:</p>
 
 <pre class="no-pretty-print">
@@ -242,36 +231,36 @@
     <th scope="col">Setting</th>
   </tr>
   <tr>
-    <th scope="col">ARMv5TE</th>
-    <th scope="col">{@code armeabi}</th>
+    <td>ARMv5TE</td>
+    <td>{@code armeabi}</td>
   </tr>
   <tr>
-    <th scope="col">ARMv7</th>
-    <th scope="col">{@code armeabi-v7a}</th>
+    <td>ARMv7</td>
+    <td>{@code armeabi-v7a}</td>
   </tr>
   <tr>
-    <th scope="col">ARMv8 AArch64</th>
-    <th scope="col">{@code arm64-v8a}</th>
+    <td>ARMv8 AArch64</td>
+    <td>{@code arm64-v8a}</td>
   </tr>
   <tr>
-    <th scope="col">i686</th>
-    <th scope="col">{@code x86}</th>
+    <td>i686</td>
+    <td>{@code x86}</td>
   </tr>
   <tr>
-    <th scope="col">x86-64</th>
-    <th scope="col">{@code x86_64}</th>
+    <td>x86-64</td>
+    <td>{@code x86_64}</td>
   </tr>
   <tr>
-    <th scope="col">mips32 (r1)</th>
-    <th scope="col">{@code mips}</th>
+    <td>mips32 (r1)</td>
+    <td>{@code mips}</td>
   </tr>
   <tr>
-    <th scope="col">mips64 (r6)</th>
-    <th scope="col">{@code mips64}</th>
+    <td>mips64 (r6)</td>
+    <td>{@code mips64}</td>
   </tr>
   <tr>
-    <th scope="col">All</th>
-    <th scope="col">{@code all}</th>
+    <td>All</td>
+    <td>{@code all}</td>
   </tr>
 </table>
 
@@ -286,8 +275,7 @@
 
 <p>For more details about architecture ABIs and associated compatibility
 issues, refer to
-<a href="{@docRoot}ndk/guides/md_3__key__topics__c_p_u__support__chapter_1-section_8__a_b_is.html">
-Android Native CPU ABI Management</a></p>
+<a href="{@docRoot}ndk/guides/abis.html">ABI Management</a>.</p>
 
 <p>New target ABIs in the future will have different values.</p>
 
@@ -303,7 +291,7 @@
 <p class="note"><strong>Note:</strong> Up to Android NDK 1.6_r1, the default value was
 {@code android-3-arm}.</p>
 
-<h2 id="mdv">Module-description variables</h2>
+<h2 id="mdv">Module-Description Variables</h2>
 <p>The variables in this section describe your module to the build system. Each module description
 should follow this basic flow:
 <ul>
@@ -332,7 +320,8 @@
 and must not contain any spaces. You must define it before including any scripts (other than
 the one for {@code CLEAR_VARS}). You need not add either the {@code lib} prefix
 or the {@code .so} or {@code .a} file extension; the build system makes these modifications
-automatically. Throughout your {@code Android.mk} and {@code Application.mk} files, refer to
+automatically. Throughout your {@code Android.mk} and
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> files, refer to
 your module by its unmodified name. For example, the following line results in the generation of a
 shared library module called {@code libfoo.so}:</p>
 
@@ -365,8 +354,7 @@
 system automatically computes any associated depencies.</p>
 <p>Note that you can use both relative (to {@code LOCAL_PATH}) and absolute file paths.
 
-<p>We recommend avoiding absolute file paths; relative paths make your
-<a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a> file more
+<p>We recommend avoiding absolute file paths; relative paths make your {@code Android.mk} file more
 portable.</p>
 
 <p class="note"><strong>Note: </strong> Always use Unix-style forward slashes (/) in build files.
@@ -450,8 +438,8 @@
 
 <p>Try not to change the optimization/debugging level in your {@code Android.mk} file.
 The build system can handle this setting automatically for you, using the relevant information
-in the {@code Application.mk} file. Doing it this way allows the build system to generate useful
-data files used during debugging.</p>
+in the <a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file. Doing it
+this way allows the build system to generate useful data files used during debugging.</p>
 
 <p class="note"><strong>Note: </strong>In android-ndk-1.5_r1, the corresponding flags only applied
 to C source files, not C++ ones. They now match the full Android build system behavior.
@@ -520,7 +508,7 @@
 </pre>
 
 <p>For the list of exposed system libraries against which you can link in this NDK release, see
-<a href="stable_apis.html">Android NDK Stable APIs</a>.</p>
+<a href="stable_apis.html">Android NDK Native APIs</a>.</p>
 
 <p class="note"><strong>Note: </strong> If you define this variable for a static library,
 the build system ignores it, and {@code ndk-build} prints a warning.</p>
@@ -574,22 +562,20 @@
 
 <p class="note"><strong>Note: </strong> You can also force the build system to generate ARM binaries
 by setting {@code APP_OPTIM} in your
-<a href="{@docRoot}ndk/guides/application_mk.html>{@code Application.mk}</a> file to {@code debug}.
-Specifying {@code debug} forces an ARM build because the toolchain debugger does not handle thumb
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file to {@code debug}.
+Specifying {@code debug} forces an ARM build because the toolchain debugger does not handle Thumb
 code properly.</p>
 
 
 <h4>LOCAL_ARM_NEON</h4>
-<p>This variable only matters when you are targetting the {@code armeabi-v7a} ABI. It allows the
+<p>This variable only matters when you are targeting the {@code armeabi-v7a} ABI. It allows the
 use of ARM Advanced SIMD (NEON) GCC intrinsics in your C and C++ sources, as well as NEON
 instructions in Assembly files.</p>
 
 <p>Note that not all ARMv7-based CPUs support the NEON instruction set extensions. For this reason,
 you must perform runtime detection to be able to safely use this code at runtime. For more
-information, please see <a href="{@docRoot}ndk/guides/cpu_support.html">Android
-NDK &amp; ARM NEON Instruction Set Extension Support</a> and <a
-href="{@docRoot}ndk/guides/cpu_features.html">Android
-NDK CPU Features Detection Library</a>.</p>
+information, see <a href="{@docRoot}ndk/guides/cpu-arm-neon.html">NEON Support</a> and <a
+href="{@docRoot}ndk/guides/cpu-features.html">The {@code cpufeatures} Library</a>.</p>
 
 <p>Alternatively, you can use the {@code .neon} suffix to specify that the build system only
 compile specific source files with NEON support. In the following example, the build system compiles
@@ -635,8 +621,8 @@
 
 <p>By default, the build system compiles code with format string protection. Doing so forces a
 compiler error if a non-constant format string is used in a {@code printf}-style function.</p>
-<p>This protection is off by default, but you can disable it by setting its value to
-{@code true}. We do not recommend doing so without a compelling reason.</p>
+<p>This protection is on by default, but you can disable it by setting the value of
+this variable to {@code true}. We do not recommend doing so without a compelling reason.</p>
 
 
 <h4>LOCAL_EXPORT_CFLAGS</h4>
@@ -729,7 +715,7 @@
 
 <p>Note that any value other than {@code true} will revert to the
 default behaviour. You can also define {@code APP_SHORT_COMMANDS} in your
-<a href="{docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file to force this
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file to force this
 behavior for all modules in your project.</p>
 
 <p>We do not recommend enabling this feature by default, since it makes the build slower.</p>
@@ -745,7 +731,8 @@
 such libraries <em>cannot</em> be moved to a different location (all paths
 inside them are relative).</p>
 <p>Valid values are {@code true}, {@code false} or empty. A
-default value can be set in your {@code Application.mk} file through the {@code APP_THIN_ARCHIVE}
+default value can be set in your <a href="{@docRoot}ndk/guides/application_mk.html">
+{@code Application.mk}</a> file through the {@code APP_THIN_ARCHIVE}
 
 variable.</p>
 <p class="note"><strong>Note:</strong> This is ignored for non-static library modules, or prebuilt
@@ -785,7 +772,7 @@
 myasmfilter bar.S $OBJS_DIR/bar.S
 </pre>
 
-<h3 id="npfm">NDK-Provided Function Macros</h2>
+<h3 id="npfm">NDK-provided function macros</h2>
 <p>This section explains GNU Make function macros that the NDK provides. Use
 {@code $(call &lt;function&gt;)} to evaluate them; they return textual information.</p>
 
@@ -876,16 +863,16 @@
 included the current one).</p>
 
 <h4>import-module</h4>
-<p>A function that allows you to find and include the {@code Android.mk}
-of another module by name. A typical example is as follows: </p>
+<p>A function that allows you to find and include a module's {@code Android.mk} file by the name of
+the module. A typical example is as follows: </p>
 
 <pre class="no-pretty-print">
 $(call import-module,&lt;name&gt;)
 </pre>
 
-<p>In this example, the build system looks for the module tagged &lt;name&gt; in the list of
+<p>In this example, the build system looks for the module tagged {@code &lt;name&gt;} in the list of
 directories referenced that your {@code NDK_MODULE_PATH} environment variable references, and
 includes its {@code Android.mk} file automatically for you.</p>
 
-<p>For more information, see <a href="import_module.html">Android Module Paths (Sharing Code)</a>.
+<p>For more information, see <a href="import.html">Android Module Paths (Sharing Code)</a>.
 </p>
diff --git a/docs/html-ndk/ndk/guides/application_mk.jd b/docs/html-ndk/ndk/guides/application_mk.jd
index be82fbe..d51cf64 100644
--- a/docs/html-ndk/ndk/guides/application_mk.jd
+++ b/docs/html-ndk/ndk/guides/application_mk.jd
@@ -117,7 +117,7 @@
 
 <h4>APP_ABI</h4>
 <p>By default, the NDK build system generates machine code for the
-<a href="{docRoot}ndk/guides/abis.html">{@code armeabi}</a> ABI. This machine code
+<a href="{@docRoot}ndk/guides/abis.html">{@code armeabi}</a> ABI. This machine code
 corresponds to an ARMv5TE-based CPU with software floating point operations. You can use
 {@code APP_ABI} to select a different ABI. Table 1 shows the {@code APP_ABI}
 settings for different instruction sets.</p>
@@ -169,12 +169,12 @@
 </pre>
 
 <p>For the list of all supported ABIs and details about their usage and limitations, refer to
-<a href="{@docRoot}ndk/guides/abis.html">Android Native CPU ABI Management</a>.</p>
+<a href="{@docRoot}ndk/guides/abis.html">ABI Management</a>.</p>
 
 <h4>APP_PLATFORM</h4>
 <p>This variable contains the name of the target Android platform. For example, {@code android-3}
 specifies the Android 1.5 system images. For a complete list of platform names and corresponding
-Android system images, see <a href="{@docRoot}ndk/guides/stable_apis.html">Android NDK Stable APIs
+Android system images, see <a href="{@docRoot}ndk/guides/stable_apis.html">Android NDK Native APIs
 </a>.</p>
 
 <h4>APP_STL</h4>
@@ -205,14 +205,14 @@
   </tr>
 </table>
 
-<p>For more information on this subject, see <a href="{@docRoot}ndk/guides/cpp_support.html">C++
-Support</a>.</p>
+<p>For more information on this subject, see <a href="{@docRoot}ndk/guides/cpp-support.html">
+C++ Library Support</a>.</p>
 
 
 <h4>APP_SHORT_COMMANDS</h4>
 <p>The equivalent of {@code LOCAL_SHORT_COMMANDS} in {@code Application.mk} for your whole project.
 For more information, see the documentation for this variable on
-<a href="{docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a>.</p>
+<a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a>.</p>
 
 <h4>NDK_TOOLCHAIN_VERSION</h4>
 <p>Define this variable as either {@code 4.9} or {@code 4.8} to select a version of the GCC
@@ -237,5 +237,5 @@
 <h4>APP_THIN_ARCHIVE</h4>
 <p>Sets the default value of {@code LOCAL_THIN_ARCHIVE} in the {@code Android.mk} file for all
 static library modules in this project. For more information, see the documentation for
-{@code LOCAL_THIN_ARCHIVE} on <a href="{docRoot}ndk/guides/android_mk.html">{@code Android.mk}.</a>
+{@code LOCAL_THIN_ARCHIVE} on <a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}.</a>
 </p>
diff --git a/docs/html-ndk/ndk/guides/arch.jd b/docs/html-ndk/ndk/guides/arch.jd
index 875bbd9..3dafe8f 100644
--- a/docs/html-ndk/ndk/guides/arch.jd
+++ b/docs/html-ndk/ndk/guides/arch.jd
@@ -1,31 +1,19 @@
-page.title=Architectures and CPUs
+page.title=CPUs and Architectures
 @jd:body
 
-<div class="contents">
-<div class="textblock"><p>This section includes detailed information about ABIs and detailed information on support for respective instruction sets. It includes these topics:</p>
-<ul>
-<li><a href="./md_3__key__topics__c_p_u__support__chapter_1-section_8__a_b_is.html">ABI Management</a><ul>
-<li>Different ABIs support different CPUs and processing capabilities.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__c_p_u__support__c_p_u-_a_r_m-_n_e_o_n.html">Neon</a><ul>
-<li>Details about targeting devices whose CPUs support Neon, or Advanced SIMD. Neon is an optional extension of the armv7 architecture.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__c_p_u__support__c_p_u-_m_i_p_s.html">Mips</a><ul>
-<li>Details about targeting devices with CPUs supporting the MIPS32 instruction set.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__c_p_u__support__c_p_u-_x86.html">x86</a><ul>
-<li>Details about targeting devices with CPUs supporting the IA-32 instruction set.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__c_p_u__support__c_p_u-_x86-64.html">x86-64</a><ul>
-<li>Details about targeting devices whose CPUs support the x86-64 instruction set.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__c_p_u__support__c_p_u-_f_e_a_t_u_r_e_s.html">CPU Features</a><ul>
-<li>A small library that detects the target device's CPU family and supported features. </li>
-</ul>
-</li>
-</ul>
\ No newline at end of file
+<p>When you're working with native code, hardware matters. The NDK lets you ensure you're compiling
+for the right architectures and CPUs by giving you a variety of ABIs from which
+to choose.</p>
+
+<p>This section begins by explaining how to target specific
+<a href="{@docRoot}ndk/guides/abis.html">architectures and CPUs</a>. It then
+provides information you need to know when targeting the
+<a href="{@docRoot}ndk/guides/abis.html">ARM</a>
+family of CPUs and architectures. Next, it provides information about  the other CPUs and
+architectures that it supports: <a href="{@docRoot}ndk/guides/cpu-arm-neon.html">NEON</a>, x86
+(<a href="{@docRoot}ndk/guides/x86.html">32-bit</a> and
+<a href="{@docRoot}ndk/guides/x86-64.html">64-bit</a>), and
+<a href="{@docRoot}ndk/guides/mips.html">MIPS</a>. Finally, it explains how to use the
+<a href="{@docRoot}ndk/guides/cpu-features.html">{@code cpufeatures}</a>
+library, which your app can use to query a given CPU and architecture about the optional
+features they support.</p>
\ No newline at end of file
diff --git a/docs/html-ndk/ndk/guides/build.jd b/docs/html-ndk/ndk/guides/build.jd
index b1893fa..6286328 100644
--- a/docs/html-ndk/ndk/guides/build.jd
+++ b/docs/html-ndk/ndk/guides/build.jd
@@ -1,23 +1,18 @@
-page.title=Building
+page.title=Building Your Project
 @jd:body
 
-<div class="contents">
-<div class="textblock"><p>This section explains, in detail, how to use the NDK to build your project. It comprises the following topics:</p>
-<ul>
-<li><a href="./md_3__key__topics__building__chapter_1-section_8_ndk-build.html">ndk-build</a><ul>
-<li>How to use the shell script that invokes the tools to build your shared libraries.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__building__chapter_1-section_8__android_8mk.html">Android.mk</a><ul>
-<li>Syntax for the file that describes your build sources to the build system.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__building__a_p_p_l_i_c_a_t_i_o_n-_m_k.html">Application.mk</a><ul>
-<li>Syntax for the file that describes the native modules that your application requires.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__building__s_t_a_n_d_a_l_o_n_e-_t_o_o_l_c_h_a_i_n.html">Standalone Toolchain</a><ul>
-<li>How to integrate the NDK into your existing build system. </li>
-</ul>
-</li>
-</ul>
\ No newline at end of file
+<p>One of the NDK's core purposes is allowing you to build C and C++ source code into shared
+libraries that you can use in your app.</p>
+
+<p>This section explains how to build native binaries for use in your Android app. It begins by
+explaining the
+<a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a> file, which
+defines properties specific to individual <i>modules</i>, or libraries. Then, it explains the
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file, which defines
+properties for all the modules that you use in your
+app. Next, it tells you how to use the <a href="{@docRoot}ndk/guides/ndk-build.html">
+{@code ndk-build}</a> script, which is what the NDK uses to build your sources. Last, it ventures
+into advanced territory, discussing how to incorporate the NDK into your own
+<a href="{@docRoot}ndk/guides/standalone_toolchain.html">toolchain</a>, if you prefer to
+build that way instead of using
+<a href="{@docRoot}ndk/guides/ndk-build.html">{@code ndk-build}</a>.</p>
\ No newline at end of file
diff --git a/docs/html-ndk/ndk/guides/concepts.jd b/docs/html-ndk/ndk/guides/concepts.jd
index bd4570e..45dceeb 100644
--- a/docs/html-ndk/ndk/guides/concepts.jd
+++ b/docs/html-ndk/ndk/guides/concepts.jd
@@ -23,7 +23,7 @@
 <li>Already familiar with concepts inherent in native programming and in
 <a href="{@docRoot}">Android development</a>.</li>
 <li>Working in <a href="{@docRoot}sdk/index.html">Eclipse, and using the Android
-Development Tools ("ADT")</a>, except where otherwise noted.</li>
+Development Tools (ADT)</a>, except where otherwise noted.</li>
 </ul>
 <h2 id="intro">Introduction</h2>
 
@@ -53,14 +53,14 @@
 <li>Generate binaries.</li>
 <li>Copy the binaries to your app's project path.</li>
 </ul>
-<p>For more information, see the
-<a href="{@docRoot}ndk/guides/ndk-build.html">ndk-build</a> section of this guide.</p>
+<p>For more information, see
+<a href="{@docRoot}ndk/guides/ndk-build.html">ndk-build</a>.</p>
 </li>
 </ul>
 
 <ul>
 <li>Java: From your Java source, the Android build process generates {@code .dex}
-("Dalvik EXecutable") files, which are what the Android OS runs in the Dalvik Virtual Machine
+(Dalvik EXecutable) files, which are what the Android OS runs in the Dalvik Virtual Machine
 (“DVM”). Even if your app contains no Java source code at all, the build process still generates a
 {@code .dex} executable file within which the native component runs.
 
@@ -92,14 +92,14 @@
 </ul>
 
 <ul>
-<li>Java Native Interface ("JNI"): The JNI is the interface via which the Java and C++ components
+<li>Java Native Interface (JNI): The JNI is the interface via which the Java and C++ components
 talk to one another. This guide assumes knowledge of the JNI; for information about it, consult the
 <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.html">
 Java Native Interface Specification</a>.</li>
 </ul>
 
 <ul>
-<li>Application Binary Interface ("ABI"): The ABI defines exactly how your app's machine code is
+<li>Application Binary Interface (ABI): The ABI defines exactly how your app's machine code is
 expected to interact with the system at runtime. The NDK builds {@code .so} files against these
 definitions. Different ABIs correspond to different architectures: The NDK includes ABI support for
 ARMEABI (default), MIPS, and x86. For more information, see
@@ -109,9 +109,9 @@
 <ul>
 <li>Manifest: If you are writing an app with no Java component to it, you must declare the
 {@link android.app.NativeActivity} class in the
-<a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest</a>. The
-<a href="#naa">Native Activity</a> section provides more detail on how to do this, under
-“Using the native-activity.h interface.”
+<a href="{@docRoot}guide/topics/manifest/manifest-intro.html">manifest</a>.
+<a href="#naa">Native Activities and Applications</a> provides more detail on how to do this, under
+“Using the {@code native-activity.h} interface.”
 </li>
 </ul>
 
@@ -119,21 +119,22 @@
 the Android NDK as standalone compilers.</p>
 
 <ul>
-<li>{@code Android.mk}: You must create an {@code Android.mk} configuration file inside your
-{@code jni} folder. The ndk-build script looks at this file, which defines the module and its name,
-the source files to be compiled, build flags and libraries to link. For more information, see the
-<a href="{@docRoot}ndk/guides/android.mk.html">Android.mk</a> section of this document.</li>
+<li>{@code Android.mk}: You must create an <a href="{@docRoot}ndk/guides/android_mk.html">
+{@code Android.mk}</a> configuration file inside your {@code jni} folder. The ndk-build script
+looks at this file, which defines the module and its name, the source files to be compiled, build
+flags and libraries to link.</li>
 </ul>
 
 <ul>
-<li>{@code Application.mk}: You may optionally create an Application.mk file. This file enumerates
-and describes the modules that your app requires. This information includes:<ul>
+<li>{@code Application.mk}: You may optionally create an
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file. This file
+This file enumerates and describes the modules that your app requires. This information includes:
+
+<ul>
 <li>ABIs used to compile for specific platforms.</li>
 <li>Toolchains.</li>
 <li>Standard libraries to include (static and dynamic STLport or default system).</li>
 </ul>
-<p>For more information, see the
-<a href="{@docRoot}ndk/guides/application.mk.html">Application.mk</a> section.</p>
 </li>
 </ul>
 
@@ -152,13 +153,14 @@
 <li>Create an Android app Project in Eclipse as you would for any other Android project.</li>
 <li>If you are writing a native-only app, declare the {@link android.app.NativeActivity} class in
 {@code AndroidManifest.xml}. You can do so from the Eclipse/ADT Android Manifest Editor, or by
-hand-editing the file. For more information, see the <a href="#naa">Native Activity</a> section.
+hand-editing the file. For more information, see the <a href="#naa">Native Activities and
+Applications</a>.
 </li>
-<li>Create an Android.mk file describing the native library, including name, flags, linked libraries
-and source files to be compiled in the ‘JNI’ directory.</li>
-<li>OPTIONAL: Create an {@code Application.mk} file configuring the target ABIs, toolchain,
-release/debug mode, and STL. For any of these that you do not specify, the following default values
-are used, respectively:
+<li>Create an {@code Android.mk} file describing the native library, including name, flags, linked
+libraries, and source files to be compiled in the ‘JNI’ directory.</li>
+<li>Optionally, you can create an {@code Application.mk} file configuring the target ABIs,
+toolchain, release/debug mode, and STL. For any of these that you do not specify, the following
+default values are used, respectively:
 <ul>
 <li>
 ABI: armeabi
@@ -195,7 +197,7 @@
 through the JNI. In certain cases, however&ndash;such as for sensors, input events, and
 assets&ndash;the NDK provides native interfaces that you can use instead of having to call
 across the JNI. For more information about such support, see
-<a href="{@docRoot}ndk/guides/stable-apis.html">Stable APIs</a>.</p>
+<a href="{@docRoot}ndk/guides/stable_apis.html">Android NDK Native APIs</a>.</p>
 
 <p>Regardless of whether or not you are developing a native activity, we recommend that you create
 your projects with the traditional Android build tools. Doing so helps ensure building and packaging
@@ -265,25 +267,25 @@
 function, which the app calls when the native activity starts. This function, analogous
 to {@code main} in C/C++, receives a pointer to an {@code ANativeActivity} structure,
 which contains function pointers to the various callback implementations that you need to write.
-Set the applicable callback function pointers in {@code ANativeActivity-&gt;;callbacks} to the
+Set the applicable callback function pointers in {@code ANativeActivity-&gt;callbacks} to the
 implementations of your callbacks.</li>
 
 <!--TODO: API Ref links in the above para.-->
 
-<li>Set the {@code ANativeActivity-&gt;;instance} field to the address of any instance of specific
+<li>Set the {@code ANativeActivity-&gt;instance} field to the address of any instance of specific
 data that you want to use.</li>
 <li>Implement anything else that you want your activity to do upon starting.</li>
-<li>Implement the rest of the callbacks that you set in {@code ANativeActivity-&gt;;callbacks}. For
-more information on when the callbacks are called, see the
-<a href="{@docRoot}training/basics/activity-lifecycle/index.html">SDK documentation for Activity Lifecycles</a>.
+<li>Implement the rest of the callbacks that you set in {@code ANativeActivity-&gt;callbacks}. For
+more information on when the callbacks are called, see
+<a href="{@docRoot}training/basics/activity-lifecycle/index.html">Managing the Activity
+Lifecycle</a>.
 </li>
 <li>Develop the rest of your application.</li>
 <li>Create an {@code Android.mk file} in the {@code jni/} directory of your project to describe your
-native module to the build system. For more information, see the
-<a href="./md_3__key__topics__building__chapter_1-section_8__android_8mk.html">Android.mk section.</a>.
-</li>
-<li>Once you have an {@code Android.mk} file, compile your native code using the {@code ndk-build}
-command.</li>
+native module to the build system. For more information, see
+<a href="{@docRoot}ndk/guides/android_mk.html">Android.mk</a>.</li>
+<li>Once you have an <a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a>
+file, compile your native code using the {@code ndk-build} command.</li>
 
 <pre class="no-pretty-print">
 $ cd &lt;path&gt;/&lt;to&gt;/&lt;project&gt;
diff --git a/docs/html-ndk/ndk/guides/cpp-support.jd b/docs/html-ndk/ndk/guides/cpp-support.jd
index 6054181..ff170f4 100644
--- a/docs/html-ndk/ndk/guides/cpp-support.jd
+++ b/docs/html-ndk/ndk/guides/cpp-support.jd
@@ -114,7 +114,7 @@
 For more information on how to use these runtimes with your own toolchain, see <a href="{@docRoot}ndk/guides/standalone_toolchain.html">Standalone Toolchain</a>.</p>
 
 <h2 id="rc">Runtime Characteristics</h2>
-<h3 id="system">System runtime</h3>
+<h3 id="system">libstdc++ (default system runtime)</h3>
 
 <p>This runtime only provides the following headers, with no support beyond them:</p>
 <ul>
@@ -175,7 +175,7 @@
 shared library file is named {@code libc++_shared.so}.</p>
 
 <p>By default, this runtime compiles with {@code -std=c++11}. As with GNU {@code libstdc++}, you
-need to explicitly turns on exceptions or rtti support. For information on how to do this, see
+need to explicitly turns on exceptions or RTTI support. For information on how to do this, see
 <a href="#xp">C++ Exceptions</a> and <a href="#rt">RTTI</a>.</p>
 
 <p>The NDK provides prebuilt static and shared libraries for {@code libc++} compiled by Clang 3.4,
@@ -235,9 +235,9 @@
 exceptions either for your entire app, or for individual modules.
 
 <p>To enable exception-handling support for your entire app, add the following line to
-your <a href="{docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file.
+your <a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file.
 To enable exception-handling support for individual modules', add the following line to
-their respective <a href="{docRoot}ndk/guides/android.html">{@code Android.mk}</a> files.</p>
+their respective <a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a> files.</p>
 
 <pre>
 APP_CPPFLAGS += -fexceptions
@@ -249,14 +249,14 @@
 sources with {@code -fno-rtti} by default.
 
 <p>To enable RTTI support for your entire app for your entire application, add the following line to
-your <a href="{docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file:
+your <a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a> file:
 
 <pre>
 APP_CPPFLAGS += -frtti
 </pre>
 
 To enable RTTI support for individual modules, add the following line to
-their respective <a href="{docRoot}ndk/guides/android.html">{@code Android.mk}</a> files:
+their respective <a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a> files:
 
 <pre>
 LOCAL_CPP_FEATURES += rtti
@@ -303,7 +303,7 @@
 <li>libstlport_shared.so, used by both libfoo and libbar</li>
 </ul>
 
-<p>You must need to load the libraries in reverse dependency order: </p>
+<p>You must load the libraries in reverse dependency order: </p>
 <pre>
     static {
       System.loadLibrary("stlport_shared");
@@ -325,4 +325,4 @@
 License</a> on the GCC website.</p>
 
 <p><a href="https://llvm.org/svn/llvm-project/libcxx/trunk/LICENSE.TXT">LLVM {@code libc++}</a>
-is dual-licensed under both the University of Illinois "BSD-Like" license and the MIT license.</p>
\ No newline at end of file
+is dual-licensed under both the University of Illinois "BSD-Like" license and the MIT license.</p>
diff --git a/docs/html-ndk/ndk/guides/cpu-arm-neon.jd b/docs/html-ndk/ndk/guides/cpu-arm-neon.jd
index 32e9942..1d12937 100644
--- a/docs/html-ndk/ndk/guides/cpu-arm-neon.jd
+++ b/docs/html-ndk/ndk/guides/cpu-arm-neon.jd
@@ -27,7 +27,7 @@
 <p>Not all ARMv7-based Android devices support NEON, but devices that do may benefit significantly
 from its support for scalar/vector instructions. For x86 devices, the NDK can also translate NEON
 instructions into SSE, although with several restrictions. For more information, see
-<a href="{docRoot}ndk/guides/x86.html#an>x86 Support for ARM NEON Intrinsics.</a></p>
+<a href="{@docRoot}ndk/guides/x86.html#an">x86 Support for ARM NEON Intrinsics.</a></p>
 
 <h2 id="ul">Using LOCAL_ARM_NEON</h2>
 <p>To have the NDK build all its source files with NEON support, include the following line in
@@ -58,7 +58,7 @@
 <p>NEON support only works with the {@code armeabi-v7a} and {@code x86} ABIs. If the NDK build
 scripts encounter other ABIs while attempting to build with NEON support, the NDK build scripts
 exit. x86 provides <a href="x86.html">partial NEON support</a> via translation header. It is
-important to use checks like the following in your <a href="{docRoot}ndk/guides/android_mk.html">
+important to use checks like the following in your <a href="{@docRoot}ndk/guides/android_mk.html">
 {@code Android.mk}</a> file:</p>
 
 <pre class="no-pretty-print">
@@ -76,7 +76,7 @@
 <p>Your app must perform runtime detection to confirm that NEON-capable machine code can be run on
 the target device. This is because not all ARMv7-based Android devices support NEON. The app can
 perform this check using the
-<a href="{@docRoot}ndk/guides/cpu_features.html">{@code cpufeatures}</a> library that comes with
+<a href="{@docRoot}ndk/guides/cpu-features.html">{@code cpufeatures}</a> library that comes with
 this NDK.</p>
 
 <p>You should explicitly check that {@code android_getCpuFamily()} returns {@code
diff --git a/docs/html-ndk/ndk/guides/cpu-features.jd b/docs/html-ndk/ndk/guides/cpu-features.jd
index b27250a..b031909 100644
--- a/docs/html-ndk/ndk/guides/cpu-features.jd
+++ b/docs/html-ndk/ndk/guides/cpu-features.jd
@@ -98,7 +98,7 @@
 
 <dt>{@code ANDROID_CPU_ARM_FEATURE_ARMv7}</dt>
 <dd>Indicates that the device's CPU supports the ARMv7-A instruction set as supported by the
-<a href="{@docRoot}ndk/guides/abis.html">armeabi-v7a</a> ABI. This instruction set supports both
+<a href="{@docRoot}ndk/guides/abis.html#v7a">armeabi-v7a</a> ABI. This instruction set supports both
 Thumb-2 and VFPv3-D16 instructions. This return value also indicates support for the VFPv3 hardware
 FPU instruction-set extension.</dd>
 
diff --git a/docs/html-ndk/ndk/guides/debug.jd b/docs/html-ndk/ndk/guides/debug.jd
index b202ed9..3c4da3b 100644
--- a/docs/html-ndk/ndk/guides/debug.jd
+++ b/docs/html-ndk/ndk/guides/debug.jd
@@ -1,17 +1,11 @@
-page.title=Debugging
+page.title=Debugging Your Project
 @jd:body
 
-<div class="title">Debugging </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><p>This section introduces you to debugging with the NDK. It includes:</p>
-<ul>
-<li><a href="./md_3__key__topics__debugging__n_d_k-_g_d_b.html">ndk-gdb and ndk-gdb-py</a><ul>
-<li>The helper shell script named <code>ndk-gdb</code>, which allows you to launch a native debugging session for your NDK-generated machine code.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__debugging__n_d_k-_s_t_a_c_k.html">ndk-stack</a><ul>
-<li>A tool that helps you use ADB <code>logcat</code> in your debugging. </li>
-</ul>
-</li>
-</ul>
\ No newline at end of file
+<p>After you've built your app, you'll probably need to debug it. This section introduces you to the
+NDK's debugging tools.</p>
+
+<p>It begins by telling you how to use the <a href="{@docRoot}ndk/guides/ndk-gdb.html">
+{@code ndk-gdb}</a> tool to debug your code. It closes with an explanation of the
+<a href="{@docRoot}ndk/guides/ndk-stack.html">{@code ndk-stack}</a> tool, which helps you use the
+<a href="{@docRoot}tools/help/logcat.html">ADB logcat tool</a>
+as you debug.</p>
\ No newline at end of file
diff --git a/docs/html-ndk/ndk/guides/guides_toc.cs b/docs/html-ndk/ndk/guides/guides_toc.cs
index 854169d..981eb51 100644
--- a/docs/html-ndk/ndk/guides/guides_toc.cs
+++ b/docs/html-ndk/ndk/guides/guides_toc.cs
@@ -8,64 +8,58 @@
 
 <ul id="nav">
    <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/index.html"><span class="en">
-      Getting Started</span></a></div>
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>ndk/guides/index.html">
+      <span class="en">Getting Started</span></a></div>
       <ul>
-         <li><a href="setup.html">Setup</a></li>
-         <li><a href="concepts.html">Concepts</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/setup.html">Setup</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/concepts.html">Concepts</a></li>
       </ul>
    </li>
 
    <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/build.html"><span class="en">
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>ndk/guides/build.html">
+      <span class="en">
       Building</span></a></div>
       <ul>
-         <li><a href="#">ndk-build</a></li>
-         <li><a href="#">Android.mk</a></li>
-         <li><a href="#">Application.mk</a></li>
-         <li><a href="#">Standalone Toolchain</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/android_mk.html">Android.mk</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/application_mk.html">Application.mk</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/ndk-build.html">ndk-build</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/standalone_toolchain.html">Standalone Toolchain
+         </a></li>
       </ul>
    </li>
 
    <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/debug.html"><span class="en">
-      Debugging</span></a></div>
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>ndk/guides/arch.html">
+      <span class="en">Architectures and CPUs</span></a></div>
       <ul>
-         <li><a href="#">ndk-gdb</a></li>
-         <li><a href="#">ndk-stack</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/abis.html">ABI Management</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/cpu-arm-neon.html">NEON</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/x86.html">x86</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/x86-64.html">x86-64</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/mips.html">MIPS</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/cpu-features.html">The cpufeatures Library</a>
+         </li>
       </ul>
    </li>
 
    <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/arch.html"><span class="en">
-      Architectures and CPUs</span></a></div>
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>ndk/guides/debug.html">
+      <span class="en">Debugging</span></a></div>
       <ul>
-         <li><a href="#">ABI Management</a></li>
-         <li><a href="#">Neon</a></li>
-         <li><a href="#">Mips</a></li>
-         <li><a href="#">x86</a></li>
-         <li><a href="#">x86-64</a></li>
-         <li><a href="#">CPU Features</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/ndk-gdb.html">ndk-gdb</a></li>
+         <li><a href="<?cs var:toroot ?>ndk/guides/ndk-stack.html">ndk-stack</a></li>
       </ul>
    </li>
 
    <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/libs.html"><span class="en">
-      Libraries</span></a></div>
+      <div class="nav-section-header"><a href="<?cs var:toroot ?>ndk/guides/libs.html">
+      <span class="en">Libraries</span></a></div>
       <ul>
-      <li><a href="#">Stable APIs</a></li>
-      <li><a href="#">C++ Support</a></li>
-      <li><a href="#">Prebuilt Libraries</a></li>
-      </ul>
-   </li>
+      <li><a href="<?cs var:toroot ?>ndk/guides/prebuilts.html">Prebuilt Libraries</a></li>
+      <li><a href="<?cs var:toroot ?>ndk/guides/cpp-support.html">C++ Support</a></li>
+      <li><a href="<?cs var:toroot ?>ndk/guides/stable_apis.html">Stable APIs</a></li>
 
-   <li class="nav-section">
-      <div class="nav-section-header"><a href="/ndk/guides/sample.html"><span class="en">
-      Sample Walkthrough</span></a></div>
-      <ul>
-      <li><a href="#">hello-jni</a></li>
-      <li><a href="#">native-activity</a></li>
-      <li><a href="#">Teapot</a></li>
       </ul>
    </li>
 
diff --git a/docs/html-ndk/ndk/guides/index.jd b/docs/html-ndk/ndk/guides/index.jd
index 3fbfb47..febeaab 100644
--- a/docs/html-ndk/ndk/guides/index.jd
+++ b/docs/html-ndk/ndk/guides/index.jd
@@ -1,17 +1,25 @@
-page.title=Getting Started
+page.title=Getting Started with the NDK
 @jd:body
 
-<p>This section provides the information you need to get up and running
-with the NDK.</p>
+<p>The Native Development Kit (NDK) is a set of tools that allow you to leverage C and
+C++ code in your Android apps. You can use it either to build from your own source code, or to take
+advantage of existing prebuilt libraries.</p>
+
+<p>The NDK is not appropriate for most novice Android programmers, and has little value for many
+types of Android apps. It is often not worth the additional complexity it inevitably brings to the
+development process. However, it can be useful in cases in which you need to:</p>
+
 <ul>
-   <li><a href="setup.html">Setup</a></li>
-   <ul>
-      <li>Learn how to set up the NDK, and verify that it's integrated into
-      your toolchain.</li>
-   </ul>
-   <li><a href="concepts.html">Concepts</a></li>
-   <ul>
-      <li>Learn some basics about how the NDK works and its components, and about how to use it.
-      </li>
-   </ul>
+   <li>Squeeze extra performance out of a device for computationally intensive applications like
+   games or physics simulations.</li>
+   <li>Reuse your own or other developers' C or C++ libraries.</li>
 </ul>
+
+<p>This guide gives you the information you need to get up and running with the NDK. It starts by
+explaining the <a href="{@docRoot}ndk/guides/concepts.html">concepts</a> underpinning the NDK, and
+how to <a href="{@docRoot}ndk/guides/setup.html">set it up</a>. Next, it explains how to use
+the NDK to <a href="{@docRoot}ndk/guides/build.html">build</a> and
+<a href="{@docRoot}ndk/guides/debug.html">debug</a> your app. Then, it continues with information
+about targeting <a href="{@docRoot}ndk/guides/arch.html">different hardware platforms</a> in your
+builds. Finally, it discusses how to use your own and other prebuilt
+<a href="{@docRoot}ndk/guides/libs.html">libraries</a>.</p>
diff --git a/docs/html-ndk/ndk/guides/libs.jd b/docs/html-ndk/ndk/guides/libs.jd
index 1d4d2ac..ea607de 100644
--- a/docs/html-ndk/ndk/guides/libs.jd
+++ b/docs/html-ndk/ndk/guides/libs.jd
@@ -1,20 +1,13 @@
-page.title=Libraries
+page.title=Using Existing Libraries
 @jd:body
 
-<div class="contents">
-<div class="textblock"><p>This section discusses libraries included with the NDK, as well as how to use other people's libraries and modules in your own application. It discusses:</p>
-<ul>
-<li><a href="./md_3__key__topics__libraries__s_t_a_b_l_e-_a_p_i_s.html">Stable APIs</a><ul>
-<li>This section discusses the stable APIs exposed by the NDK.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__libraries__p_r_e_b_u_i_l_t_s.html">Prebuilt Libraries</a><ul>
-<li>How to include and use prebuilt libraries in your own application.</li>
-</ul>
-</li>
-<li><a href="./md_3__key__topics__libraries__c_p_l_u_s_p_l_u_s-_s_u_p_p_o_r_t.html">C++ Support</a><br/>
-<ul>
-<li>Information about the NDK's C++ runtime support library and corresponding header files. </li>
-</ul>
-</li>
-</ul>
\ No newline at end of file
+<p>This section discusses the use of existing libraries&ndash;both your own, and those that the NDK
+provides.</p>
+
+<p>It begins by telling you how to use your own <a href="{@docRoot}ndk/guides/prebuilts.html">
+prebuilt libraries</a>. Then, it explains the <a href="{@docRoot}ndk/guides/cpp-support.html">
+C++ helper runtimes</a> available with the NDK, and how to use them. Finally, it provides
+information on <a href="{@docRoot}ndk/guides/stable_apis.html">the other libraries</a> that the NDK provides, such
+as <a href="https://www.khronos.org/opengles/">OpenGL ES</a> and
+<a href="https://www.khronos.org/opensles/">OpenSL ES</a>, and the minimum Android API levels
+required to support those libraries.</p>
\ No newline at end of file
diff --git a/docs/html-ndk/ndk/guides/mips.jd b/docs/html-ndk/ndk/guides/mips.jd
index 1aa1868..2b4eea4 100644
--- a/docs/html-ndk/ndk/guides/mips.jd
+++ b/docs/html-ndk/ndk/guides/mips.jd
@@ -29,7 +29,7 @@
 
 <p>The build system places generated libraries into {@code $PROJECT/libs/mips/}, where
 {@code $PROJECT} represents your project's root directory, and embeds them in your APK under
-{@code /lib/mips/}.</p>
+the {@code /lib/mips/} directory.</p>
 
 <p>The Android package manager extracts these libraries when installing your APK on a compatible
 MIPS-based device, placing them under your app's private data directory.</p>
diff --git a/docs/html-ndk/ndk/guides/ndk-build.jd b/docs/html-ndk/ndk/guides/ndk-build.jd
index d52d224..9e3edda 100644
--- a/docs/html-ndk/ndk/guides/ndk-build.jd
+++ b/docs/html-ndk/ndk/guides/ndk-build.jd
@@ -9,7 +9,7 @@
         <li><a href="#int">Internals</a></li>
          <li><a href="#ifc">Invoking from the Command Line</a></li>
          <li><a href="#ife">Invoking from Eclipse</a></li>
-         <li><a href="#6432">64-bit and 32-bit toolchains</a></li>
+         <li><a href="#6432">64-Bit and 32-Bit Toolchains</a></li>
          <li><a href="#req">Requirements</a></li>
           </ol>
         </li>
@@ -17,12 +17,12 @@
     </div>
   </div>
 
-<p>ndk-build is a tiny shell script introduced in Android NDK r4. Its purpose
-is simply to invoke the right NDK build script.
+<p>The {@code ndk-build} file is a shell script introduced in Android NDK r4. Its purpose
+is to invoke the right NDK build script.
 
 <h2 id="int">Internals</h2>
 
-ndk-build is equivalent to: </p>
+<p>Running the {@code ndk-build} script is equivalent to running the following command:</p>
 
 <pre class="no-pretty-print">
 $GNUMAKE -f &lt;ndk&gt;/build/core/build-local.mk
@@ -35,8 +35,8 @@
 make files.</p>
 
 <h2 id="ifc">Invoking from the Command Line</h2>
-<p>ndk-build lives in the top level the NDK installation directory. To run it from the
-command line, invoke it while in or under your application project directory.
+<p>The {@code ndk-build} file lives in the top level the NDK installation directory. To run it
+from the command line, invoke it while in or under your application project directory.
 For example: </p>
 
 <pre class="no-pretty-print">
@@ -132,7 +132,7 @@
 Optimized*3 </td></tr>
 </table>
 *1: Useful for profiling.<br>
-*2: Default for running <a href="{@docRoot}ndk/guides/"ndk-gdb.html">ndk-gdb</a>.<br>
+*2: Default for running <a href="{@docRoot}ndk/guides/ndk-gdb.html">{@code ndk-gdb}</a>.<br>
 *3: Default mode.<br>
 <br>
 <p class="note"><strong>Note:</strong> {@code NDK_DEBUG=0} is the equivalent of
@@ -159,7 +159,7 @@
 pick the native debug files generated with {@code NDK_DEBUG=1}.
 
 
-<h2 id="6432">64-bit and 32-bit toolchains</h2>
+<h2 id="6432">64-Bit and 32-Bit Toolchains</h2>
 <p>Some toolchains come with both 64-bit and 32-bit versions. For example,
 directories {@code &lt;ndk&gt;/toolchain/&lt;name&gt;/prebuilt/} and
 {@code &lt;ndk&gt;/prebuilt/} may contain both {@code linux-x86} and
diff --git a/docs/html-ndk/ndk/guides/ndk-gdb.jd b/docs/html-ndk/ndk/guides/ndk-gdb.jd
index 2370ba2..b15e67e 100644
--- a/docs/html-ndk/ndk/guides/ndk-gdb.jd
+++ b/docs/html-ndk/ndk/guides/ndk-gdb.jd
@@ -29,12 +29,12 @@
 <li>Build your app to run on Android 2.2 (Android API level 8) or higher.</li>
 <li>Debug on a device or emulator running Android 2.2 or higher. For debugging purposes, the target
 API level that you declare in your {@code AndroidManifest.xml} file does not matter.</li>
-<li>Develop your app in a Unix shell. On Windows, use <a href="https://www.cygwin.com/">Cygwin
+<li>Develop your app in a Unix shell. On Windows, use <a href="https://www.cygwin.com/">Cygwin</a>
 or the experimental {@code ndk-gdb-py} <a href="https://www.python.org/">Python</a>
 implementation.</li>
 <li>Use GNU Make 3.81 or higher.</li>
 <li>If you are building your app from
-<a href="http://developer.android.com/sdk/installing/installing-adt.html">Eclipse</a>, build it
+<a href="{@docRoot}sdk/installing/installing-adt.html">Eclipse</a>, build it
 using version 0.9.7 or higher of the ADT plug-in.</li>
 
 <h2 id="use">Usage</h2>
@@ -150,7 +150,7 @@
 
 <tr>
 <td>{@code --adb=&lt;file&gt;}</td>
-<td><p>This option specifies the <a href="http://developer.android.com/tools/help/adb.html">adb</a>
+<td><p>This option specifies the <a href="{@docRoot}tools/help/adb.html">adb</a>
 tool executable. It is only necessary if you have not set your path to include that executable.</p>
 </td>
 </tr>
diff --git a/docs/html-ndk/ndk/guides/ndk-stack.jd b/docs/html-ndk/ndk/guides/ndk-stack.jd
index 27c752a..46146cb 100644
--- a/docs/html-ndk/ndk/guides/ndk-stack.jd
+++ b/docs/html-ndk/ndk/guides/ndk-stack.jd
@@ -12,8 +12,10 @@
   </div>
 
 <p>The {@code ndk-stack} tool allows you to filter stack traces as they appear in the
-output of {@code adb logcat}, and replace any address inside a shared library with the corresponding
-{@code &lt;source-file&gt;:&lt;line-number&gt;} values.</p>
+output of <a href="{@docRoot}tools/help/logcat.html">{@code adb logcat}</a>. It also replaces any
+address inside a shared library with the corresponding
+{@code &lt;source-file&gt;:&lt;line-number&gt;} values from your source code, making issues easier
+to pinpoint.</p>
 
 <p>For example, it translates something like:</p>
 
@@ -36,7 +38,7 @@
 I/DEBUG   (   31):
 </pre>
 
-<p>Into the more readable output: </p>
+<p>into the more readable output: </p>
 
 <pre>
 ********** Crash dump: **********
diff --git a/docs/html-ndk/ndk/guides/prebuilts.jd b/docs/html-ndk/ndk/guides/prebuilts.jd
index f0530d1..f13e70e 100644
--- a/docs/html-ndk/ndk/guides/prebuilts.jd
+++ b/docs/html-ndk/ndk/guides/prebuilts.jd
@@ -42,7 +42,7 @@
     whether you are using a shared ({@code .so}) or static {@code .a}) library.</li>
 </ol>
 
-  <p>Here is a trivial example that assumes that the prebuilt library {@code libfoo.so} resides in
+  <p>Here is a trivial example that assumes the prebuilt library {@code libfoo.so} resides in
   the same directory as the <a href="{@docRoot}ndk/guides/android_mk.html">{@code Android.mk}</a>
   file that describes it.</p>
 
@@ -142,4 +142,4 @@
 <p>If you have specified {@code armeabi} as the value of {@code TARGET_ARCH_ABI}, the build system
 uses the version of {@code libfoo.so} located in the {@code armeabi} directory. If you have
 specified {@code x86} as the value {@code TARGET_ARCH_ABI}, the build system uses the version in the
-{@code x86} directory.</p>
\ No newline at end of file
+{@code x86} directory.</p>
diff --git a/docs/html-ndk/ndk/guides/setup.html b/docs/html-ndk/ndk/guides/setup.html
deleted file mode 100644
index 0b44132..0000000
--- a/docs/html-ndk/ndk/guides/setup.html
+++ /dev/null
@@ -1,520 +0,0 @@
-<!DOCTYPE html>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<html>
-<head>
-
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="viewport" content="width=device-width" />
-
-<meta name="Description" content="This document explains how to: This document assumes that you are already familiar with Java-based Android development. For more information on that topic, see the Android developer site . To install and configure the NDK, follow these steps: Eclipse …">
-<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
-<title>Setup | Android Developers</title>
-
-<!-- STYLESHEETS -->
-<link rel="stylesheet"
-href="//fonts.googleapis.com/css?family=Roboto+Condensed">
-<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
-  title="roboto">
-<link href="/assets/css/default.css?v=5" rel="stylesheet" type="text/css">
-
-<!-- JAVASCRIPT -->
-<script src="//www.google.com/jsapi" type="text/javascript"></script>
-<script src="/assets/js/android_3p-bundle.js" type="text/javascript"></script>
-<script type="text/javascript">
-  var toRoot = "/";
-  var metaTags = [];
-  var devsite = false;
-</script>
-<script src="/assets/js/docs.js?v=3" type="text/javascript"></script>
-
-
-
-<script>
-  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-  ga('create', 'UA-5831155-1', 'android.com');
-  ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'});  // New tracker);
-  ga('send', 'pageview');
-  ga('universal.send', 'pageview'); // Send page view for new tracker.
-</script>
-
-</head>
-
-<body class="gc-documentation develop  guide" itemscope itemtype="http://schema.org/Article">
-
-<a name="top"></a>
-
-<!-- dialog to prompt lang pref change when loaded from hardcoded URL
-<div id="langMessage" style="display:none">
-  <div>
-    <div class="lang en">
-      <p>You requested a page in English, would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang es">
-      <p>You requested a page in Spanish (Español), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ja">
-      <p>You requested a page in Japanese (日本語), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ko">
-      <p>You requested a page in Korean (한국어), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ru">
-      <p>You requested a page in Russian (Русский), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang zh-cn">
-      <p>You requested a page in Simplified Chinese (简体中文), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang zh-tw">
-      <p>You requested a page in Traditional Chinese (繁體中文), would you like to proceed with this language setting?</p>
-    </div>
-    <a href="#" class="button yes" onclick="return false;">
-      <span class="lang en">Yes</span>
-      <span class="lang es">Sí</span>
-      <span class="lang ja">Yes</span>
-      <span class="lang ko">Yes</span>
-      <span class="lang ru">Yes</span>
-      <span class="lang zh-cn">是的</span>
-      <span class="lang zh-tw">没有</span>
-    </a>
-    <a href="#" class="button" onclick="$('#langMessage').hide();return false;">
-      <span class="lang en">No</span>
-      <span class="lang es">No</span>
-      <span class="lang ja">No</span>
-      <span class="lang ko">No</span>
-      <span class="lang ru">No</span>
-      <span class="lang zh-cn">没有</span>
-      <span class="lang zh-tw">没有</span>
-    </a>
-  </div>
-</div> -->
-
-
-  <!-- Header -->
-  <div id="header-wrapper">
-    <div id="header">
-
-
-
-
-      <div class="wrap" id="header-wrap">
-        <div class="col-3 logo">
-          <a href="/index.html">
-            <img src="/assets/images/dac_logo.png"
-                srcset="/assets/images/dac_logo@2x.png 2x"
-                width="123" height="25" alt="Android Developers" />
-          </a>
-          <div class="btn-quicknav" id="btn-quicknav">
-            <a href="#" class="arrow-inactive">Quicknav</a>
-            <a href="#" class="arrow-active">Quicknav</a>
-          </div>
-        </div>
-
-        
-
-        
-
-      </div><!-- end header-wrap.wrap -->
-    </div><!-- end header -->
-
-
-    <!-- Secondary x-nav -->
-    <div id="nav-x">
-        <div class="wrap" style="position:relative;z-index:1">
-
-            <ul class="nav-x col-9 develop" style="width:100%">
-                <li class="guide"><a href="/ndk/guides/index.html">
-                    Guides</a></li>
-                <li class="reference"><a href="/ndk/reference/index.html">
-                    Reference</a></li>
-                <li class="samples"><a href="/ndk/samples/index.html">
-                    Samples</a></li>
-                <li class="downloads"><a href="/ndk/downloads/index.html">
-                    Downloads</a></li>
-                </li>
-            </ul>
-        </div>
-    </div>
-
-
-    <div id="searchResults" class="wrap" style="display:none;">
-      <h2 id="searchTitle">Results</h2>
-      <div id="leftSearchControl" class="search-control">Loading...</div>
-    </div>
-  </div> <!--end header-wrapper -->
-
-  <div id="sticky-header">
-    <div>
-      <a class="logo" href="#top"></a>
-      <a class="top" href="#top"></a>
-      <ul class="breadcrumb">
-        
-        <li class="current">Setup</li>
-      </ul>
-    </div>
-  </div>
-
-
-
-
-  <div class="wrap clearfix" id="body-content">
-    <div class="col-3" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <div id="devdoc-nav" class="scroll-pane">
-
-
-
-<ul id="nav">
-<li><strong>NDK</strong>
-   <ul>
-   <li><a href="/ndk/guides/index.html"><span class="en">Getting Started</span></a>
-      <ul>
-      <li><a href="setup.html">Setup</a></li>
-      <li><a href="concepts.html">Concepts</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/build.html"><span class="en">Building</span></a>
-      <ul>
-      <li><a href="">ndk-build</a></li>
-      <li><a href="">Android.mk</a></li>
-      <li><a href="">Application.mk</a></li>
-      <li><a href="">Standalone Toolchain</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/debug.html"><span class="en">Debugging</span></a>
-      <ul>
-      <li><a href="">ndk-gdb</a></li>
-      <li><a href="">ndk-stack</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/arch.html"><span class="en">Architectures and CPUs</span></a>
-      <ul>
-      <li><a href="">ABI Management</a></li>
-      <li><a href="">Neon</a></li>
-      <li><a href="">Mips</a></li>
-      <li><a href="">x86</a></li>
-      <li><a href="">x86-64</a></li>
-      <li><a href="">CPU Features</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/libs.html"><span class="en">Libraries</span></a>
-      <ul>
-      <li><a href="">Stable APIs</a></li>
-      <li><a href="">C++ Support</a></li>
-      <li><a href="">Prebuilt Libraries</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/sample.html"><span class="en">Sample Walkthrough</span></a>
-      <ul>
-      <li><a href="">hello-jni</a></li>
-      <li><a href="">native-activity</a></li>
-      <li><a href="">Teapot</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/atomics.html"><span class="en">Atomics</span></a></li>
-   <li><a href="/ndk/guides/importing.html"><span class="en">Importing Modules</span></a></li>
-   <li><a href="/ndk/guides/depends.html"><span class="en">ndk-depends</span></a></li>
-   <li><a href="/ndk/guides/system.html"><span class="en">System Image Issues</span></a></li>
-   <li><a href="/ndk/guides/licenses.html"><span class="en">Licenses</span></a></li>
-   </ul></li>
-<li><strong>Radiance</strong>
-   <ul>
-   <li><a href="/ndk/guides/null.html"><span class="en">Stub 1</span></a>
-      <ul>
-      <li><a href="">Stublet</a></li>
-      <li><a href="">Stublet</a></li>
-      </ul></li>
-   <li><a href="/ndk/guides/null.html"><span class="en">Stub 2, etc.</span></a>
-      <ul>
-      <li><a href="">Another Stublet</a></li>
-      <li><a href="">Another Stublet</a></li>
-      </ul></li>
-   </ul></li>
-</ul>
-
-
-<script type="text/javascript">
-<!--
-    buildToggleLists();
-    changeNavLang(getLangPref());
-//-->
-</script>
-
-
-
-
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-
-
-
-
-<div class="col-12" id="doc-col" >
-
-
-  
-
-  
-    
-      
-        <h1 itemprop="name" >Setup</h1>
-      
-    
-  
-
-
-  
-  <div id="jd-content">
-
-
-    <div class="jd-descr" itemprop="articleBody">
-    <div id="qv-wrapper">
-    <div id="qv">
-      <h2>On this page</h2>
-
-      <ol>
-        <li><a href="#install">Installation</a></li>
-        <li><a href="#configure">Configuring Eclipse</a></li>
-        <li><a href="#verify">Verification</a></li>
-          </ol>
-        </li>
-      </ol>
-    </div>
-  </div>
-
-
-<div class="contents">
-<div class="textblock"><p>This document explains how to:</p>
-<ul>
-<li><a href="#install">Get</a> and install the NDK.</li>
-<li><a href="#configure">Configure</a> your system and the Eclipse and the Android Development Tool
-(ADT) for use with it.</li>
-<li><a href="#verify">Verify</a>, using a simple sample, that everything is working as expected.
-</li>
-</ul>
-<p>This document assumes that you are already familiar with Java-based Android development. For more
-information on that topic, see the
-<a href="/">Android developer site</a>.</p>
-
-<h2 id="install">Installation</h2>
-<p>To install and configure the NDK, follow these steps:</p>
-<ol type="1">
-<li>Get and install the <a href="/sdk/index.html">Android SDK</a>.if you
-have not already done so.</li>
-<li><a href="/tools/sdk/ndk/index.html">Download</a> and unzip the NDK,
-making sure to download the correct version for your development platform. You may place the
-unzipped directory anywhere on your local drive.</li>
-<li>Update your <code>PATH</code> environment variable with the location of the directory that
-contains the NDK.</li>
-</ol>
-
-
-<h2 id="configure">Configuring Eclipse</h2>
-<p>Eclipse must know where the NDK is in order to use it when building your app. Follow these steps
-to set the location of the NDK.</p>
-<ol type="1">
-<li>Launch Eclipse, which is installed as part of the Android SDK.</li>
-<li>Open <b>Window</b> &gt; <b>Preferences</b>.</li>
-<li>In the pane on the left side of the <i>Preferences</i> window, select <i>Android</i>.
-The <i>Android</i> section expands, revealing a number of subsections.</li>
-<li>Select <b>NDK</b>. In the pane on the right side of the <i>Preferences</i> window, browse to
-the directory that contains the NDK.</li>
-<li>Click <b>OK</b> to return to the <i>Package Explorer</i> display.</li>
-</ol>
-
-<h2 id="verify">Verification</h2>
-<h3>Eclipse</h3>
-<p>To confirm that you have installed the NDK, set it up correctly, and properly configured Eclipse,
-follow these steps:</p>
-<ol type="1">
-<li>Import the hello-jni sample from <code>&lt;ndk&gt;/samples/</code>, as you would any other Android
-project.</li>
-<li>In the <i>Project Explorer</i> pane, right-click the project name (<i>HelloJni</i>). A
-context menu appears.</li>
-<li>From the context menu, select <b>Android Tools</b> &gt; <b>Add Native Support</b>. The
-<i>Add Android Native Support</i> window appears.</li>
-<li>Accept the default library name (“hello-jni”), and click <b>Finish</b>.</li>
-<li>Build and execute the application.</li>
-</ol>
-<h3>Command line</h3>
-<p>Follow these steps to build from the command line:</p>
-<ol type="1">
-<li>Change to the root directory of your project.</li>
-<li>Execute ndk-build to build the native component of your app. do this by
-typing <code>ndk-build</code> at the command prompt.</li>
-<li>Build and install your project as you would a regular Android app written in Java. For more
-information, see
-<a href="/tools/building/index.html">Building and Running</a> and
-<a href="/tools/building/building-cmdline.html">Building and Running
-from the Command Line</a>.</li>
-</ol>
-
-<p>If you have successfully installed and configured the NDK, the screen on your target device looks
-as shown in Figure 1.</p>
-
-<img src="./images/verification_screen.png" srcset="./images/verification_screen@2x.png 2x" alt="Output: Hello from JNI!" id="figure2" />
-
-<p class="img-caption">
-<strong>Figure 1.</strong> Target-device screen after successful launch.
-</p>
-
-    </div>
-
-      <div class="content-footer layout-content-row"
-                    itemscope itemtype="http://schema.org/SiteNavigationElement">
-        
-        <div class="paging-links layout-content-col col-10">
-          
-        </div>
-        <div class="layout-content-col plus-container col-2" >
-          
-            <div class="g-plusone" data-size="medium"></div>
-          
-        </div>
-        
-      </div>
-
-  </div> <!-- end jd-content -->
-
-<div id="footer" class="wrap" >
-        
-
-  <div id="copyright">
-    
-  Except as noted, this content is
-  licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
-  Creative Commons Attribution 2.5</a>. For details and
-  restrictions, see the <a href="/license.html">Content
-  License</a>.
-  </div>
-
-
-  <div id="footerlinks">
-    
-  <p>
-    <a href="/about/index.html">About Android</a>&nbsp;&nbsp;|&nbsp;
-    <a href="/legal.html">Legal</a>&nbsp;&nbsp;|&nbsp;
-    <a href="/support.html">Support</a>
-  </p>
-  </div>
-
-</div> <!-- end footer -->
-</div><!-- end doc-content -->
-
-</div> <!-- end body-content --> 
-
-
-
-
-
-  <script src="https://developer.android.com/ytblogger_lists_unified.js" type="text/javascript"></script>
-  <script src="/jd_lists_unified.js?v=8" type="text/javascript"></script>
-  <script src="/jd_extras.js?v=10" type="text/javascript"></script>
-  <script src="/jd_collections.js?v=10" type="text/javascript"></script>
-  <script src="/jd_tag_helpers.js?v=5" type="text/javascript"></script>
-
-</body>
-</html>
-
-
-
diff --git a/docs/html-ndk/ndk/guides/setup.jd b/docs/html-ndk/ndk/guides/setup.jd
new file mode 100644
index 0000000..81a33c0
--- /dev/null
+++ b/docs/html-ndk/ndk/guides/setup.jd
@@ -0,0 +1,94 @@
+page.title=Setup
+@jd:body
+
+
+<div id="qv-wrapper">
+    <div id="qv">
+      <h2>On this page</h2>
+
+      <ol>
+        <li><a href="#install">Installation</a></li>
+        <li><a href="#configure">Configuring Eclipse</a></li>
+        <li><a href="#verify">Verification</a></li>
+          </ol>
+        </li>
+      </ol>
+    </div>
+  </div>
+
+
+<div class="contents">
+<div class="textblock"><p>This document explains how to:</p>
+<ul>
+<li><a href="#install">Get</a> and install the NDK.</li>
+<li><a href="#configure">Configure</a> your system and the Eclipse and the Android Development Tool
+(ADT) for use with it.</li>
+<li><a href="#verify">Verify</a>, using a simple sample, that everything is working as expected.
+</li>
+</ul>
+<p>This document assumes that you are already familiar with Java-based Android development. For more
+information on that topic, see the
+<a href="{@docRoot}">Android developer site</a>.</p>
+
+<h2 id="install">Installation</h2>
+<p>To install and configure the NDK, follow these steps:</p>
+<ol type="1">
+<li>Get and install the <a href="{@docRoot}sdk/index.html">Android SDK</a>.</li>
+<li><a href="{@docRoot}ndk/downloads/index.html">Download</a> and
+<a href="{@docRoot}ndk/downloads/index.html#extract">extract</a> the NDK,
+making sure to download the correct version for your development platform. You may place the
+unzipped directory anywhere on your local drive.</li>
+<li>Update your {@code PATH} environment variable with the location of the directory that
+contains the NDK.</li>
+</ol>
+
+
+<h2 id="configure">Configuring Eclipse</h2>
+<p>Eclipse must know where the NDK is in order to use it when building your app. Follow these steps
+to set the location of the NDK.</p>
+<ol type="1">
+<li>Launch Eclipse, which is installed as part of the Android SDK.</li>
+<li>Open <b>Window</b> &gt; <b>Preferences</b>.</li>
+<li>In the pane on the left side of the <i>Preferences</i> window, select <i>Android</i>.
+The <i>Android</i> section expands, revealing a number of subsections.</li>
+<li>Select <b>NDK</b>. In the pane on the right side of the <i>Preferences</i> window, browse to
+the directory that contains the NDK.</li>
+<li>Click <b>OK</b> to return to the <i>Package Explorer</i> display.</li>
+</ol>
+
+<h2 id="verify">Verification</h2>
+<h3>Eclipse</h3>
+<p>To confirm that you have installed the NDK, set it up correctly, and properly configured Eclipse,
+follow these steps:</p>
+<ol type="1">
+<li>Import the hello-jni sample from {@code &lt;ndk&gt;/samples/}, as you would any other Android
+project.</li>
+<li>In the <i>Project Explorer</i> pane, right-click the project name (<i>HelloJni</i>). A
+context menu appears.</li>
+<li>From the context menu, select <b>Android Tools</b> &gt; <b>Add Native Support</b>. The
+<i>Add Android Native Support</i> window appears.</li>
+<li>Accept the default library name (“hello-jni”), and click <b>Finish</b>.</li>
+<li>Build and execute the application.</li>
+</ol>
+<h3>Command line</h3>
+<p>Follow these steps to build from the command line:</p>
+<ol type="1">
+<li>Change to the root directory of your project.</li>
+<li>Execute ndk-build to build the native component of your app. do this by
+typing {@code ndk-build} at the command prompt.</li>
+<li>Build and install your project as you would a regular Android app written in Java. For more
+information, see
+<a href="{@docRoot}tools/building/index.html">Building and Running</a> and
+<a href="{@docRoot}tools/building/building-cmdline.html">Building and Running
+from the Command Line</a>.</li>
+</ol>
+
+<p>If you have successfully installed and configured the NDK, the screen on your target device looks
+as shown in Figure 1.</p>
+
+<img src="./images/verification_screen.png" srcset="./images/verification_screen@2x.png 2x"
+alt="Output: Hello from JNI!" id="figure1" />
+
+<p class="img-caption">
+<strong>Figure 1.</strong> Target-device screen after successful launch.
+</p>
diff --git a/docs/html-ndk/ndk/guides/stable_apis.jd b/docs/html-ndk/ndk/guides/stable_apis.jd
index a3fedcc..cad02ac 100644
--- a/docs/html-ndk/ndk/guides/stable_apis.jd
+++ b/docs/html-ndk/ndk/guides/stable_apis.jd
@@ -58,7 +58,7 @@
 have a specific new group of headers and libraries for an Android API level, it means that
 an app targeting that level should use the most recently released NDK assets. For example,
 there was no new release of NDK headers or libraries for Android API levels 6 and 7. Therefore,
-when developing an app targeting Android API level 7, you would use the headers and libraries
+when developing an app targeting Android API level 7, you should use the headers and libraries
 located under {@code android-5/}.</p>
 
 <p>Table 1 shows the correspondence between NDK-supported API levels and Android releases.</p>
diff --git a/docs/html-ndk/ndk/guides/standalone_toolchain.jd b/docs/html-ndk/ndk/guides/standalone_toolchain.jd
index f3777f3..62d22b5 100644
--- a/docs/html-ndk/ndk/guides/standalone_toolchain.jd
+++ b/docs/html-ndk/ndk/guides/standalone_toolchain.jd
@@ -29,7 +29,7 @@
 unnecessary for most use cases. In most cases, we recommend that you forego using a standalone
 toolchain, and instead stick to the NDK build system.</p>
 
-<h2 id="syt">Selecting your Toolchain</h2>
+<h2 id="syt">Selecting Your Toolchain</h2>
 <p>Before anything else, you need to decide which processing architecture your standalone toolchain
 is going to target. Each architecture corresponds to a different toolchain name, as Table 1
 shows.</p>
@@ -69,7 +69,7 @@
 
 
 
-<h2 id="sys">Selecting your Sysroot</h2>
+<h2 id="sys">Selecting Your Sysroot</h2>
 <p>The next thing you need to do is define your <i>sysroot</i> (A sysroot is a directory containing
 the system headers and libraries for your target). To define the sysroot, you must must know the
 Android API level you want to target for native support; available native APIs vary by Android API
@@ -86,7 +86,7 @@
 </pre>
 
 For more detail about the Android API levels and the respective native APIs they support, see
-<a href={docRoot}ndk/guides/stable_apis.html>Stable APIs</a>.
+<a href={@docRoot}ndk/guides/stable_apis.html>Android NDK Native APIs</a>.
 
 <h2 id="itc">Invoking the Compiler</h2>
 
@@ -307,7 +307,7 @@
 </table>
 
 For more information on specifying a 32- or 64-bit instruction host toolchain, see
-<a href="{@docRoot}/ndk/guides/ndk-build.html#6432">ndk-build</a>.
+<a href="{@docRoot}ndk/guides/ndk-build.html#6432">ndk-build</a>.
 
 <p>You may specify {@code stl=stlport} to copy {@code libstlport} instead of the default
 {@code libgnustl}. If you do so, and you wish to link against the shared library, you must
@@ -334,7 +334,7 @@
 
 <p>For more options and details, use {@code --help}.</p>
 
-<h2>Working with Clang</h2>
+<h2 id="wwc">Working with Clang</h2>
 <p>You can install Clang binaries in the standalone installation by using the
 {@code --llvm-version=&lt;version&gt;} option. {@code &lt;version&gt;} is a LLVM/Clang version
 number, such as {@code 3.4} or {@code 3.5}. For example:
@@ -413,9 +413,9 @@
 section.</p>
 
 
-<h2>ABI Compatibility</h2>
+<h2 id="abi">ABI Compatibility</h2>
 <p>The machine code that the ARM toolchain generates should be compatible with the official Android
-<a href="{docRoot}/ndk/guides/cpu-arch-abis.html">armeabi ABI</a> by default.</p>
+{@code armeabi} <a href="{@docRoot}ndk/guides/abis.html">ABI</a> by default.</p>
 
 <p>We recommend use of the {@code -mthumb} compiler flag to force the generation of 16-bit Thumb-1
 instructions (the default being 32-bit ARM instructions).</p>
@@ -467,9 +467,9 @@
 
 <p>You don't have to use any specific compiler flag when targeting the MIPS ABI.</p>
 
-<p>To learn more about ABI support, see <a href="{@docRoot}/ndk/guides/x86.html">x86</a>.</p>
+<p>To learn more about ABI support, see <a href="{@docRoot}ndk/guides/x86.html">x86</a>.</p>
 
-<h2>Warnings and Limitations</h2>
+<h2 id="war">Warnings and Limitations</h2>
 <h3>Windows support</h3>
 <p>The Windows binaries do not depend on Cygwin. This lack of dependency makes them faster. The
 cost, however, is that they do not understand Cygwin path specifications like
diff --git a/docs/html-ndk/ndk/guides/x86-64.jd b/docs/html-ndk/ndk/guides/x86-64.jd
index 22f3aaa..c2f0d28 100644
--- a/docs/html-ndk/ndk/guides/x86-64.jd
+++ b/docs/html-ndk/ndk/guides/x86-64.jd
@@ -41,7 +41,7 @@
 
 <h2 id="st">Standalone Toolchain</h2>
 
-<p>It is possible to use the 64-bit x86 toolchain in standalone mode with the NDK. For more
+<p>You can use the 64-bit x86 toolchain in standalone mode with the NDK. For more
 information about doing so, see <a href="{@docRoot}ndk/guides/standalone_toolchain.html">
 Standalone Toolchain</a>, under the "Advanced method" section.
 
@@ -49,4 +49,4 @@
 <p>The NDK provides native versions of Android APIs for 64-bit x86 machine code starting from
 Android 5.0 (Android API level 21). If your project files target an older API level, but include
 {@code x86_64} as a targeted platform, the NDK build script automatically selects the right set of
-native platform headers and libraries for you.</p>
\ No newline at end of file
+native platform headers and libraries for you.</p>
diff --git a/docs/html-ndk/ndk/guides/x86.jd b/docs/html-ndk/ndk/guides/x86.jd
index e112a56..3a01b05 100644
--- a/docs/html-ndk/ndk/guides/x86.jd
+++ b/docs/html-ndk/ndk/guides/x86.jd
@@ -28,7 +28,7 @@
 </pre
 
 <p>For more information about defining the {@code APP_ABI} variable, see
-<a href="{docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a>.</p>
+<a href="{@docRoot}ndk/guides/application_mk.html">{@code Application.mk}</a>.</p>
 
 <p>The build system places generated libraries into {@code $PROJECT/libs/x86/}, where
 {@code $PROJECT} represents your project's root directory, and embeds them in your APK under
diff --git a/docs/html-ndk/ndk/index.jd b/docs/html-ndk/ndk/index.jd
index f97dbef..30d68d3 100644
--- a/docs/html-ndk/ndk/index.jd
+++ b/docs/html-ndk/ndk/index.jd
@@ -13,7 +13,7 @@
       <div class="col-7of16 cdol-push-1of16">
         <h1 class="dac-hero-title">Android NDK</h1>
         <p class="dac-hero-description">
-        The Android NDK is a toolset that lets you implement parts of your app using native code languages such as C and C++. For certain types of apps, this can help you reuse existing code libraries written in those languages.
+        The Android NDK is a toolset that lets you implement parts of your app using native-code languages such as C and C++. For certain types of apps, this can help you reuse existing code libraries written in those languages.
         </p>
 
         <a class="dac-hero-cta" href="/ndk/guides/index.html">
@@ -45,7 +45,7 @@
   <div class="resource-widget resource-flow-layout col-16"
        data-query="type:blog+tag:ndk"
        data-cardSizes="6x6"
-       data-maxResults="6"
+       data-maxResults="9"
        data-initial-results="3"></div>
 </div></section>
 
diff --git a/docs/html-ndk/ndk/reference/index.jd b/docs/html-ndk/ndk/reference/index.jd
index a496f19..a89c152 100644
--- a/docs/html-ndk/ndk/reference/index.jd
+++ b/docs/html-ndk/ndk/reference/index.jd
@@ -1,4 +1,12 @@
-page.title=Reference
+page.title=API Reference
 @jd:body
 
-<p>NDK reference docs
\ No newline at end of file
+<p>The API reference for the NDK currently comprises documentation for the base set of
+native headers that the NDK provides for Android. These headers, and their associated libraries,
+provide functionalities such as:</p>
+
+<ul>
+   <li>Using hardware sensors.</li>
+   <li>Accessing storage.</li>
+   <li>Handling user input.</li>
+</ul>
\ No newline at end of file
diff --git a/docs/html-ndk/ndk/reference/reference_toc.cs b/docs/html-ndk/ndk/reference/reference_toc.cs
index 3e10562..404a0a6 100644
--- a/docs/html-ndk/ndk/reference/reference_toc.cs
+++ b/docs/html-ndk/ndk/reference/reference_toc.cs
@@ -8,40 +8,66 @@
 
 <ul id="nav">
   <li class="nav-section">
-    <div class="nav-section-header"><a href="group___asset.html"><span class="en">Asset</span></a></div>
+    <div class="nav-section-header"><a href="/ndk/reference/group___asset.html"><span class="en">Asset Manager</span></a></div>
     <ul>
-      <li><a href="asset__manager_8h.html">asset_manager.h</a></li>
-      <li><a href="asset__manager__jni_8h.html">asset_manager_jni.h</a></li>
+      <li><a href="/ndk/reference/asset__manager_8h.html">asset_manager.h</a></li>
+      <li><a href="/ndk/reference/asset__manager__jni_8h.html">asset_manager_jni.h</a></li>
     </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___bitmap.html"><span class="en">
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___bitmap.html"><span class="en">
     Bitmap</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/bitmap_8h.html">bitmap.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___configuration.html"><span class="en">
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___configuration.html"><span class="en">
     Configuration</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/configuration_8h.html">configuration.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___input.html"><span class="en">
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___input.html"><span class="en">
     Input</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/input_8h.html">input.h</a></li>
+      <li><a href="/ndk/reference/keycodes_8h.html">keycodes.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___looper.html"><span class="en">
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___looper.html"><span class="en">
     Looper</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/looper_8h.html">looper.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___native_activity.html"><span class="en">
-    Native Activity</span></a></div>
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___native_activity.html"><span class="en">
+    Native Activity and Window</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/native__activity_8h.html">native_activity.h</a></li>
+      <li><a href="/ndk/reference/native__window_8h.html">native_window.h</a></li>
+      <li><a href="/ndk/reference/native__window__jni_8h.html">native_window.h</a></li>
+      <li><a href="/ndk/reference/rect_8h.html">rect.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___sensor.html"><span class="en">
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___sensor.html"><span class="en">
     Sensor</span></a></div>
+    <ul>
+      <li><a href="/ndk/reference/sensor_8h.html">sensor.h</a></li>
+    </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="group___storage.html"><span class="en">
-    Storage</span></a></div>
+    <div class="nav-section-header empty"><a href="/ndk/reference/group___storage.html"><span class="en">
+    Storage Manager</span></a></div>
   </li>
+    <ul>
+      <li><a href="/ndk/reference/storage__manager_8h.html">sensor_manager.h</a></li>
+      <li><a href="/ndk/reference/obb_8h.html">obb.h</a></li>
+    </ul>
 </ul>
 
 <script type="text/javascript">
diff --git a/docs/html-ndk/ndk/samples/downloads.jd b/docs/html-ndk/ndk/samples/downloads.jd
new file mode 100644
index 0000000..3e5e3b7
--- /dev/null
+++ b/docs/html-ndk/ndk/samples/downloads.jd
@@ -0,0 +1,24 @@
+page.title=Samples: Downloads
+@jd:body
+
+<style>
+
+.landing-button {
+  min-width: 155px;
+  text-align: center;
+}
+</style>
+
+<p>From this page, you can download samples that provide a look at the NDK in action. A few of the
+topics covered are:</p>
+
+<ul>
+   <li>Managing your native app's activity lifecycle.</li>
+   <li>Using native OpenGL on an Android device.</li>
+   <li>Implementing native audio.</li>
+   <li>Exporting modules.</li>
+</ul>
+
+<p class="landing-button landing-secondary"><a href="{@docRoot}ndk/samples/samples_download.zip">Download the NDK Samples</a>
+</p>
+
diff --git a/docs/html-ndk/ndk/samples/index.jd b/docs/html-ndk/ndk/samples/index.jd
index b333aa7..ce03f1c 100644
--- a/docs/html-ndk/ndk/samples/index.jd
+++ b/docs/html-ndk/ndk/samples/index.jd
@@ -1,4 +1,13 @@
 page.title=Samples
 @jd:body
 
-<p>NDK samples
\ No newline at end of file
+<p>Welcome to the NDK samples area. Here, you can
+<a href="{@docRoot}ndk/samples/downloads.html">download</a> a variety of sample apps to help
+deepen your understanding of how to use the NDK. There are also detailed
+<a href="{@docRoot}ndk/samples/walkthroughs.html">walkthroughs</a> of several
+of the apps, providing additional insight into key topics.</p>
+
+<p>These samples are also contained in the NDK installation package. They reside in
+{@code $NDK/samples/}, where {@code $NDK} is the NDK installation root.</p>
+
+
diff --git a/docs/html-ndk/ndk/guides/sample_hellojni.jd b/docs/html-ndk/ndk/samples/sample_hellojni.jd
similarity index 98%
rename from docs/html-ndk/ndk/guides/sample_hellojni.jd
rename to docs/html-ndk/ndk/samples/sample_hellojni.jd
index fa3fb5d..8d11989 100644
--- a/docs/html-ndk/ndk/guides/sample_hellojni.jd
+++ b/docs/html-ndk/ndk/samples/sample_hellojni.jd
@@ -16,7 +16,7 @@
     </div>
   </div>
 
-<p>This sample provides a bare-bones look at HelloJNI, a minimal
+<p>This sample guides you through HelloJNI, a minimal
 application built with the NDK. This sample is in the {@code samples/hello-jni/} directory
 under the root directory of your NDK installation.</p>
 
@@ -120,4 +120,4 @@
 <pre class="no-pretty-print">
 return (*env)-&gt;NewStringUTF(env, "Hello from JNI !
 Compiled with ABI " ABI ".");
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html-ndk/ndk/guides/sample_na.jd b/docs/html-ndk/ndk/samples/sample_na.jd
similarity index 99%
rename from docs/html-ndk/ndk/guides/sample_na.jd
rename to docs/html-ndk/ndk/samples/sample_na.jd
index 55362cd..a677de5 100644
--- a/docs/html-ndk/ndk/guides/sample_na.jd
+++ b/docs/html-ndk/ndk/samples/sample_na.jd
@@ -20,7 +20,7 @@
 {@code samples/native-activity}. It is a very simple example of a purely native
 application, with no Java source code. In the absence of any Java source, the
 Java compiler still creates an executable stub for the virtual machine to run.
-The stub serves as a wrapper for the actual, native program, which lives in the {@code .so}
+The stub serves as a wrapper for the actual, native program, which is located in the {@code .so}
 file.</p>
 
 <p>The app itself simply renders a color onto the entire screen, and
@@ -256,4 +256,4 @@
         engine_draw_frame(&amp;engine);
     }
 }
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html-ndk/ndk/guides/sample_teapot.jd b/docs/html-ndk/ndk/samples/sample_teapot.jd
similarity index 99%
rename from docs/html-ndk/ndk/guides/sample_teapot.jd
rename to docs/html-ndk/ndk/samples/sample_teapot.jd
index 9542a9d..6d19de6 100644
--- a/docs/html-ndk/ndk/guides/sample_teapot.jd
+++ b/docs/html-ndk/ndk/samples/sample_teapot.jd
@@ -77,7 +77,7 @@
 {@code samples/Teapot/src/com/sample/teapot}, under the NDK installation root directory. It handles
 activity lifecycle events, and also enables the app to display text on the screen. The following
 block of code is most important from the perspective of the native-side implementation: The native
-code calls it to display a popup window for text display.</p>
+code calls it to display a popup window for displaying text.</p>
 
 <pre class="no-pretty-print">
 
@@ -357,4 +357,4 @@
     state->userData = &g_engine;
     state->onAppCmd = Engine::HandleCmd;
     state->onInputEvent = Engine::HandleInput;
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html-ndk/ndk/samples/samples_download.zip b/docs/html-ndk/ndk/samples/samples_download.zip
new file mode 100644
index 0000000..35265be
--- /dev/null
+++ b/docs/html-ndk/ndk/samples/samples_download.zip
Binary files differ
diff --git a/docs/html-ndk/ndk/samples/samples_toc.cs b/docs/html-ndk/ndk/samples/samples_toc.cs
index 9a39f04..e0dcf04 100644
--- a/docs/html-ndk/ndk/samples/samples_toc.cs
+++ b/docs/html-ndk/ndk/samples/samples_toc.cs
@@ -6,13 +6,23 @@
        localized titles are added in the language order specified below.
 ?>
 
-
 <ul id="nav">
+   <li class="nav-section">
+      <div class="nav-section-header empty"><a href="<?cs var:toroot ?>ndk/samples/downloads.html">
+      <span class="en">Downloads</span></a></div>
+   </li>
 
-  <li class="nav-section">
-    <div class="nav-section-header empty"><a href="/ndk/samples/index.html"><span class="en">
-      Samples</span></a></div>
-  </li>
+   <li class="nav-section">
+      <div class="nav-section-header">
+      <a href="<?cs var:toroot ?>ndk/samples/walkthroughs.html"><span class="en">
+      Walkthroughs</span></a></div>
+      <ul>
+      <li><a href="<?cs var:toroot ?>ndk/samples/sample_hellojni.html">hello-jni</a></li>
+      <li><a href="<?cs var:toroot ?>ndk/samples/sample_na.html">sample-na</a></li>
+      <li><a href="<?cs var:toroot ?>ndk/samples/sample_teapot.html">Teapot</a></li>
+      </ul>
+   </li>
+
 </ul>
 
 
diff --git a/docs/html-ndk/ndk/samples/walkthroughs.jd b/docs/html-ndk/ndk/samples/walkthroughs.jd
new file mode 100644
index 0000000..b214e66
--- /dev/null
+++ b/docs/html-ndk/ndk/samples/walkthroughs.jd
@@ -0,0 +1,10 @@
+page.title=Samples: Walkthroughs
+@jd:body
+
+<p>This section provides detailed walkthroughs of several key samples. The samples are as
+follows:</p>
+
+<li><a href="{@docRoot}ndk/samples/sample_hellojni.html">hello-jni</a>: A very basic app that illustrates core workings of the NDK.</li>
+<li><a href="{@docRoot}ndk/samples/sample_na.html">native-activity</a>: An app that shows the fundamentals of constructing a purely native app. It places particular emphasis on the
+{@code android_native_app_glue library}.</li>
+<li><a href="<a href="{@docRoot}ndk/samples/sample_teapot.html">Teapot</a>: A simple OpenGL demo, showcasing the <code>ndk_helper</code> class.</li>
\ No newline at end of file
diff --git a/docs/html/_redirects.yaml b/docs/html/_redirects.yaml
index 94e6469..5d59130 100644
--- a/docs/html/_redirects.yaml
+++ b/docs/html/_redirects.yaml
@@ -326,6 +326,15 @@
 - from: /shareables/training/BitmapFun.zip
   to: /downloads/samples/DisplayingBitmaps.zip
 
+- from: /shareables/auto/AndroidAuto-audio-apps.pdf
+  to: http://google.com/design/spec-auto/audio-apps/design-principles.html
+
+- from: /shareables/auto/AndroidAuto-messaging-apps.pdf
+  to: http://google.com/design/spec-auto/messaging-apps/voice-based-messaging.html
+
+- from: /shareables/auto/AndroidAuto-custom-colors.pdf
+  to: http://google.com/design/spec-auto/colors-branding/color-themes.html
+
 - from: /shareables/...
   to: http://commondatastorage.googleapis.com/androiddevelopers/shareables/...
 
@@ -399,5 +408,5 @@
   to: /training/building-wearables.html
 
 # ---------- DISTRIBUTE ------------------
-- from /distribute/tools/promote/badge-files.html
+- from: /distribute/tools/promote/badge-files.html
   to: /distribute/tools/promote/badges.html
diff --git a/docs/html/auto/images/logos/apps/umano.png b/docs/html/auto/images/logos/apps/umano.png
deleted file mode 100644
index 478e268..0000000
--- a/docs/html/auto/images/logos/apps/umano.png
+++ /dev/null
Binary files differ
diff --git a/docs/html/auto/images/logos/apps/whatsapp.png b/docs/html/auto/images/logos/apps/whatsapp.png
new file mode 100644
index 0000000..a180d7a
--- /dev/null
+++ b/docs/html/auto/images/logos/apps/whatsapp.png
Binary files differ
diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd
index 66ea15a..bf36995 100644
--- a/docs/html/auto/index.jd
+++ b/docs/html/auto/index.jd
@@ -272,8 +272,9 @@
                    />
             </div>
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/umano.png"
-                   width="160" height="160" class="img-logo" />
+              <img src="{@docRoot}auto/images/logos/apps/skype.png"
+                   width="160" height="70" class="img-logo" style="margin-top:40px"
+                   />
             </div>
             <div class="col-4">
               <img src="/auto/images/logos/apps/spotify.png"
@@ -293,15 +294,14 @@
                    />
             </div>
             <div class="col-4">
-              <img src="{@docRoot}auto/images/logos/apps/skype.png"
-                   width="160" height="70" class="img-logo" style="margin-top:40px; margin-left:160px"
-                   />
-            </div>
-            <div class="col-4">
               <img src="{@docRoot}auto/images/logos/apps/textme.png"
                    width="80" height="80" class="img-logo" style="margin-top:30px;margin-left:200px"
                    />
             </div>
+            <div class="col-4">
+              <img src="{@docRoot}auto/images/logos/apps/whatsapp.png"
+                   width="120" height="120" class="img-logo" style="margin-top:10px;margin-left:180px" />
+            </div>
           </div>
 
           <div class="cols" style="margin-top:60px">
diff --git a/docs/html/design/auto/index.jd b/docs/html/design/auto/index.jd
index 06f8592..49bd221 100644
--- a/docs/html/design/auto/index.jd
+++ b/docs/html/design/auto/index.jd
@@ -14,13 +14,13 @@
   <h2><strong>UI Guidelines</strong></h2>
   <ul>
   <li><a href="{@docRoot}shareables/auto/AndroidAuto-audio-apps.pdf">
-    <strong>Auto Audio Apps (PDF)</strong></a>
+    <strong>Auto Audio Apps</strong></a>
   </li>
   <li><a href="{@docRoot}shareables/auto/AndroidAuto-messaging-apps.pdf">
-    <strong>Auto Messaging Apps (PDF)</strong></a>
+    <strong>Auto Messaging Apps</strong></a>
   </li>
   <li><a href="{@docRoot}shareables/auto/AndroidAuto-custom-colors.pdf">
-    <strong>Auto Color Customization (PDF)</strong></a>
+    <strong>Auto Color Customization</strong></a>
   </li>
  </ul>
 </div>
diff --git a/docs/html/develop/index.jd b/docs/html/develop/index.jd
index 9707c99..bbd2f71 100644
--- a/docs/html/develop/index.jd
+++ b/docs/html/develop/index.jd
@@ -56,9 +56,11 @@
 <section class="dac-section dac-gray dac-small dac-invert" id="latest"><div class="wrap">
   <h2 class="norule">Latest</h2>
   <div class="resource-widget resource-flow-layout col-16"
+       data-query="type:youtube+tag:develop+tag:featured, type:blog+tag:develop+tag:featured"
        data-query="collection:develop/landing/latest"
+       data-sortOrder="-timestamp"
        data-cardSizes="6x6"
-       data-maxResults="9"
+       data-maxResults="12"
        data-initial-results="3"></div>
 </div></section>
 
@@ -70,10 +72,9 @@
   <div class="resource-widget resource-flow-layout col-16"
        data-query="collection:develop/landing/tools"
        data-cardSizes="6x6"
-       data-maxResults="3"
+       data-maxResults="15"
+       data-initial-results="3"
        data-sortOrder="random"></div>
-  <ul class="dac-section-links">
-  </ul>
 </div></section>
 
 <section class="dac-section dac-section-light"><div class="wrap">
@@ -96,7 +97,7 @@
 <section class="dac-section dac-gray"><div class="wrap">
   <h1 class="dac-section-title">Ubiquitous computing on Android</h1>
   <div class="dac-section-subtitle">
-    Opening up new stuff.
+    A great experience for your users across devices. 
   </div>
   <div class="resource-widget resource-flow-layout col-16"
        data-query="collection:develop/landing/ubicomp"
diff --git a/docs/html/distribute/engage/engage_toc.cs b/docs/html/distribute/engage/engage_toc.cs
index e146056..91206d3 100644
--- a/docs/html/distribute/engage/engage_toc.cs
+++ b/docs/html/distribute/engage/engage_toc.cs
@@ -1,6 +1,12 @@
 <ul id="nav">
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
+        var:toroot?>distribute/engage/intents.html">
+        <span class="en">Increase Usage through Intents</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
         var:toroot?>distribute/engage/widgets.html">
         <span class="en">Build Useful Widgets</span></a>
     </div>
@@ -13,18 +19,6 @@
   </li>
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/gcm.html">
-        <span class="en">Integrate GCM</span></a>
-    </div>
-  </li>
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/easy-signin.html">
-        <span class="en">Add Google Sign-in</span></a>
-    </div>
-  </li>
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
         var:toroot?>distribute/engage/deep-linking.html">
         <span class="en">Drive Usage with Search</span></a>
     </div>
@@ -37,8 +31,8 @@
   </li>
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/intents.html">
-        <span class="en">Increase Usage through Intents</span></a>
+        var:toroot?>distribute/engage/game-services.html">
+        <span class="en">Encourage Competition</span></a>
     </div>
   </li>
   <li class="nav-section">
@@ -49,27 +43,14 @@
   </li>
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/game-services.html">
-        <span class="en">Encourage Competition</span></a>
+        var:toroot?>distribute/engage/easy-signin.html">
+        <span class="en">Add Google Sign-in</span></a>
     </div>
   </li>
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/app-updates.html">
-        <span class="en">Update Regularly</span></a>
-    </div>
-  </li>
-
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/community.html">
-        <span class="en">Engage Your Community</span></a>
-    </div>
-  </li>
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs
-        var:toroot?>distribute/engage/video.html">
-        <span class="en">Delight with Videos</span></a>
+        var:toroot?>distribute/engage/gcm.html">
+        <span class="en">Integrate GCM</span></a>
     </div>
   </li>
 
@@ -81,4 +62,3 @@
     changeNavLang(getLangPref());
 //-->
 </script>
-
diff --git a/docs/html/distribute/engage/index.jd b/docs/html/distribute/engage/index.jd
index 165cc0e..f67538b 100644
--- a/docs/html/distribute/engage/index.jd
+++ b/docs/html/distribute/engage/index.jd
@@ -14,13 +14,9 @@
   <div class="resource-widget resource-flow-layout landing col-16"
     data-query="collection:distribute/engagelanding"
     data-cardSizes="6x6"
-    data-maxResults="6">
+    data-maxResults="26">
   </div>
-  <div class="resource-widget resource-flow-layout landing col-16"
-    data-query="collection:distribute/engagelanding"
-    data-cardSizes="6x3"
-    data-maxResults="20">
-  </div>
+
 
 <!--  <h2>Related Resources</h2>
   <div class="resource-widget resource-flow-layout col-16"
diff --git a/docs/html/distribute/essentials/essentials_toc.cs b/docs/html/distribute/essentials/essentials_toc.cs
index baca18f..072aa08 100644
--- a/docs/html/distribute/essentials/essentials_toc.cs
+++ b/docs/html/distribute/essentials/essentials_toc.cs
@@ -10,15 +10,16 @@
           </a>
     </div>
   </li>
+
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/quality/tv.html">
-            <span class="en">TV App Quality</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/quality/wear.html">
+            <span class="en">Wear App Quality</span>
           </a>
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/quality/wear.html">
-            <span class="en">Wear App Quality</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/quality/tv.html">
+            <span class="en">TV App Quality</span>
           </a>
     </div>
   </li>
@@ -28,12 +29,43 @@
           </a>
     </div>
   </li>
+
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/essentials/optimizing-your-app.html">
-          <span class="en">Optimize Your App</span>
-        </a>
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/launch-checklist.html" zh-cn-lang="发布检查清单">
+            <span class="en">Launch Checklist</span></a>
     </div>
   </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/localization-checklist.html" zh-cn-lang="本地化检查清单">
+            <span class="en">Localization Checklist</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/promote/brand.html" zh-cn-lang="品牌指南">
+            <span class="en">Brand Guidelines</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/promote/device-art.html" zh-cn-lang="Device Art Generator">
+            <span class="en">Device Art Generator</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/promote/badges.html" zh-cn-lang="Google Play 徽章生成器">
+            <span class="en">Google Play Badges</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/promote/linking.html" zh-cn-lang="链接到您的商品">
+            <span class="en">Linking to Your Products</span></a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/tools/open-distribution.html">
+            <span class="en">Alternative Distribution</span></a>
+    </div>
+  </li>
+
 </ul>
 
 
diff --git a/docs/html/distribute/essentials/index.jd b/docs/html/distribute/essentials/index.jd
index d5c3397..6185e54 100644
--- a/docs/html/distribute/essentials/index.jd
+++ b/docs/html/distribute/essentials/index.jd
@@ -12,10 +12,20 @@
   process of monitoring feedback and making improvement after launch.
 </p>
 
+<h2 id="guidelines">Quality Guidelines</h2>
+
 <div class="resource-widget resource-flow-layout landing col-16"
-  data-query="collection:distribute/essentials"
+  data-query="collection:distribute/essentials/guidelines"
   data-cardSizes="6x6"
-  data-maxResults="6">
+  data-maxResults="9">
+</div>
+
+<h2 id="tools">Tools &amp; Resources</h2>
+
+<div class="resource-widget resource-flow-layout landing col-16"
+  data-query="collection:distribute/essentials/tools"
+  data-cardSizes="6x6"
+  data-maxResults="9">
 </div>
 
 <!-- <h2>Related resources</h2>
diff --git a/docs/html/distribute/essentials/quality/auto.jd b/docs/html/distribute/essentials/quality/auto.jd
index db0f20a..ae9aac5 100644
--- a/docs/html/distribute/essentials/quality/auto.jd
+++ b/docs/html/distribute/essentials/quality/auto.jd
@@ -37,18 +37,33 @@
 </p>
 
 <p>
-  Great auto experiences are predictive and predictable.  Apps that support Android Auto
+  Great auto experiences are predictive and predictable. Apps that support Android Auto
   should show timely information to the driver only when it is relevant, and use
   simple, predictable patterns for common tasks.
 </p>
 
+<p>
+  It's important that you test your auto app for the criteria listed on this page prior to
+  submitting to Google Play for review. There are two ways to test your app:
+</p>
+
+<ol>
+  <li> Use the Android Auto simulator to validate each checklist item. The simulator allows you to
+  sideload your app for testing. For more information on the simulator, see
+  <a href="{@docRoot}training/auto/start/index.html#test-it">Run and Test Auto Apps</a>.</li>
+  <li>Test your app in a vehicle by uploading your app to the alpha/beta channel on Google Play.
+  Apps will not work on Auto in vehicles unless they are installed from the Play Store.
+  For more information, see <a
+  href="{@docRoot}distribute/googleplay/developer-console.html#alpha-beta">Alpha and Beta Testing</a>.
+  </li>
+</ol>
+
 <p class="caution">
   <strong>Important:</strong> The criteria listed in this page apply to your app's user interface
   and behavior when running on devices connected to an Android Auto screen. Apps must meet these
   criteria to qualify as an Android Auto app on Google Play.
 </p>
 
-
 <div class="headerLine">
   <h2 id="core">
   Core App Quality
@@ -103,8 +118,8 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-      App does not display on the Auto screen animated elements such as animated graphics, games, video, or
-      progress bars.
+      App does not display on the Auto screen animated elements such as animated graphics,
+      video, or progress bars.
     </p>
   </td>
 </tr>
@@ -141,7 +156,9 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-    App does not include any features that distract the driver.
+    App does not include games or other features outside of the intended app types supported
+    by Auto.
+    (<a href="{@docRoot}training/auto/start/index.html">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -152,8 +169,9 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-    App never presents any form of visual information (notifications, toasts, video, images,
-    advertising, etc.) on the phone screen while the app is active in Android Auto.
+    App never activates the phone screen to present any form of visual information (notifications,
+    toasts, video, images, advertising, etc.) on the phone screen while the app is active in Android
+    Auto.
     </p>
   </td>
 </tr>
@@ -161,7 +179,7 @@
 
 
 <tr>
-  <td rowspan="3" id="layout">
+  <td rowspan="1" id="layout">
     Layout
   </td>
 
@@ -175,29 +193,6 @@
   </td>
 </tr>
 
-
-<tr>
-  <td id="AU-FT">
-    AU-FT
-  </td>
-  <td>
-    <p style="margin-bottom:.5em;">
-     App displays all strings using the default Roboto fonts in two approved sizes.
-    </p>
-  </td>
-</tr>
-
-<tr>
-  <td id="AU-ST">
-    AU-ST
-  </td>
-  <td>
-    <p style="margin-bottom:.5em;">
-     App does not display any individual string longer than 120 characters.
-    </p>
-  </td>
-</tr>
-
 <tr>
   <td rowspan="4" id="contrast">
     Visual Contrast
@@ -209,7 +204,7 @@
   <td>
     <p style="margin-bottom:.5em;">
      App supports day mode, which renders dark text and controls on a light background.
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-custom-colors.pdf">Learn How</a>)
+     (<a href="//google.com/design/spec-auto/colors-branding/day-night-colors.html">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -221,7 +216,7 @@
   <td>
     <p style="margin-bottom:.5em;">
      App supports night mode, which renders light text and controls on a dark background.
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-custom-colors.pdf">Learn How</a>)
+     (<a href="//google.com/design/spec-auto/colors-branding/day-night-colors.html">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -234,7 +229,7 @@
     <p style="margin-bottom:.5em;">
      App provides white icon sets that the system colorizes to provide automatic
      contrast compensation.
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-custom-colors.pdf">Learn How</a>)
+     (<a href="//google.com/design/spec-auto/colors-branding/color-themes.html">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -246,7 +241,7 @@
   <td>
     <p style="margin-bottom:.5em;">
      App provides colors that the system can optimize for easy in-vehicle readability.
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-custom-colors.pdf">Learn How</a>)
+     (<a href="//google.com/design/spec-auto/colors-branding/color-themes.html">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -261,7 +256,8 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-     App must support voice commands.
+     App must support voice commands in audio apps.
+     (<a href="{@docRoot}training/auto/audio/index.html#support_voice">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -317,7 +313,7 @@
 </tr>
 
 <tr>
-  <td rowspan="5" id="general">
+  <td rowspan="6" id="general">
    General
   </td>
 
@@ -326,7 +322,18 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-     App loads in no more than 10 seconds.
+     App launches in no more than 10 seconds.
+    </p>
+  </td>
+</tr>
+
+<tr>
+  <td id="AU-LC">
+    AU-LC
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+     App loads content in no more than 10 seconds.
     </p>
   </td>
 </tr>
@@ -361,6 +368,7 @@
   <td>
     <p style="margin-bottom:.5em;">
      No tasks in the app take more than six steps to complete.
+     (<a href="//google.com/design/spec-auto/system-overview/drawer.html#drawer-drawer-content-patterns">Learn How</a>)
     </p>
   </td>
 </tr>
@@ -371,44 +379,30 @@
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-     Any app button which is non-functional or disabled must be grayed out.
+     Interactive elements that are intentionally grayed-out must be non-functional.
     </p>
   </td>
 </tr>
 
 
 <tr>
-  <td rowspan="2" id="media">
+  <td rowspan="1" id="media">
     Media
   </td>
 
 
-  <td id="AU-PA">
-    AU-PA
+  <td id="AU-MT">
+    AU-MT
   </td>
   <td>
     <p style="margin-bottom:.5em;">
-     App has no more than four primary actions plus one optional action overflow toggle (or five if
-     no action overflow is used).
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-audio-apps.pdf">Learn How</a>)
+     Media apps do not autoplay or take over media focus when launched.
+     (<a href="{@docRoot}training/auto/audio/index.html#playback-commands">Learn How</a>)
     </p>
   </td>
 </tr>
 
 <tr>
-  <td id="AU-SA">
-    AU-SA
-  </td>
-  <td>
-    <p style="margin-bottom:.5em;">
-     App has no more than four optional secondary actions plus one action overflow toggle.
-     (<a href="{@docRoot}shareables/auto/AndroidAuto-audio-apps.pdf">Learn How</a>)
-    </p>
-  </td>
-</tr>
-
-
-<tr>
   <td rowspan="2" id="notifications">
     Notifications
   </td>
@@ -439,6 +433,70 @@
   </td>
 </tr>
 
+<tr>
+  <td rowspan="5" id="messages">
+    Messaging
+  </td>
+
+  <td id="AU-MI">
+    AU-MI
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+      App is able to successfully receive incoming messages.
+      (<a href="{@docRoot}training/auto/messaging/index.html">Learn How</a>)
+    </p>
+  </td>
+</tr>
+
+<tr>
+  <td id="AU-MG">
+    AU-MG
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+     Messages are properly grouped and displayed in the correct order.
+     (<a href="{@docRoot}training/auto/messaging/index.html#build_conversation">Learn How</a>)
+   </p>
+  </td>
+</tr>
+
+<tr>
+  <td id="AU-MR">
+    AU-MR
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+     User is able to successfully reply to a message.
+     (<a href="{@docRoot}training/auto/messaging/index.html">Learn How</a>)
+   </p>
+  </td>
+</tr>
+
+<tr>
+  <td id="AU-MS">
+    AU-MS
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+     Apps use short-form messaging app design patterns. Traditional long-form messaging apps, such
+     as apps for email, are not permitted.
+   </p>
+  </td>
+</tr>
+
+<tr>
+  <td id="AU-MP">
+    AU-MP
+  </td>
+  <td>
+    <p style="margin-bottom:.5em;">
+     Apps are peer-to-peer messaging services and not notification service apps such as weather,
+     stocks, and sport scores apps.
+   </p>
+  </td>
+</tr>
+
 </table>
 
 <!--
@@ -457,14 +515,18 @@
 </div>
 
 <p style="margin-top:30px;">
-  <strong>After I submit my app, how will find out if my app does not meet all
+  <strong>After submitting my app, how will I find out if my app does not meet all
     the requirements for Android Auto?</strong>
 </p>
-<p>If you are planning to develop apps for Auto, you are encouraged to begin enabling and testing
-  your apps now. However, Auto-enabled apps cannot be published at this time. Join the
- <a href="http://g.co/AndroidAutoDev" class="external-link">Auto
- Developers Google+ community</a> for updates on when you will be able to submit
- your Auto-enabled apps.</p>
+<p>
+  If your app does not meet the usability requirements described on this page, the Play Store team
+  will contact you through the email address specified in the <a href=
+  "https://play.google.com/apps/publish/">Google Play Developer Console</a> account associated with
+  the app.
+</p>
+<p class="note">
+ <strong>Note:</strong> For information about how to publish your Auto app in Google Play, see <a
+ href="{@docRoot}distribute/googleplay/auto.html">Distributing to Android Auto</a>.
 </p>
 
 
@@ -474,11 +536,11 @@
   tablets?</strong>
 </p>
 <p>
-  No. When Google begins the approval process, your auto app will undergo a driver safety
+  No. When Google begins the approval process, your Auto app will undergo a driver safety
   review, and will not be
   available for distribution until the app is approved. Because this is the same APK as
   for phones and tablets, your Play Store updates for those devices will not be available until the
-  Auto approval process is complete.
+  Auto app approval process is complete.
 </p>
 
 <p class="caution">
diff --git a/docs/html/distribute/googleplay/families/about.jd b/docs/html/distribute/googleplay/families/about.jd
index 9156e5c..38738b1 100644
--- a/docs/html/distribute/googleplay/families/about.jd
+++ b/docs/html/distribute/googleplay/families/about.jd
@@ -6,26 +6,25 @@
 
 @jd:body
 
-    <p>
-  If you got great apps targeting kids and/or families, the family-focused experience
-  on Google Play is a great way to make them discoverable by parents.
+<p>
+  If you've built great apps designed for kids or families, the family discovery experience
+  on Google Play is a great way to surface them to parents.
 </p>
 
 <p>Developers are invited to opt-in these apps and games to the new Designed for
   Families program. Apps that meet the <a href=
   "https://support.google.com/googleplay/android-developer/answer/6184502">program
-  requirements</a> will be shown in the new family experience so that
-  parents can find suitable, trusted, high-quality apps and games more easily.
+  requirements</a> will be featured through Google Play's family-friendly browse
+  and search experiences so that parents can find suitable, trusted, high-quality
+  apps and games more easily.
 </p>
 
 <img src="{@docRoot}distribute/images/about-dff-sm.jpg">
 
 <p>
-  Opt-in your apps and games today using the tools and processes you currently
-  use to manage your apps in the Developer Console. Your apps in the program
-  can benefit from enhanced discoverability in addition to maintaining their
-  existing categories, rankings, and reviews elsewhere on the Google Play
-  store.
+Opt-in your apps and games to Designed for Families from the <strong>All Applications</strong> page
+in the Developer Console, under <strong>Pricing and Distribution</strong>. For more information on
+  opting-in, visit the Google Play Developer <a href="https://support.google.com/googleplay/android-developer/answer/6231938">Help Center</a>. 
 </p>
 
 
@@ -34,13 +33,12 @@
     <div class="figure" style="width:300px;">
 
      <img src="{@docRoot}images/distribute/dff-browse.png" style="width:300px">
-     <p class="figure-caption" style="text-align:center">Browse gives you improved visibility to families.</p>
+     <p class="figure-caption" style="text-align:center">New browsing categories give you improved visibility to parents.</p>
    </div>
    
 <p>
-  By opting-in to Designed for Families, parents can easily find your family-friendly
-  content on the Google Play store however they are accessing it.
-</p>
+Designed for Families expands the visibility of your family content on Google Play, helping parents easily find your family-friendly apps and games throughout the store. And new features create a trusted environment that empowers parents to make informed desicions and engage with your content.</p>
+
 
 
 
@@ -58,8 +56,8 @@
 
     <div class="figure" style="width:300px;">
 
-     <img src="{@docRoot}images/distribute/dff-character.png" style="width:300px">
-     <p class="figure-caption" style="text-align:center">Character pages let parents disover your content based on familiar brands and characters.</p>
+     <img src="{@docRoot}images/distribute/dff-character-group.png" style="width:500px">
+     <p class="figure-caption" style="text-align:center">Character pages let parents discover your content based on familiar brands and characters.</p>
    </div>
 
 
@@ -110,6 +108,6 @@
 
 <p>If you'd like to receive occasional emails with news relating to the Designed for Families
 program and Google Play opportunities, sign up using the <a
-href="https://docs.google.com/forms/d/1EtvUWqlkxS6RxHJjeI-3-7uzdbIZx6n9Cocy2D369B8/viewform">Dssigned
+href="https://docs.google.com/forms/d/1EtvUWqlkxS6RxHJjeI-3-7uzdbIZx6n9Cocy2D369B8/viewform">Designed
 for Families Interest Form</a>
 </p>
\ No newline at end of file
diff --git a/docs/html/distribute/googleplay/googleplay_toc.cs b/docs/html/distribute/googleplay/googleplay_toc.cs
index 0eef721..d55271b 100644
--- a/docs/html/distribute/googleplay/googleplay_toc.cs
+++ b/docs/html/distribute/googleplay/googleplay_toc.cs
@@ -42,23 +42,18 @@
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/cast.html">
-          <span class="en">Stream Your Content <span style="white-space:nowrap">with Cast</span></span>
-        </a>
-    </div>
-  </li>
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/cardboard.html">
-          <span class="en">Build VR with <span style="white-space:nowrap">Google Cardboard</span></span>
-        </a>
-    </div>
-  </li>
-  <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/families/about.html">
           <span class="en">Designed for Families</span>
         </a>
     </div>
   </li>
+
+  <li class="nav-section">
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/work/about.html">
+          <span class="en"><span style="white-space:nowrap">Google Play for Work</span></span>
+        </a>
+    </div>
+  </li>
   <li class="nav-section">
     <div class="nav-section-header" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/edu/about.html">
           <span class="en">Google Play for Education</span>
@@ -74,8 +69,14 @@
     </ul>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/work/about.html">
-          <span class="en"><span style="white-space:nowrap">Google Play for Work</span></span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/cast.html">
+          <span class="en">Stream Your Content <span style="white-space:nowrap">with Cast</span></span>
+        </a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/googleplay/cardboard.html">
+          <span class="en">Build VR with <span style="white-space:nowrap">Google Cardboard</span></span>
         </a>
     </div>
   </li>
diff --git a/docs/html/distribute/googleplay/index.jd b/docs/html/distribute/googleplay/index.jd
index 1908e01..3b5966f 100644
--- a/docs/html/distribute/googleplay/index.jd
+++ b/docs/html/distribute/googleplay/index.jd
@@ -20,7 +20,7 @@
     data-maxResults="3">
   </div>
 
-  <h2>Distribute Your Apps</h2>
+  <h2 id="opportunities">Opportunities &amp; Programs</h2>
 
   <div class="resource-widget resource-flow-layout landing col-16"
     data-query="collection:distribute/gp/gpfelanding"
diff --git a/docs/html/distribute/monetize/ads.jd b/docs/html/distribute/monetize/ads.jd
index 6f55535..3ea9dc0 100644
--- a/docs/html/distribute/monetize/ads.jd
+++ b/docs/html/distribute/monetize/ads.jd
@@ -204,6 +204,9 @@
   <li>Exercise control options sensibly, don't get carried away excluding
   potentially competing ads at the expense of revenue.
   </li>
+  <li>If you also need to manage direct deals with advertisers, consider using
+  <a href="https://www.google.com/doubleclick/publishers/small-business/index.html">DoubleClick
+  for Publishers Small Business</a>.</li>
 </ul>
 
 
diff --git a/docs/html/distribute/monetize/ecommerce.jd b/docs/html/distribute/monetize/ecommerce.jd
index be1db64..4117146 100644
--- a/docs/html/distribute/monetize/ecommerce.jd
+++ b/docs/html/distribute/monetize/ecommerce.jd
@@ -1,16 +1,15 @@
 page.title=E-commerce
 page.image=/images/cards/card-ecommerce_16-9_2x.png
-page.metaImage=With Instant Buy you can sell physical goods and services from your web pages.
-page.tags="monetizing", "physical goods", "payments"
+page.metaImage=Enable easy and secure purchases of physical goods and services, such as clothing or movie tickets, using the Android Pay API.
+page.tags="monetizing", "physical goods", "payments", "androidpay"
 @jd:body
 
 <div class="figure">
-  <img src="{@docRoot}images/gp-ecom-0.png" style="width:300px;">
-  <p class="img-caption">
-    Product Purchase with Android Pay
+  <img src="{@docRoot}images/distribute/android-pay-checkout.png" style="width:300px;">
+  <p class="figure-caption" style="text-align:center">
+    Product purchase with Android Pay
   </p>
 </div>
-
 <p>
   With Android Pay, you've the added flexibility of selling
   physical goods and services, such as clothing or movie tickets, through your
@@ -18,7 +17,6 @@
   "https://developers.google.com/wallet/instant-buy/">the Android Pay API</a>
   <strong>(US Only)</strong>.
 </p>
-
 <p>
   You can use this option where your app is the store-front for retail or
   webtail operations. However, you can also combine it with your <a href=
@@ -26,23 +24,19 @@
   "{@docRoot}distribute/monetize/freemium.html">freemium</a> apps by offering
   related products.
 </p>
-
 <p>
-  Your customers purchase goods and services with any payment
-  method &mdash; credit card, gift card, or Wallet balance. Android Pay
-  helps you minimize user data entry by enabling your payment flow
-  to retrieve information directly from the user’s wallet.
+  Your customers purchase goods and services with credit or debit card payment
+  methods. Android Pay helps you minimize user data entry by enabling your payment flow
+  to retrieve information directly from the user's Google account.
 </p>
-
 <p>
   You also keep your existing payment infrastructure and leverage Android Pay
   to optimize your payment flow &mdash; users can make purchases in as a few as
   two clicks and the flow is simplified with features to retrieve information
-  directly from the user’s wallet and intelligent auto-completion of addresses.
-  To get started, set up a <a href=
-  "{@docRoot}distribute/googleplay/start.html#merchant-account">Merchant
-  Account</a>.
-</p>
+  directly from the user’s wallet and intelligent auto-completion of addresses.</p>
+
+  <p><a href=
+  "https://developers.google.com/android-pay/">Get started with Android Pay</a></p>
 
 <p style="clear:both">
 </p>
diff --git a/docs/html/distribute/monetize/monetize_toc.cs b/docs/html/distribute/monetize/monetize_toc.cs
index aa1bdd6..a3aa50f 100644
--- a/docs/html/distribute/monetize/monetize_toc.cs
+++ b/docs/html/distribute/monetize/monetize_toc.cs
@@ -17,14 +17,14 @@
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/monetize/ecommerce.html">
-          <span class="en">E-commerce</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/monetize/ads.html">
+          <span class="en">AdMob Ads</span>
         </a>
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/monetize/ads.html">
-          <span class="en">AdMob Ads</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/monetize/ecommerce.html">
+          <span class="en">E-commerce</span>
         </a>
     </div>
   </li>
diff --git a/docs/html/distribute/tools/launch-checklist.jd b/docs/html/distribute/tools/launch-checklist.jd
index 57a1616..962e3ff 100644
--- a/docs/html/distribute/tools/launch-checklist.jd
+++ b/docs/html/distribute/tools/launch-checklist.jd
@@ -445,7 +445,7 @@
 
 <div class="headerLine">
   <h2 id="consider-billing">
-    9. Consider using In-app Billing
+    9. Consider using In-app Billing or Android Pay
   </h2>
 
 
@@ -460,12 +460,15 @@
   subscriptions from inside your app. This can help you to monetize the app
   over its installed lifetime.
 </p>
-
+<p>
+  Android Pay enables simple and secure purchases of physical goods and services
+  in your app, such as clothing, food delivery or movie tickets
+</p>
 <p>
   If your are looking for more ways to monetize your app and build engagement,
-  you should consider In-app Billing or Instant Buy. These services have become
-  very popular with both users and developers. To use In-app Billing or Instant
-  Buy, you need to make changes to your app binary, so you will need to
+  you should consider In-app Billing or Android Pay. These services have become
+  very popular with both users and developers. To use In-app Billing or Android
+  Pay, you need to make changes to your app binary, so you will need to
   complete and test your implementation before creating your release-ready APK.
 </p>
 
diff --git a/docs/html/distribute/tools/open-distribution.jd b/docs/html/distribute/tools/open-distribution.jd
index e28102d..a929692 100644
--- a/docs/html/distribute/tools/open-distribution.jd
+++ b/docs/html/distribute/tools/open-distribution.jd
@@ -80,14 +80,6 @@
 </p>
 
 <p>
-  <strong>Note:</strong> The <strong>Install Now</strong> button, shown in
-  Figure 1, appears only if the user has configured their device to allow
-  installation from <a href=
-  "{@docRoot}distribute/open.html#unknown-sources">unknown sources</a> and
-  opened your email in the native Gmail app.
-</p>
-
-<p>
   Distributing apps through email is convenient if you’re sending them to a few
   trusted users, as it provides few protections from piracy and unauthorized
   distribution; that is, anyone you send your apps to can simply forward them
diff --git a/docs/html/distribute/users/app-invites.jd b/docs/html/distribute/users/app-invites.jd
new file mode 100644
index 0000000..ec9579d
--- /dev/null
+++ b/docs/html/distribute/users/app-invites.jd
@@ -0,0 +1,51 @@
+page.title=Smarter App Invites
+page.metaDescription=Tap into your existing user base to increase downloads and increase conversions.
+page.tags="google", "identity", "signin"
+page.image=distribute/images/advertising.jpg
+
+@jd:body
+
+<p>By combining the power of word-of-mouth with optimized discovery, App Invites helps drive your app installs. </p>
+
+<p>Personal recommendations can be one of the strongest motivators for a user installing your app. With this in mind, App Invites helps you organically find valuable users to download and use your app. With intelligent friend recommendations, smart invite delivery, and the ability to add offers or incentives, new users will get immediate access to your app and can be deep linked to a personalized onboarding flow.</p>
+
+<p><a href="https://developers.google.com/app-invites/">Get started with App Invites</a></p>
+
+<div class="wrap">
+  <div class="cols" style="margin:1em auto;">
+    <div class="col-1of2">
+      <div style="width:300px;">
+        <img src="{@docRoot}images/distribute/app_invites_1.png" style="width:300px">
+        <p class="figure-caption" style="text-align:center">You can create special offers that your user can deliver through a App Invite, to make installing your app more appealing.</p>
+      </div>
+    </div>
+    <div class="col-1of2">
+       <div style="width:300px;">
+         <img src="{@docRoot}images/distribute/app_invites_2.png" style="width:300px">
+         <p class="figure-caption" style="text-align:center">App Invites presents your user with a list of suggested contacts most likely to take advantage of any recommendation and determines the best delivery channel (notification, SMS, or email).</p>
+       </div>
+    </div>
+  </div>
+</div>
+
+
+<h2>Tips</h2>
+
+<ul>
+  <li>Invites can include graphics or videos to make them more appealing to recipients.</li>
+  <li>You can personalise the invite flow by deep linking to app content and in-app purchases,
+  so the user is taken straight to checkout. Use Google Sign-In and Wallet to make any order
+  friction free.</li>
+</ul>
+
+
+<h2 style="clear:both" id="related-resources">Related Resources</h2>
+
+<div class="resource-widget resource-flow-layout col-13"
+  data-query="collection:distribute/users/appinvites"
+  data-sortorder="-timestamp"
+  data-cardsizes="6x3"
+  data-maxresults="6">
+</div>
+
+
diff --git a/docs/html/distribute/users/index.jd b/docs/html/distribute/users/index.jd
index a3f8d01..4da4077 100644
--- a/docs/html/distribute/users/index.jd
+++ b/docs/html/distribute/users/index.jd
@@ -13,7 +13,7 @@
 <div class="resource-widget resource-flow-layout landing col-16"
   data-query="collection:distribute/users"
   data-cardSizes="6x6"
-  data-maxResults="6">
+  data-maxResults="9">
 </div>
 <div class="resource-widget resource-flow-layout landing col-16"
   data-query="collection:distribute/users"
diff --git a/docs/html/distribute/users/users_toc.cs b/docs/html/distribute/users/users_toc.cs
index 3aa3fe1..1e4085b 100644
--- a/docs/html/distribute/users/users_toc.cs
+++ b/docs/html/distribute/users/users_toc.cs
@@ -1,22 +1,11 @@
 <ul id="nav">
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/know-your-user.html">
-            <span class="en">Know Your User</span></a>
-    </div>
-  </li>
-  <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/your-listing.html">
             <span class="en">Create a Great Listing</span>
           </a>
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/expand-to-new-markets.html">
-          <span class="en">Expand to New Markets</span>
-        </a>
-    </div>
-  </li>
-  <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/promote-with-ads.html">
           <span class="en">Promote with Ads</span>
         </a>
@@ -24,7 +13,13 @@
   </li>
   <li class="nav-section">
     <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/appindexing.html">
-          <span class="en">Drive Installs through Search</span>
+          <span class="en">Drive Installs from Search</span>
+        </a>
+    </div>
+  </li>
+  <li class="nav-section">
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/expand-to-new-markets.html">
+          <span class="en">Expand to New Markets</span>
         </a>
     </div>
   </li>
@@ -35,8 +30,8 @@
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/house-ads.html">
-          <span class="en">Cross-Sell to Users with House Ads</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/app-invites.html">
+          <span class="en">Smarter App Invites</span>
         </a>
     </div>
   </li>
@@ -47,14 +42,8 @@
     </div>
   </li>
   <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/build-buzz.html">
-          <span class="en">Build Buzz</span>
-        </a>
-    </div>
-  </li>
-  <li class="nav-section">
-    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/build-community.html">
-          <span class="en">Build Community</span>
+    <div class="nav-section-header empty" style="font-weight:normal"><a href="<?cs var:toroot?>distribute/users/house-ads.html">
+          <span class="en">Cross-Sell with House Ads</span>
         </a>
     </div>
   </li>
diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd
index 923d48d..e3b2ae1 100644
--- a/docs/html/google/index.jd
+++ b/docs/html/google/index.jd
@@ -11,7 +11,7 @@
   <div class="wrap">
     <div class="cols dac-hero-content">
       <div class="col-1of2 col-push-1of2 dac-hero-figure">
-        <img class="dac-hero-image" src="/images/google/hero-play-services_2x.png" style="padding-bottom:1em">
+        <img class="dac-hero-image" src="/images/google/hero-play-services_2x.png" style="height:400px">
       </div>
       <div class="col-1of2 col-pull-1of2">
         <h1 class="dac-hero-title">Build better apps with Google</h1>
@@ -42,9 +42,9 @@
 <section class="dac-section dac-gray dac-small dac-invert" id="latest"><div class="wrap">
   <h2 class="norule">Latest</h2>
   <div class="resource-widget resource-flow-layout col-16"
-       data-query="type:blog+tag:googleservices+tag:featured+tag:develop"
+       data-query="type:blog+tag:googleservices+tag:featured"
        data-cardSizes="6x6"
-       data-maxResults="9"
+       data-maxResults="12"
        data-initial-results="3"></div>
   </div>
 </section>
@@ -75,12 +75,19 @@
        data-cardSizes="6x6"
        data-maxResults="3"></div>
   </div>
+    <ul class="dac-section-links">
+    <li class="dac-section-link"><a href="https://www.youtube.com/playlist?list=PLWz5rJ2EKKc9Qk1_iCZNbBp6adYnJf9Vf">
+      <span class="dac-sprite dac-auto-chevron"></span>
+      Playlist
+    </a></li>
+  </ul>
+
 </section>
 
 <section class="dac-section dac-invert dac-darken-bg" style="background-image: url(/images/distribute/google-play-bg.jpg)"><div class="wrap">
   <h1 class="dac-section-title">Google Play developer tools</h1>
   <div class="dac-section-subtitle">
-    Scale your publishing, manage your catalog, and build revenue using Google Play developer tools. 
+    Scale your publishing, manage your catalog, build revenue using Google Play developer tools. 
   </div>
   <div class="resource-widget resource-flow-layout col-16"
        data-query="collection:google/landing/googleplay"
diff --git a/docs/html/images/cards/card-google-cloud-messaging_16-9_2x.png b/docs/html/images/cards/card-google-cloud-messaging_16-9_2x.png
index 6bdf13c..5310c7b 100644
--- a/docs/html/images/cards/card-google-cloud-messaging_16-9_2x.png
+++ b/docs/html/images/cards/card-google-cloud-messaging_16-9_2x.png
Binary files differ
diff --git a/docs/html/images/developing/app_invites_2.png b/docs/html/images/developing/app_invites_2.png
new file mode 100644
index 0000000..a5e1972
--- /dev/null
+++ b/docs/html/images/developing/app_invites_2.png
Binary files differ
diff --git a/docs/html/images/distribute/android-pay-checkout.png b/docs/html/images/distribute/android-pay-checkout.png
new file mode 100644
index 0000000..15b8e19
--- /dev/null
+++ b/docs/html/images/distribute/android-pay-checkout.png
Binary files differ
diff --git a/docs/html/images/distribute/app_invites_1.png b/docs/html/images/distribute/app_invites_1.png
new file mode 100644
index 0000000..2cc0f0f
--- /dev/null
+++ b/docs/html/images/distribute/app_invites_1.png
Binary files differ
diff --git a/docs/html/images/distribute/app_invites_2.png b/docs/html/images/distribute/app_invites_2.png
new file mode 100644
index 0000000..4f5383c
--- /dev/null
+++ b/docs/html/images/distribute/app_invites_2.png
Binary files differ
diff --git a/docs/html/images/distribute/dff-browse.png b/docs/html/images/distribute/dff-browse.png
index ae84ee0..81ea745 100644
--- a/docs/html/images/distribute/dff-browse.png
+++ b/docs/html/images/distribute/dff-browse.png
Binary files differ
diff --git a/docs/html/images/distribute/dff-character-group.png b/docs/html/images/distribute/dff-character-group.png
new file mode 100644
index 0000000..0738115
--- /dev/null
+++ b/docs/html/images/distribute/dff-character-group.png
Binary files differ
diff --git a/docs/html/images/home/devices-hero_620px.png b/docs/html/images/home/devices-hero_620px.png
new file mode 100644
index 0000000..d4388e1
--- /dev/null
+++ b/docs/html/images/home/devices-hero_620px.png
Binary files differ
diff --git a/docs/html/images/media/mediacodec_async_states.png b/docs/html/images/media/mediacodec_async_states.png
new file mode 100644
index 0000000..c21f5c0
--- /dev/null
+++ b/docs/html/images/media/mediacodec_async_states.png
Binary files differ
diff --git a/docs/html/images/media/mediacodec_async_states.svg b/docs/html/images/media/mediacodec_async_states.svg
new file mode 100644
index 0000000..7349511
--- /dev/null
+++ b/docs/html/images/media/mediacodec_async_states.svg
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="649 397 519 356" width="519pt" height="356pt" xmlns:dc="http://purl.org/dc/elements/1.1/">
+    <defs>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#ea8008">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#274ecc">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_3" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#d02e2a">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_4" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#262626">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <font-face font-family="Roboto" font-size="20" panose-1="2 0 0 0 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="500">
+            <font-face-src>
+                <font-face-name name="Roboto-Regular"/>
+            </font-face-src>
+        </font-face>
+        <font-face font-family="Roboto Condensed" font-size="16" panose-1="0 0 4 6 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="300" font-stretch="condensed">
+            <font-face-src>
+                <font-face-name name="RobotoCondensed-Light"/>
+            </font-face-src>
+        </font-face>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_5" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#126f33">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+    </defs>
+    <g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
+        <title>MediaCodec state diagram for asynchronous operation</title>
+        <g>
+            <line x1="740" y1="508.5" x2="740" y2="471.4" marker-end="url(#FilledArrow_Marker)" stroke="#ea8008" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="740" y1="598.5" x2="740" y2="561.4" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="763.33333" y1="458.5" x2="763.33333" y2="495.6" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="920" y1="542" x2="822.9" y2="541.85288" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="920" y1="617.5" x2="822.89947" y2="618.38273" marker-end="url(#FilledArrow_Marker_3)" stroke="#d02e2a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="919.5" y1="528.5" x2="822.9" y2="528.5" marker-end="url(#FilledArrow_Marker)" stroke="#ea8008" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="827.11573" y1="674.83365" x2="843.6129" y2="701.97642" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="922.88427" y1="674.83365" x2="904.22416" y2="702.32635" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 927.5 400 L 1092.5 400 C 1095.8137 400 1098.5 402.6863 1098.5 406 L 1098.5 671 C 1098.5 674.3137 1095.8137 677 1092.5 677 L 927.5 677 C 924.1863 677 921.5 674.3137 921.5 671 L 921.5 406 C 921.5 402.6863 924.1863 400 927.5 400 Z" fill="#178f46"/>
+            <path d="M 927.5 400 L 1092.5 400 C 1095.8137 400 1098.5 402.6863 1098.5 406 L 1098.5 671 C 1098.5 674.3137 1095.8137 677 1092.5 677 L 927.5 677 C 924.1863 677 921.5 674.3137 921.5 671 L 921.5 406 C 921.5 402.6863 924.1863 400 927.5 400 Z" stroke="#178f46" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
+            <text transform="translate(926.5 648.5)" fill="#aadbc2">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadbc2" x="40.091797" y="19" textLength="21.279297">Ex</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadbc2" x="61.17578" y="19" textLength="65.73242">ecuting</tspan>
+            </text>
+            <path d="M 657.5 400 L 822.5 400 C 825.8137 400 828.5 402.6863 828.5 406 L 828.5 671 C 828.5 674.3137 825.8137 677 822.5 677 L 657.5 677 C 654.1863 677 651.5 674.3137 651.5 671 L 651.5 406 C 651.5 402.6863 654.1863 400 657.5 400 Z" stroke="#d02e2a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(656.5 648.5)" fill="#d02e2a">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d02e2a" x="46.53711" y="19" textLength="18.398438">St</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d02e2a" x="64.740234" y="19" textLength="55.722656">opped</tspan>
+            </text>
+            <text transform="translate(1130.1743 479.5)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x=".64453125" y="15" textLength="30.710938">flush</tspan>
+            </text>
+            <text transform="translate(968 467)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="4.4101562" y="15" textLength="24.148438">star</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="28.949219" y="15" textLength="4.640625">t</tspan>
+            </text>
+            <text transform="translate(844.054 419.2185)" fill="#136f34">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#136f34" x="14.255245" y="15" textLength="24.148438">star</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#136f34" x="38.794307" y="15" textLength="4.640625">t</tspan>
+            </text>
+            <text transform="translate(848.3963 505)" fill="#ea8008">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#ea8008" x="11.621094" y="15" textLength="11.78125">st</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#ea8008" x="23.246094" y="15" textLength="15.6328125">op</tspan>
+            </text>
+            <text transform="translate(858.68587 621.3852)" fill="#b6251f">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x=".21875" y="15" textLength="16.992188">err</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x="17.054688" y="15" textLength="12.6875">or</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x="28.78125" y="15" textLength="9">…</tspan>
+            </text>
+            <text transform="translate(857.8257 546.43005)" fill="#274ecc">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(768.33333 466.62302)" fill="#274ecc">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(744 571.12)" fill="#274ecc">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecc" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(675 479.5)" fill="#ea8008">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#ea8008" x="2.8125" y="15" textLength="30.382812">confi</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#ea8008" x="33.195312" y="15" textLength="20.320312">gur</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#ea8008" x="53.367187" y="15" textLength="7.3203125">e</tspan>
+            </text>
+            <path d="M 676 418.5 L 804 418.5 C 807.3137 418.5 810 421.1863 810 424.5 L 810 452.5 C 810 455.8137 807.3137 458.5 804 458.5 L 676 458.5 C 672.6863 458.5 670 455.8137 670 452.5 L 670 424.5 C 670 421.1863 672.6863 418.5 676 418.5 Z" fill="#f0a608"/>
+            <text transform="translate(675 426.5)" fill="#fbe4a3">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="16.381836" y="19" textLength="46.533203">Confi</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="62.91504" y="19" textLength="29.013672">gur</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="91.743164" y="19" textLength="21.875">ed</tspan>
+            </text>
+            <path d="M 946 508.5 L 1074 508.5 C 1077.3137 508.5 1080 511.1863 1080 514.5 L 1080 542.5 C 1080 545.8137 1077.3137 548.5 1074 548.5 L 946 548.5 C 942.6863 548.5 940 545.8137 940 542.5 L 940 514.5 C 940 511.1863 942.6863 508.5 946 508.5 Z" fill="#f8f8f8"/>
+            <path d="M 946 508.5 L 1074 508.5 C 1077.3137 508.5 1080 511.1863 1080 514.5 L 1080 542.5 C 1080 545.8137 1077.3137 548.5 1074 548.5 L 946 548.5 C 942.6863 548.5 940 545.8137 940 542.5 L 940 514.5 C 940 511.1863 942.6863 508.5 946 508.5 Z" stroke="#49b077" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 516.5)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="28.740234" y="19" textLength="72.51953">Running</tspan>
+            </text>
+            <path d="M 676 508.5 L 804 508.5 C 807.3137 508.5 810 511.1863 810 514.5 L 810 542.5 C 810 545.8137 807.3137 548.5 804 548.5 L 676 548.5 C 672.6863 548.5 670 545.8137 670 542.5 L 670 514.5 C 670 511.1863 672.6863 508.5 676 508.5 Z" fill="#346df1"/>
+            <text transform="translate(675 516.5)" fill="#bad0fb">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#bad0fb" x="10.825195" y="19" textLength="86.63086">Uninitializ</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#bad0fb" x="97.299805" y="19" textLength="21.875">ed</tspan>
+            </text>
+            <path d="M 676 598.5 L 804 598.5 C 807.3137 598.5 810 601.1863 810 604.5 L 810 632.5 C 810 635.8137 807.3137 638.5 804 638.5 L 676 638.5 C 672.6863 638.5 670 635.8137 670 632.5 L 670 604.5 C 670 601.1863 672.6863 598.5 676 598.5 Z" fill="#d02e2a"/>
+            <text transform="translate(675 606.5)" fill="white">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="white" x="43.55957" y="19" textLength="24.902344">Err</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="white" x="68.2666" y="19" textLength="18.173828">or</tspan>
+            </text>
+            <path d="M 946 418.5 L 1074 418.5 C 1077.3137 418.5 1080 421.1863 1080 424.5 L 1080 452.5 C 1080 455.8137 1077.3137 458.5 1074 458.5 L 946 458.5 C 942.6863 458.5 940 455.8137 940 452.5 L 940 424.5 C 940 421.1863 942.6863 418.5 946 418.5 Z" fill="#f8f8f8"/>
+            <path d="M 946 418.5 L 1074 418.5 C 1077.3137 418.5 1080 421.1863 1080 424.5 L 1080 452.5 C 1080 455.8137 1077.3137 458.5 1074 458.5 L 946 458.5 C 942.6863 458.5 940 455.8137 940 452.5 L 940 424.5 C 940 421.1863 942.6863 418.5 946 418.5 Z" stroke="#de6560" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 426.5)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="29.93164" y="19" textLength="70.13672">Flushed</tspan>
+            </text>
+            <path d="M 946 598.5 L 1074 598.5 C 1077.3137 598.5 1080 601.1863 1080 604.5 L 1080 632.5 C 1080 635.8137 1077.3137 638.5 1074 638.5 L 946 638.5 C 942.6863 638.5 940 635.8137 940 632.5 L 940 604.5 C 940 601.1863 942.6863 598.5 946 598.5 Z" fill="#f8f8f8"/>
+            <path d="M 946 598.5 L 1074 598.5 C 1077.3137 598.5 1080 601.1863 1080 604.5 L 1080 632.5 C 1080 635.8137 1077.3137 638.5 1074 638.5 L 946 638.5 C 942.6863 638.5 940 635.8137 940 632.5 L 940 604.5 C 940 601.1863 942.6863 598.5 946 598.5 Z" stroke="#f4c23d" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 606.5)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="2.0410156" y="19" textLength="87.09961">End of Str</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="88.95508" y="19" textLength="39.003906">eam</tspan>
+            </text>
+            <path d="M 810 438.5 C 810 438.5 878.0599 435.16865 921.5 455 C 947.861 467.03438 957.6335 484.16434 961.2431 495.77385" marker-end="url(#FilledArrow_Marker_5)" stroke="#126f33" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="963.33333" y1="458.5" x2="963.33333" y2="495.6" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="963.33333" y1="548.5" x2="963.33333" y2="585.6" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 1080 521.83333 C 1080 521.83333 1106 504.33135 1106 484.5 C 1106 473.46106 1097.9439 464.58984 1090.80046 458.89346" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 1056.66667 598.5 C 1056.66667 598.5 1110.38955 548.8288 1117 503.5 C 1121.4143 473.23063 1103.434 454.40253 1090.9997 445.23311" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(968.25 550.5)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="2.171875" y="15" textLength="111.25">queueInputBuffer</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="38.46875" y="34" textLength="35.0625">(EOS)</tspan>
+            </text>
+            <path d="M 809.6463 713 L 937.6463 713 C 940.96 713 943.6463 715.6863 943.6463 719 L 943.6463 747 C 943.6463 750.3137 940.96 753 937.6463 753 L 809.6463 753 C 806.3326 753 803.6463 750.3137 803.6463 747 L 803.6463 719 C 803.6463 715.6863 806.3326 713 809.6463 713 Z" fill="#535353"/>
+            <text transform="translate(808.6463 721)" fill="#d5d5d5">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d5d5d5" x="24.28711" y="19" textLength="81.42578">Released</tspan>
+            </text>
+            <text transform="translate(852.18587 683)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x=".15625" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="4.84375" y="15" textLength="40">elease</tspan>
+            </text>
+        </g>
+    </g>
+</svg>
diff --git a/docs/html/images/media/mediacodec_buffers.png b/docs/html/images/media/mediacodec_buffers.png
new file mode 100644
index 0000000..f17f4ac
--- /dev/null
+++ b/docs/html/images/media/mediacodec_buffers.png
Binary files differ
diff --git a/docs/html/images/media/mediacodec_buffers.svg b/docs/html/images/media/mediacodec_buffers.svg
new file mode 100644
index 0000000..fa121ee
--- /dev/null
+++ b/docs/html/images/media/mediacodec_buffers.svg
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="20 17 540 208" width="45pc" height="208pt" xmlns:dc="http://purl.org/dc/elements/1.1/">
+    <defs>
+        <font-face font-family="Roboto" font-size="20" panose-1="2 0 0 0 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="500">
+            <font-face-src>
+                <font-face-name name="Roboto-Regular"/>
+            </font-face-src>
+        </font-face>
+        <font-face font-family="Roboto" font-size="12" panose-1="2 0 0 0 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="300">
+            <font-face-src>
+                <font-face-name name="Roboto-Light"/>
+            </font-face-src>
+        </font-face>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-4 -2 5 4" markerWidth="5" markerHeight="4" color="#262626">
+            <g>
+                <path d="M -2.16 0 L 0 .81 L 0 -.81 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+    </defs>
+    <g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
+        <title>MediaCodec buffer flow diagram</title>
+        <g>
+            <line x1="291" y1="20" x2="290" y2="220" stroke="#535353" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke-dasharray="4,4"/>
+            <path d="M 560 71 L 560 179 L 560 185 L 554 185 L 510 185 L 466 185 C 462.6863 185 460 182.31371 460 179 L 460 71 C 460 67.68629 462.6863 65 466 65 L 510 65 L 554 65 L 560 65 Z M 554 65 C 554 65 554 65 554 65 Z" fill="#178f46"/>
+            <text transform="translate(465 113)" fill="#aadcc2">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadcc2" x="19.555664" y="19" textLength="50.888672">Client</tspan>
+            </text>
+            <path d="M 246 75 L 334 75 C 337.3137 75 340 77.68629 340 81 L 340 169 C 340 172.31371 337.3137 175 334 175 L 246 175 C 242.68629 175 240 172.31371 240 169 L 240 81 C 240 77.68629 242.68629 75 246 75 Z" fill="#346df1"/>
+            <text transform="translate(245 113)" fill="#bad0fb">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#bad0fb" x="16.616211" y="19" textLength="56.767578">Codec</tspan>
+            </text>
+            <path d="M 132 140 L 148 140 C 149.10457 140 150 140.89543 150 142 L 150 158 C 150 159.10457 149.10457 160 148 160 L 132 160 C 130.89543 160 130 159.10457 130 158 L 130 142 C 130 140.89543 130.89543 140 132 140 Z" fill="#de6560"/>
+            <path d="M 132 140 L 148 140 C 149.10457 140 150 140.89543 150 142 L 150 158 C 150 159.10457 149.10457 160 148 160 L 132 160 C 130.89543 160 130 159.10457 130 158 L 130 142 C 130 140.89543 130.89543 140 132 140 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 172 140 L 188 140 C 189.10457 140 190 140.89543 190 142 L 190 158 C 190 159.10457 189.10457 160 188 160 L 172 160 C 170.89543 160 170 159.10457 170 158 L 170 142 C 170 140.89543 170.89543 140 172 140 Z" fill="#de6560"/>
+            <path d="M 172 140 L 188 140 C 189.10457 140 190 140.89543 190 142 L 190 158 C 190 159.10457 189.10457 160 188 160 L 172 160 C 170.89543 160 170 159.10457 170 158 L 170 142 C 170 140.89543 170.89543 140 172 140 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 212 140 L 228 140 C 229.10457 140 230 140.89543 230 142 L 230 158 C 230 159.10457 229.10457 160 228 160 L 212 160 C 210.89543 160 210 159.10457 210 158 L 210 142 C 210 140.89543 210.89543 140 212 140 Z" fill="#de6560"/>
+            <path d="M 212 140 L 228 140 C 229.10457 140 230 140.89543 230 142 L 230 158 C 230 159.10457 229.10457 160 228 160 L 212 160 C 210.89543 160 210 159.10457 210 158 L 210 142 C 210 140.89543 210.89543 140 212 140 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 212 90 L 228 90 C 229.10457 90 230 90.89543 230 92 L 230 108 C 230 109.10457 229.10457 110 228 110 L 212 110 C 210.89543 110 210 109.10457 210 108 L 210 92 C 210 90.89543 210.89543 90 212 90 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 172 90 L 188 90 C 189.10457 90 190 90.89543 190 92 L 190 108 C 190 109.10457 189.10457 110 188 110 L 172 110 C 170.89543 110 170 109.10457 170 108 L 170 92 C 170 90.89543 170.89543 90 172 90 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 132 90 L 148 90 C 149.10457 90 150 90.89543 150 92 L 150 108 C 150 109.10457 149.10457 110 148 110 L 132 110 C 130.89543 110 130 109.10457 130 108 L 130 92 C 130 90.89543 130.89543 90 132 90 Z" stroke="#b6251f" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(128.5 70.5)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".19238281" y="11" textLength="86.44336">empty input buff</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="86.495117" y="11" textLength="16.3125">ers</tspan>
+            </text>
+            <path d="M 20 71 L 20 179 L 20 185 L 26 185 L 70 185 L 114 185 C 117.31371 185 120 182.31371 120 179 L 120 71 C 120 67.68629 117.31371 65 114 65 L 70 65 L 26 65 L 20 65 Z M 26 65 C 26 65 26 65 26 65 Z" fill="#178f46"/>
+            <text transform="translate(25 113)" fill="#aadcc2">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadcc2" x="19.555664" y="19" textLength="50.888672">Client</tspan>
+            </text>
+            <path d="M 352 110 L 368 110 C 369.10457 110 370 109.10457 370 108 L 370 92 C 370 90.89543 369.10457 90 368 90 L 352 90 C 350.89543 90 350 90.89543 350 92 L 350 108 C 350 109.10457 350.89543 110 352 110 Z" fill="#f4c23d"/>
+            <path d="M 352 110 L 368 110 C 369.10457 110 370 109.10457 370 108 L 370 92 C 370 90.89543 369.10457 90 368 90 L 352 90 C 350.89543 90 350 90.89543 350 92 L 350 108 C 350 109.10457 350.89543 110 352 110 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 392 110 L 408 110 C 409.10457 110 410 109.10457 410 108 L 410 92 C 410 90.89543 409.10457 90 408 90 L 392 90 C 390.89543 90 390 90.89543 390 92 L 390 108 C 390 109.10457 390.89543 110 392 110 Z" fill="#f4c23d"/>
+            <path d="M 392 110 L 408 110 C 409.10457 110 410 109.10457 410 108 L 410 92 C 410 90.89543 409.10457 90 408 90 L 392 90 C 390.89543 90 390 90.89543 390 92 L 390 108 C 390 109.10457 390.89543 110 392 110 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 432 110 L 448 110 C 449.10457 110 450 109.10457 450 108 L 450 92 C 450 90.89543 449.10457 90 448 90 L 432 90 C 430.89543 90 430 90.89543 430 92 L 430 108 C 430 109.10457 430.89543 110 432 110 Z" fill="#f4c23d"/>
+            <path d="M 432 110 L 448 110 C 449.10457 110 450 109.10457 450 108 L 450 92 C 450 90.89543 449.10457 90 448 90 L 432 90 C 430.89543 90 430 90.89543 430 92 L 430 108 C 430 109.10457 430.89543 110 432 110 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 432 160 L 448 160 C 449.10457 160 450 159.10457 450 158 L 450 142 C 450 140.89543 449.10457 140 448 140 L 432 140 C 430.89543 140 430 140.89543 430 142 L 430 158 C 430 159.10457 430.89543 160 432 160 Z" fill="#f4c23d"/>
+            <path d="M 432 160 L 448 160 C 449.10457 160 450 159.10457 450 158 L 450 142 C 450 140.89543 449.10457 140 448 140 L 432 140 C 430.89543 140 430 140.89543 430 142 L 430 158 C 430 159.10457 430.89543 160 432 160 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 392 160 L 408 160 C 409.10457 160 410 159.10457 410 158 L 410 142 C 410 140.89543 409.10457 140 408 140 L 392 140 C 390.89543 140 390 140.89543 390 142 L 390 158 C 390 159.10457 390.89543 160 392 160 Z" fill="#f4c23d"/>
+            <path d="M 392 160 L 408 160 C 409.10457 160 410 159.10457 410 158 L 410 142 C 410 140.89543 409.10457 140 408 140 L 392 140 C 390.89543 140 390 140.89543 390 142 L 390 158 C 390 159.10457 390.89543 160 392 160 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 352 160 L 368 160 C 369.10457 160 370 159.10457 370 158 L 370 142 C 370 140.89543 369.10457 140 368 140 L 352 140 C 350.89543 140 350 140.89543 350 142 L 350 158 C 350 159.10457 350.89543 160 352 160 Z" fill="#f4c23d"/>
+            <path d="M 352 160 L 368 160 C 369.10457 160 370 159.10457 370 158 L 370 142 C 370 140.89543 369.10457 140 368 140 L 352 140 C 350.89543 140 350 140.89543 350 142 L 350 158 C 350 159.10457 350.89543 160 352 160 Z" stroke="#eb8007" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="230" y1="120.03223" x2="110" y2="120" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <line x1="232.38" y1="130.03034" x2="110" y2="130" marker-start="url(#FilledArrow_Marker)" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <path d="M 110 130 C 107.238576 130 105 127.76142 105 125 C 105 122.238576 107.238576 120 110 120" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <line x1="350" y1="120.53223" x2="470" y2="120.5" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <line x1="347.62" y1="130.53034" x2="470" y2="130.5" marker-start="url(#FilledArrow_Marker)" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <path d="M 470 130.5 C 472.76142 130.5 475 128.26142 475 125.5 C 475 122.738576 472.76142 120.5 470 120.5" stroke="#262626" stroke-linecap="square" stroke-linejoin="round" stroke-width="2" stroke-dasharray="8,5"/>
+            <text transform="translate(132.5 166.5)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".3671875" y="11" textLength="6.4453125">fi</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="6.8125" y="11" textLength="71.648438">lled input buff</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="78.320312" y="11" textLength="16.3125">ers</tspan>
+            </text>
+            <text transform="translate(348.5 70.5)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".42382812" y="11" textLength="6.4453125">fi</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="6.8691406" y="11" textLength="79.535156">lled output buff</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="86.26367" y="11" textLength="16.3125">ers</tspan>
+            </text>
+            <text transform="translate(366.5 165)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="11.748047" y="11" textLength="32.080078">discar</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="43.716797" y="11" textLength="19.535156">ded</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".22851562" y="25" textLength="58.371094">output buff</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="58.458984" y="25" textLength="16.3125">ers</tspan>
+            </text>
+            <text transform="translate(35.5 192)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".13378906" y="11" textLength="41.8125">client pr</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="41.829102" y="11" textLength="6.720703">o</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="48.461914" y="11" textLength="27.404297">vides</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="11.6621094" y="25" textLength="52.67578">input data</tspan>
+            </text>
+            <text transform="translate(466.5 192)" fill="#262626">
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x=".40136719" y="11" textLength="86.197266">client consumes</tspan>
+                <tspan font-family="Roboto" font-size="12" font-weight="300" fill="#262626" x="13.21875" y="25" textLength="60.5625">output data</tspan>
+            </text>
+            <text transform="translate(157.5 30)" fill="#d02d2a">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d02d2a" x=".166015625" y="19" textLength="44.66797">input</tspan>
+            </text>
+            <text transform="translate(371 30)" fill="#f0a608">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#f0a608" x=".12792969" y="19" textLength="57.74414">output</tspan>
+            </text>
+        </g>
+    </g>
+</svg>
diff --git a/docs/html/images/media/mediacodec_states.png b/docs/html/images/media/mediacodec_states.png
new file mode 100644
index 0000000..a34b613
--- /dev/null
+++ b/docs/html/images/media/mediacodec_states.png
Binary files differ
diff --git a/docs/html/images/media/mediacodec_states.svg b/docs/html/images/media/mediacodec_states.svg
new file mode 100644
index 0000000..81646fd
--- /dev/null
+++ b/docs/html/images/media/mediacodec_states.svg
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xl="http://www.w3.org/1999/xlink" version="1.1" viewBox="649 8 519 357" width="519pt" height="357pt" xmlns:dc="http://purl.org/dc/elements/1.1/">
+    <defs>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#ea8008">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_2" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#274ecc">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_3" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#d02e2a">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_4" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#262626">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+        <font-face font-family="Roboto" font-size="20" panose-1="2 0 0 0 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="500">
+            <font-face-src>
+                <font-face-name name="Roboto-Regular"/>
+            </font-face-src>
+        </font-face>
+        <font-face font-family="Roboto Condensed" font-size="16" panose-1="0 0 4 6 0 0 0 0 0 0" units-per-em="1000" underline-position="-73.242188" underline-thickness="48.828125" slope="0" x-height="538.08594" cap-height="720.70312" ascent="927.7344" descent="-244.14062" font-weight="300" font-stretch="condensed">
+            <font-face-src>
+                <font-face-name name="RobotoCondensed-Light"/>
+            </font-face-src>
+        </font-face>
+        <marker orient="auto" overflow="visible" markerUnits="strokeWidth" id="FilledArrow_Marker_5" viewBox="-1 -3 7 6" markerWidth="7" markerHeight="6" color="#126f33">
+            <g>
+                <path d="M 4.8 0 L 0 -1.8 L 0 1.8 Z" fill="currentColor" stroke="currentColor" stroke-width="1"/>
+            </g>
+        </marker>
+    </defs>
+    <g stroke="none" stroke-opacity="1" stroke-dasharray="none" fill="none" fill-opacity="1">
+        <title>MediaCodec state diagram</title>
+        <g>
+            <line x1="740" y1="120" x2="740" y2="82.9" marker-end="url(#FilledArrow_Marker)" stroke="#ea8008" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="740" y1="210" x2="740" y2="172.9" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="763.33333" y1="70" x2="763.33333" y2="107.1" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="920" y1="153.5" x2="822.9" y2="153.35288" marker-end="url(#FilledArrow_Marker_2)" stroke="#274ecc" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="920" y1="229" x2="822.89947" y2="229.88273" marker-end="url(#FilledArrow_Marker_3)" stroke="#d02e2a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="919.5" y1="140" x2="822.9" y2="140" marker-end="url(#FilledArrow_Marker)" stroke="#ea8008" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="827.11573" y1="286.33365" x2="843.6129" y2="313.47642" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="922.88427" y1="286.33365" x2="904.22416" y2="313.82635" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 927.5 11.5 L 1092.5 11.5 C 1095.8137 11.5 1098.5 14.1862915 1098.5 17.5 L 1098.5 282.5 C 1098.5 285.8137 1095.8137 288.5 1092.5 288.5 L 927.5 288.5 C 924.1863 288.5 921.5 285.8137 921.5 282.5 L 921.5 17.5 C 921.5 14.1862915 924.1863 11.5 927.5 11.5 Z" fill="#178f46"/>
+            <path d="M 927.5 11.5 L 1092.5 11.5 C 1095.8137 11.5 1098.5 14.1862915 1098.5 17.5 L 1098.5 282.5 C 1098.5 285.8137 1095.8137 288.5 1092.5 288.5 L 927.5 288.5 C 924.1863 288.5 921.5 285.8137 921.5 282.5 L 921.5 17.5 C 921.5 14.1862915 924.1863 11.5 927.5 11.5 Z" stroke="#178f46" stroke-linecap="round" stroke-linejoin="round" stroke-width="3"/>
+            <text transform="translate(926.5 260)" fill="#aadbc2">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadbc2" x="40.091797" y="19" textLength="21.279297">Ex</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#aadbc2" x="61.17578" y="19" textLength="65.73242">ecuting</tspan>
+            </text>
+            <path d="M 657.5 11.5 L 822.5 11.5 C 825.8137 11.5 828.5 14.1862915 828.5 17.5 L 828.5 282.5 C 828.5 285.8137 825.8137 288.5 822.5 288.5 L 657.5 288.5 C 654.1863 288.5 651.5 285.8137 651.5 282.5 L 651.5 17.5 C 651.5 14.1862915 654.1863 11.5 657.5 11.5 Z" stroke="#d02e2a" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(656.5 260)" fill="#d02e2a">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d02e2a" x="46.53711" y="19" textLength="18.398438">St</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d02e2a" x="64.740234" y="19" textLength="55.722656">opped</tspan>
+            </text>
+            <text transform="translate(1130.1743 91)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x=".64453125" y="15" textLength="30.710938">flush</tspan>
+            </text>
+            <text transform="translate(968 78.5)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x=".859375" y="15" textLength="122.78125">dequeueInputBuffer</tspan>
+            </text>
+            <text transform="translate(846.272 20.5)" fill="#126f33">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#126f33" x="14.255245" y="15" textLength="24.148438">star</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#126f33" x="38.794307" y="15" textLength="4.640625">t</tspan>
+            </text>
+            <text transform="translate(848.3963 116.5)" fill="#eb8007">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#eb8007" x="11.621094" y="15" textLength="11.78125">st</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#eb8007" x="23.246094" y="15" textLength="15.6328125">op</tspan>
+            </text>
+            <text transform="translate(858.68587 232.88521)" fill="#b6251f">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x=".21875" y="15" textLength="16.992188">err</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x="17.054688" y="15" textLength="12.6875">or</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#b6251f" x="28.78125" y="15" textLength="9">…</tspan>
+            </text>
+            <text transform="translate(857.8257 157.930055)" fill="#274ecd">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(768.33333 78.12302)" fill="#274ecd">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(744 182.62)" fill="#274ecd">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x=".4453125" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#274ecd" x="5.1328125" y="15" textLength="26.421875">eset</tspan>
+            </text>
+            <text transform="translate(675 91)" fill="#eb8007">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#eb8007" x="2.8125" y="15" textLength="30.382812">confi</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#eb8007" x="33.195312" y="15" textLength="20.320312">gur</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#eb8007" x="53.367187" y="15" textLength="7.3203125">e</tspan>
+            </text>
+            <path d="M 676 30 L 804 30 C 807.3137 30 810 32.686292 810 36 L 810 64 C 810 67.31371 807.3137 70 804 70 L 676 70 C 672.6863 70 670 67.31371 670 64 L 670 36 C 670 32.686292 672.6863 30 676 30 Z" fill="#f0a608"/>
+            <text transform="translate(675 38)" fill="#fbe4a3">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="16.381836" y="19" textLength="46.533203">Confi</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="62.91504" y="19" textLength="29.013672">gur</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#fbe4a3" x="91.743164" y="19" textLength="21.875">ed</tspan>
+            </text>
+            <path d="M 946 120 L 1074 120 C 1077.3137 120 1080 122.68629 1080 126 L 1080 154 C 1080 157.31371 1077.3137 160 1074 160 L 946 160 C 942.6863 160 940 157.31371 940 154 L 940 126 C 940 122.68629 942.6863 120 946 120 Z" fill="#f8f8f8"/>
+            <path d="M 946 120 L 1074 120 C 1077.3137 120 1080 122.68629 1080 126 L 1080 154 C 1080 157.31371 1077.3137 160 1074 160 L 946 160 C 942.6863 160 940 157.31371 940 154 L 940 126 C 940 122.68629 942.6863 120 946 120 Z" stroke="#49b077" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 128)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="28.740234" y="19" textLength="72.51953">Running</tspan>
+            </text>
+            <path d="M 676 120 L 804 120 C 807.3137 120 810 122.68629 810 126 L 810 154 C 810 157.31371 807.3137 160 804 160 L 676 160 C 672.6863 160 670 157.31371 670 154 L 670 126 C 670 122.68629 672.6863 120 676 120 Z" fill="#346df1"/>
+            <text transform="translate(675 128)" fill="#bad0fb">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#bad0fb" x="10.825195" y="19" textLength="86.63086">Uninitializ</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#bad0fb" x="97.299805" y="19" textLength="21.875">ed</tspan>
+            </text>
+            <path d="M 676 210 L 804 210 C 807.3137 210 810 212.68629 810 216 L 810 244 C 810 247.31371 807.3137 250 804 250 L 676 250 C 672.6863 250 670 247.31371 670 244 L 670 216 C 670 212.68629 672.6863 210 676 210 Z" fill="#d02e2a"/>
+            <text transform="translate(675 218)" fill="white">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="white" x="43.55957" y="19" textLength="24.902344">Err</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="white" x="68.2666" y="19" textLength="18.173828">or</tspan>
+            </text>
+            <path d="M 946 30 L 1074 30 C 1077.3137 30 1080 32.686292 1080 36 L 1080 64 C 1080 67.31371 1077.3137 70 1074 70 L 946 70 C 942.6863 70 940 67.31371 940 64 L 940 36 C 940 32.686292 942.6863 30 946 30 Z" fill="#f8f8f8"/>
+            <path d="M 946 30 L 1074 30 C 1077.3137 30 1080 32.686292 1080 36 L 1080 64 C 1080 67.31371 1077.3137 70 1074 70 L 946 70 C 942.6863 70 940 67.31371 940 64 L 940 36 C 940 32.686292 942.6863 30 946 30 Z" stroke="#de6560" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 38)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="29.93164" y="19" textLength="70.13672">Flushed</tspan>
+            </text>
+            <path d="M 946 210 L 1074 210 C 1077.3137 210 1080 212.68629 1080 216 L 1080 244 C 1080 247.31371 1077.3137 250 1074 250 L 946 250 C 942.6863 250 940 247.31371 940 244 L 940 216 C 940 212.68629 942.6863 210 946 210 Z" fill="#f8f8f8"/>
+            <path d="M 946 210 L 1074 210 C 1077.3137 210 1080 212.68629 1080 216 L 1080 244 C 1080 247.31371 1077.3137 250 1074 250 L 946 250 C 942.6863 250 940 247.31371 940 244 L 940 216 C 940 212.68629 942.6863 210 946 210 Z" stroke="#f4c23d" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(945 218)" fill="#178f46">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="2.0410156" y="19" textLength="87.09961">End of Str</tspan>
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#178f46" x="88.95508" y="19" textLength="39.003906">eam</tspan>
+            </text>
+            <line x1="810" y1="50" x2="927.1" y2="50" marker-end="url(#FilledArrow_Marker_5)" stroke="#126f33" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="963.33333" y1="70" x2="963.33333" y2="107.1" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <line x1="963.33333" y1="160" x2="963.33333" y2="197.1" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 1080 133.33333 C 1080 133.33333 1106 115.83135 1106 96 C 1106 84.961065 1097.9439 76.089842 1090.80046 70.39346" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <path d="M 1056.66667 210 C 1056.66667 210 1110.38955 160.3288 1117 115 C 1121.4143 84.73063 1103.434 65.902535 1090.9997 56.733113" marker-end="url(#FilledArrow_Marker_4)" stroke="#262626" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
+            <text transform="translate(968.25 162)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="2.171875" y="15" textLength="111.25">queueInputBuffer</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="38.46875" y="34" textLength="35.0625">(EOS)</tspan>
+            </text>
+            <path d="M 809.6463 324.5 L 937.6463 324.5 C 940.96 324.5 943.6463 327.1863 943.6463 330.5 L 943.6463 358.5 C 943.6463 361.8137 940.96 364.5 937.6463 364.5 L 809.6463 364.5 C 806.3326 364.5 803.6463 361.8137 803.6463 358.5 L 803.6463 330.5 C 803.6463 327.1863 806.3326 324.5 809.6463 324.5 Z" fill="#535353"/>
+            <text transform="translate(808.6463 332.5)" fill="#d5d5d5">
+                <tspan font-family="Roboto" font-size="20" font-weight="500" fill="#d5d5d5" x="24.28711" y="19" textLength="81.42578">Released</tspan>
+            </text>
+            <text transform="translate(852.18587 294.5)" fill="#262626">
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x=".15625" y="15" textLength="4.8359375">r</tspan>
+                <tspan font-family="Roboto Condensed" font-size="16" font-weight="300" font-stretch="condensed" fill="#262626" x="4.84375" y="15" textLength="40">elease</tspan>
+            </text>
+        </g>
+    </g>
+</svg>
diff --git a/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image01.png b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image01.png
new file mode 100644
index 0000000..d4a1ea5
--- /dev/null
+++ b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image01.png
Binary files differ
diff --git a/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image02.png b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image02.png
new file mode 100644
index 0000000..f8f0d8c
--- /dev/null
+++ b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image02.png
Binary files differ
diff --git a/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image03.png b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image03.png
new file mode 100644
index 0000000..fc59b54
--- /dev/null
+++ b/docs/html/images/tools/performance/allocation-tracker/gettingstarted_image03.png
Binary files differ
diff --git a/docs/html/images/tools/performance/allocation_tracker.png b/docs/html/images/tools/performance/allocation_tracker.png
new file mode 100755
index 0000000..cbae4cd
--- /dev/null
+++ b/docs/html/images/tools/performance/allocation_tracker.png
Binary files differ
diff --git a/docs/html/images/tools/performance/battery_historian.png b/docs/html/images/tools/performance/battery_historian.png
new file mode 100755
index 0000000..d1d58ac
--- /dev/null
+++ b/docs/html/images/tools/performance/battery_historian.png
Binary files differ
diff --git a/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image01.png b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image01.png
new file mode 100644
index 0000000..8f12698
--- /dev/null
+++ b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image01.png
Binary files differ
diff --git a/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image02.png b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image02.png
new file mode 100644
index 0000000..e8a0a87
--- /dev/null
+++ b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image02.png
Binary files differ
diff --git a/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image03.png b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image03.png
new file mode 100644
index 0000000..8914d3b
--- /dev/null
+++ b/docs/html/images/tools/performance/batterystats-battery-historian/gettingstarted_image03.png
Binary files differ
diff --git a/docs/html/images/tools/performance/compare_AllocationTracker.png b/docs/html/images/tools/performance/compare_AllocationTracker.png
new file mode 100755
index 0000000..bec9931
--- /dev/null
+++ b/docs/html/images/tools/performance/compare_AllocationTracker.png
Binary files differ
diff --git a/docs/html/images/tools/performance/compare_HeapViewer.png b/docs/html/images/tools/performance/compare_HeapViewer.png
new file mode 100755
index 0000000..2cc4bce
--- /dev/null
+++ b/docs/html/images/tools/performance/compare_HeapViewer.png
Binary files differ
diff --git a/docs/html/images/tools/performance/compare_MemoryMonitor.png b/docs/html/images/tools/performance/compare_MemoryMonitor.png
new file mode 100755
index 0000000..5a728fd
--- /dev/null
+++ b/docs/html/images/tools/performance/compare_MemoryMonitor.png
Binary files differ
diff --git a/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image01.png b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image01.png
new file mode 100644
index 0000000..a398f35
--- /dev/null
+++ b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image01.png
Binary files differ
diff --git a/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image02.png b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image02.png
new file mode 100644
index 0000000..9a7ccb3
--- /dev/null
+++ b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image02.png
Binary files differ
diff --git a/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image03.png b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image03.png
new file mode 100644
index 0000000..acdff2c
--- /dev/null
+++ b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image03.png
Binary files differ
diff --git a/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image04.png b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image04.png
new file mode 100644
index 0000000..8219ec8
--- /dev/null
+++ b/docs/html/images/tools/performance/debug-gpu-overdraw/gettingstarted_image04.png
Binary files differ
diff --git a/docs/html/images/tools/performance/gpu_profiling.png b/docs/html/images/tools/performance/gpu_profiling.png
new file mode 100755
index 0000000..c86fb14
--- /dev/null
+++ b/docs/html/images/tools/performance/gpu_profiling.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap-viewer/gettingstarted_image01.png b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image01.png
new file mode 100644
index 0000000..eef493c
--- /dev/null
+++ b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image01.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap-viewer/gettingstarted_image02.png b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image02.png
new file mode 100644
index 0000000..7540640
--- /dev/null
+++ b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image02.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap-viewer/gettingstarted_image03.png b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image03.png
new file mode 100644
index 0000000..42e8ba3
--- /dev/null
+++ b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image03.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap-viewer/gettingstarted_image04.png b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image04.png
new file mode 100644
index 0000000..36d1164
--- /dev/null
+++ b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image04.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap-viewer/gettingstarted_image05.png b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image05.png
new file mode 100644
index 0000000..b74d37b
--- /dev/null
+++ b/docs/html/images/tools/performance/heap-viewer/gettingstarted_image05.png
Binary files differ
diff --git a/docs/html/images/tools/performance/heap_viewer.png b/docs/html/images/tools/performance/heap_viewer.png
new file mode 100755
index 0000000..d9028d0
--- /dev/null
+++ b/docs/html/images/tools/performance/heap_viewer.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image001.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image001.png
new file mode 100644
index 0000000..eef493c
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image002.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image002.png
new file mode 100644
index 0000000..00e8edf
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image003.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image003.png
new file mode 100644
index 0000000..c0f9c78
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image004.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image004.png
new file mode 100644
index 0000000..bc555b8
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image005.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image005.png
new file mode 100644
index 0000000..209f71b
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image006.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image006.png
new file mode 100644
index 0000000..57d3256
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image006.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image007.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image007.png
new file mode 100644
index 0000000..dd12e07
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image007.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image008.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image008.png
new file mode 100644
index 0000000..74302b2
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image008.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image009.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image009.png
new file mode 100644
index 0000000..1b93961
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image009.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image010.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image010.png
new file mode 100644
index 0000000..1fe198b
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image010.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image011.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image011.png
new file mode 100644
index 0000000..a9a0a3e
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image011.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image012.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image012.png
new file mode 100644
index 0000000..9308cd1
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image012.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image013.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image013.png
new file mode 100644
index 0000000..80e1ba1
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image013.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image014.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image014.png
new file mode 100644
index 0000000..326c5a0
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image014.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image015.png b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image015.png
new file mode 100644
index 0000000..e9824a4
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy-viewer/gettingstarted_image015.png
Binary files differ
diff --git a/docs/html/images/tools/performance/hierarchy_viewer.png b/docs/html/images/tools/performance/hierarchy_viewer.png
new file mode 100755
index 0000000..064efea
--- /dev/null
+++ b/docs/html/images/tools/performance/hierarchy_viewer.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image001.png b/docs/html/images/tools/performance/import_image001.png
new file mode 100755
index 0000000..872c55b
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image002.png b/docs/html/images/tools/performance/import_image002.png
new file mode 100755
index 0000000..114f90b
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image003.png b/docs/html/images/tools/performance/import_image003.png
new file mode 100755
index 0000000..1e47d7b
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image004.png b/docs/html/images/tools/performance/import_image004.png
new file mode 100755
index 0000000..6c5b801
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image005.png b/docs/html/images/tools/performance/import_image005.png
new file mode 100755
index 0000000..35080c5
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image006.png b/docs/html/images/tools/performance/import_image006.png
new file mode 100755
index 0000000..08b9e61
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image006.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image007.png b/docs/html/images/tools/performance/import_image007.png
new file mode 100755
index 0000000..d2ec83b
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image007.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image008.png b/docs/html/images/tools/performance/import_image008.png
new file mode 100755
index 0000000..efde7df
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image008.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image009.png b/docs/html/images/tools/performance/import_image009.png
new file mode 100755
index 0000000..f9e6109
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image009.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image010.png b/docs/html/images/tools/performance/import_image010.png
new file mode 100755
index 0000000..165edea
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image010.png
Binary files differ
diff --git a/docs/html/images/tools/performance/import_image011.png b/docs/html/images/tools/performance/import_image011.png
new file mode 100755
index 0000000..f475ebc
--- /dev/null
+++ b/docs/html/images/tools/performance/import_image011.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory-monitor/gettingstarted_image001.png b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image001.png
new file mode 100644
index 0000000..c6fe045
--- /dev/null
+++ b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory-monitor/gettingstarted_image002.png b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image002.png
new file mode 100644
index 0000000..f46b6f1
--- /dev/null
+++ b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory-monitor/gettingstarted_image003.png b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image003.png
new file mode 100644
index 0000000..72291cd
--- /dev/null
+++ b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory-monitor/gettingstarted_image004.png b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image004.png
new file mode 100644
index 0000000..d343879
--- /dev/null
+++ b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory-monitor/gettingstarted_image005.png b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image005.png
new file mode 100644
index 0000000..f7d9784
--- /dev/null
+++ b/docs/html/images/tools/performance/memory-monitor/gettingstarted_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/memory_monitor.png b/docs/html/images/tools/performance/memory_monitor.png
new file mode 100755
index 0000000..c761141
--- /dev/null
+++ b/docs/html/images/tools/performance/memory_monitor.png
Binary files differ
diff --git a/docs/html/images/tools/performance/overdraw.png b/docs/html/images/tools/performance/overdraw.png
new file mode 100755
index 0000000..ff402d0
--- /dev/null
+++ b/docs/html/images/tools/performance/overdraw.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image001.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image001.png
new file mode 100644
index 0000000..d59cf12
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image002.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image002.png
new file mode 100644
index 0000000..5f974ef
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image003.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image003.png
new file mode 100644
index 0000000..788c18d
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image004.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image004.png
new file mode 100644
index 0000000..ab0616e
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image005.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image005.png
new file mode 100644
index 0000000..6411bf6
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image006.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image006.png
new file mode 100644
index 0000000..6376a1a
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image006.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image007.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image007.png
new file mode 100644
index 0000000..586a8d8
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image007.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image008.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image008.png
new file mode 100644
index 0000000..47ff045
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image008.png
Binary files differ
diff --git a/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image009.png b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image009.png
new file mode 100644
index 0000000..c448162
--- /dev/null
+++ b/docs/html/images/tools/performance/profile-gpu-rendering/gettingstarted_image009.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace.png b/docs/html/images/tools/performance/systrace.png
new file mode 100755
index 0000000..567a8a7
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace/gettingstarted_image001.png b/docs/html/images/tools/performance/systrace/gettingstarted_image001.png
new file mode 100644
index 0000000..e31f531
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace/gettingstarted_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace/gettingstarted_image002.png b/docs/html/images/tools/performance/systrace/gettingstarted_image002.png
new file mode 100644
index 0000000..01c69f5
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace/gettingstarted_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace/gettingstarted_image003.png b/docs/html/images/tools/performance/systrace/gettingstarted_image003.png
new file mode 100644
index 0000000..bf34f3f
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace/gettingstarted_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace/gettingstarted_image004.png b/docs/html/images/tools/performance/systrace/gettingstarted_image004.png
new file mode 100644
index 0000000..2a5286f
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace/gettingstarted_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/systrace/gettingstarted_image005.png b/docs/html/images/tools/performance/systrace/gettingstarted_image005.png
new file mode 100644
index 0000000..7f41398
--- /dev/null
+++ b/docs/html/images/tools/performance/systrace/gettingstarted_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview.png b/docs/html/images/tools/performance/traceview.png
new file mode 100755
index 0000000..16e6bdd
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image001.png b/docs/html/images/tools/performance/traceview/gettingstarted_image001.png
new file mode 100644
index 0000000..eef493c
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image001.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image002.png b/docs/html/images/tools/performance/traceview/gettingstarted_image002.png
new file mode 100644
index 0000000..a334319
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image002.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image003.png b/docs/html/images/tools/performance/traceview/gettingstarted_image003.png
new file mode 100644
index 0000000..57f3ab4
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image003.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image004.png b/docs/html/images/tools/performance/traceview/gettingstarted_image004.png
new file mode 100644
index 0000000..b32b9ad
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image004.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image005.png b/docs/html/images/tools/performance/traceview/gettingstarted_image005.png
new file mode 100644
index 0000000..a893dde
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image005.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image006.png b/docs/html/images/tools/performance/traceview/gettingstarted_image006.png
new file mode 100644
index 0000000..9ffee43
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image006.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image007.png b/docs/html/images/tools/performance/traceview/gettingstarted_image007.png
new file mode 100644
index 0000000..3b04ba3
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image007.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image008.png b/docs/html/images/tools/performance/traceview/gettingstarted_image008.png
new file mode 100644
index 0000000..054cd90
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image008.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image009.png b/docs/html/images/tools/performance/traceview/gettingstarted_image009.png
new file mode 100644
index 0000000..7b95cf3e
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image009.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image010.png b/docs/html/images/tools/performance/traceview/gettingstarted_image010.png
new file mode 100644
index 0000000..871d4bc
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image010.png
Binary files differ
diff --git a/docs/html/images/tools/performance/traceview/gettingstarted_image011.png b/docs/html/images/tools/performance/traceview/gettingstarted_image011.png
new file mode 100644
index 0000000..6e39a19
--- /dev/null
+++ b/docs/html/images/tools/performance/traceview/gettingstarted_image011.png
Binary files differ
diff --git a/docs/html/index.jd b/docs/html/index.jd
index 7fae38a..3989b92 100644
--- a/docs/html/index.jd
+++ b/docs/html/index.jd
@@ -15,7 +15,9 @@
   <div class="wrap" style="max-width:1100px;">
     <div class="cols dac-hero-content">
       <div class="col-10of16 col-push-6of16 dac-hero-figure">
-        <img src="{@docRoot}images/home/devices-hero_620px_2x.png">
+        <img class="dac-hero-image" src="{@docRoot}images/home/devices-hero_620px_2x.png"
+             srcset="{@docRoot}images/home/devices-hero_620px.png 1x,
+             {@docRoot}images/home/devices-hero_620px_2x.png 2x">
       </div>
       <div class="col-6of16 col-pull-10of16">
         <div class="dac-hero-tag"></div>
diff --git a/docs/html/jd_collections.js b/docs/html/jd_collections.js
index 05f89ff..46d81e5 100644
--- a/docs/html/jd_collections.js
+++ b/docs/html/jd_collections.js
@@ -284,14 +284,14 @@
   },
   "distribute/gp/gpfelanding": {
     "resources": [
-      "distribute/googleplay/auto.html",
-      "distribute/googleplay/tv.html",
       "distribute/googleplay/wear.html",
-      "distribute/googleplay/cardboard.html",
-      "distribute/googleplay/cast.html",
-      "distribute/googleplay/edu/about.html",
+      "distribute/googleplay/tv.html",
+      "distribute/googleplay/auto.html",
       "distribute/googleplay/families/about.html",
-      "distribute/googleplay/work/about.html"
+      "distribute/googleplay/work/about.html",
+      "distribute/googleplay/edu/about.html",
+      "distribute/googleplay/cast.html",
+      "distribute/googleplay/cardboard.html",
     ]
   },
   "distribute/googleplay/gpfw": {
@@ -324,33 +324,31 @@
   "distribute/users": {
     "title": "",
     "resources": [
-      "distribute/users/know-your-user.html",
       "distribute/users/your-listing.html",
-      "distribute/users/expand-to-new-markets.html",
       "distribute/users/promote-with-ads.html",
       "distribute/users/appindexing.html",
+      "distribute/googleplay/index.html#opportunities",
+      "distribute/analyze/improve-roi.html",
+      "distribute/users/expand-to-new-markets.html",
+      "distribute/users/promote-with-ads.html",
+      "distribute/analyze/index.html",
+      "distribute/users/app-invites.html",
       "distribute/users/ota-installs.html",
-      "distribute/users/house-ads.html",
       "distribute/users/youtube.html",
-      "distribute/users/build-buzz.html",
-      "distribute/users/build-community.html"
+      "distribute/users/house-ads.html",
     ]
   },
   "distribute/engagelanding": {
     "resources": [
+      "distribute/engage/intents.html",
       "distribute/engage/widgets.html",
       "distribute/engage/notifications.html",
-      "distribute/engage/gcm.html",
-      "distribute/engage/easy-signin.html",
       "distribute/engage/deep-linking.html",
       "distribute/engage/ads.html",
-      "distribute/engage/intents.html",
-      "distribute/engage/deep-linking.html",
-      "distribute/engage/analytics.html",
       "distribute/engage/game-services.html",
-      "distribute/engage/app-updates.html",
-      "distribute/engage/community.html",
-      "distribute/engage/video.html"
+      "distribute/engage/easy-signin.html",
+      "distribute/analyze/build-better-apps.html",
+      "distribute/engage/gcm.html",
     ]
   },
   "distribute/monetize": {
@@ -358,9 +356,10 @@
       "distribute/monetize/premium.html",
       "distribute/monetize/freemium.html",
       "distribute/monetize/subscriptions.html",
-      "distribute/monetize/ecommerce.html",
       "distribute/monetize/ads.html",
-      "distribute/monetize/payments.html"
+      "distribute/monetize/ecommerce.html",
+      "distribute/monetize/payments.html",
+      "distribute/analyze/understand-user-value.html",
     ]
   },
   "distribute/analyzelanding": {
@@ -429,6 +428,31 @@
       "https://support.google.com/tagmanager/answer/6003007"
     ]
   },
+  "distribute/essentials/guidelines": {
+    "title": "",
+    "resources": [
+      "distribute/essentials/quality/core.html",
+      "distribute/essentials/quality/tablets.html",
+      "distribute/essentials/quality/wear.html",
+      "distribute/essentials/quality/tv.html",
+      "distribute/essentials/quality/auto.html",
+      "https://developers.google.com/edu/guidelines"
+    ]
+  },
+  "distribute/essentials/tools": {
+    "title": "",
+    "resources": [
+      "distribute/tools/launch-checklist.html",
+      "distribute/tools/localization-checklist.html",
+      "https://support.google.com/googleplay/android-developer",
+      "distribute/tools/promote/brand.html",
+      "distribute/tools/promote/device-art.html",
+      "distribute/tools/promote/badges.html",
+      "distribute/tools/promote/linking.html",
+      "distribute/tools/open-distribution.html",
+      "about/dashboards/index.html"
+    ]
+  },
   "distribute/tools/checklists": {
     "title": "",
     "resources": [
@@ -608,12 +632,12 @@
       "http://android-developers.blogspot.com/2013/10/improved-app-insight-by-linking-google.html"
      ]
   },
-  "distribute/users/knowyouruser": {
+  "distribute/users/appinvites": {
     "title": "",
     "resources": [
-      "distribute/essentials/optimizing-your-app.html",
-      "http://www.youtube.com/watch?v=RRelFvc6Czo",
-      "distribute/stories/localization.html"
+      "https://developers.google.com/app-invites/",
+      "https://developers.google.com/identity/sign-in/android/",
+      "https://developers.google.com/app-indexing/"
     ]
   },
   "distribute/users/promotewithads": {
@@ -1365,11 +1389,8 @@
     "title": "",
     "resources": [
       "https://support.google.com/admob/topic/2784623",
-      "https://developers.google.com/mobile-ads-sdk/download",
+      "http://admob.blogspot.com/",
       "http://analyticsacademy.withgoogle.com/mobile-app",
-      "http://support.google.com/googleplay/android-developer/topic/2985714",
-      "https://support.google.com/admob/answer/2753860",
-      "https://support.google.com/admob/"
     ]
   },
   "distribute/monetize/paymentmethods": {
@@ -1386,12 +1407,8 @@
       "preview/download.html",
       "preview/setup-sdk.html",
       "preview/samples.html",
-      "preview/support.html",
       "preview/api-overview.html",
-      "preview/features/runtime-permissions.html",
-      "preview/api-changes.html",
-      "preview/api-overview.html",
-      "preview/backup/index.html",
+      "preview/support.html"
     ]
   },
   "autolanding": {
@@ -1580,5 +1597,38 @@
       "training/enterprise/work-policy-ctrl.html",
       "samples/BasicManagedProfile/index.html"
     ]
+  },
+  "tools/performance/rendering": {
+    "title": "",
+    "resources": [
+       "tools/performance/debug-gpu-overdraw/index.html",
+       "tools/performance/profile-gpu-rendering/index.html",
+       "tools/performance/hierarchy-viewer/setup.html",
+       "tools/performance/hierarchy-viewer/index.html",
+       "tools/performance/hierarchy-viewer/profiling.html"
+    ]
+  },
+  "tools/performance/memory": {
+    "title": "",
+    "resources": [
+       "tools/performance/memory-monitor/index.html",
+       "tools/performance/heap-viewer/index.html",
+       "tools/performance/allocation-tracker/index.html",
+       "tools/performance/comparison.html"
+    ]
+  },
+  "tools/performance/cpu": {
+    "title": "",
+    "resources": [
+       "tools/performance/traceview/index.html",
+       "tools/performance/systrace/index.html"
+    ]
+  },
+  "tools/performance/battery": {
+    "title": "",
+    "resources": [
+       "tools/performance/batterystats-battery-historian/index.html",
+       "tools/performance/batterystats-battery-historian/charts.html"
+    ]
   }
 }
\ No newline at end of file
diff --git a/docs/html/jd_extras.js b/docs/html/jd_extras.js
index 5d17679..54343eb 100644
--- a/docs/html/jd_extras.js
+++ b/docs/html/jd_extras.js
@@ -443,7 +443,7 @@
     "group":"",
     "keywords": [],
     "tags": [],
-    "image":"images/play_dev.jpg",
+    "image":"images/cards/google-play_2x.png",
     "type":"google"
   },
   {
@@ -1596,6 +1596,19 @@
     "lang": "en",
     "group": "",
     "tags": [],
+    "url": "http://admob.blogspot.com/",
+    "timestamp": null,
+    "image": "images/cards/analytics-mobile_2x.jpg",
+    "title": "Inside Admob",
+    "summary": "Google’s official blog for news, tips, and information on the AdMob developer platform.",
+    "keywords": ["ads, analytics, monetize"],
+    "type": "distribute",
+    "titleFriendly": ""
+  },
+  {
+    "lang": "en",
+    "group": "",
+    "tags": [],
     "url": "https://support.google.com/admob/answer/3111064",
     "timestamp": null,
     "image": "distribute/images/advertising.jpg",
@@ -2518,6 +2531,19 @@
     "type": "distribute",
     "titleFriendly": ""
   },
+  {
+    "lang": "en",
+    "group": "",
+    "tags": [],
+    "url": "https://developers.google.com/app-invites/",
+    "timestamp": 1383243492000,
+    "image": "images/cards/google-search_2x.png",
+    "title": "Set up App Invites",
+    "summary": "Bring new users to your apps with personal recommendations, incentives, and offers.",
+    "keywords": ["invites", "appinvites", "engagement", "getusers"],
+    "type": "guide",
+    "titleFriendly": ""
+  },
 
   {
     "lang": "en",
@@ -3231,21 +3257,25 @@
     "title": "Designed for Families",
     "summary": "Introducing a new Google Play section to promote family friendly apps. Your apps in the program can benefit from enhanced discoverability in addition to maintaining their existing categories, rankings, and reviews elsewhere on the Google Play store."
   },
-  "https://www.youtube.com/watch?v=Pd49vTkvu0U": {
+  "http://www.youtube.com/watch?v=Pd49vTkvu0U": {
+    "url":"http://www.youtube.com/watch?v=Pd49vTkvu0U&list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c",
     "image": "images/distribute/hero-jelly-button.jpg",
     "title": "How Jelly Button Games are growing globally through data",
-    "summary": "To really understand their users, Jelly Button Games analyses over 3 billion events each month using Google Analytics and Google BigQuery."
+    "summary": "To really understand their users, Jelly Button Games analyzes over 3 billion events each month using Google Analytics and Google BigQuery."
   },
-  "http://www.youtube.com/watch?v=700gYRkhkLM%26list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c": {
+  "http://www.youtube.com/watch?v=700gYRkhkLM": {
+    "url":"http://www.youtube.com/watch?v=700gYRkhkLM&list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c",
     "image": "images/distribute/hero-outfit7.jpg",
     "title": "Outfit7 — Building an entertainment company with Google",
     "summary": "Outfit7, creators of My Talking Tom and My Talking Angela, offer a complete entertainment experience to users spanning mobile apps, user generated and original YouTube content, and a range of toys, clothing, and accessories...."
   },
-  "http://www.youtube.com/watch?v=MPnH7h12h0U%26list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c": {
+  "http://www.youtube.com/watch?v=MPnH7h12h0U": {
+    "url":"http://www.youtube.com/watch?v=MPnH7h12h0U&list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c",
     "image": "images/distribute/hero-haystack.jpg",
     "summary": "Haystack TV built a scalable business with six employees and Android TV. Two weeks was all it took for them to bring their mobile app to the big screen."
   },
-  "http://www.youtube.com/watch?v=ekxABqJeRBc%26list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c": {
+  "http://www.youtube.com/watch?v=ekxABqJeRBc": {
+    "url":"http://www.youtube.com/watch?v=ekxABqJeRBc&list=PLWz5rJ2EKKc9ofd2f-_-xmUi07wIGZa1c",
     "image": "images/distribute/hero-ginlemon.jpg",
     "title": "How GinLemon is breaking through with Google Play",
     "summary": "Meet Vincenzo Colucci, developer and founder of GinLemon, which started as a summer holiday joke and has now become a successful global app business on Google Play based in Manfredonia, southern Italy."
diff --git a/docs/html/preview/api-changes.jd b/docs/html/preview/api-changes.jd
index e4be2a1..8ea91dd 100644
--- a/docs/html/preview/api-changes.jd
+++ b/docs/html/preview/api-changes.jd
@@ -1,6 +1,6 @@
 page.title=Behavior Changes
 page.keywords=preview,sdk,compatibility
-sdk.platform.apiLevel=23
+page.tags=previewresources, androidm
 @jd:body
 
 <div id="qv-wrapper">
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index 5ab4b89..bf5eec4 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -1,7 +1,8 @@
 page.title=API Overview
 page.keywords=preview,sdk,compatibility
+page.tags=previewresources, androidm
 sdk.platform.apiLevel=22-mnc
-page.image=images/cards/card-key-changes_16-9_2x.png
+page.image=images/cards/card-api-overview_16-9_2x.png
 @jd:body
 
 
@@ -14,8 +15,7 @@
         <span class="less" style="display:none">show less</span></a></h2>
 
 <ol id="toc44" class="hide-nested">
-  <li><a href="#backup">Auto Backup for Apps</a></li>
-  <li><a href="#notifications">Notifications</a></li>
+  <li><a href="#backup">Automatic App Data Backup</a></li>
   <li><a href="#authentication">Authentication</a>
     <ul>
       <li><a href="#fingerprint-authentication">Fingerprint Authentication</a></li>
@@ -24,14 +24,27 @@
   </li>
   <li><a href="#direct-share">Direct Share</a></li>
   <li><a href="#voice-interactions">Voice Interactions</a></li>
+  <li><a href="#assist">Assist API</a></li>
+  <li><a href="#notifications">Notifications</a></li>
   <li><a href="#bluetooth-stylus">Bluetooth Stylus Support</a></li>
-  <li><a href="#audio">New Audio Features</a></li>
-  <li><a href="#afw">New Android for Work Features</a></li>
+  <li><a href="#ble-scanning">Improved Bluetooth Low Energy Scanning</a></li>
+  <li><a href="#hotspot">Hotspot 2.0 Release 1 Support</a></li>
+  <li><a href="#4K-display">4K Display Mode</a></li>
+  <li><a href="#behavior-themeable-colorstatelists">Themeable ColorStateLists</a></li>
+  <li><a href="#audio">Audio Features</a></li>
+  <li><a href="#video">Video Features</a></li>
+  <li><a href="#camera">Camera Features</a>
+    <ul>
+      <li><a href="#flashlight">Flashlight API</a></li>
+      <li><a href="#reprocessing">Camera Reprocessing</a></li>
+    </ul>
+  </li>
+  <li><a href="#afw">Android for Work Features</a></li>
 </ol>
 
 <h2>API Differences</h2>
 <ol>
-<li><a href="">API level 22 to M &raquo;</a> </li>
+<li><a href="{@docRoot}preview/download.html">API level 22 to M Preview &raquo;</a> </li>
 </ol>
 
 </div>
@@ -55,40 +68,24 @@
 href="{@docRoot}">developer.android.com</a>. These API elements are
 formatted in {@code code style} in this document (without hyperlinks). For the
 preliminary API documentation for these elements, download the <a
-href="http://storage.googleapis.com/androiddevelopers/preview/m-developer-preview-reference.zip">
-preview reference</a>.</p>
+href="{@docRoot}preview/download.html#docs"> preview reference</a>.</p>
 
 <h3>Important behavior changes</h3>
 
 <p>If you have previously published an app for Android, be aware that your app might be affected
-by changes in M.</p>
+by changes in the platform.</p>
 
-<p>Please see <a href="api-changes.html">Behavior Changes</a> for complete information.</p>
+<p>Please see <a href="behavior-changes.html">Behavior Changes</a> for complete information.</p>
 
-<h2 id="backup">Auto Backup for Apps</h2>
+<h2 id="backup">Automatic App Data Backup</h2>
 <p>The system now performs automatic full data backup and restore for apps. This behavior is
-enabled by default for apps targeting M; you do not need to add any additional code. If users
-delete their Google account, their backup data is deleted as well.</p>
-<p>To learn how this feature works and how to configure what to back up on the file system,
-see the <a href="">App Backup for Apps guide</a>.</p>
-
-<h2 id="notifications">Notifications</h2>
-<p>M adds the following API changes for notifications:</p>
-<ul>
-  <li>New {@code NotificationListenerService.INTERRUPTION_FILTER_ALARMS} filter level that
-    corresponds to the new <em>Alarms only</em> do not disturb mode.</li>
-  <li>New {@code Notification.CATEGORY_REMINDER} category value that is used to distinguish
-  user-scheduled reminders from other events
-  ({@link android.app.Notification#CATEGORY_EVENT}) and alarms
-  ({@link android.app.Notification#CATEGORY_ALARM}).</li>
-  <li>New {@code android.graphics.drawable.Icon} class which can be attached to your notifications
-    via the Notification.Builder.setIcon() and Notification.Builder.setLargeIcon() methods.</li>
-  <li>New {@code NotificationManager.getActiveNotifications()} method that allows your apps to
-    find out which of their notifications are currently alive.</li>
-</ul>
+enabled by default for apps targeting M Preview; you do not need to add any additional code. If
+users delete their Google accounts, their backup data is deleted as well. To learn how this feature
+works and how to configure what to back up on the file system, see
+<a href="{@docRoot}preview/backup/index.html">Automatic App Data Backup</a>.</p>
 
 <h2 id="authentication">Authentication</h2>
-<p>The M release offers new APIs to let you authenticate users by using their fingerprint scans on
+<p>This preview offers new APIs to let you authenticate users by using their fingerprint scans on
 supported devices, and check how recently the user was last authenticated using a device unlocking
 mechanism (such as a lockscreen password). Use these APIs in conjunction with
 the <a href="{@docRoot}training/articles/keystore.html">Android Keystore system</a>.</p>
@@ -97,17 +94,15 @@
 
 <p>To authenticate users via fingerprint scan, get an instance of the new
 {@code android.hardware.fingerprint.FingerprintManager} class and call the
-{@code FingerprintManager.authenticate()} method. Your app must be running on a device with a
-fingerprint sensor. You must implement the user interface for the fingerprint
-authentication flow on your app, and use the standard fingerprint Android icon in your UI.
-If you are developing multiple apps that use fingerprint authentication, note that each app must
-authenticate the user’s fingerprint independently.
+{@code FingerprintManager.authenticate()} method. Your app must be running on a compatible
+device with a fingerprint sensor. You must implement the user interface for the fingerprint
+authentication flow on your app, and use the standard Android fingerprint icon in your UI.
+The Android fingerprint icon ({@code c_fp_40px.png}) is included in the
+<a href="https://github.com/googlesamples/android-FingerprintDialog"
+class="external-link">sample app</a>. If you are developing multiple apps that use fingerprint
+authentication, note that each app must authenticate the user’s fingerprint independently.
 </p>
 
-<img src="{@docRoot}preview/images/fingerprint-screen_2x.png"
-srcset="{@docRoot}preview/images/fingerprint-screen.png 1x, preview/images/fingerprint-screen_2x.png 2x"
-style="margin:0 0 10px 20px" width="282" height="476" />
-
 <p>To use this feature in your app, first add the {@code USE_FINGERPRINT} permission in your
 manifest.</p>
 
@@ -116,34 +111,34 @@
         android:name="android.permission.USE_FINGERPRINT" /&gt;
 </pre>
 
-<p>The following snippet shows how you might listen for fingerprint events in your
-{@code FingerprintManager.AuthenticationCallback} implementation.</p>
+<img src="{@docRoot}preview/images/fingerprint-screen.png"
+srcset="{@docRoot}preview/images/fingerprint-screen.png 1x, {@docRoot}preview/images/fingerprint-screen_2x.png 2x"
+style="float:right; margin:0 0 10px 20px" width="282" height="476" />
 
-<pre>
-// Call this to start listening for fingerprint events
-public void startListening(FingerprintManager.CryptoObject cryptoObject) {
-    if (!isFingerprintAuthAvailable()) {
-        return;
-    }
-    mCancellationSignal = new CancellationSignal();
-    mSelfCancelled = false;
-    mFingerprintManager.authenticate(cryptoObject,
-            mCancellationSignal, this, 0 /* flags */);
-    // Icon to display when prompting users to start a fingerprint scan
-    mIcon.setImageResource(R.drawable.ic_fp_40px);
-}
+<p>To see an app implementation of fingerprint authentication, refer to the
+<a href="https://github.com/googlesamples/android-FingerprintDialog" class="external-link">
+  Fingerprint Dialog sample</a>.</p>
 
-// Helper method to check if the device supports fingerprint
-// scanning and if the user has enrolled at least one fingerprint.
-public boolean isFingerprintAuthAvailable() {
-    return mFingerprintManager.isHardwareDetected()
-        &amp;&amp; mFingerprintManager.hasEnrolledFingerprints();
-}
+<p>If you are testing this feature, follow these steps:</p>
+<ol>
+<li>Enroll a new fingerprint in the emulator by going to
+<strong>Settings > Security > Fingerprint</strong>, then follow the enrollment instructions.</li>
+<li>Install Android SDK Tools Revision 24.3, if you have not done so.</li>
+<li>Use an emulator to emulate fingerprint touch events with the
+following command. Use the same command to emulate fingerprint touch events on the lockscreen or
+in your app.
+<pre class="no-prettyprint">
+adb -e emu finger touch &lt;finger_id&gt;
 </pre>
+<p>On Windows, you may have to run {@code telnet 127.0.0.1 &lt;emulator-id&gt;} followed by
+  {@code finger touch &lt;finger_id&gt;}.
+</p>
+</li>
+</ol>
 
 <h3 id="confirm-credentials">Confirm Credentials</h3>
 <p>Your app can authenticate users based on how recently they last unlocked their device. You can
-use the same public or secret key to authenticate users into multiple apps. This feature frees
+use the same public or secret key to authenticate users. This feature frees
 users from having to remember additional app-specific passwords, and avoids the need for you to
 implement your own authentication user interface.</p>
 
@@ -152,46 +147,14 @@
 {@code android.security.KeyPairGeneratorSpec.Builder} and
 {@code android.security.KeyGeneratorSpec.Builder} classes for public key pairs and secret keys
 respectively. If you are importing keys, use the {@link android.security.KeyStoreParameter.Builder}
-class to set your constraints.</p>
+class to set your constraints. You can use the
+{@link android.app.KeyguardManager#createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence) createConfirmDeviceCredentialIntent()}
+method to re-authenticate the user within your app if the timeout expired.
+</p>
 
-<p>The following example shows how you might create a symmetric key in the Keystore which can only be
-used if the user has successfully unlocked the device within the last 5 minutes.</p>
-
-<pre>
-private void createKey() {
-    // Generate a key to decrypt payment credentials, tokens, etc.
-    // This will most likely be a registration step for the user when
-    // they are setting up your app.
-    try {
-        KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
-        ks.load(null);
-        KeyGenerator keyGenerator = KeyGenerator.getInstance("AES",
-                "AndroidKeyStore");
-        keyGenerator.init(new KeyGeneratorSpec.Builder(this)
-                // Alias of the entry in Android KeyStore where the key will appear
-                .setAlias(KEY_NAME)
-                // Key use constraints
-                .setPurposes(KeyStoreKeyProperties.Purpose.ENCRYPT
-                    | KeyStoreKeyProperties.Purpose.DECRYPT)
-                .setBlockModes("CBC")
-                .setUserAuthenticationRequired(true)
-                // Require that the user has unlocked in the last 5 minutes
-                .setUserAuthenticationValidityDurationSeconds(5 * 60)
-                .setEncryptionPaddings("PKCS7Padding")
-                .build());
-        keyGenerator.generateKey();
-    } catch (NoSuchAlgorithmException | NoSuchProviderException
-            | InvalidAlgorithmParameterException | KeyStoreException
-            | CertificateException | IOException e) {
-          throw new RuntimeException(e);
-    }
-}
-</pre>
-
-<p>To determine the last time users logged into their account, call the
-{@code android.accounts.AccountManager.confirmCredentials()} method. If the call is successful, the
-method returns an bundle that includes a {@code KEY_LAST_AUTHENTICATED_TIME} value which indicates
-the last time, in milliseconds, that the credential for that account was validated or created.</p>
+<p>To see an app implementation of this feature, refer to the
+<a href="https://github.com/googlesamples/android-ConfirmDeviceCredentials" class="external-link">
+  Confirm Device Credentials sample</a>.</p>
 
 <h2 id="direct-share">Direct Share</h2>
 
@@ -199,7 +162,7 @@
 srcset="{@docRoot}preview/images/direct-share-screen.png 1x, preview/images/direct-share-screen_2x.png 2x"
 style="float:right; margin:0 0 20px 30px" width="312" height="385" />
 
-<p>This release provides you with APIs to makes sharing intuitive and quick for users. You can now
+<p>This preview provides you with APIs to makes sharing intuitive and quick for users. You can now
 define <em>deep links</em> that target a specific activity in your app. These deep links are
 exposed to users via the <em>Share</em> menu. This feature allows users to share content to
 targets, such as contacts, within other apps. For example, the deep link might launch an
@@ -214,9 +177,6 @@
 {@code SERVICE_INTERFACE} action.</p>
 <p>The following example shows how you might declare the {@code ChooserTargetService} in your
 manifest.</p>
-<br>
-<br>
-<br>
 <pre>
 &lt;service android:name=".ChooserTargetService"
         android:label="&#64;string/service_name"
@@ -243,37 +203,142 @@
         android:value=".ChooserTargetService" /&gt;
 &lt;/activity>
 </pre>
+<p>To see an app implementation of this feature, refer to the
+<a href="https://github.com/googlesamples/android-DeepLinkSharing" class="external-link">
+  Deep Link Sharing sample</a>.</p>
+
 
 <h2 id="voice-interactions">Voice Interactions</h2>
 <p>
-This release provides a new voice interaction API which, together with
+This preview provides a new voice interaction API which, together with
 <a href="https://developers.google.com/voice-actions/" class="external-link">Voice Actions</a>,
 allows you to build conversational voice experiences into your apps. Call the
 {@code android.app.Activity.isVoiceInteraction()} method to determine if your activity was
 started in response to a voice action. If so, your app can use the
 {@code android.app.VoiceInteractor} class to request a voice confirmation from the user, select
-from a list of options, and more.</p>
-<p>To learn more about implementing voice actions, see the voice interaction API
+from a list of options, and more. To learn more about implementing voice actions, see the
 <a href="https://developers.google.com/voice-actions/interaction/"
-class="external-link">guide</a>.
+class="external-link">Voice Actions developer site</a>.
 </p>
 
+<h2 id="assist">Assist API</h2>
+<p>
+This preview offers a new way for users to engage with your apps through an assistant. To use this
+feature, the user must enable the assistant to use the current context. Once enabled, the user
+can summon the assistant within any app, by long-pressing on the <strong>Home</strong> button.</p>
+<p>The platform passes the current context to the assistant. In addition to the standard set of
+information that the platform passes to the assistant, your app can share additional information
+by using the new {@code android.app.Activity.AssistContent} class.</p>
+
+<p>To provide the assistant with additional context from your app, follow these steps:</p>
+
+<ol>
+<li>Implement the {@link android.app.Application.OnProvideAssistDataListener} interface.</li>
+<li>Register this listener by using
+{@link android.app.Application#registerOnProvideAssistDataListener(android.app.Application.OnProvideAssistDataListener) registerOnProvideAssistDataListener()}.</li>
+<li>In order to provide activity-specific contextual information, override the
+{@link android.app.Activity#onProvideAssistData(android.os.Bundle) onProvideAssistData()}
+callback and, optionally, the new {@code Activity.onProvideAssistContent()} callback.
+</ol>
+
+<h2 id="notifications">Notifications</h2>
+<p>This preview adds the following API changes for notifications:</p>
+<ul>
+  <li>New {@code NotificationListenerService.INTERRUPTION_FILTER_ALARMS} filter level that
+    corresponds to the new <em>Alarms only</em> do not disturb mode.</li>
+  <li>New {@code Notification.CATEGORY_REMINDER} category value that is used to distinguish
+  user-scheduled reminders from other events
+  ({@link android.app.Notification#CATEGORY_EVENT}) and alarms
+  ({@link android.app.Notification#CATEGORY_ALARM}).</li>
+  <li>New {@code android.graphics.drawable.Icon} class which can be attached to your notifications
+    via the {@code Notification.Builder.setSmallIcon(Icon)} and
+    {@code Notification.Builder.setLargeIcon(Icon)} methods.</li>
+  <li>New {@code NotificationManager.getActiveNotifications()} method that allows your apps to
+    find out which of their notifications are currently alive. To see an app implementation that
+    uses this feature, see the <a href="https://github.com/googlesamples/android-ActiveNotifications"
+    class="external-link">Active Notifications sample</a>.</li>
+</ul>
+
 <h2 id="bluetooth-stylus">Bluetooth Stylus Support</h2>
-<p>The M release provides improved support for user input using a Bluetooth stylus. If the user
-touches a stylus with a button on the screen of your app, the
-{@link android.view.MotionEvent#getToolType(int) getTooltype()} method now returns
-{@code TOOL_TYPE_STYLUS}. The {@link android.view.MotionEvent#getButtonState() getButtonState()}
-method returns {@link android.view.MotionEvent#BUTTON_SECONDARY} when the user
+<p>This preview provides improved support for user input using a Bluetooth stylus. Users can pair
+and connect a compatible Bluetooth stylus with their phone or tablet.  While connected, position
+information from the touch screen is fused with pressure and button information from the stylus to
+provide a greater range of expression than with the touch screen alone. Your app can listen for
+stylus button presses and perform secondary actions, by registering the new
+{@code View.onStylusButtonPressListener} and {@code GestureDetector.OnStylusButtonPressListener}
+callbacks in your activity.</p>
+
+<p>Use the {@link android.view.MotionEvent} methods and constants to detect stylus button
+interactions:</p>
+<ul>
+<li>If the user touches a stylus with a button on the screen of your app, the
+{@link android.view.MotionEvent#getToolType(int) getTooltype()} method returns
+{@link android.view.MotionEvent#TOOL_TYPE_STYLUS}.</li>
+<li>For apps targeting M Preview, the
+{@link android.view.MotionEvent#getButtonState() getButtonState()}
+method returns {@code MotionEvent.STYLUS_BUTTON_PRIMARY} when the user
 presses the primary stylus button. If the stylus has a second button, the same method returns
-{@link android.view.MotionEvent#BUTTON_TERTIARY} when the user presses it. If the user presses
-both buttons simultaneously, the method returns both these values. In addition, the system reports
-the user button-press action to the new {@code View.onStylusButtonPressListener} and
-{@code GestureDetector.OnStylusButtonPressListener} callbacks in your activity, if you have
-registered these listeners in your app.</p>
+{@code MotionEvent.STYLUS_BUTTON_SECONDARY} when the user presses it. If the user presses
+both buttons simultaneously, the method returns both values OR'ed together
+({@code STYLUS_BUTTON_PRIMARY|STYLUS_BUTTON_SECONDARY}).</li>
+<li>
+For apps targeting a lower platform version, the
+{@link android.view.MotionEvent#getButtonState() getButtonState()} method returns
+{@link android.view.MotionEvent#BUTTON_SECONDARY} (for primary stylus button press),
+{@link android.view.MotionEvent#BUTTON_TERTIARY} (for secondary stylus button press), or both.
+</li>
+</ul>
 
-<h2 id="audio">New Audio Features</h2>
+<h2 id="ble-scanning">Improved Bluetooth Low Energy Scanning</h2>
+<p>
+If your app performs performs Bluetooth Low Energy scans, you can use the new
+{@code android.bluetooth.le.ScanSettings.Builder.setCallbackType()} method to specify that
+you want callbacks to only be notified when an advertisement packet matching the set
+{@link android.bluetooth.le.ScanFilter} is first found, and when it is not seen for a period of
+time. This approach to scanning is more power-efficient than what’s provided in the previous
+platform version.
+</p>
 
-<p>This release adds enhancements to audio processing on Android, including: </p>
+<h2 id="hotspot">Hotspot 2.0 Release 1 Support</h2>
+<p>
+This preview adds support for the Hotspot 2.0 Release 1 spec on Nexus 6 and Nexus 9 devices. To
+provision Hotspot 2.0 credentials in your app, use the new methods of the
+{@link android.net.wifi.WifiEnterpriseConfig} class, such as {@code setPlmn()} and
+{@code setRealm()}. In the {@link android.net.wifi.WifiConfiguration} object, you can set the
+{@link android.net.wifi.WifiConfiguration#FQDN} and the {@code providerFriendlyName} fields.
+The new {@code ScanResult.PasspointNetwork} property indicates if a detected
+network represents a Hotspot 2.0 access point.
+</p>
+
+<h2 id="4K-display">4K Display Mode</h2>
+<p>The platform now allows apps to request that the display resolution be upgraded to 4K rendering
+on compatible hardware. To query the current physical resolution, use the new
+{@code android.view.Display.Mode} APIs. If the UI is drawn at a lower logical resolution and is
+upscaled to a larger physical resolution, be aware that the physical resolution the
+{@code Display.Mode.getPhysicalWidth()} method returns may differ from the logical
+resolution reported by {@link android.view.Display#getSize(android.graphics.Point) getSize()}.</p>
+
+<p>You can request the system to change the physical resolution in your app as it runs, by setting
+the {@code WindowManager.LayoutParams.preferredDisplayModeId} property of your app’s window.  This
+feature is useful if you want to switch to 4K display resolution. While in 4K display mode, the
+UI continues to be rendered at the original resolution (such as 1080p) and is upscaled to 4K, but
+{@link android.view.SurfaceView} objects may show content at the native resolution.</p>
+
+<p>To test the new 4K display mode, simulate a secondary display of a larger resolution using the
+<strong>Developer Options</strong> settings.</p>
+
+<h2 id="behavior-themeable-colorstatelists">Themeable ColorStateLists</h2>
+<p>Theme attributes are now supported in
+{@link android.content.res.ColorStateList} for devices running the M Preview. The
+{@link android.content.res.Resources#getColorStateList(int) getColorStateList()} and
+{@link android.content.res.Resources#getColor(int) getColor()} methods have been deprecated. If
+you are calling these APIs, call the new {@code Context.getColorStateList()} or
+{@code Context.getColor()} methods instead. These methods are also available in the
+v4 appcompat library via {@link android.support.v4.content.ContextCompat}.</p>
+
+<h2 id="audio">Audio Features</h2>
+
+<p>This preview adds enhancements to audio processing on Android, including: </p>
 <ul>
   <li>Support for the <a href="http://en.wikipedia.org/wiki/MIDI" class="external-link">MIDI</a>
 protocol, with the new {@code android.media.midi} APIs. Use these APIs to send and receive MIDI
@@ -293,8 +358,78 @@
 when an audio device is connected or disconnected.</li>
 </ul>
 
-<h2 id="afw">New Android for Work Features</h2>
-<p>This release includes the following new APIs for Android for Work:</p>
+<h2 id="video">Video Features</h2>
+<p>This preview adds new capabilities to the video processing APIs, including:</p>
+<ul>
+<li>New {@code android.media.MediaSync} class which helps applications to synchronously render
+audio and video streams. The audio buffers are submitted in non-blocking fashion and are
+returned via a callback. It also supports dynamic playback rate.
+</li>
+<li>New {@code MediaDrm.EVENT_SESSION_RECLAIMED} event, which indicates that a session opened by
+the app has been reclaimed by the resource manager. If your app uses DRM sessions, you should
+handle this event and make sure not to use a reclaimed session.
+</li>
+<li>New {@code MediaCodec.CodecException.ERROR_RECLAIMED} error code, which indicates that the
+resource manager reclaimed the media resource used by the codec. With this exception, the codec
+must be released, as it has moved to terminal state.
+</li>
+<li>New {@code MediaCodecInfo.CodecCapabilities.getMaxSupportedInstances()} interface to get a
+hint for the max number of the supported concurrent codec instances.
+</li>
+<li>New {@code MediaPlayer.setPlaybackParams()} method to set the media playback rate for fast or
+slow motion playback. It also stretches or speeds up the audio playback automatically in
+conjunction with the video.</li>
+</ul>
+
+<h2 id="camera">Camera Features</h2>
+<p>This preview includes the following new APIs for accessing the camera’s flashlight and for
+camera reprocessing of images:</p>
+
+<h3 id="flashlight">Flashlight API</h3>
+<p>If a camera device has a flash unit, you can call the {@code CameraManager.setTorchMode()}
+method to switch the flash unit’s torch mode on or off without opening the camera device. The app
+does not have exclusive ownership of the flash unit or the camera device. The torch mode is turned
+off and becomes unavailable whenever the camera device becomes unavailable, or when other camera
+resources keeping the torch on become unavailable. Other apps can also call {@code setTorchMode()}
+to turn off the torch mode. When the last app that turned on the torch mode is closed, the torch
+mode is turned off.</p>
+
+<p>You can register a callback to be notified about torch mode status by calling the
+{@code CameraManager.registerTorchCallback()} method. The first time the callback is registered,
+it is immediately called with the torch mode status of all currently known camera devices with a
+flash unit. If the torch mode is turned on or off successfully, the
+{@code CameraManager.TorchCallback.onTorchModeChanged()} method is invoked.</p>
+
+<h3 id="reprocessing">Reprocessing API</h3>
+<p>The {@link android.hardware.camera2 Camera2} API is extended to support YUV and private
+opaque format image reprocessing. Your app determine if the reprocessing capabilities are available
+via {@code CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES}. If a device supports reprocessing,
+you can create a reprocessable camera capture session by calling
+{@code CameraDevice.createReprocessableCaptureSession()}, and create requests for input
+buffer reprocessing.</p>
+
+<p>Use the {@code ImageWriter} class to connect the input buffer flow to the camera reprocessing
+input. To get an empty buffer, follow this programming model:</p>
+
+<ol>
+<li>Call the {@code ImageWriter.dequeueInputImage()} method.</li>
+<li>Fill the data into the input buffer.</li>
+<li>Send the buffer to the  camera by calling the {@code ImageWriter.queueInputImage()} method.</li>
+</ol>
+
+<p>If you are using a {@code ImageWriter} object together with an
+{@code android.graphics.ImageFormat.PRIVATE} image, your app cannot access the image
+data directly. Instead, pass the {@code ImageFormat.PRIVATE} image directly to the
+{@code ImageWriter} by calling the {@code ImageWriter.queueInputImage()} method without any
+buffer copy.</p>
+
+<p>The {@code ImageReader} class now supports {@code android.graphics.ImageFormat.PRIVATE} format
+image streams. This support allows your app to maintain a circular image queue of
+{@code ImageReader} output images, select one or more images, and send them to the
+{@code ImageWriter} for camera reprocessing.</p>
+
+<h2 id="afw">Android for Work Features</h2>
+<p>This preview includes the following new APIs for Android for Work:</p>
 <ul>
   <li><strong>Enhanced controls for Corporate-Owned, Single-Use devices:</strong> The Device Owner
 can now control the following settings to improve management of
@@ -325,13 +460,13 @@
 <li><strong>Auto-acceptance of system updates.</strong> By setting a system update policy with
 {@code DevicePolicyManager.setSystemUpdatePolicy()}, a Device Owner can now auto-accept a system
 update, for instance in the case of a kiosk device, or postpone the update and prevent it being
-taken by the user for up to 30 days. Furthermore, an administrator can set a time window in which an
-update must be taken, for example during the hours when a kiosk device is not in use. When a
-system update is available, the system checks if the Work Policy Controller app has set a system
+taken by the user for up to 30 days. Furthermore, an administrator can set a daily time window in
+which an update must be taken, for example during the hours when a kiosk device is not in use. When
+a system update is available, the system checks if the Work Policy Controller app has set a system
 update policy, and behaves accordingly.
 </li>
 <li>
-<strong>Delegated certificate installation.</strong> A Profile or Device Owner can now grant a
+<strong>Delegated certificate installation:</strong> A Profile or Device Owner can now grant a
 third-party app the ability to call these {@link android.app.admin.DevicePolicyManager} certificate
 management APIs:
 <ul>
@@ -349,21 +484,49 @@
 installKeyPair()}</li>
 </ul>
 </li>
-<li><strong>Enterprise factory reset protection.</strong> When provisioning a Device Owner, you can
-now configure parameters for bypassing Factory Reset Protection (FRP), by setting the
+<li><strong>Enterprise factory reset protection:</strong> When provisioning a Device Owner, you can
+now configure parameters to unlock Factory Reset Protection (FRP) by setting the
 {@code DeviceManagerPolicy.EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS} bundle. An NFC Programmer
-app can provide these parameters after a device has been reset to bypass FRP and provision the device,
+app can provide these parameters after a device has been reset to unlock FRP and provision the device,
 without requiring the previously configured Google account. If you don't modify these parameters,
 FRP remains in-place and prevents the device from being activated without the previously activated
-Google credentials.</li>
-<li><strong>Data usage tracking.</strong> A Profile or Device Owner can now query for the data
-usage statistics visible in <em>Settings > Data</em> usage by using the new
+Google credentials.
+<p>Additionally, by setting app restrictions on Google Play services, Device Owners can specify
+alternative Google accounts for unlocking FRP to replace the ones activated on the device.</p>
+</li>
+<li><strong>Data usage tracking.</strong> A Profile or Device Owner can now query for the
+data usage statistics visible in <strong>Settings > Data</strong> usage by using the new
 {@code android.app.usage.NetworkStatsManager} methods. Profile Owners are automatically granted
 permission to query data on the profile they manage, while Device Owners get access to usage data
 of the managed primary user.</li>
+<li><strong>Runtime permission management:</strong> With the new runtime permissions model, a
+Profile or Device Owner can now silently grant or revoke an app’s permissions by calling
+{@code DevicePolicyManager.setPermissionGranted()}. Granting or revoking a single permission applies
+that setting to all permissions within that runtime permission group; the user is not prompted
+at runtime when any permission from that runtime permission group is required. Furthermore, the
+user cannot modify the selection made by the Profile or Device Owner within the app’s permissions
+screen in <strong>Settings</strong>.
+<img src="{@docRoot}preview/images/work-profile-screen_2x.png"
+srcset="{@docRoot}preview/images/work-profile-screen.png 1x, preview/images/work-profile-screen_2x.png 2x"
+style="float:right; margin:0 0 10px 20px" width="282" height="476" />
+<p>A Profile or Device Owner can also set a permission policy
+for all runtime requests of all applications using
+{@code DevicePolicyManager.setPermissionPolicy()}, to either prompt the user to grant the
+permission as normal or automatically grant or deny the permission silently. If the latter policy
+is set, the user cannot modify the selection made by the Profile or Device Owner within the
+app’s permissions screen in <strong>Settings</strong>.</p></li>
+<li><strong>VPN in Settings:</strong> VPN apps are now visible in
+    <strong>Settings > More > VPN</strong>.
+Additionally, the notifications that accompany VPN usage are now specific to whether that VPN is
+configured for a managed profile or the entire device.</li>
+<li><strong>Work status notification:</strong> A status bar briefcase icon now appears whenever
+an app from the managed profile has an activity in the foreground. Furthermore, if the device is
+unlocked directly to the activity of an app in the managed profile, a toast is displayed notifying
+the user that they are within the work profile.
+</li>
 </ul>
 
 <p class="note">
   For a detailed view of all API changes in the M Developer Preview, see the <a href=
-  "{@docRoot}preview/reference.html">API Differences Report</a>.
+  "{@docRoot}preview/download.html">API Differences Report</a>.
 </p>
\ No newline at end of file
diff --git a/docs/html/preview/backup/index.jd b/docs/html/preview/backup/index.jd
index 8610b82..c7d85ae 100644
--- a/docs/html/preview/backup/index.jd
+++ b/docs/html/preview/backup/index.jd
@@ -1,5 +1,6 @@
 page.title=Auto Backup for Apps
-page.tags=backup
+page.tags=backup, previewresources, androidm
+page.keywords=backup, autobackup, preview
 
 @jd:body
 
@@ -26,8 +27,8 @@
 
 <p>
   Automatic backups are enabled for all apps installed on devices running the Android M Preview. No
-  additional app code is required. The system provides users with the ability opt out of automatic
-  data backups. You can also choose to limit what data from your app is backed up.
+  additional app code is required. The system provides users with the ability to opt out of
+  automatic data backups. You can also choose to limit what data from your app is backed up.
 </p>
 
 <p>
@@ -105,8 +106,8 @@
 &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:tools="http://schemas.android.com/tools"
         package="com.my.appexample"&gt;
-    &lt;uses-sdk android:minSdkVersion="9"/&gt;
-    &lt;uses-sdk android:targetSdkVersion="android-MNC"/&gt;
+    &lt;uses-sdk android:minSdkVersion="MNC"/&gt;
+    &lt;uses-sdk android:targetSdkVersion="MNC"/&gt;
     &lt;app ...
 <strong>        android:fullBackupContent="&#64;xml/mybackupscheme"&gt;</strong>
     &lt;/app&gt;
@@ -223,8 +224,8 @@
 &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:tools="http://schemas.android.com/tools"
         package="com.my.appexample"&gt;
-    &lt;uses-sdk android:minSdkVersion="9"/&gt;
-    &lt;uses-sdk android:targetSdkVersion="android-MNC"/&gt;
+    &lt;uses-sdk android:minSdkVersion="MNC"/&gt;
+    &lt;uses-sdk android:targetSdkVersion="MNC"/&gt;
     &lt;app ...
 <strong>        android:allowBackup="false"&gt;</strong>
     &lt;/app&gt;
diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd
new file mode 100644
index 0000000..0dd549b
--- /dev/null
+++ b/docs/html/preview/behavior-changes.jd
@@ -0,0 +1,407 @@
+page.title=Behavior Changes
+page.keywords=preview,sdk,compatibility
+sdk.platform.apiLevel=23
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+
+<ol id="toc44" class="hide-nested">
+    <li><a href="#behavior-runtime-permissions">Runtime Permissions</a></li>
+    <li><a href="#behavior-project-volta">Project Volta</a>
+        <ol>
+            <li><a href="#behavior-doze">Doze mode</a></li>
+            <li><a href="#behavior-app-standby">App Standby</a></li>
+        </ol>
+    </li>
+    <li><a href="#behavior-adoptable-storage">Adoptable Storage Devices</a></li>
+    <li><a href="#behavior-apache-http-client">Apache HTTP Client Removal</a></li>
+    <li><a href="#behavior-audiomanager-Changes">AudioManager Changes</a></li>
+    <li><a href="#behavior-test-selection">Text Selection</a></li>
+    <li><a href="#behavior-keystore">Android Keystore Changes</a></li>
+    <li><a href="#night-mode">Night Mode</a></li>
+    <li><a href="#behavior-network">Wi-Fi and Networking Changes</a></li>
+    <li><a href="#behavior-camera">Camera Service Changes</a></li>
+    <li><a href="#behavior-art-runtime">ART Runtime</a></li>
+    <li><a href="#behavior-apk-validation">APK Validation</a></li>
+    <li><a href="#behavior-afw">Android for Work Changes</a></li>
+</ol>
+
+<h2>API Differences</h2>
+<ol>
+<li><a href="{@docRoot}preview/download.html">API level 22 to M Preview &raquo;</a> </li>
+</ol>
+
+
+<h2>See Also</h2>
+<ol>
+<li><a href="{@docRoot}preview/api-overview.html">M Developer Preview API Overview</a> </li>
+</ol>
+
+</div>
+</div>
+
+<p>API Level: M</p>
+<p>Along with new features and capabilities, the M Developer Preview includes a variety of
+system changes and API behavior changes. This document highlights
+some of the key changes that you should be understand and account for in your apps.</p>
+
+<p>If you have previously published an app for Android, be aware that your app
+  might be affected by these changes in the platform.</p>
+
+<h2 id="behavior-runtime-permissions">Runtime Permissions</h1>
+<p>This preview introduces a new runtime permissions model, where users can now directly manage
+their app permissions at runtime. This model gives users improved visibility and control over
+permissions, while streamlining the installation and auto-update processes for app developers.
+Users can set permissions on or off for all apps running on the M Preview. However, apps that
+don’t target the M Preview cannot request permissions at runtime.</p>
+
+<p>On your apps that target the M Preview, make sure to check and request for permissions at
+runtime. To determine if your app has been granted a permission, call the
+new {@code Context.checkSelfPermission()} method. To request for a permission, call the new
+{@code Activity.requestPermission()} method.</p>
+
+<p>For more information on supporting the new permissions model in your app, see
+<a href="{@docRoot}preview/features/runtime-permissions.html">
+Android M Preview Runtime Permissions</a>.</p>
+
+<h2 id="behavior-project-volta">Project Volta</h2>
+<p>This preview introduces new power-saving optimizations for idle devices and apps.</p>
+
+<h3 id="behavior-doze">Doze mode</h3>
+<p>If a device is unplugged and left stationary with the screen off for a period of time, it
+goes into <em>Doze</em> mode where it attempts to keep the system in a sleep state. In this mode,
+devices periodically resume normal operations for brief periods of time so that app syncing can
+occur and the system can perform any pending operations.</p>
+
+<p>The following restrictions apply to your apps while in Doze mode:</p>
+<ul>
+<li>Network access is disabled, unless your app receives a high priority Google Cloud Messaging
+tickle.</li>
+<li><a href="{@docRoot}reference/android/os/PowerManager.WakeLock.html">Wake locks</a> are ignored.</li>
+<li>Alarms scheduled with the {@link android.app.AlarmManager} class are disabled, except for
+alarms that you've set with the {@link android.app.AlarmManager#setAlarmClock setAlarmClock()}
+method and {@code AlarmManager.setAndAllowWhileIdle()}.</li>
+<li>WiFi scans are not performed.</li>
+<li>Syncs and jobs for your sync adapters and {@link android.app.job.JobScheduler} are not
+permitted to run.</li>
+</ul>
+</p>
+<p>When the device exists doze mode, it executes any jobs and syncs that are pending.</p>
+<p>You can test this feature by connecting a device running the M Preview to your development
+machine and calling the following commands:
+</p>
+<pre class="no-prettyprint">
+$ adb shell dumpsys battery unplug
+$ adb shell dumpsys deviceidle step
+$ adb shell dumpsys deviceidle -h
+</pre>
+<p class="note"><strong>Note</strong>: The upcmoning
+<a href="{@docRoot}google/gcm/index.html">Google Cloud Messaging</a> release lets you designate
+high-priority messages. If your app receives high-priority GCM messages, it’s granted
+brief network access even when the device is in doze mode.
+</p>
+
+<h3 id="behavior-app-standby">App standby</h3>
+<p>With this preview, the system may determine that apps are idle when they are not in active
+use. Your app is considered idle after a period of time, unless the system detects
+any of these signals:</p>
+
+<ul>
+<li>The app has a process currently in the foreground (either as an activity or foreground service,
+or in use by another activity or foreground service).</li>
+<li>The app generates a notification that users see on the lock screen or in the
+notification tray.</li>
+<li>The user explicitly asks for the app to be exempt from optimizations,
+via <strong>Settings</strong>.</li>
+</ul>
+
+<p>If the device is unplugged, apps deemed idle will have their network access disabled
+and their syncs and jobs suspended. When the device is plugged into a power supply, these apps are
+allowed network access and can execute any jobs and syncs that are pending. If the
+device is idle for long periods of time, idle apps are allowed network access around once a day.</p>
+
+<p>You can test this feature by connecting a device running the M Preview to your development
+machine and calling the following commands:
+</p>
+<pre class="no-prettyprint">
+$ adb shell am broadcast -a android.os.action.DISCHARGING
+$ adb shell am set-idle &lt;packageName&gt; true
+$ adb shell am set-idle &lt;packageName&gt; false
+$ adb shell am get-idle &lt;packageName&gt;
+</pre>
+
+<p class="note"><strong>Note</strong>: The upcoming
+<a href="{@docRoot}google/gcm/index.html">Google Cloud Messaging</a> (GCM) release lets you
+designate high-priority messages. If your app receives high-priority GCM messages, it’s granted
+brief network access even when the app is idle.
+</p>
+
+<h2 id="behavior-adoptable-storage">Adoptable Storage Devices</h2>
+<p>
+With this preview, users can <em>adopt</em> external storage devices such as SD cards. Adopting an
+external storage device encrypts and formats the device to behave like internal storage. This
+feature allows users to move both apps and private data of those apps between storage devices. When
+moving apps, the system respects the
+<a href="{@docRoot}guide/topics/manifest/manifest-element.html#install">{@code android:installLocation}</a>
+preference in the manifest.</p>
+
+<p>If your app accesses the following APIs or fields, be aware that the file paths they return
+will dynamically change when the app is moved between internal and external storage devices.
+When building file paths, it is strongly recommended that you always call these APIs dynamically.
+Don’t use hardcoded file paths or persist fully-qualified file paths that were built previously.</p>
+
+<ul>
+<li>{@link android.content.Context} methods:
+    <ul>
+        <li>{@link android.content.Context#getFilesDir() getFilesDir()}</li>
+        <li>{@link android.content.Context#getCacheDir() getCacheDir()}</li>
+        <li>{@link android.content.Context#getCodeCacheDir() getCodeCacheDir()}</li>
+        <li>{@link android.content.Context#getDatabasePath(java.lang.String) getDatabasePath()}</li>
+        <li>{@link android.content.Context#getDir(java.lang.String,int) getDir()}</li>
+        <li>{@link android.content.Context#getNoBackupFilesDir() getNoBackupFilesDir()}</li>
+        <li>{@link android.content.Context#getFileStreamPath(java.lang.String) getFileStreamPath()}</li>
+        <li>{@link android.content.Context#getPackageCodePath() getPackageCodePath()}</li>
+        <li>{@link android.content.Context#getPackageResourcePath() getPackageResourcePath()}</li>
+    </ul>
+</li>
+<li>{@link android.content.pm.ApplicationInfo} fields:
+    <ul>
+        <li>{@link android.content.pm.ApplicationInfo#dataDir dataDir}</li>
+        <li>{@link android.content.pm.ApplicationInfo#sourceDir sourceDir}</li>
+        <li>{@link android.content.pm.ApplicationInfo#nativeLibraryDir nativeLibraryDir}</li>
+        <li>{@link android.content.pm.ApplicationInfo#publicSourceDir publicSourceDir}</li>
+        <li>{@link android.content.pm.ApplicationInfo#splitSourceDirs splitSourceDirs}</li>
+        <li>{@link android.content.pm.ApplicationInfo#splitPublicSourceDirs splitPublicSourceDirs}</li>
+    </ul>
+</li>
+</ul>
+
+<p>To debug this feature in the developer preview, you can enable adoption of a USB drive that is
+connected to an Android device through a USB On-The-Go (OTG) cable, by running this command:</p>
+
+<pre class="no-prettyprint">
+$ adb shell sm set-force-adoptable true
+</pre>
+
+<h2 id="behavior-apache-http-client">Apache HTTP Client Removal</h2>
+<p>This preview removes support for the Apache HTTP client. If your app is using this client and
+targets Android 2.3 (API level 9) or higher, use the {@link java.net.HttpURLConnection} class
+instead. This API is more efficient because it reduces network use through transparent compression
+and response caching, and minimizes power consumption. To continue using the Apache HTTP APIs, you
+must first declare the following compile-time dependency in your {@code build.gradle} file:
+</p>
+<pre>
+android {
+    useLibrary 'org.apache.http.legacy'
+}
+</pre>
+<p>Android is moving away from OpenSSL to the
+<a href="https://boringssl.googlesource.com/boringssl/" class="external-link">BoringSSL</a>
+library. If you’re using the Android NDK in your app, don't link against cryptographic libraries
+that are not a part of the NDK API, such as {@code libcrypto.so} and {@code libssl.so}. These
+libraries are not public APIs, and may change or break without notice across releases and devices.
+In addition, you may expose yourself to security vulnerabilities. Instead, modify your
+native code to call the Java cryptography APIs via JNI or to statically link against a
+cryptography library of your choice.</p>
+
+<h2 id="behavior-audiomanager-Changes">AudioManager Changes</h2>
+<p>Setting the volume directly or muting specific streams via the {@link android.media.AudioManager}
+class is no longer supported. The {@link android.media.AudioManager#setStreamSolo(int,boolean)
+setStreamSolo()} method is deprecated, and you should call the
+{@code AudioManager.requestAudioFocus()} method instead. Similarly, the
+{@link android.media.AudioManager#setStreamMute(int,boolean) setStreamMute()} method is
+deprecated; instead, call the {@code AudioManager.adjustStreamVolume()} method
+and pass in the direction value {@code ADJUST_MUTE} or {@code ADJUST_UNMUTE}.</p>
+
+<h2 id="behavior-test-selection">Text Selection</h2>
+
+<img src="{@docRoot}preview/images/text-selection.gif"
+style="float:right; margin:0 0 20px 30px" width="360" height="640" />
+
+<p>When users select text in your app, you can now display text selection actions such as
+<em>Cut</em>, <em>Copy</em>, and <em>Paste</em> in a
+<a href="http://www.google.com/design/spec/patterns/selection.html#selection-text-selection"
+class="external-link">floating toolbar</a>. The user interaction implementation is similar to that
+for the contextual action bar, as described in
+<a href="{@docRoot}guide/topics/ui/menus.html#CABforViews">
+Enabling the contextual action mode for individual views</a>.</p>
+
+<p>To implement a floating toolbar for text selection, make the following changes in your existing
+apps:</p>
+<ol>
+<li>In your {@link android.view.View} or {@link android.app.Activity} object, change your
+{@link android.view.ActionMode} calls from
+{@code startActionMode(Callback)} to {@code startActionMode(Callback, ActionMode.TYPE_FLOATING)}.</li>
+<li>Take your existing implementation of {@code ActionMode.Callback} and make it extend
+{@code ActionMode.Callback2} instead.</li>
+<li>Override the {@code Callback2.onGetContentRect()} method to provide the coordinates of the
+content {@link android.graphics.Rect} object (such as a text selection rectangle) in the view.</li>
+<li>If the rectangle positioning is no longer valid, and this is the only element to be invalidated,
+call the {@code ActionMode.invalidateContentRect()} method.</li>
+</ol>
+
+<p>If you are using <a href="{@docRoot}tools/support-library/index.html">
+Android Support Library</a> revision 22.2, be aware that floating toolbars are not
+backward-compatible and appcompat takes control over {@link android.view.ActionMode} objects by
+default. This prevents floating toolbars from being displayed. To enable
+{@link android.view.ActionMode} support in an
+{@link android.support.v7.app.AppCompatActivity}, call
+{@code android.support.v7.app.AppCompatActivity.getDelegate()}, then call
+{@code android.support.v7.app.AppCompatDelegate.setHandleNativeActionModesEnabled()} on the returned
+{@link android.support.v7.app.AppCompatDelegate} object and set the input
+parameter to {@code false}. This call returns control of {@link android.view.ActionMode} objects to
+the framework. In devices running the M Preview, that allows the framework to support
+{@link android.support.v7.app.ActionBar} or floating toolbar modes, while on pre-M Preview devices,
+only the {@link android.support.v7.app.ActionBar} modes are supported.</p>
+
+<h2 id="behavior-keystore">Android Keystore Changes</h2>
+<p>With this preview, the
+<a href="{@docRoot}training/articles/keystore.html">Android Keystore provider</a> no longer supports
+DSA. ECDSA is still supported.</p>
+
+<p>Keys which do not require encryption at rest will no longer be deleted when secure lock screen
+is disabled or reset (for example, by the user or a Device Administrator). Keys which require
+encryption at rest will be deleted during these events.</p>
+
+<h2 id="night-mode">Night Mode (User-configurable Dark Theme)</h2>
+<p>
+Support for the {@code -night} resource qualifier has been updated. Previously, night mode was
+only available when a device was docked and in car mode. With this preview, night mode is
+available on
+all devices and is user-configurable via <strong>Settings > Display > Theme</strong>. You can adjust
+this setting globally using {@link android.app.UiModeManager#setNightMode(int) setNightMode()}. The
+Dark theme corresponds to {@link android.app.UiModeManager#MODE_NIGHT_YES}. When the device is in
+night mode, the resource framework prefers resources that have the {@code -night} qualifier. To
+take advantage of user-configurable Dark mode in your app, extend from the
+{@code Theme.Material.DayNight} set of themes rather than {@code Theme.Material} or
+{@code Theme.Material.Light}.
+</p>
+
+<h2 id="behavior-network">Wi-Fi and Networking Changes</h2>
+
+<p>This preview introduces the following behavior changes to the Wi-Fi and networking APIs.</p>
+<ul>
+<li>Your apps can now change the state of {@link android.net.wifi.WifiConfiguration} objects only
+if you created these objects. You are not permitted to modify or delete
+{@link android.net.wifi.WifiConfiguration} objects created by the user or by other apps.
+</li>
+<li>
+Previously, if an app forced the device to connect to a specific Wi-Fi network by using
+{@link android.net.wifi.WifiManager#enableNetwork(int,boolean) enableNetwork()} with the
+{@code disableAllOthers=true} setting, the device disconnected from other networks such as
+cellular data. In this preview, the device no longer disconnects from such other networks. If
+your app’s {@code targetSdkVersion} is {@code “20”} or lower, it is pinned to the selected
+Wi-Fi network. If your app’s {@code targetSdkVersion} is {@code “21”} or higher, use the
+multinetwork APIs (such as
+{@link android.net.Network#openConnection(java.net.URL) openConnection()},
+{@link android.net.Network#bindSocket(java.net.Socket) bindSocket()}, and the new
+{@code ConnectivityManager.bindProcessToNetwork()} method) to ensure that its network traffic is
+sent on the selected network.</li>
+</ul>
+
+<h2 id="behavior-camera">Camera Service Changes</h2>
+<p>In this preview, the model for accessing shared resources in the camera service has been changed
+from the previous “first come, first serve” access model to an access model where high-priority
+processes are favored.  Changes to the service behavior include:</p>
+<ul>
+<li>Access to camera subsystem resources, including opening and configuring a camera device, is
+awarded based on the “priority” of the client application process. Application processes with
+user-visible or foreground activities are generally given a higher-priority, making camera resource
+acquisition and use more dependable.</li>
+<li>Active camera clients for lower priority apps may be “evicted” when a higher priority
+application attempts to use the camera.  In the deprecated {@link android.hardware.Camera} API,
+this results in
+{@link android.hardware.Camera.ErrorCallback#onError(int,android.hardware.Camera) onError()} being
+called for the evicted client. In the {@link android.hardware.camera2 Camera2} API, it results in
+{@link android.hardware.camera2.CameraDevice.StateCallback#onDisconnected(android.hardware.camera2.CameraDevice) onDisconnected()}
+being called for the evicted client.</li>
+<li>On devices with appropriate camera hardware, separate application processes are able to
+independently open and use separate camera devices simultaneously. However, multi-process use
+cases, where simultaneous access causes significant degradation of performance or capabilities of
+any of the open camera devices, are now detected and disallowed by the camera service. This change
+may result in “evictions” for lower priority clients even when no other app is directly
+attempting to access the same camera device.
+</li>
+<li>
+Changing the current user causes active camera clients in apps owned by the previous user account
+to be evicted.  Access to the camera is limited to user profiles owned by the current device user.
+In practice, this means that a “Guest” account, for example, will not be able to leave running
+processes that use the camera subsystem when the user has switched to a different account.
+</li>
+</ul>
+
+<h2 id="behavior-art-runtime">ART Runtime</h2>
+<p>The ART runtime now properly implements access rules for the
+{@link java.lang.reflect.Constructor#newInstance(java.lang.Object...) newInstance()} method. This
+change fixes a problem where Dalvik was checking access rules incorrectly in previous versions.
+If your app uses the
+{@link java.lang.reflect.Constructor#newInstance(java.lang.Object...) newInstance()} method and you
+want to override access checks, call the
+{@link java.lang.reflect.Constructor#setAccessible(boolean) setAccessible()} method with the input
+parameter set to {@code true}. If your app uses the
+<a href="{@docRoot}tools/support-library/features.html#v7-appcompat">v7 appcompat library</a> or the
+<a href="{@docRoot}tools/support-library/features.html#v7-recyclerview">v7 recyclerview library</a>,
+you must update your app to use to the latest versions of these libraries. Otherwise, make sure that
+any custom classes referenced from XML are updated so that their class constructors are accessible.</p>
+
+<p>This preview updates the behavior of the dynamic linker. The dynamic linker now understands the
+difference between a library’s {@code soname} and its path
+(<a href="https://code.google.com/p/android/issues/detail?id=6670" class="external-link">
+public bug 6670</a>), and search by {@code soname} is now
+implemented. Apps which previously worked that have bad {@code DT_NEEDED} entries
+(usually absolute paths on the build machine’s file system) may fail when loaded.</p>
+
+<p>The {@code dlopen(3) RTLD_LOCAL} flag is now correctly implemented. Note that
+{@code RTLD_LOCAL} is the default, so calls to {@code dlopen(3)} that didn’t explicitly use
+{@code RTLD_LOCAL} will be affected (unless your app explicitly used {@code RTLD_GLOBAL}). With
+{@code RTLD_LOCAL}, symbols will not be made available to libraries loaded by later calls to
+{@code dlopen(3)} (as opposed to being referenced by {@code DT_NEEDED} entries).</p>
+</p>
+
+<h2 id="behavior-apk-validation">APK Validation</h2>
+<p>The platform now performs stricter validation of APKs. An APK is considered corrupt if a file is
+declared in the manifest but not present in the APK itself. An APK must be re-signed if any of the
+contents are removed.</p>
+
+<h2 id="behavior-afw">Android for Work Changes</h2>
+<p>This preview includes the following behavior changes for Android for Work:</p>
+<ul>
+<li><strong>Work contacts in personal contexts.</strong> The Google Dialer
+Call Log now displays work contacts when the user views past calls. Both
+work and personal contacts are now available to devices over Bluetooth, but you can hide work
+profile contacts through a device policy by calling the new
+{@code DevicePolicyManager.setBluetoothContactSharingDisabled()} method. Initiating a call still
+shows personal contacts, as consistent with the experience in Android 5.0.
+</li>
+<li><strong>WiFi configuration removal:</strong> WiFi configurations added by a Profile Owner
+(for example, through calls to the
+{@link android.net.wifi.WifiManager#addNetwork(android.net.wifi.WifiConfiguration)
+addNetwork()} method) are now removed if that work profile is deleted.</li>
+<li><strong>WiFi configuration lockdown:</strong> Any WiFi configuration created by an active Device
+Owner can no longer be modified or deleted by the user. The user can still create and
+modify their own WiFi configurations, so long as the {@link android.os.UserManager} constant
+{@link android.os.UserManager#DISALLOW_CONFIG_WIFI} has not been set for that user.</li>
+<li><strong>Download Work Policy Controller via Google account addition:</strong> When a Google
+account that requires management via a Work Policy Controller (WPC) app is added to a device
+outside of a managed context, the add account flow now prompts the user to install the
+appropriate WPC. This behavior also applies to accounts added via
+<strong>Settings > Accounts</strong> in the initial device setup wizard.</li>
+<li><strong>Changes to specific DevicePolicyManager API behaviors:</strong>
+Calling the {@link android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName,boolean) setCameraDisabled()}
+method affects the camera for the calling user only; calling it from the managed profile doesn’t
+affect camera apps running on the primary user. In addition, the
+{@link android.app.admin.DevicePolicyManager#setKeyguardDisabledFeatures(android.content.ComponentName,int) setKeyguardDisabledFeatures()}
+method is now available for Profile Owners, in addition to Device Owners. A Profile Owner can set
+these keyguard restrictions:
+<ul>
+<li>{@link android.app.admin.DevicePolicyManager#KEYGUARD_DISABLE_TRUST_AGENTS} and
+    {@link android.app.admin.DevicePolicyManager#KEYGUARD_DISABLE_FINGERPRINT}, which affect the
+    keyguard settings for the profile’s parent user.</li>
+<li>{@link android.app.admin.DevicePolicyManager#KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS}, which
+    only affects notifications generated by applications in the managed profile.</li>
+</ul>
+</li>
+</ul>
diff --git a/docs/html/preview/download.jd b/docs/html/preview/download.jd
index 4341f8d..8a67a9a 100644
--- a/docs/html/preview/download.jd
+++ b/docs/html/preview/download.jd
@@ -1,4 +1,4 @@
-page.title=Download
+page.title=Downloads
 page.image=images/cards/card-download_16-9_2x.png
 
 @jd:body
diff --git a/docs/html/preview/features/app-linking.jd b/docs/html/preview/features/app-linking.jd
new file mode 100644
index 0000000..a677b1c
--- /dev/null
+++ b/docs/html/preview/features/app-linking.jd
@@ -0,0 +1,123 @@
+page.title=App Links
+
+@jd:body
+
+
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+      <ol>
+        <li><a href="#web-assoc">Declare a Website Association</a></li>
+        <li><a href="#verfy-links">Request App Link Verification</a></li>
+        <li><a href="#user-manage">Managing App Link Settings</a></li>
+      </ol>
+  </div>
+</div>
+
+<p>
+  The Android Intent system is a flexible mechanism to enable apps to handle content and requests.
+  Multiple apps may declare matching URI patterns in their intent filters. When a user clicks on a
+  web link that does not have default launch handler, the platform may show a dialog for the user
+  to select from a list of apps that have declared matching intent filters.
+</p>
+
+<p>
+  The Android M Developer Preview introduces support for App Links, which improves upon existing
+  link handling by allowing app developers to associate an app with a web domain they own. When
+  developers create this association, the platform can automatically determine the default app used
+  to handle a particular web link and skip asking users.
+</p>
+
+
+<h2 id="web-assoc">Declare a Website Association</h2>
+
+<p>
+  Website owners must declare associations with apps to establish an app link. The site owner
+  declares the relationship to an app by hosting a JSON file, named {@code statements.json}, at the
+  well-known location on the domain:
+</p>
+
+<pre>http://&lt;domain&gt;:&lt;optional port&gt;/.well-known/statements.json</pre>
+
+<p class="note">
+  <strong>Note:</strong>
+  During the M Developer Preview period, the JSON file is verified via http protocol. For
+  the official release of the platform, the file is verified over encrypted, https protocol.
+</p>
+
+<p>
+  This JSON file indicates the Android app that should be used as the default handler for the URLs
+  under this domain. It identifies the app based on these fields:
+</p>
+
+<ul>
+  <li>{@code package_name}: The package name declared in the app's manifest.</li>
+
+  <li>{@code sha256_cert_fingerprints}: The SHA256 fingerprint of your app’s signing certificate.
+    You can use the Java keytool to generate the fingerprint using the following command:
+    <pre>keytool -list -v -keystore my-release-key.keystore</pre>
+  </li>
+</ul>
+
+<p>
+  The following file listing shows an example of the contents and format of a
+  {@code statements.json} file:
+</p>
+
+<pre>
+[{
+  "relation": ["delegate_permission/common.handle_all_urls"],
+  "target": {
+    "namespace": "android_app",
+    "package_name": "<strong>&lt;package name&gt;</strong>",
+    "sha256_cert_fingerprints": ["<strong>6C:EC:C5:0E:34:AE....EB:0C:9B</strong>"]
+  }
+}]
+</pre>
+
+
+<h2 id="verfy-links">Request App Link Verification</h2>
+
+<p>
+  An app can request that the platform automatically verify any app links defined by the host names
+  in the data elements of its intent filters against the {@code statements.json} files hosted on
+  the respective web domains. To request app link verification, add an {@code android:autoVerify}
+  attribute to each desired intent filter in the manifest, as shown in the following manifest code
+  snippet:
+</p>
+
+<pre>
+&lt;activity ...&gt;
+    &lt;intent-filter <strong>android:autoVerify="true"</strong>&gt;
+        &lt;action android:name="android.intent.action.VIEW" /&gt;
+        &lt;category android:name="android.intent.category.DEFAULT" /&gt;
+        &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
+        &lt;data android:scheme="http" android:host="www.android.com" /&gt;
+        &lt;data android:scheme="https" android:host="www.android.com" /&gt;
+    &lt;/intent-filter&gt;
+&lt;/activity&gt;
+</pre>
+
+<p>
+  When the (@code android:autoVerify} attribute is present in an app manifest, the platform
+  attempts to verify app links when the app is installed. If the platform cannot successfully
+  verify the app links, the app is not set as the preferred app to handle the web links. The next
+  time a user opens one of the links, the platform falls back to presenting the user with a
+  dialog.
+</p>
+
+<p class="note">
+  <strong>Note:</strong> In testing, there is a potential for a false positive if verfication
+  fails, but the user has explicitly enabled the app to open supported links without asking, using
+  the system Settings app. In this case, no dialog is shown and the link goes directly to your
+  app, but only because of the user setting, and not because verification succeeded.
+</p>
+
+
+<h2 id="user-manage">Managing App Link Settings</h2>
+
+<p>
+  Users can change app link settings so URLs are handled the way they prefer. You can review and
+  manage app links in the system Settings app, under <strong>Settings &gt; Apps &gt; App Info &gt;
+  Open by default</strong>.
+</p>
diff --git a/docs/html/preview/features/images/app-permissions-screen.png b/docs/html/preview/features/images/app-permissions-screen.png
new file mode 100644
index 0000000..679b7ad
--- /dev/null
+++ b/docs/html/preview/features/images/app-permissions-screen.png
Binary files differ
diff --git a/docs/html/preview/features/images/app-permissions-screen@2x.png b/docs/html/preview/features/images/app-permissions-screen@2x.png
new file mode 100644
index 0000000..e3eb13f
--- /dev/null
+++ b/docs/html/preview/features/images/app-permissions-screen@2x.png
Binary files differ
diff --git a/docs/html/preview/features/runtime-permissions.jd b/docs/html/preview/features/runtime-permissions.jd
index 4a01010..2ee44ef 100644
--- a/docs/html/preview/features/runtime-permissions.jd
+++ b/docs/html/preview/features/runtime-permissions.jd
@@ -1,15 +1,53 @@
-page.title=Android M Preview Runtime Permissions
-
+page.title=Runtime Permissions
+page.tags=previewresources, androidm
+page.keywords=permissions, runtime, preview
 @jd:body
 
 
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>Quickview</h2>
+    <ul>
+      <li>If your app targets the M Preview SDK, it prompts users to grant
+        permissions at runtime, instead of install time.</li>
+      <li>Users can revoke permissions at any time from the app Settings
+        screen.</li>
+      <li>Your app needs to check that it has the permissions it needs every
+        time it runs.</li>
+    </ul>
+
+    <h2>In this document</h2>
+    <ol>
+      <li><a href="#overview">Overview</a></li>
+      <li><a href="#coding">Coding for Runtime Permissions</a></li>
+      <li><a href="#testing">Testing Runtime Permissions</a></li>
+      <li><a href="#best-practices">Best Practices</a></li>
+    </ol>
+
+<!--
+  <h2>Related Samples</h2>
+  <ol>
+    <li></li>
+  </ol>
+-->
+
+<!--
+  <h2>See also</h2>
+  <ol>
+    <li></li>
+  </ol>
+-->
+  </div> <!-- qv -->
+</div> <!-- qv-wrapper -->
+
+
 <p>
-  The M Developer Preview introduces a new app permissions model which makes it
-  less frustrating for users to install and upgrade apps. If an app running on
-  M supports the new permissions model, the user does not have to grant any
-  permissions when they install or upgrade the app. Instead, the app requests
-  permissions as they are needed, and the system shows a dialog to the user
-  asking for the permission.
+  The M Developer Preview introduces a new app permissions model which
+  streamlines the process for users to install and upgrade apps. If an app
+  running on the M Preview supports the new permissions model, the user does not have to
+  grant any permissions when they install or upgrade the app. Instead, the app
+  requests permissions as it needs them, and the system shows a dialog to the
+  user asking for the permission.
 </p>
 
 <p>
@@ -18,70 +56,122 @@
   model on those devices.
 </p>
 
-<h2>
+<h2 id="overview">
   Overview
 </h2>
 
 <p>
-  If an app's target SDK version is the M developer preview, that indicates
-  that the app uses the new permissions model:
+  With the M Developer Preview, the platform introduces a new app permissions
+  model. Here's a summary of the key components of this new model:
 </p>
 
 <ul>
-  <li>Permissions are divided into <em>permission groups</em>, based on their
-  functionality. For example, all permissions relating to the camera and photo
-  roll are grouped in the Camera permission group,
-  [link]android.permission-group.CAMERA[/link].
+  <li>
+    <strong>Declaring Permissions:</strong> The app declares all the
+    permissions it needs in the manifest, as in earlier Android platforms.
   </li>
 
-  <li>The app declares all the permissions it needs in the manifest, as in
-  earlier Android platforms.
+  <li>
+    <strong>Permission Groups:</strong> Permissions are divided into
+    <em>permission groups</em>, based on their functionality. For example, the
+    <code>CONTACTS</code> permission group contains permissions to read and
+    write the user's contacts and profile information.
   </li>
 
-  <li>When the user installs or updates the app, the app is granted just those
-  permissions it requests that fall under <a href=
-  "https://android-preview.googleplex.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_NORMAL">
-    <code>PROTECTION_NORMAL</code></a>, as well as signature and system permissions, as
-    described below. The user is <em>not</em> prompted to grant any permissions
-    at this time.
+  <li>
+    <p><strong>Limited Permissions Granted at Install Time:</strong> When the
+    user installs or updates the app, the system grants the app all
+    permissions that the app requests that fall under {@link
+    android.content.pm.PermissionInfo#PROTECTION_NORMAL PROTECTION_NORMAL}.
+    For example, alarm clock and internet permissions fall under {@link
+    android.content.pm.PermissionInfo#PROTECTION_NORMAL PROTECTION_NORMAL}, so
+    they are automatically granted at install time.
+    </p>
+
+    <p>The system may also grant the app signature and system permissions, as
+    described in <a href="#system-apps">System apps and signature
+    permissions</a>. The user is <em>not</em> prompted to grant any permissions
+    at install time.</p>
   </li>
 
-  <li>When the app needs to perform any action that requires a permission, it
-  first checks whether it has that permission already. If it does not, it
-  requests to be granted that permission.
+  <li>
+    <strong>User Grants Permissions at Run-Time:</strong> When the app requests
+    a permission, the system shows a dialog to the user, then calls the app's
+    callback function to notify it whether the permission was granted. If a
+    user grants a permission, the app is given all permissions in that
+    permission's functional area that were declared in the app manifest.
   </li>
 
-  <li>When the app requests a permission, the system shows a dialog box to the
-  user, then calls the app's callback function to notify it whether the
-  permission was granted. If a user grants a permission, the app is given all
-  permissions in that permission's functional area that were declared in the
-  app manifest.
+</ul>
+
+<p>
+  This permission model changes the way your app behaves for features that
+  require permissions. Here's a summary of the development practices you should
+  follow to adjust to this model:
+</p>
+
+<ul>
+
+  <li>
+    <strong>Always Check for Permissions:</strong> When the app needs to
+    perform any action that requires a permission, it should first check
+    whether it has that permission already. If it does not, it requests to be
+    granted that permission.
   </li>
 
-  <li>If the app is not granted an appropriate permission, it should handle the
-  failure cleanly. For example, if the permission is just needed for an added
-  feature, the app can disable that feature. If the permission is essential for
-  the app to function, the app might disable all its functionality and inform
-  the user that they need to grant that permission.
+  <li>
+    <strong>Handle Lack of Permissions Gracefully:</strong> If the app is not
+    granted an appropriate permission, it should handle the failure cleanly.
+    For example, if the permission is just needed for an added feature, the app
+    can disable that feature. If the permission is essential for the app to
+    function, the app might disable all its functionality and inform the user
+    that they need to grant that permission.
   </li>
 
-  <li>Users can always go to the app's <b>Settings</b> screen and turn on or
-  off any of the app's permissions.
-  <!-- insert screenshot of settings screen-->
-  If a user turns off an app's permissions, the app is
-  <em>not</em> notified.
+  <div class="figure" style="width:220px">
+    <img src="images/app-permissions-screen.png" srcset=
+    "images/app-permissions-screen@2x.png 2x" alt="" width="220" height=
+    "375">
+    <p class="img-caption">
+      <strong>Figure 2.</strong> Permission screen in the app's Settings.
+    </p>
+  </div>
+
+  <li>
+    <strong>Permissions are Revocable:</strong> Users can revoke an app's
+    permissions at any time. If a user turns off an app's permissions, the app
+    is <em>not</em> notified. Once again, your app should verify that it has
+    needed permissions before performing any restricted actions.
   </li>
 </ul>
 
-<h3>
-  System Apps and Signature Permissions
+<p class="note">
+  <strong>Note:</strong> If an app targets the M Developer Preview, it
+  <em>must</em> use the new permissions model.
+</p>
+
+<p>
+  As of the launch of the M Developer Preview, not all Google apps fully
+  implement the new permissions model. Google is updating these apps over
+  the course of the M Developer Preview to properly respect Permissions toggle
+  settings.
+</p>
+
+<p class="note">
+  <strong>Note:</strong> If your app has its own API surface, do not proxy
+  permissions without first ensuring the caller has the requisite permissions
+  to access that data.
+</p>
+
+<h3 id="system-apps">
+  System apps and signature permissions
 </h3>
 
 <p>
-  Ordinarily, an app is just granted the <a href=
-  "https://android-preview.googleplex.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_NORMAL">
-  <code>PROTECTION_NORMAL</code></a> permissions when it is installed. However,
-  under some circumstances the app is granted more permissions:
+  Ordinarily, when the user installs an app, the system only grants the app the
+  {@link android.content.pm.PermissionInfo#PROTECTION_NORMAL
+  PROTECTION_NORMAL}. However, under some circumstances the system grants the
+  app more permissions:
 </p>
 
 <ul>
@@ -89,37 +179,130 @@
   the permissions listed in its manifest.
   </li>
 
-  <li>Apps are granted all permissions listed in the manifest that fall under
-  <a href=
-  "https://android-preview.googleplex.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_SIGNATURE">
-    PROTECTION_SIGNATURE</a>, if the app's signature matches the signature of
-    the app that declares the permissions.
+  <li>If the app requests permissions in the manifest that fall under {@link
+  android.content.pm.PermissionInfo#PROTECTION_SIGNATURE PROTECTION_SIGNATURE},
+  and the app is signed with the same certificate as the app that declared
+  those permissions, the system grants the requesting app those permissions on
+  installation.
   </li>
 </ul>
 
 <p>
   In both cases, the user can still revoke permissions at any time by going to
-  the app's <b>Settings</b> screen, so the app should continue to check for
-  permissions at run time and request them if necessary.
+  the system's <strong>Settings</strong> screen and choosing <strong>Apps
+  &gt;</strong> <i>app_name</i> <strong>&gt; Permissions</strong>. The app
+  should continue to check for permissions at run time and request them if
+  necessary.
 </p>
 
-<h3>
-  Forwards and Backwards Compatibility
+<h3 id="compatibility">
+  Forwards and backwards compatibility
 </h3>
 
 <p>
-  If an app does not target the M developer preview, it continues to use the
-  old permissions model even on M devices. When the app is installed, the
-  system asks the user to grant all permissions listed in the app's manifest.
+  If an app does not target the M Developer Preview, the app continues to use
+  the old permissions model even on M Preview devices. When the user installs
+  the app, the system asks the user to grant all permissions listed in the
+  app's manifest.
+</p>
+
+<p class="note">
+  <strong>Note:</strong> On devices running the M Developer Preview, a user can
+  turn off permissions for any app (including legacy apps) from the app's
+  Settings screen. If a user turns off permissions for a legacy app, the system
+  silently disables the appropriate functionality. When the app attempts to
+  perform an operation that requires that permission, the operation will not
+  necessarily cause an exception. Instead, it might return an empty data set,
+  signal an error, or otherwise exhibit unexpected behavior. For example, if you
+  query a calendar without permission, the method returns an empty data set.
 </p>
 
 <p>
-  If an app using the new permissions model is run on a pre-M device, the
-  system treats it the same as any other app. Once again, the system asks the
-  user to grant all declared permissions at install time.
+  If you install an app using the new permissions model on a device that is not
+  running the M Preview,
+  the system treats it the same as any other app: the system asks
+  the user to grant all declared permissions at install time.
 </p>
 
-<h2 id="">Coding for Runtime Permissions</h2>
+<p class="note">
+  <strong>Note:</strong> For the preview release, you must set the minimum SDK
+  version to the M Preview SDK to compile with the preview SDK. This means you
+  will not be able to test such apps on older platforms during the developer
+  preview.
+</p>
+
+<h3 id="perms-vs-intents">Permissions versus intents</h3>
+
+<p>
+  In many cases, you can choose between two ways for your app to perform a
+  task. You can have your app ask for permission to perform the operation
+  itself. Alternatively, you can have the app use an intent to have another app
+  perform the task.
+</p>
+
+<p>
+  For example, suppose your app needs to be able to take pictures with the
+  device camera. Your app can request the
+  <code>android.permission.CAMERA</code> permission, which allows your app to
+  access the camera directly. Your app would then use the camera APIs
+  to control the camera and take a picture. This approach gives your app full
+  control over the photography process, and lets you incorporate the camera UI
+  into your app.
+</p>
+
+<p>
+  However, if you don't need such control, you can just use an {@link
+  android.provider.MediaStore#ACTION_IMAGE_CAPTURE ACTION_IMAGE_CAPTURE} intent
+  to request an image. When you start the intent, the user is prompted to
+  choose a camera app (if there isn't already a default camera app), and that
+  app takes the picture. The camera app returns the picture to your app's {@link
+  android.app.Activity#onActivityResult onActivityResult()} method.
+</p>
+
+<p>
+  Similarly, if you need to make a phone call, access the user's contacts, and
+  so on, you can do that by creating an appropriate intent, or you can request
+  the permission and access the appropriate objects directly. There are
+  advantages and disadvantages to each approach.
+</p>
+
+<p>
+  If you use permissions:
+</p>
+
+<ul>
+  <li>Your app has full control over the user experience when you perform the
+  operation. However, such broad control adds to the complexity of your task,
+  since you need to design an appropriate UI.
+  </li>
+
+  <li>The user is prompted to give permission once, the first time you perform
+  the operation. After that, your app can perform the operation without
+  requiring additional interaction from the user. However, if the user doesn't
+  grant the permission (or revokes it later on), your app becomes unable to
+  perform the operation at all.
+  </li>
+</ul>
+
+<p>
+  If you use an intent:
+</p>
+
+<ul>
+  <li>You do not have to design the UI for the operation. The app that handles
+  the intent provides the UI. However, this means you have
+  no control over the user experience. The user could be interacting with an
+  app you've never seen.
+  </li>
+
+  <li>If the user does not have a default app for the operation, the system
+  prompts the user to choose an app. If the user does not designate a default
+  handler, they may have to go
+  through an extra dialog every time they perform the operation.
+  </li>
+</ul>
+
+<h2 id="coding">Coding for Runtime Permissions</h2>
 
 <p>
   If your app targets the new M Developer Preview, you must use the new
@@ -129,44 +312,47 @@
   have them.
 </p>
 
-<h3>
-  Enabling the New Permissions Model
+<h3 id="enabling">
+  Enabling the new permissions model
 </h3>
 
 <p>
   To enable the new M Developer Preview permissions model, set the app's
-  <a href=
-  "http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target">
-  targetSdkVersion</a> attribute to "M". Doing this enables all the new
-  permissions features.
+  <code>targetSdkVersion</code> attribute to <code>"MNC"</code>, and
+  <code>compileSdkVersion</code> to <code>"android-MNC"</code>. Doing so
+  enables all the new permissions features.
 </p>
 
-<!-- TODO: Insert manifest snippet -->
+<p>
+  For the preview release, you must set <code>minSdkVersion</code> to
+  <code>"MNC"</code> to compile with the preview SDK.
+</p>
 
-<h3>
-  Designating a Permission for M Only
+<h3 id="m-only-perm">
+  Designating a permission for the M Preview only
 </h3>
 
 <p>
-  You can use the new <code>&lt;uses-permission-sdk-m&gt;</code> element in the
-  app manifest to indicate that a permission is only needed on the M platform.
-  If you declare a permission this way, then whenever the app is installed on
-  an older device, the user is not prompted to grant the permission and the
-  permission is not granted to the app. This allows you to add new permissions
+  You can use the new <code>&lt;uses-permission-sdk-m&gt;</code> element in the app manifest
+  to indicate that a permission is only needed on the M Developer Preview. If
+  you declare a permission this way, then whenever the app is installed on an
+  older device, the system does not prompt the user or grant the
+  permission to the app. By using the <code>&lt;uses-permission-sdk-m&gt;</code>
+  element, you can add new permissions
   to updated versions of your app without forcing users to grant permissions
   when they install the update.
 </p>
 
 <p>
-  If the app is running on a device with the M developer preview,
+  If the app is running on a device with the M Developer Preview,
   <code>&lt;uses-permission-sdk-m&gt;</code> behaves the same as
-  <code>&lt;uses-permission&gt;</code>. The user is not prompted to grant any
-  permissions when the app is installed, and the app requests permissions as
-  they are needed.
+  <code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>.
+  The system does not prompt the user to grant any permissions when they install
+  the app, and the app requests permissions as they are needed.
 </p>
 
 <h3 id="prompting">
-  Prompting for Permissions on the M Preview
+  Prompting for permissions
 </h3>
 
 <p>
@@ -178,73 +364,348 @@
 </p>
 
 <p>
-  An app should follow this workflow to request permissions on an Android M
-  device. The device can check what platform it's running on by checking the
-  value of {@link android.os.Build.VERSION#SDK_INT Build.VERSION.SDK_INT}. If
-  the device is running the M Developer Preview, {@link
-  android.os.Build.VERSION#SDK_INT SDK_INT} is 23.
-  <!-- TODO: Confirm this number -->
-</p>
-<ol>
-  <li>When the user tries to do something that requires a permission, the app
-  checks to see if it currently has permission to perform this operation. To do
-  this, the app calls
-   <a href="https://android-preview.googleplex.com/reference/android/content/Context.html#checkSelfPermission(java.lang.String)"><code>Context.CheckSelfPermission(<em>permission_name</em>)</code></a> . The
-  app should do this even if it knows the user has already granted that
-  permission, since the user can revoke an app's permissions at any time. For
-  example, if a user wants to use an app to take a picture, the app calls
-  <a href="https://android-preview.googleplex.com/reference/android/content/Context.html#checkSelfPermission(java.lang.String)"><code>Context.CheckSelfPermission(Manifest.permission.CAMERA)</code></a>.
-  </li>
-
-<!-- TODO: Full list of permissions (or link to that list),
-  and how they break down by functional area]-->
-
-  <li>If the permission is not already granted to the app, the app calls
-  <a href=
-  "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-    <code>requestPermissions()</code></a> to request the
-    appropriate permission or permissions. This method functions
-    asynchronously.
-    <!-- TODO: insert code snippet showing permission check and request -->
-  </li>
-
-  <li>The system presents a dialog box to the user.
-  <!-- TODO: insert screenshot of permissions dialog box -->
-    When the user responds, the system calls <a href=
-    "https://android-preview.googleplex.com/reference/android/app/Activity.html#onRequestPermissionsResult(int,%20java.lang.String[],%20int[])">
-    <code>Activity.onRequestPermissionsResult()</code></a> with the
-    results; your app needs to override that method. The callback is passed the
-    same request code you passed to <a href=
-    "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-    <code>requestPermissions()</code></a>.
-    <!-- TODO: Insert code snippet of callback method -->
-  </li>
-
-  <li>If the user grants a permission, the app is given all permissions
-  in that functional area that are listed in the app manifest.
-  If the request is denied, you should take appropriate action. For
-  example, you might disable any menu actions that depend on this permission.
-  </li>
-</ul>
-
-<p>
-  When the system asks the user to grant a permission, the user has the option
-  of telling the system not to ask for that permission again. In that case,
-  when an app asks for that permission with <a href=
-    "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-    <code>requestPermissions()</code></a>, the
-  system immediately denies the request. For this reason, your app cannot
-  assume that any direct interaction with the user has taken place.
-</p>
-
-<p>
   If your app runs on a device that has SDK 22 or lower, the app uses the old
   permissions model. When the user installs the app, they are prompted to grant
   all the permissions your app requests in its manifest, except for those
   permissions which are labeled with <code>&lt;uses-permission-sdk-m&gt;</code>.
 </p>
 
-<h2 id="">Best Practices</h2>
+<h4 id="check-platform">Check what platform the app is running on</h4>
+
+<p>
+  This permissions model is only supported on devices running the M Developer
+  Preview. Before calling any of these methods, the app should verify
+  what platform it's running on
+  by checking the value of {@link android.os.Build.VERSION#CODENAME
+  Build.VERSION.CODENAME}. If the device is running the M Developer Preview,
+  {@link android.os.Build.VERSION#CODENAME CODENAME} is <code>"MNC"</code>.
+</p>
+
+<h4 id="check-for-permission">Check if the app has the needed permission</h4>
+
+<p>When the user tries to do something that requires a permission, the app
+  checks to see if it currently has permission to perform this operation. To do
+  this, the app calls
+  <code>Context.checkSelfPermission(<i>permission_name</i>)</code>. The app
+  should perform this check even if it knows the user has already granted that
+  permission,
+  since the user can revoke an app's permissions at any time. For example, if a
+  user wants to use an app to take a picture, the app calls
+  <code>Context.checkSelfPermission(Manifest.permission.CAMERA)</code>.</p>
+
+<p class="table-caption" id="permission-groups">
+  <strong>Table 1.</strong> Permissions and permission groups.</p>
+<table>
+  <tr>
+    <th scope="col">Permission Group</th>
+    <th scope="col">Permissions</th>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.CALENDAR</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.READ_CALENDAR</code>
+        </li>
+      </ul>
+      <ul>
+        <li>
+          <code>android.permission.WRITE_CALENDAR</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.CAMERA</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.CAMERA</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.CONTACTS</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.READ_CONTACTS</code>
+        </li>
+        <li>
+          <code>android.permission.WRITE_CONTACTS</code>
+        </li>
+        <li>
+          <code>android.permission.READ_PROFILE</code>
+        </li>
+        <li>
+          <code>android.permission.WRITE_PROFILE</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.LOCATION</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.ACCESS_FINE_LOCATION</code>
+        </li>
+        <li>
+          <code>android.permission.ACCESS_COARSE_LOCATION</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.MICROPHONE</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.RECORD_AUDIO</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.PHONE</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.READ_PHONE_STATE</code>
+        </li>
+        <li>
+          <code>android.permission.CALL_PHONE</code>
+        </li>
+        <li>
+          <code>android.permission.READ_CALL_LOG</code>
+        </li>
+        <li>
+          <code>android.permission.WRITE_CALL_LOG</code>
+        </li>
+        <li>
+          <code>com.android.voicemail.permission.ADD_VOICEMAIL</code>
+        </li>
+        <li>
+          <code>android.permission.USE_SIP</code>
+        </li>
+        <li>
+          <code>android.permission.PROCESS_OUTGOING_CALLS</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.SENSORS</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.BODY_SENSORS</code>
+        </li>
+      </ul>
+      <ul>
+        <li>
+          <code>android.permission.USE_FINGERPRINT</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+  <tr>
+    <td><code>android.permission-group.SMS</code></td>
+    <td>
+      <ul>
+        <li>
+          <code>android.permission.SEND_SMS</code>
+        </li>
+        <li>
+          <code>android.permission.RECEIVE_SMS</code>
+        </li>
+        <li>
+          <code>android.permission.READ_SMS</code>
+        </li>
+        <li>
+          <code>android.permission.RECEIVE_WAP_PUSH</code>
+        </li>
+        <li>
+          <code>android.permission.RECEIVE_MMS</code>
+        </li>
+        <li>
+          <code>android.permission.READ_CELL_BROADCASTS</code>
+        </li>
+      </ul>
+    </td>
+  </tr>
+
+</table>
+
+<h4 id="request-permissions">Request permissions if necessary</h4>
+
+<p>If the app doesn't already have the permission it needs, the app calls the
+  <code>Activity.requestPermissions(String[], int)</code> method to
+  request the appropriate permission or permissions. The app passes the
+  permission or permissions it wants, and also an integer "request code".
+  This method functions asynchronously: it returns right away, and after
+  the user responds to the dialog box, the system calls the app's callback
+  method with the results, passing the same "request code" that the app passed
+  to <code>requestPermissions()</code>.</p>
+
+  <p>The following code code checks if the app has permission to read the
+    user's contacts, and requests the permission if necessary:</p>
+
+<pre>
+if (checkSelfPermission(Manifest.permission.READ_CONTACTS)
+        != PackageManager.PERMISSION_GRANTED) {
+    requestPermissions(new String[]{Manifest.permission.READ_CONTACTS},
+            MY_PERMISSIONS_REQUEST_READ_CONTACTS);
+
+    // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
+    // app-defined int constant
+
+    return;
+}
+</pre>
+
+<h4 id="handle-response">Handle the permissions request response</h4>
+
+<p>
+  When an app requests permissions, the system presents a dialog box to the
+  user. When the user responds, the system invokes your app's
+  <code>Activity.onRequestPermissionsResult(int, String[], int[])</code>
+  passing it the user response. Your app needs to override that method. The
+  callback is passed the same request code you passed to
+  <code>requestPermissions()</code>. For example, if an app requests
+  <code>READ_CONTACTS</code> access it might have the following callback
+  method:
+</p>
+
+<pre>
+&#64;Override
+public void onRequestPermissionsResult(int requestCode,
+        String permissions[], int[] grantResults) {
+    switch (requestCode) {
+        case MY_PERMISSIONS_REQUEST_READ_CONTACTS: {
+            if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+
+                // permission was granted, yay! do the
+                // calendar task you need to do.
+
+            } else {
+
+                // permission denied, boo! Disable the
+                // functionality that depends on this permission.
+            }
+            return;
+        }
+
+        // other 'switch' lines to check for other
+        // permissions this app might request
+    }
+}
+</pre>
+
+  <p>If the user grants a permission, the system gives the app all permissions
+  that the app manifest lists for that functional area. If the user denies the
+  request, you should take appropriate action. For example, you might disable
+  any menu actions that depend on this permission.
+  </li>
+</p>
+
+<p>
+  When the system asks the user to grant a permission, the user has the option
+  of telling the system not to ask for that permission again. In that case,
+  when an app uses <code>requestPermissions()</code> to ask for that permission,
+  the system immediately denies the request. In this case, the system calls
+  your <code>onRequestPermissionsResult()</code> the same way it would if the
+  user had explicitly rejected your request again. For this reason, your app
+  cannot assume that any direct interaction with the user has taken place.
+</p>
+
+<h2 id="testing">Testing Runtime Permissions</h2>
+
+
+<p>
+  If your app targets the M Developer Preview, you must test that it
+  handles permissions properly. You cannot assume that your app has any
+  particular permissions when it runs. When the app is first launched, it is
+  likely to have no permissions, and the user can revoke or restore permissions
+  at any time.
+</p>
+
+<p>
+  You should test your app to make sure it behaves properly under all
+  permission situations. With the M Preview SDK, we have provided new
+  <a href="{@docRoot}tools/help/adb.html">Android
+  Debug Bridge (adb)</a> commands to enable you to test your app with whatever
+  permissions settings you need to try.
+</p>
+
+<h3>
+  New adb commands and options
+</h3>
+
+<p>
+  The M Preview SDK Platform-tools provides several new commands to let you test
+  how your app handles permissions.
+</p>
+
+<h4>
+  Install with permissions
+</h4>
+
+<p>
+  You can use the <a href="{@docRoot}tools/help/adb.html#move"><code>adb
+  install</code></a> command's new <code>-g</code> option, which installs the
+  app and grants all permissions listed in its manifest:
+</p>
+
+<pre class="no-pretty-print">
+$ adb install -g &lt;path_to_apk&gt;
+</pre>
+
+<h4>
+  Grant and revoke permissions
+</h4>
+
+<p>
+  You can use new ADB <a href="{@docRoot}tools/help/adb.html#pm">package manager
+  (pm)</a> commands to grant and revoke permissions to an installed app.
+  This functionality can be useful for automated testing.
+</p>
+
+<p>
+  To grant a permission, use the package manager's <code>grant</code> command:
+</p>
+
+<pre class="no-pretty-print">
+$ adb pm grant &lt;package_name&gt; &lt;permission_name&gt;
+</pre>
+
+<p>
+  For example, to grant the com.example.myapp package permission to record
+  audio, use this command:
+</p>
+
+<pre class="no-pretty-print">
+$ adb pm grant com.example.myapp android.permission.RECORD_AUDIO
+</pre>
+
+<p>
+  To revoke a permission, use the package manager's <code>revoke</code> command:
+</p>
+
+<pre class="no-pretty-print">
+$ adb pm revoke &lt;package_name&gt; &lt;permission_name&gt;
+</pre>
+
+<h2 id="best-practices">Best Practices</h2>
 
 <p>
   The new permissions model gives users a smoother experience, and makes it
@@ -253,12 +714,32 @@
   the new model.
 </p>
 
-<h3>
-  Don't Overwhelm the User
+
+<h3 id="bp-what-you-need">Only ask for permissions you need</h3>
+
+<p>
+  Every time you ask for a permission, you force the user to make a decision.
+  If the user turns down the request, that reduces your app's functionality.
+  You should minimize the number of times you make these requests.
+</p>
+
+<p>
+  For example, quite often your app can get needed functionality by using an
+  <a href="{@docRoot}guide/components/intents-filters.html">intent</a> instead
+  of asking for permissions. If your app needs to take pictures with the
+  phone's camera, your app can use a {@link
+  android.provider.MediaStore#ACTION_IMAGE_CAPTURE
+  MediaStore.ACTION_IMAGE_CAPTURE} intent. When your app executes the intent, the
+  system prompts the user to choose an already-installed camera app to take the
+  picture.
+</p>
+
+<h3 id="bp-dont-overwhelm">
+  Don't overwhelm the user
 </h3>
 
 <p>
-  If you confront the user with a lot of permissions requests at once, you may
+  If you confront the user with a lot of requests for permissions at once, you may
   overwhelm the user and cause them to quit your app. Instead, you should ask
   for permissions as you need them.
 </p>
@@ -266,35 +747,30 @@
 <p>
   In some cases, one or more permissions might be absolutely essential to your
   app. In that case, it might make sense to ask for all the permissions as soon
-  as the app launches.
-  <!-- TODO: insert screenshot of dialog box asking for several permissions -->
-  For example, if you make a photography app, the app would
-  need access to the device camera. When the user launches the app for the
-  first time, they won't be surprised to be asked to give permission to use the
-  camera. But if the same app also had a feature to share photos with the
+  as the app launches. For example, if you make a photography app, the app
+  would need access to the device camera. When the user launches the app for
+  the first time, they won't be surprised to be asked for permission to use
+  the camera. But if the same app also had a feature to share photos with the
   user's contacts, you probably should <em>not</em> ask for that permission at
   first launch. Instead, wait until the user tries to use the "sharing" feature
   and ask for the permission then.
 </p>
 
 <p>
-  If your app provides a tutorial, it may make sense to request app's essential
+  If your app provides a tutorial, it may make sense to request the app's essential
   permissions at the end of the tutorial sequence.
 </p>
 
-<h3>
-  Explain Why You Need Permissions
+<h3 id="bp-explain">
+  Explain why you need permissions
 </h3>
 
 <p>
-  The permissions screen shown by the system when you call <a href=
-  "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-  <code>requestPermissions()</code></a> says what permission your app wants,
-  but doesn't say why you want it. In some cases, the user may find that
-  puzzling. It's a good idea to explain to the user why your app wants the
-  permissions before you call <a href=
-  "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-  <code>requestPermissions()</code></a>.
+  The permissions dialog shown by the system when you call
+  <code>requestPermissions()</code> says what permission your app wants, but
+  doesn't say why. In some cases, the user may find that puzzling.
+  It's a good idea to explain to the user why your app wants the permissions
+  before calling <code>requestPermissions()</code>.
 </p>
 
 <p>
@@ -303,50 +779,17 @@
   contain location information, and would be puzzled why their photography app
   wanted to know the location. So in this case, it's a good idea for the app to
   tell the user about this feature <em>before</em> calling
-  <a href=
-  "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-  <code>requestPermissions()</code></a>.
+  <code>requestPermissions()</code>.
 </p>
 
 <p>
-  As noted, one way to do this is to incorporate these requests into an app
-  tutorial. The tutorial can show each of the app's features in turn, and as it
-  does this, it can explain what permissions are needed. For example, the
-  photography app's tutorial demonstrate its "share photos with your contacts"
-  feature, then tell the user that they'll need to give permission for the app
-  to see the user's contacts, and <em>then</em> call <a href=
-  "https://android-preview.googleplex.com/reference/android/app/Activity.html#requestPermissions(java.lang.String[],%20int)">
-  <code>requestPermissions()</code></a>
-  to get that access. Of course, some users will want to skip the tutorial, so
-  you'll still need to check for and request permissions during the app's
-  normal operation.
-</p>
-
-<h3>
-  Opt Out If Necessary
-</h3>
-
-<p>
-  Until you are ready to use the new permissions model, you can opt out simply
-  by setting your app's <a href=
-  "http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target">
-  targetSdkVersion</a> to 22 or less. If you do this, the system will use the
-  old permissions model. When the user downloads the app, they will be prompted
-  to grant all the permissions listed in the manifest.
-</p>
-
-<p>
-  With the M Developer Preview, users can turn off permissions for <em>any</em>
-  app from the app's Settings page, regardless of what SDK version the app
-  targets. For this reason, it's a good idea to follow the steps described in
-  <a href="#prompting">"Prompting for Permissions on the M Preview"</a> even if
-  your app doesn't fully support the new permissions model.
-</p>
-
-<p class="note">
-  <strong>Note:</strong> If a user turns off permissions for a legacy app, the system
-  silently disables the appropriate functionality. When the app attempts to
-  perform an operation that requires that permission, the operation will not
-  necessarily cause an exception. Instead, it might return an empty data set or
-  otherwise signal an error.
+  One way to do this is to incorporate these requests into an app tutorial. The
+  tutorial can show each of the app's features in turn, and as it does this, it
+  can explain what permissions are needed. For example, the photography app's
+  tutorial can demonstrate its "share photos with your contacts" feature, then
+  tell the user that they need to give permission for the app to see the user's
+  contacts. The app can then call <code>requestPermissions()</code> to ask the
+  user for that access. Of course, not every user is going to follow the
+  tutorial, so you still need to check for and request permissions during the
+  app's normal operation.
 </p>
diff --git a/docs/html/preview/images/m-preview-timeline-crop.png b/docs/html/preview/images/m-preview-timeline-crop.png
new file mode 100644
index 0000000..724a6af
--- /dev/null
+++ b/docs/html/preview/images/m-preview-timeline-crop.png
Binary files differ
diff --git a/docs/html/preview/images/perf-test-frame-latency.png b/docs/html/preview/images/perf-test-frame-latency.png
new file mode 100644
index 0000000..87d1cfc
--- /dev/null
+++ b/docs/html/preview/images/perf-test-frame-latency.png
Binary files differ
diff --git a/docs/html/preview/images/perf-test-framestats.png b/docs/html/preview/images/perf-test-framestats.png
new file mode 100644
index 0000000..589a923
--- /dev/null
+++ b/docs/html/preview/images/perf-test-framestats.png
Binary files differ
diff --git a/docs/html/preview/images/work-profile-screen.png b/docs/html/preview/images/work-profile-screen.png
new file mode 100644
index 0000000..c3e4e44
--- /dev/null
+++ b/docs/html/preview/images/work-profile-screen.png
Binary files differ
diff --git a/docs/html/preview/images/work-profile-screen_2x.png b/docs/html/preview/images/work-profile-screen_2x.png
new file mode 100644
index 0000000..5dcf610
--- /dev/null
+++ b/docs/html/preview/images/work-profile-screen_2x.png
Binary files differ
diff --git a/docs/html/preview/index.jd b/docs/html/preview/index.jd
index d9af7e0..c5644cc 100644
--- a/docs/html/preview/index.jd
+++ b/docs/html/preview/index.jd
@@ -8,28 +8,35 @@
 @jd:body
 
 <section class="dac-expand dac-hero dac-light" >
-  <div class="wrap" style="max-width:1100px">
+  <div class="wrap">
     <div class="cols dac-hero-content">
       <div class="col-9of16 col-push-7of16 dac-hero-figure">
-        <img class="dac-hero-image" src="/images/home/devices-hero_620px_2x.png">
+        <img class="dac-hero-image" src="{@docRoot}images/home/devices-hero_620px_2x.png"
+             srcset="{@docRoot}images/home/devices-hero_620px.png 1x,
+             {@docRoot}images/home/devices-hero_620px_2x.png 2x">
       </div>
-      <div class="col-6of16 col-pull-8of16">
+      <div class="col-7of16 col-pull-9of16">
         <h1 class="dac-hero-title">Android M Developer Preview</h1>
         <p class="dac-hero-description">
           Get ready for the next version of Android. Test your apps on Nexus 5, 6, 9, and
           Player. Explore what's new &mdash; a <strong>runtime permissions</strong> model,
-          power-saving <strong>Volta features</strong>, new <strong>assist technology</strong>,
-          and more.
+          power-saving <strong>Doze</strong> and <strong>Standby Mode</strong>, new
+          <strong>assist technology</strong>, and more.
         </p>
 
-        <a class="dac-hero-cta" href="/preview/overview.html">
+        <a class="dac-hero-cta" href="{@docRoot}preview/overview.html">
           <span class="dac-sprite dac-auto-chevron"></span>
           Get Started!
         </a><br>
       </div>
     </div>
-
-
+    <div class="dac-section dac-small">
+      <div class="resource-widget resource-flow-layout col-16"
+           data-query="collection:preview/landing/resources"
+           data-cardSizes="6x2"
+           data-maxResults="6"></div>
+    </div>
+  </div>
 </section>
 
 
@@ -40,30 +47,6 @@
 </div>
 
 <section class="dac-section dac-gray dac-small dac-invert" id="latest"><div class="wrap">
-  <h2 class="norule">Resources</h2>
-<div class="dac-section dac-small">
-      <div class="resource-widget resource-flow-layout col-16"
-           data-query="collection:preview/landing/resources"
-           data-cardSizes="6x2"
-           data-maxResults="6"></div>
-    </div> 
-  </div></section>
-
-
-
-<section class="dac-section dac-section-light" id="build-apps"><div class="wrap">
-  <h1 class="dac-section-title">Get your apps ready</h1>
-  <div class="dac-section-subtitle">
-    Resources to help you learn about Android M and get your app ready.
-  </div>
-  <div class="resource-widget resource-flow-layout col-16"
-       data-query="collection:preview/landing/resources"
-       data-cardSizes="6x6"
-       data-maxResults="6"></div>
-</div></section>
-
-
-<section class="dac-section dac-gray dac-small dac-invert" id="latest"><div class="wrap">
   <h2 class="norule">Latest</h2>
   <div class="resource-widget resource-flow-layout col-16"
        data-query="type:blog+tag:androidm,type:youtube+tag:androidm"
@@ -71,3 +54,17 @@
        data-maxResults="6"
        data-initial-results="3"</div>
 </div></section>
+
+
+<section class="dac-section dac-light"><div class="wrap">
+  <h1 class="dac-section-title">Resources</h1>
+  <div class="dac-section-subtitle">
+    Essential information to help you get your apps ready for Android M.
+  </div>
+  <div class="resource-widget resource-flow-layout col-16"
+       data-query="tag:previewresources"
+       data-cardSizes="6x6"
+       data-initial-results="6"
+       data-maxResults="16"></div>
+</div></section>
+
diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd
index e235d68..4c13fbc 100644
--- a/docs/html/preview/overview.jd
+++ b/docs/html/preview/overview.jd
@@ -1,39 +1,345 @@
-page.title=Preview Program Overview
+page.title=Program Overview
+page.metaDescription=Welcome to the Android M Developer Preview, a program that gives you everything you need to test and optimize your apps for the next version of Android.
 page.image=images/cards/card-preview_16-9_2x.png
+page.tags="preview", "developer", "android"
 
 @jd:body
 
 <p>
-  The Android M platform is still under development, but we’re offering developers an early look
-  through the Android M Developer Preview program. This program is an opportunity for you to test
-  the compatibility of your apps with the next platform release, try out early versions of new API
-  features, and provide feedback to the Android team. Developers can try out the M Preview system
-  on with the Android SDK emulator or on Nexus 5, Nexus 6, Nexus 9, and Nexus Player devices. The
-  program includes update releases during course of the program to allow you to follow the progress
-  of feature development and fixes, leading up to the official release of the platform.
+  Welcome to the <strong>Android M Developer Preview</strong>, a program that gives you
+  everything you need to test and optimize your apps for the next version of
+  Android. It's free, and you can get started right away just by downloading
+  the M Developer Preview tools.
 </p>
 
-<img src="{@docRoot}preview/images/m-preview-timeline.png"
-  alt="Preview program timeline" id="figure1" style="margin-top: 15px;">
-<p class="img-caption">
-  Timeline for the M Developer Preview program.
+<div style="background-color:#eceff1;padding:1em;">
+<div class="wrap">
+  <div class="cols">
+    <div class="col-4of12">
+      <h5>
+        Hardware and emulator system images
+      </h5>
+
+      <p>
+        Run and test your apps on Nexus 5, 6, 9, and Player (for TV), as well
+        as emulator.
+      </p>
+    </div>
+
+    <div class="col-4of12">
+      <h5>
+        Latest platform code
+      </h5>
+
+      <p>
+        We’ll provide multiple updates during the Preview, so you’ll be testing
+        against the latest platform changes.
+      </p>
+    </div>
+
+    <div class="col-4of12">
+      <h5>
+        Updates delivered by OTA
+      </h5>
+
+      <p>
+        You  can get updates over the air, once you’ve flashed a
+        device to the initial preview.
+      </p>
+    </div>
+  </div>
+
+  <div class="cols">
+
+<!--<div class="col-4of12">
+<h5>Early access to new  APIs</h5>
+<p>Explore the new capabilities and APIs offered in the new platform and give us
+feedback. Note that APIs and capabilities may change during the Preview
+program.</p>
+</div>-->
+
+    <div class="col-4of12">
+      <h5>
+        New behaviors and capabilities
+      </h5>
+
+      <p>
+        Start work early to support new platform behaviors such as
+        the new runtime permissions model and power-saving features.
+      </p>
+    </div>
+
+    <div class="col-4of12">
+      <h5>
+        Priority window for developer-reported issues
+      </h5>
+
+      <p>
+        During the first several weeks we’ll give priority to developer-reported
+        issues, so test and give feedback as soon as possible.
+      </p>
+    </div>
+
+    <div class="col-4of12">
+      <h5>
+        Feedback and support channels
+      </h5>
+
+      <p>
+        Report issues and give us feedback using our <a href=
+        "https://code.google.com/p/android-developer-preview/">issue tracker</a>.
+        Connect with other developers in the <a
+        href="http://g.co/dev/AndroidMDevPreview">M&nbsp;Developer Community</a>.
+      </p>
+    </div>
+  </div>
+</div>
+</div>
+
+<!--
+<p>
+  With the M Developer Preview, you'll get an early start on testing your apps,
+  with enough time to make adjustments before the public platform release later
+  in the year. We'll provide several updates to the Preview tools in the weeks
+  ahead, so you can keep in sync with the latest changes as the platform moves
+  toward launch.
+</p>
+<img src="{@docRoot}preview/images/m-preview-timeline.png" alt=
+"Preview program timeline" id="timeline">
+<p>
+  You can help us improve the platform by <a href=
+  "https://code.google.com/p/android-developer-preview/">reporting issues</a>
+  through our feedback channels. This is especially
+  critical in the first month of the preview, when we’ll be giving priority to
+  developer-reported issues and feedback.
+</p> -->
+
+
+<h2 id="timeline">
+  Timeline and updates
+</h2>
+<img src="{@docRoot}preview/images/m-preview-timeline-crop.png" alt=
+"Preview program timeline" id="timeline">
+<p>
+  The M Developer Preview runs from May 27 until the final Android M SDK, which
+  we’ll release shortly before the public release during Q3
+  2015. 
 </p>
 
 <p>
-  We strongly encourage you to provide feedback for the M Preview releases through our <a href=
-  "https://code.google.com/p/android-developer-preview/">issue tracker</a>. Issues reported early
-  in the program have a better chance of being addressed before the official release, so reports
-  provided by June 30, 2015 receive priority processing by the Android team.
+  At key development milestones, we’ll deliver updates for your test devices.
+  The tentative milestones are
 </p>
 
+<ul>
+  <li>
+    <strong>Preview&nbsp;1</strong> (initial Preview release, late May),
+  </li>
+
+  <li>
+    <strong>Preview&nbsp;2</strong> (late June/early July), and
+  </li>
+
+  <li>
+    <strong>Preview&nbsp;3</strong> (near final, late July)
+  </li>
+</ul>
+
+<p>
+  These updates culminate in the <strong>final SDK</strong> (later in Q3),
+  which delivers the official APIs for the new version of Android, as well
+  as the final system behaviors and features.
+</p>
+
+<p>
+  As you test and develop on Android M, we strongly recommend <strong>keeping
+  your development environment up-to-date</strong> as Preview updates are released.
+  To make the process easier, we'll deliver <strong>updates over the air
+  (OTA)</strong> to devices already flashed to a Preview build, as well as
+  providing system images that you can download and flash manually.
+</p>
+<p class="note">
+  <strong>Note:</strong> The final SDK and system images can not be delivered
+  by OTA, but will instead need to be <strong>flashed manually</strong> to
+  your test devices.</strong>
+</p>
+
+<p>
+  We’ll notify you when Preview updates are available via the <a href=
+  "http://android-developers.blogspot.com/">Android Developers Blog</a>, as
+  well as this site and the
+  <a href="http://g.co/dev/AndroidMDevPreview">Android M Developer Community</a>.
+</p>
+
+<h2 id="preview_tools">
+  What’s in the Preview?
+</h2>
+
+<p>
+  The M Developer Preview includes everything you need to test your existing
+  apps on a variety of screen sizes, network technologies, CPU/GPU chipsets,
+  and hardware architectures.
+</p>
+
+<h4>
+  SDK tools
+</h4>
+
+<p>
+  You can download these components through the SDK Manager in <a href=
+  "{@docRoot}sdk/installing/adding-packages.html">Android Studio</a>:
+</p>
+
+<ul>
+  <li>M Developer Preview <strong>SDK tools</strong>
+  </li>
+
+  <li>M Developer Preview <strong>emulator system image</strong> (32-bit &amp;
+  64-bit)
+  </li>
+
+  <li>M Developer Preview <strong>emulator system Image for Android TV</strong>
+  (32-bit)
+  </li>
+</ul>
+
+<h4>
+  Hardware system images
+</h4>
+
+<p>
+  You can download these hardware system images for Nexus devices from the
+  <a href="downloads.html">Downloads page</a>:
+</p>
+
+<ul>
+  <li>
+    <strong>Nexus 5</strong> (GSM/LTE) “hammerhead” device system image
+  </li>
+
+  <li>
+    <strong>Nexus 6</strong> “shamu” device system image
+  </li>
+
+  <li>
+    <strong>Nexus 9</strong> (Wi-Fi) “volantis” device system image
+  </li>
+
+  <li>
+    <strong>Nexus Player</strong> (Android TV) “fugu” device system image
+  </li>
+</ul>
+
+<h4>
+  Documentation and sample code
+</h4>
+
+<p>
+  These documentation resources help you learn about the Preview:
+</p>
+
+<ul>
+  <li>
+    <a href="setup-sdk.html">Set Up the SDK</a> has step-by-step instructions
+    for getting started.
+  </li>
+
+  <li>
+    <a href="testing.html">Testing Guide</a> and <a href=
+    "api-changes.html">Behavior Changes</a> point you to key areas to test.
+  </li>
+
+  <li>Documentation of new APIs, including an <a href="api-overview.html">API Overview</a>,
+  downloadable <a href="">API Reference</a>, and detailed developer guides on
+  key features such as <a href="">permissions</a>, <a href="">app backup</a>,
+  and others.
+  </li>
+
+  <li>
+    <a href="">Sample code</a> that demonstrates how support
+    permissions and other new features.
+  </li>
+
+  <li>
+    <a href="">Release notes</a> for the current version of the M Developer
+    Preview, including change notes and diff reports.
+  </li>
+</ul>
+
+<h4>
+  Support resources
+</h4>
+
+<p>
+  Use these support resources as you test and develop on the M
+  Developer Preview:
+</p>
+
+<ul>
+  <li><a href="https://code.google.com/p/android-developer-preview/">M
+  Developer Preview Issue Tracker</a> is your <strong>primary feedback
+  channel.</strong> You can report bugs, performance issues, and general
+  feedback through the issue tracker. You can also check for known issues
+  and find workaround steps, if available.
+  </li>
+
+  <li>The <a href="http://g.co/dev/AndroidMDevPreview">Android M Developer
+  Community</a> is a Google+ community where you can <strong>connect with
+  other developers</strong> working with Android M. You can share
+  observations or ideas or find answers to questions about Android M.
+  </li>
+</ul>
+
+
+<h2 id="preview_apis_and_publishing">
+  Targeting, preview APIs, and publishing
+</h2>
+
+<p>
+  The Android M Developer Preview is a development-only release and
+  <strong>does not have a standard API level</strong>. If you want to opt out
+  of compatibility behaviors to test your app (which is strongly recommended),
+  you can target the M Developer Preview by setting your app's <code><a href=
+  "/guide/topics/manifest/uses-sdk-element.html">targetSdkVersion</a></code>
+  to <code>“MNC”</code>.
+</p>
+
+<p>
+  The Android M Developer Preview delivers <strong>preview APIs</strong>
+  &mdash; the APIs will not be official until the final SDK is released,
+  currently planned for the third quarter of 2015. This means that you can
+  <strong>expect minor API changes</strong> over time, especially during
+  initial weeks of the program. We’ll provide a summary of changes to you with
+  each update of the Android M Developer Preview.
+</p>
+
+<p class="note">
+  Note that although preview APIs may change, underlying system behaviors such
+  as runtime permissions and power-saving features are stable and ready for
+  testing right away.
+</p>
+
+<p>
+  In terms of publishing, Google Play <strong>prevents publishing of apps
+  targeting the M Developer Preview</strong>. When the Android M final SDK is
+  available, you’ll be able to target the official Android M API level and
+  publish your app to Google Play. Meanwhile, if you want to distribute an app
+  targeting Android M to testers, you can do so via email or by direct download
+  from your site.
+</p>
+
+<h2 id="get_started">
+  How to get started?
+</h2>
+
 <p>
   To get started testing your app:
 </p>
 
-<ul>
-  <li>Review the <a href="{@docRoot}preview/api-overview.html"> API Overview</a> and
-    <a href="{@docRoot}preview/api-changes.html">Behavior Changes</a> to
-    get an idea of what's new and how it affects your app.
+<ol>
+  <li>Review the <a href="{@docRoot}preview/api-overview.html">API Overview</a>
+    and <a href="{@docRoot}preview/behavior.html">Behavior Changes</a> to get an
+    idea of what's new and how it affects your apps.
   </li>
 
   <li>Setup for testing and development by following the instructions for
@@ -41,23 +347,24 @@
     and configuring test devices.
   </li>
 
-  <li>You can <a href="{@docRoot}preview/download.html">download</a> the latest M Developer
-    Preview system image for compatible Nexus devices and install it for testing. Once you have
-    flashed a development device, it is upgraded automatically with the next preview release
-    through over-the-air (OTA) updates.
+  <li>Follow the <a href="https://developers.google.com/android/nexus/images">
+    flashing instructions</a> to flash the latest M developer preview system image
+    for Nexus 5, 6, 9, and Player. Once you've flashed your development device,
+    Preview updates will be delivered through over-the-air (OTA) updates.</a>
   </li>
 
-  <li>Review the M Preview <a href="{@docRoot}preview/reference.html">API Reference</a> and
-    <a href="{@docRoot}preview/samples.html">samples</a> to
-    gain more insight into new API features and how to use them in your app.
+  <li>Download the <a href="{@docRoot}preview/reference.html">M Preview API
+  Reference</a> and <a href="{@docRoot}preview/samples.html">M Preview
+  samples</a> to gain more insight into new API features and how to use them in
+  your app.
   </li>
 
-  <li>Join the M Preview <a href="http://g.co/dev/AndroidMDevPreview">Google+ developer
-    community</a> to get the latest developer updates and connect with other
-    developers working with the preview.
+  <li>Join the <a href="http://g.co/dev/AndroidMDevPreview">Android M
+  Developer Community</a> to get the latest news and connect with other
+  developers working with the new platform.
   </li>
-</ul>
+</ol>
 
 <p>
-  Thanks in advance for your participation in the developer preview program!
-</p>
+  Thank you for your participation in the Android M Developer Preview program!
+</p>
\ No newline at end of file
diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs
index 7e9f292..0a141bb 100644
--- a/docs/html/preview/preview_toc.cs
+++ b/docs/html/preview/preview_toc.cs
@@ -7,7 +7,7 @@
 
   <li class="nav-section">
     <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/download.html">
-      Download</a></div>
+      Downloads</a></div>
   </li>
 
   <li class="nav-section">
@@ -31,17 +31,16 @@
         <li><a href="<?cs var:toroot ?>preview/features/runtime-permissions.html">
           Runtime Permissions</a></li>
         <li><a href="<?cs var:toroot ?>preview/features/app-linking.html">
-          App Linking</a></li>
+          App Links</a></li>
         <li><a href="<?cs var:toroot ?>preview/backup/index.html">
           Automatic Backups</a></li>
       </ul>
   </li>
 
   <li class="nav-section">
-    <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/api-changes.html">
+    <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/behavior-changes.html">
       Behavior Changes</a></div>
   </li>
-
   <li class="nav-section">
     <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/samples.html">
       Samples</a></div>
diff --git a/docs/html/preview/samples.jd b/docs/html/preview/samples.jd
index 29b9e2a..3974ee3 100644
--- a/docs/html/preview/samples.jd
+++ b/docs/html/preview/samples.jd
@@ -1,10 +1,10 @@
 page.title=Samples
-page.image=images/cards/card-samples_16-9_2x.png
+page.image=images/cards/samples-new_2x.png
 @jd:body
 
 <p>
-  The following code samples are provided for the M Developer Preview. You can download them in the
-  Android SDK Manager under the <b>SDK Samples</b> component for the M Developer Preview.
+  The following code samples are provided for the M Developer Preview. To download
+  the samples in Android Studio, select the <b>File > Import Samples</b> menu option.
 </p>
 
 <img src="{@docRoot}images/cards/card-google-cloud-messaging_16-9_2x" class="figure">
@@ -24,13 +24,13 @@
 
 <p><a href="https://github.com/googlesamples/android-RuntimePermissions">Get it on GitHub</a></p>
 
-<h3 id="ConfirmCredentials">Confirm Device Credentials</h3>
+<h3 id="ConfirmCredentials">Confirm Credential</h3>
 
 <p>
  This sample demonstrates how to use device credentials as an authentication method in your app.
 </p>
 
-<p><a href="https://github.com/googlesamples/android-ConfirmDeviceCredentials">Get it on
+<p><a href="https://github.com/googlesamples/android-ConfirmCredential">Get it on
 GitHub</a></p>
 
 <h3 id="FingerprintDialog">Fingerprint Dialog</h3>
@@ -42,23 +42,14 @@
 
 <p><a href="https://github.com/googlesamples/android-FingerprintDialog">Get it on GitHub</a></p>
 
-<h3 id="AutomaticBackup">Automatic Backup</h3>
+<h3 id="AutomaticBackup">Auto Backup for Apps</h3>
 
 <p>
  Android M introduces automatic backup for app settings. This sample demonstrates how to add
  filtering rules to an app in order to manage settings backup.
 </p>
 
-<p><a href="https://github.com/googlesamples/android-AutomaticBackup">Get it on GitHub</a></p>
-
-<h3 id="VoiceCamera">Voice Camera</h3>
-
-<p>
-  This sample demonstrates how to implement the "OK Google, take a selfie" voice command and confirm
-  the user intent with the <code>VoiceInteraction</code> API.
-</p>
-
-<p><a href="https://github.com/googlesamples/android-VoiceCamera">Get it on GitHub</a></p>
+<p><a href="https://github.com/googlesamples/android-AutoBackupForApps">Get it on GitHub</a></p>
 
 <h3 id="CameraRaw">Camera 2 Raw</h3>
 
@@ -77,15 +68,4 @@
   can tell you how many notifications your app is currently showing.
 </p>
 
-<p><a href="https://github.com/googlesamples/android-ActiveNotification">Get it on GitHub</a></p>
-
-<h3 id="VoiceSynthesizer">Voice Synthesizer</h3>
-
-<p>
-  This sample demonstrates how to use the <code>NativeAudio</code> APIs to demonstrate low-latency
-  audio processing.
-</p>
-
-<p><a href="https://github.com/googlesamples/android-VoiceSynthesizer">Get it on GitHub</a></p>
-
-
+<p><a href="https://github.com/googlesamples/android-ActiveNotifications">Get it on GitHub</a></p>
diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd
index b31b104..f0def9b 100644
--- a/docs/html/preview/setup-sdk.jd
+++ b/docs/html/preview/setup-sdk.jd
@@ -72,8 +72,8 @@
 
 <ul>
   <li><code>compileSdkVersion</code> is set to <code>'android-MNC'</code></li>
-  <li><code>minSdkVersion</code> is set to <code>'android-MNC'</code></li>
-  <li><code>targetSdkVersion</code> is set to <code>'android-MNC'</code></li>
+  <li><code>minSdkVersion</code> is set to <code>'MNC'</code></li>
+  <li><code>targetSdkVersion</code> is set to <code>'MNC'</code></li>
 </ul>
 
 
diff --git a/docs/html/preview/testing/guide.jd b/docs/html/preview/testing/guide.jd
new file mode 100644
index 0000000..1879268
--- /dev/null
+++ b/docs/html/preview/testing/guide.jd
@@ -0,0 +1,176 @@
+page.title=Testing Guide
+page.image=images/cards/card-set-up_16-9_2x.png
+
+@jd:body
+
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+      <ol>
+        <li><a href="#runtime-permissions">Testing Runtime Permissions</a></li>
+        <li><a href="#doze-standby">Testing Doze and App Standby</a></li>
+      </ol>
+  </div>
+</div>
+
+<p>
+  The Android M Developer Preview gives you an opportunity to ensure your apps work with the next
+  version of the platform. This preview includes a number of APIs and behavior changes that can
+  impact your app, as described in the <a href="{@docRoot}preview/api-overview.html">API
+  Overview</a> and <a href="{@docRoot}preview/api-changes.html">Behavior Changes</a>. In testing
+  your app with the preview, there are some specific system changes that you should focus on to
+  ensure that users have a good experience.
+</p>
+
+<p>
+  This guide describes the what and how to test preview features with your app. You should
+  prioritize testing of these specific preview features, due to their high potential impact on your
+  app's behavior:
+</p>
+
+<ul>
+  <li><a href="#runtime-permissions">Runtime Permissions</a>
+  </li>
+  <li><a href="#doze-mode">Doze and App Standby</a>
+  </li>
+</ul>
+
+<p>
+  For more information about how to set up devices or virtual devices with a preview system image
+  for testing, see <a href="{@docRoot}preview/setup-sdk.html">Set up the Preview SDK</a>.
+</p>
+
+
+<h2 id="runtime-permissions">Testing Runtime Permissions</h2>
+
+<p>
+  The <a href="{@docRoot}preview/features/runtime-permissions.html">Runtime Permissions</a> feature
+  changes the way that permissions are allocated to your app by the user. Instead of granting all
+  permissions during the install procedure, your app must ask the user for individual permissions
+  at runtime. For users this behavior provides more granular control over each app’s activities, as
+  well as better context for understanding why the app is requesting a specific permission. Users
+  can grant or revoke the permissions granted to an app individually at any time. This feature of
+  the preview is most likely to have an impact on your app's behavior and may prevent some of your
+  app features from working, or they may work in a degraded state.
+</p>
+
+<p>
+  This change that affects all apps running on the new platform, even those not targeting the new
+  platform version. The platform provides a limited compatibility behavior for legacy apps, but you
+  should begin planning your app’s migration to the new permissions model now, with a goal of
+  publishing an updated version of your app at the official platform launch.
+</p>
+
+
+<h3 id="permission-test-tips">Test tips</h3>
+
+<p>
+  Use the following test tips to help you plan and execute testing of your app with the new
+  permissions behavior.
+</p>
+
+<ul>
+  <li>Identify your app’s current permissions and the related code paths.</li>
+  <li>Test user flows across permission-protected services and data.</li>
+  <li>Test with various combinations of granted/revoked permission.</li>
+  <li>Use the {@code adb} tool to manage permssions from the command line:
+    <ul>
+      <li>List permissions and status by group:
+        <pre>adb shell pm list permissions -d -g</pre>
+      </li>
+      <li>Grant or revoke one or more permissions using the following syntax:<br>
+        <pre>adb shell pm [grant|revoke] &lt;permission.name&gt; ...</pre>
+      </li>
+    </ul>
+  </li>
+  <li>Analyze your app for services that use permissions.</li>
+</ul>
+
+<h3 id="permission-test-strategy">Test strategy</h3>
+
+<p>
+  The Runtime Permissions change affects the structure and design of your app, as well as
+  the user experience and flows you provide to users. You should assess your app’s current
+  permissions use and start planning for the new flows you want to offer. The official release of
+  the platform provides compatibility behavior, but you should plan on updating your app and not
+  rely on these behaviors.
+</p>
+
+<p>
+  Identify the permissions that your app actually needs and uses, and then find the various code
+  paths that use the permission-protected services. You can do this through a combination of
+  testing on the new platform and code analysis. In testing, you should focus on opting in to
+  runtime permissions by changing the app’s {@code targetSdkVersion} to the preview version. For
+  more information, see <a href="{@docRoot}preview/setup-sdk.html#">Set up the Preview SDK</a>.
+</p>
+
+<p>
+  Test with various combinations of permissions revoked and added, to highlight the user flows that
+  depend on permissions. Where a dependency is not obvious or logical you should consider
+  refactoring or compartmentalizing that flow to eliminate the dependency or make it clear why the
+  permission is needed.
+</p>
+
+<p>
+  For more information on the behavior of Runtime Permissions, testing, and best practices, see the
+  <a href="{@docRoot}preview/features/runtime-permissions.html">Runtime Permissions</a> developer
+  preview page.
+</p>
+
+
+<h2 id="doze-standby">Testing Doze and App Standby</h2>
+
+<p>
+  The power saving features of Doze and App Standby limits the amount of background processing that
+  your app can perform when a device is in an idle state or while your app is not in focus. The
+  restrictions the system may impose on apps include limited or no network access,
+  suspended background tasks, suspended Notifications, ignored wake requests, and alarms. To ensure
+  that your app behaves properly with these power saving optimizations, you should test your app by
+  simulating these low power states.
+</p>
+
+<h4 id="doze">Testing your app with Doze</h4>
+
+<p>To test Doze with your app:</p>
+
+<ol>
+<li>Configure a hardware device or virtual device with a M Preview system image.</li>
+<li>Connect the device to your development machine and install your app.</li>
+<li>Run your app and leave it active.</li>
+<li>Simulate the device going into Doze mode by running the following commands:
+
+<pre>
+$ adb shell dumpsys battery unplug
+$ adb shell dumpsys deviceidle step
+$ adb shell dumpsys deviceidle -h
+</pre>
+
+  </li>
+  <li>Observe the behavior of your app when the device is re-activated. Make sure it
+    recovers gracefully when the device exits Doze.</li>
+</ol>
+
+
+<h4 id="standby">Testing apps with App Standby</h4>
+
+<p>To test the App Standby mode with your app:</p>
+
+<ol>
+  <li>Configure a hardware device or virtual device with a M Preview system image.</li>
+  <li>Connect the device to your development machine and install your app.</li>
+  <li>Run your app and leave it active.</li>
+  <li>Simulate the app going into standby mode by running the following commands:
+
+<pre>
+$ adb shell am broadcast -a android.os.action.DISCHARGING
+$ adb shell am set-idle &lt;packageName&gt; true
+</pre>
+
+  </li>
+  <li>Simulate waking your app using the following command:
+    <pre>$ adb shell am set-idle &lt;packageName&gt; false</pre>
+  </li>
+  <li>Observe the behavior of your app when it is woken. Make sure it recovers gracefully
+    from standby mode. In particular, you should check if your app's Notifications and background
+    jobs continue to function as expected.</li>
+</ol>
diff --git a/docs/html/preview/testing/performance.jd b/docs/html/preview/testing/performance.jd
new file mode 100644
index 0000000..a61091f
--- /dev/null
+++ b/docs/html/preview/testing/performance.jd
@@ -0,0 +1,667 @@
+page.title=Testing Display Performance
+
+@jd:body
+
+
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+      <ol>
+        <li><a href="#measure">Measuring UI Performance</a>
+          <ul>
+            <li><a href="#aggregate">Aggregate frame stats</a></li>
+            <li><a href="#timing-info">Precise frame timing info</a></li>
+            <li><a href="#timing-dump">Simple frame timing dump</a></li>
+            <li><a href="#collection-window">Controlling the window of stat collection</a></li>
+            <li><a href="#diagnose">Diagnosing performance regressions</a></li>
+            <li><a href="#resources">Additional resources</a></li>
+          </ul>
+        </li>
+        <li><a href="#automate">Automating UI Perfomance Tests</a>
+          <ul>
+            <li><a href="#ui-tests">Setting up UI tests</a></li>
+            <li><a href="#automated-tests">Setting up automated UI testing</a></li>
+            <li><a href="#triage">Triaging and fixing observed problems</a></li>
+          </ul>
+        </li>
+      </ol>
+  </div>
+</div>
+
+
+<p>
+  User interface (UI) performance testing ensures that your app not only meets its functional
+  requirements, but that user interactions with your app are buttery smooth, running at a
+  consistent 60 frames per second (<a href=
+  "https://www.youtube.com/watch?v=CaMTIgxCSqU&amp;index=25&amp;list=PLWz5rJ2EKKc9CBxr3BVjPTPoDPLdPIFCE">why
+  60fps?</a>), without any dropped or delayed frames, or as we like to call it, <em>jank</em>. This
+  document explains tools available to measure UI performance, and lays out an approach to
+  integrate UI performance measurements into your testing practices.
+</p>
+
+
+<h2 id="measure">Measuring UI Performance</h2>
+
+<p>
+  In order to improve performance you first need the ability to measure the performance of
+  your system, and then diagnose and identify problems that may arrive from various parts of your
+  pipeline.
+</p>
+
+<p>
+  <em><a href="https://source.android.com/devices/tech/debug/dumpsys.html">dumpsys</a></em> is an
+  Android tool that runs on the device and dumps interesting information about the status of system
+  services. Passing the <em>gfxinfo</em> command to dumpsys provides an output in logcat with
+  performance information relating to frames of animation that are occurring during the recording
+  phase.
+</p>
+
+<pre>
+&gt; adb shell dumpsys gfxinfo &lt;PACKAGE_NAME&gt;
+</pre>
+
+<p>
+  This command can produce multiple different variants of frame timing data.
+</p>
+
+<h3 id="aggregate">Aggregate frame stats</h3>
+
+<p>
+  With the M Preview the command prints out aggregated analysis of frame data to logcat, collected
+  across the entire lifetime of the process. For example:
+</p>
+
+<pre class="noprettyprint">
+Stats since: 752958278148ns
+Total frames rendered: 82189
+Janky frames: 35335 (42.99%)
+90th percentile: 34ms
+95th percentile: 42ms
+99th percentile: 69ms
+Number Missed Vsync: 4706
+Number High input latency: 142
+Number Slow UI thread: 17270
+Number Slow bitmap uploads: 1542
+Number Slow draw: 23342
+</pre>
+
+<p>
+  These high level statistics convey at a high level the rendering performance of the app, as well
+  as its stability across many frames.
+</p>
+
+
+<h3 id="timing-info">Precise frame timing info</h3>
+
+<p>
+  With the M Preview comes a new command for gfxinfo, and that’s <em>framestats</em> which provides
+  extremely detailed frame timing information from recent frames, so that you can track down and
+  debug problems more accurately.
+</p>
+
+<pre>
+&gt;adb shell dumpsys gfxinfo &lt;PACKAGE_NAME&gt; framestats
+</pre>
+
+<p>
+  This command prints out frame timing information, with nanosecond timestamps, from the last 120
+  frames produced by the app. Below is example raw output from adb dumpsys gfxinfo
+  &lt;PACKAGE_NAME&gt; framestats:
+</p>
+
+<pre class="noprettyprint">
+0,49762224585003,49762241251670,9223372036854775807,0,49762257627204,49762257646058,49762257969704,49762258002100,49762265541631,49762273951162,49762300914808,49762303675954,
+0,49762445152142,49762445152142,9223372036854775807,0,49762446678818,49762446705589,49762447268818,49762447388037,49762453551527,49762457134131,49762474889027,49762476150120,
+0,49762462118845,49762462118845,9223372036854775807,0,49762462595381,49762462619287,49762462919964,49762462968454,49762476194547,49762476483454,49762480214964,49762480911527,
+0,49762479085548,49762479085548,9223372036854775807,0,49762480066370,49762480099339,49762481013089,49762481085850,49762482232152,49762482478350,49762485657620,49762486116683,
+</pre>
+
+<p>
+  Each line of this output represents a frame produced by the app. Each line has a fixed number of
+  columns describing time spent in each stage of the frame-producing pipeline. The next section
+  describes this format in detail, including what each column represents.
+</p>
+
+
+<h4 id="fs-data-format">Framestats data format</h4>
+
+<p>
+  Since the block of data is output in CSV format, it's very straightforward to paste it to your
+  spreadsheet tool of choice, or collect and parse with a script. The following table explains the
+  format of the output data columns. All timestamps are in nanoseconds.
+</p>
+
+<ul>
+  <li>FLAGS
+    <ul>
+      <li>Rows with a ‘0’ for the FLAGS column can have their total frame time computed by
+      subtracting the INTENDED_VSYNC column from the FRAME_COMPLETED column.
+      </li>
+
+      <li>If this is non-zero the row should be ignored, as the frame has been determined as being
+      an outlier from normal performance, where it is expected that layout &amp; draw take longer
+      than 16ms. Here are a few reasons this could occur:
+        <ul>
+          <li>The window layout changed (such as the first frame of the application or after a
+          rotation)
+          </li>
+
+          <li>It is also possible the frame was skipped in which case some of the values will have
+          garbage timestamps. A frame can be skipped if for example it is out-running 60fps or if
+          nothing on-screen ended up being dirty, this is not necessarily a sign of a problem in
+          the app.
+          </li>
+        </ul>
+      </li>
+    </ul>
+  </li>
+
+  <li>VSYNC
+    <ul>
+      <li>The time value that was used in all the vsync listeners and drawing for the frame
+      (Choreographer frame callbacks, animations, View.getDrawingTime(), etc…)
+      </li>
+
+      <li>To understand more about VSYNC and how it influences your application, check out the
+      <a href=
+      "https://www.youtube.com/watch?v=1iaHxmfZGGc&amp;list=PLOU2XLYxmsIKEOXh5TwZEv89aofHzNCiu&amp;index=23">
+        Understanding VSYNC</a> video.
+      </li>
+    </ul>
+  </li>
+
+
+  <li>INTENDED_VSYNC
+    <ul>
+      <li>The intended start point for the frame. If this value is different from VSYNC, there
+      was work occurring on the UI thread that prevented it from responding to the vsync signal
+      in a timely fashion.
+      </li>
+    </ul>
+  </li>
+
+  <li>OLDEST_INPUT_EVENT
+    <ul>
+      <li>The timestamp of the oldest input event in the input queue, or Long.MAX_VALUE if
+      there were no input events for the frame.
+      </li>
+
+      <li>This value is primarily intended for platform work and has limited usefulness to app
+      developers.
+      </li>
+    </ul>
+  </li>
+
+  <li>NEWEST_INPUT_EVENT
+    <ul>
+      <li>The timestamp of the newest input event in the input queue, or 0 if there were no
+      input events for the frame.
+      </li>
+
+      <li>This value is primarily intended for platform work and has limited usefulness to app
+      developers.
+      </li>
+
+      <li>However it’s possible to get a rough idea of how much latency the app is adding by
+      looking at (FRAME_COMPLETED - NEWEST_INPUT_EVENT).
+      </li>
+    </ul>
+  </li>
+
+  <li>HANDLE_INPUT_START
+    <ul>
+      <li>The timestamp at which input events were dispatched to the application.
+      </li>
+
+      <li>By looking at the time between this and ANIMATION_START it is possible to measure how
+      long the application spent handling input events.
+      </li>
+
+      <li>If this number is high (&gt;2ms), this indicates the app is spending an unusually
+      long time processing input events, such as View.onTouchEvent(), which may indicate this
+      work needs to be optimized, or offloaded to a different thread. Note that there are some
+      scenarios, such as click events that launch new activities or similar, where it is
+      expected and acceptable that this number is large.
+      </li>
+    </ul>
+  </li>
+
+  <li>ANIMATION_START
+    <ul>
+      <li>The timestamp at which animations registered with Choreographer were run.
+      </li>
+
+      <li>By looking at the time between this and PERFORM_TRANVERSALS_START it is possible to
+      determine how long it took to evaluate all the animators (ObjectAnimator,
+      ViewPropertyAnimator, and Transitions being the common ones) that are running.
+      </li>
+
+      <li>If this number is high (&gt;2ms), check to see if your app has written any custom
+      animators or what fields ObjectAnimators are animating and ensure they are appropriate
+      for an animation.
+      </li>
+
+      <li>To learn more about Choreographer, check out the <a href=
+      "https://developers.google.com/events/io/sessions/325418001">For Butter or Worse</a>
+      video.
+      </li>
+    </ul>
+  </li>
+
+  <li>PERFORM_TRAVERSALS_START
+    <ul>
+      <li>If you subtract out DRAW_START from this value, you can extract how long the layout
+      &amp; measure phases took to complete. (note, during a scroll, or animation, you would
+      hope this should be close to zero..)
+      </li>
+
+      <li>To learn more about the measure &amp; layout phases of the rendering pipeline, check
+      out the <a href=
+      "https://www.youtube.com/watch?v=we6poP0kw6E&amp;list=PLOU2XLYxmsIKEOXh5TwZEv89aofHzNCiu&amp;index=27">
+        Invalidations, Layouts and Performance</a> video
+      </li>
+    </ul>
+  </li>
+
+  <li>DRAW_START
+    <ul>
+      <li>The time at which the draw phase of performTraversals started. This is the start
+      point of recording the display lists of any views that were invalidated.
+      </li>
+
+      <li>The time between this and SYNC_START is how long it took to call View.draw() on all
+      the invalidated views in the tree.
+      </li>
+
+      <li>For more information on the drawing model, see <a href=
+      "{@docRoot}guide/topics/graphics/hardware-accel.html#hardware-model">Hardware Acceleration</a>
+      or the <a href=
+      "https://www.youtube.com/watch?v=we6poP0kw6E&amp;list=PLOU2XLYxmsIKEOXh5TwZEv89aofHzNCiu&amp;index=27">
+        Invalidations, Layouts and Performance</a> video
+      </li>
+    </ul>
+  </li>
+
+  <li>SYNC_START
+    <ul>
+      <li>The time at which the sync phase of the drawing started.
+      </li>
+
+      <li>If the time between this and ISSUE_DRAW_COMMANDS_START is substantial (&gt;0.4ms or
+      so), it typically indicates a lot of new Bitmaps were drawn which must be uploaded to the
+      GPU.
+      </li>
+
+      <li>To understand more about the sync phase, check out the <a href=
+      "https://www.youtube.com/watch?v=VzYkVL1n4M8&amp;index=24&amp;list=PLOU2XLYxmsIKEOXh5TwZEv89aofHzNCiu">
+        Profile GPU Rendering</a> video
+      </li>
+    </ul>
+  </li>
+
+  <li>ISSUE_DRAW_COMMANDS_START
+    <ul>
+      <li>The time at which the hardware renderer started issuing drawing commands to the GPU.
+      </li>
+
+      <li>The time between this and FRAME_COMPLETED gives a rough idea of how much GPU work the
+      app is producing. Problems like too much overdraw or inefficient rendering effects show
+      up here.
+      </li>
+    </ul>
+  </li>
+
+  <li>SWAP_BUFFERS
+    <ul>
+      <li>The time at which eglSwapBuffers was called, relatively uninteresting outside of
+      platform work.
+      </li>
+    </ul>
+  </li>
+
+  <li>FRAME_COMPLETED
+    <ul>
+      <li>All done! The total time spent working on this frame can be computed by doing
+      FRAME_COMPLETED - INTENDED_VSYNC.
+      </li>
+    </ul>
+  </li>
+
+</ul>
+
+<p>
+  You can use this data in different ways. One simple but useful visualization is a
+  histogram showing the distribution of frames times (FRAME_COMPLETED - INTENDED_VSYNC) in
+  different latency buckets, see figure below. This graph tells us at a glance that most
+  frames were very good - well below the 16ms deadline (depicted in red), but a few frames
+  were significantly over the deadline. We can look at changes in this histogram over time
+  to see wholesale shifts or new outliers being created. You can also graph input latency,
+  time spent in layout, or other similar interesting metrics based on the many timestamps
+  in the data.
+</p>
+
+<img src="{@docRoot}preview/images/perf-test-framestats.png">
+
+
+<h3 id="timing-dump">Simple frame timing dump</h3>
+
+<p>
+  If <strong>Profile GPU rendering</strong> is set to <strong>In adb shell dumpsys gfxinfo</strong>
+  in Developer Options, the <code>adb shell dumpsys gfxinfo</code> command prints out timing
+  information for the most recent 120 frames, broken into a few different categories with
+  tab-separated-values. This data can be useful for indicating which parts of the drawing pipeline
+  may be slow at a high level.
+</p>
+
+<p>
+  Similar to <a href="#fs-data-format">framestats</a> above, it's very
+  straightforward to paste it to your spreadsheet tool of choice, or collect and parse with
+  a script. The following graph shows a breakdown of where many frames produced by the app
+  were spending their time.
+</p>
+
+<img src="{@docRoot}preview/images/perf-test-frame-latency.png">
+
+<p>
+  The result of running gfxinfo, copying the output, pasting it into a spreadsheet
+  application, and graphing the data as stacked bars.
+</p>
+
+<p>
+  Each vertical bar represents one frame of animation; its height represents the number of
+  milliseconds it took to compute that frame of animation. Each colored segment of the bar
+  represents a different stage of the rendering pipeline, so that you can see what parts of
+  your application may be creating a bottleneck. For more information on understanding the
+  rendering pipeline, and how to optimize for it, see the <a href=
+  "https://www.youtube.com/watch?v=we6poP0kw6E&amp;index=27&amp;list=PLWz5rJ2EKKc9CBxr3BVjPTPoDPLdPIFCE">
+  Invalidations Layouts and Performance</a> video.
+</p>
+
+
+<h3 id="collection-window">Controlling the window of stat collection</h3>
+
+<p>
+  Both the framestats and simple frame timings gather data over a very short window - about
+  two seconds worth of rendering. In order to precisely control this window of time - for
+  example, to constrain the data to a particular animation - you can reset all counters,
+  and aggregate statistics gathered.
+</p>
+
+<pre>
+&gt;adb shell dumpsys gfxinfo &lt;PACKAGE_NAME&gt; reset
+</pre>
+
+<p>
+  This can also be used in conjunction with the dumping commands themselves to collect and
+  reset at a regular cadence, capturing less-than-two-second windows of frames
+  continuously.
+</p>
+
+
+<h3 id="diagnose">Diagnosing performance regressions</h3>
+
+<p>
+  Identification of regressions is a good first step to tracking down problems, and
+  maintaining high application health. However, dumpsys just identifies the existence and
+  relative severity of problems. You still need to diagnose the particular cause of the
+  performance problems, and find appropriate ways to fix them. For that, it’s highly
+  recommended to use the <a href="{@docRoot}tools/help/systrace.html">systrace</a> tool.
+</p>
+
+
+<h3 id="resources">Additional resources</h3>
+
+<p>
+  For more information on how Android’s rendering pipeline works, common problems that you
+  can find there, and how to fix them, some of the following resources may be useful to
+  you:
+</p>
+
+<ul>
+  <li>Rendering Performance 101
+  </li>
+  <li>Why 60fps?
+  </li>
+  <li>Android UI and the GPU
+  </li>
+  <li>Invalidations Layouts and performance
+  </li>
+  <li>Analyzing UI Performance with Systrace
+  </li>
+</ul>
+
+
+<h2 id="automate">Automating UI Perfomance Tests</h2>
+
+<p>
+  One approach to UI Performance testing is to simply have a human tester perform a set of
+  user operations on the target app, and either visually look for jank, or spend an very
+  large amount of time using a tool-driven approach to find it. But this manual approach is
+  fraught with peril - human ability to perceive frame rate changes varies tremendously,
+  and this is also time consuming, tedious, and error prone.
+</p>
+
+<p>
+  A more efficient approach is to log and analyze key performance metrics from automated UI
+  tests. The Android M developer preview includes new logging capabilities which make it
+  easy to determine the amount and severity of jank in your application’s animations, and
+  that can be used to build a rigorous process to determine your current performance and
+  track future performance objectives.
+</p>
+
+<p>
+  This article walks you through a recommended approach to using that data to automate your
+  performance testing.
+</p>
+
+<p>
+  This is mostly broken down into two key actions. Firstly, identifying what you're
+  testing, and how you’re testing it. and Secondly, setting up, and maintaining an
+  automated testing environment.
+</p>
+
+
+<h3 id="ui-tests">Setting up UI tests</h3>
+
+<p>
+  Before you can get started with automated testing, it’s important to determine a few high
+  level decisions, in order to properly understand your test space, and needs you may have.
+</p>
+
+<h4>
+  Identify key animations / flows to test
+</h4>
+
+<p>
+  Remember that bad performance is most visible to users when it interrupts a smooth
+  animation. As such, when identifying what types of UI actions to test for, it’s useful to
+  focus on the key animations that users see most, or are most important to their
+  experience. For example, here are some common scenarios that may be useful to identify:
+</p>
+
+<ul>
+  <li>Scrolling a primary ListView or RecyclerView
+  </li>
+
+  <li>Animations during async wait cycles
+  </li>
+
+  <li>Any animation that may have bitmap loading / manipulation in it
+  </li>
+
+  <li>Animations including Alpha Blending
+  </li>
+
+  <li>Custom View drawing with Canvas
+  </li>
+</ul>
+
+<p>
+  Work with engineers, designers, and product managers on your team to prioritize these key
+  product animations for test coverage.
+</p>
+
+<h4>
+  Define your future objectives and track against them
+</h4>
+
+<p>
+  From a high-level, it may be critical to identify your specific performance goals, and
+  focus on writing tests, and collecting data around them. For example:
+</p>
+
+<ul>
+  <li>Do you just want to begin tracking UI performance for the first time to learn more?
+  </li>
+
+  <li>Do you want to prevent regressions that might be introduced in the future?
+  </li>
+
+  <li>Are you at 90% of smooth frames today and want to get to 98% this quarter?
+  </li>
+
+  <li>Are you at 98% smooth frames and don’t want to regress?
+  </li>
+
+  <li>Is your goal to improve performance on low end devices?
+  </li>
+</ul>
+
+<p>
+  In all of these cases, you’ll want historical tracking which shows performance across
+  multiple versions of your application.
+</p>
+
+<h4>
+  Identify devices to test on
+</h4>
+
+<p>
+  Application performance varies depending on the device it's running on. Some devices may
+  contain less memory, less powerful GPUs, or slower CPU chips. This means that animations
+  which may perform well on one set of hardware, may not on others, and worse, may be a
+  result of a bottleneck in a different part of the pipeline. So, to account for this
+  variation in what a user might see, pick a range of devices to execute tests on, both
+  current high end devices, low end devices, tablets, etc. Look for variation in CPU
+  performance, RAM, screen density, size, and so on. Tests that pass on a high end device
+  may fail on a low end device.
+</p>
+
+<h4>
+  Basic frameworks for UI Testing
+</h4>
+
+<p>
+  Tool suites like <a href=
+  "https://developer.android.com/tools/testing-support-library/index.html">UIAutomator</a>,
+  and <a href="https://code.google.com/p/android-test-kit/">Espresso</a> are built to help
+  automate the action of a user moving through your application. These are simple
+  frameworks which mimic user interaction with your device. To use these frameworks, you
+  effectively create unique scripts, which run through a set of user-actions, and play them
+  out on the device itself.
+</p>
+
+<p>
+  By combining these automated tests, alongside <code>dumpsys gfxinfo</code> you can quickly
+  create a reproducible system that allows you to execute a test, and measure the
+  performance information of that particular condition.
+</p>
+
+
+<h3 id="automated-tests">Setting up automated UI testing</h3>
+
+<p>
+  Once you have the ability to execute a UI test, and a pipeline to gather the data from a
+  single test, the next important step is to embrace a framework which can execute that
+  test multiple times, across multiple devices, and aggregate the resulting performance
+  data for further analysis by your development team.
+</p>
+
+<h4>
+  A framework for test automation
+</h4>
+
+<p>
+  It’s worth noting that UI testing frameworks (like <a href=
+  "https://developer.android.com/tools/testing-support-library/index.html">UIAutomator</a>)
+  run on the target device/emulator directly. While performance gathering information done
+  by <em>dumpsys gfxinfo</em> is driven by a host machine, sending commands over ADB. To
+  help bridge the automation of these separate entities, <a href=
+  "{@docRoot}tools/help/monkeyrunner_concepts.html">MonkeyRunner</a> framework was
+  developed; A scripting system that runs on your host machine, which can issue commands to
+  a set of connected devices, as well as receive data from them.
+</p>
+
+<p>
+  Building a set of scripts for proper Automation of UI Performance testing, at a minimum,
+  should be able to utilize monkeyRunner to accomplish the following tasks:
+</p>
+
+<ul>
+  <li>Load &amp; Launch a desired APK to a target device, devices, or emulator.
+  </li>
+
+  <li>Launch a UIAutomator UI test, and allow it to be executed
+  </li>
+
+  <li>Collect performance information through <em>dumpsys gfxinfo</em><em>.</em>
+  </li>
+
+  <li>Aggregate information and display it back in a useful fashion to the developer.
+  </li>
+</ul>
+
+
+<h3 id="triage">Triaging and fixing observed problems</h3>
+
+<p>
+  Once problem patterns or regressions are identified, the next step is identifying and
+  applying the fix. If your automated test framework preserves precise timing breakdowns
+  for frames, it can help you scrutinize recent suspicious code/layout changes (in the case
+  of regression), or narrow down the part of the system you’re analyzing when you switch to
+  manual investigation. For manual investigation, <a href=
+  "{@docRoot}tools/help/systrace.html">systrace</a> is a great place to start, showing
+  precise timing information about every stage of the rendering pipeline, every thread and
+  core in the system, as well as any custom event markers you define.
+</p>
+
+<h4>
+  Properly profiling temporal timings
+</h4>
+
+<p>
+  It is important to note the difficulties in obtaining and measuring timings that come from
+  rendering performance. These numbers are, by nature, non deterministic, and often
+  fluctuate depending on the state of the system, amount of memory available, thermal
+  throttling, and the last time a sun flare hit your area of the earth. The point is that
+  you can run the same test, twice and get slightly different numbers that may be close to
+  each other, but not exact.
+</p>
+
+<p>
+  Properly gathering and profiling data in this manner means running the same test,
+  multiple times, and accumulating the results as an average, or median value. (for the
+  sake of simplicity, let’s call this a ‘batch’) This gives you the rough approximation of
+  the performance of the test, while not needing exact timings.
+</p>
+
+<p>
+  Batches can be used between code changes to see the relative impact of those changes on
+  performance. If the average frame rate for the pre-change Batch is larger than the
+  post-change batch, then you generally have an overall win wrt performance for that
+  particular change.
+</p>
+
+<p>
+  This means that any Automated UI testing you do should take this concept into
+  consideration, and also account for any anomalies that might occur during a test. For
+  example, if your application performance suddenly dips, due to some device issue (that
+  isn’t caused by your application) then you may want to re-run the batch in order to get
+  less chaotic timings.
+</p>
+
+<p>
+  So, how many times should you run a test, before the measurements become meaningful? 10
+  times should be the minimum, with higher numbers like 50 or 100 yielding more accurate
+  results (of course, you’re now trading off time for accuracy)
+</p>
diff --git a/docs/html/tools/data-binding/guide.jd b/docs/html/tools/data-binding/guide.jd
new file mode 100644
index 0000000..6a933d8
--- /dev/null
+++ b/docs/html/tools/data-binding/guide.jd
@@ -0,0 +1,1435 @@
+page.title=Data Binding Guide
+page.tags="databinding", "layouts"
+@jd:body
+
+<div class="wrap">
+<p class="caution" style="background-color:#fffdeb;">
+The <strong>Android Data Binding Library</strong> is available as a <strong>developer
+preview</strong>. Expression syntax and behaviors may change prior to the full release
+of the library, currently planned for Q3 2015. If you have feedback or want to report
+issues, please use the <a href="https://code.google.com/p/android-developer-preview/">issue
+tracker</a>. Stay tuned for more information about Data Binding and examples of how to use it. </a>
+</p>
+</div>
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>
+      In this document:
+    </h2>
+
+    <ol>
+      <li>
+        <a href="#build_environment">Build Environment</a>
+      </li>
+
+      <li>
+        <a href="#data_binding_layout_files">Data Binding Layout Files</a>
+        <ol>
+          <li>
+            <a href="writing_expressions">Writing your first data binding
+            expressions</a>
+          </li>
+
+          <li>
+            <a href="data_object">Data Object</a>
+          </li>
+
+          <li>
+            <a href="binding_data">Binding Data</a>
+          </li>
+        </ol>
+      </li>
+
+      <li>
+        <a href="#layout_details">Layout Details</a>
+        <ol>
+          <li>
+            <a href="imports">Imports</a>
+          </li>
+
+          <li>
+            <a href="variables">Variables</a>
+          </li>
+
+          <li>
+            <a href="custom_binding_class_names">Custom Binding Class Names</a>
+          </li>
+
+          <li>
+            <a href="includes">Includes</a>
+          </li>
+
+          <li>
+            <a href="expression_language">Expression Language</a>
+          </li>
+        </ol>
+      </li>
+
+      <li>
+        <a href="#data_objects">Data Objects</a>
+        <ol>
+          <li>
+            <a href="observable_objects">Observable Objects</a>
+          </li>
+
+          <li>
+            <a href="observablefields">ObservableFields</a>
+          </li>
+
+          <li>
+            <a href="observable_collections">Observable Collections</a>
+          </li>
+        </ol>
+      </li>
+
+      <li>
+        <a href="#generated_binding">Generated Binding</a>
+        <ol>
+          <li>
+            <a href="creating">Creating</a>
+          </li>
+
+          <li>
+            <a href="views_with_ids">Views With IDs</a>
+          </li>
+
+          <li>
+            <a href="variables">Variables</a>
+          </li>
+
+          <li>
+            <a href="viewstubs">ViewStubs</a>
+          </li>
+
+          <li>
+            <a href="advanced_binding">Advanced Binding</a>
+          </li>
+        </ol>
+      </li>
+
+      <li>
+        <a href="#attribute_setters">Attribute Setters</a>
+        <ol>
+          <li>
+            <a href="automatic_setters">Automatic Setters</a>
+          </li>
+
+          <li>
+            <a href="renamed_setters">Renamed Setters</a>
+          </li>
+
+          <li>
+            <a href="custom_setters">Custom Setters</a>
+          </li>
+        </ol>
+      </li>
+
+      <li>
+        <a href="#converters">Converters</a>
+        <ol>
+          <li>
+            <a href="object_conversions">Object Conversions</a>
+          </li>
+
+          <li>
+            <a href="custom_conversions">Custom Conversions</a>
+          </li>
+        </ol>
+      </li>
+    </ol>
+  </div><!-- qv -->
+</div><!-- qv-wrapper -->
+
+
+<p>
+  This document explains how to use the Data Binding Library to write
+  declarative layouts and minimize the glue code necessary to bind your
+  application logic and layouts.
+</p>
+
+<h2 id="build_environment">
+  Build Environment
+</h2>
+
+<p>
+  <strong>Setting Up Work Environment:</strong>
+</p>
+
+<p>
+  To set up your application to use data binding, add data binding to the class
+  path of your build gradle file, right below "android".
+</p>
+
+<pre>
+   dependencies {
+       classpath <strong>"com.android.tools.build:gradle:1.2.3"
+       </strong>classpath <strong>"com.android.databinding:dataBinder:</strong>1.0-rc0"
+   }
+}
+</pre>
+<p>
+  Then make sure jcenter is in the repositories list for your sub projects.
+</p>
+
+<pre>
+allprojects {
+   repositories {
+       jcenter()
+   }
+}
+</pre>
+<p>
+  In each module you want to use data binding, apply the plugin right after
+  android plugin
+</p>
+
+<pre>
+apply plugin: ‘com.android.application&apos;
+apply plugin: &apos;<strong>com.android.databinding</strong>&apos;
+</pre>
+<p>
+  The data binding plugin is going to add necessary <strong>provided</strong>
+  and <strong>compile configuration</strong> dependencies to your project.
+</p>
+
+<h2 id="data_binding_layout_files">
+  Data Binding Layout Files
+</h2>
+
+<h3 id="writing_expressions">
+  Writing your first data binding expressions
+</h3>
+
+<p>
+  Data-binding layout files are slightly different and start with a root tag of
+  <strong>layout</strong> followed by a <strong>data</strong> element and a
+  <strong>view</strong> root element. This view element is what your root would
+  be in a non-binding layout file. A sample file looks like this:
+</p>
+
+<pre>
+<em>&lt;?</em><strong>xml version="1.0" encoding="utf-8"</strong><em>?&gt;
+</em>&lt;<strong>layout xmlns:android="http://schemas.android.com/apk/res/android"</strong>&gt;
+   &lt;<strong>data</strong>&gt;
+       &lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
+   &lt;/<strong>data</strong>&gt;
+   &lt;<strong>LinearLayout
+       android:orientation="vertical"
+       android:layout_width="match_parent"
+       android:layout_height="match_parent"</strong>&gt;
+       &lt;<strong>TextView android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           android:text="&commat;{user.firstName}"</strong>/&gt;
+       &lt;<strong>TextView android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           android:text="&commat;{user.lastName}"</strong>/&gt;
+   &lt;/<strong>LinearLayout</strong>&gt;
+&lt;/<strong>layout</strong>&gt;
+</pre>
+<p>
+  The user <strong>variable</strong> within <strong>data</strong> describes a
+  property that may be used within this layout.
+</p>
+
+<pre>
+&lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
+</pre>
+<p>
+  Expressions within the layout are written in the attribute properties using
+  the “<code>&commat;{}</code>” syntax. Here, the TextView’s text is set to the
+  firstName property of user:
+</p>
+
+<pre>
+&lt;<strong>TextView android:layout_width="wrap_content"
+          android:layout_height="wrap_content"
+          android:text="&commat;{user.firstName}"</strong>/&gt;
+</pre>
+<h3 id="data_object">
+  Data Object
+</h3>
+
+<p>
+  Let’s assume for now that you have a plain-old Java object (POJO) for User:
+</p>
+
+<pre>
+<strong>public class </strong>User {
+   <strong>public final </strong>String <strong>firstName</strong>;
+   <strong>public final </strong>String <strong>lastName</strong>;
+   <strong>public </strong>User(String firstName, String lastName) {
+       <strong>this</strong>.<strong>firstName </strong>= firstName;
+       <strong>this</strong>.<strong>lastName </strong>= lastName;
+   }
+}
+</pre>
+<p>
+  This type of object has data that never changes. It is common in applications
+  to have data that is read once and never changes thereafter. It is also
+  possible to use a JavaBeans objects:
+</p>
+
+<pre>
+<strong>public class </strong>User {
+   <strong>private final </strong>String <strong>firstName</strong>;
+   <strong>private final </strong>String <strong>lastName</strong>;
+   <strong>public </strong>User(String firstName, String lastName) {
+       <strong>this</strong>.<strong>firstName </strong>= firstName;
+       <strong>this</strong>.<strong>lastName </strong>= lastName;
+   }
+   <strong>public </strong>String getFirstName() {
+       <strong>return this</strong>.<strong>firstName</strong>;
+   }
+   <strong>public </strong>String getLastName() {
+       <strong>return this</strong>.<strong>lastName</strong>;
+   }
+}
+</pre>
+<p>
+  From the perspective of data binding, these two classes are equivalent. The
+  expression <strong><code>&commat;{user.firstName}</code></strong> used for
+  the TextView’s <strong><code>android:text</code></strong> attribute will
+  access the <strong><code>firstName</code></strong> field in the former class
+  and the <code>getFirstName()</code> method in the latter class.
+</p>
+
+<h3 id="binding_data">
+  Binding Data
+</h3>
+
+<p>
+  By default, a Binding class will be generated based on the name of the layout
+  file, converting it to Pascal case and suffixing “Binding” to it. The above
+  layout file was <code>activity_main.xml</code> so the generate class was
+  <code>ActivityMainBinding</code>. This class holds all the bindings from the
+  layout properties (e.g. the <code>user</code> variable) to the layout’s Views
+  and knows how to assign values for the binding expressions.The easiest means
+  for creating the bindings is to do it while inflating:
+</p>
+
+<pre>
+&commat;Override
+<strong>protected void </strong>onCreate(Bundle savedInstanceState) {
+   <strong>super</strong>.onCreate(savedInstanceState);
+   ActivityMainBinding binding = DataBindingUtil.<em>setContentView</em>(<strong>this</strong>, R.layout.<em><strong>main_activity</strong></em>);
+   User user = <strong>new </strong>User(<strong>"Test"</strong>, <strong>"User"</strong>);
+   binding.setUser(user);
+}
+</pre>
+<p>
+  You’re done! Run the application and you’ll see Test User in the UI.
+  Alternatively, you can get the view via:
+</p>
+
+<pre>
+MainActivityBinding binding = MainActivityBinding.<em>inflate</em>(getLayoutInflater());
+</pre>
+<p>
+  If you are using data binding items inside a ListView or RecyclerView
+  adapter, you may prefer to use:
+</p>
+
+<pre>
+ListItemBinding binding = ListItemBinding.inflate(layoutInflater, viewGroup,
+false);
+//or
+ListItemBinding binding = DataBindingUtil.<em>inflate</em>(layoutInflater, R.layout.<em><strong>list_item</strong></em>, viewGroup, <strong>false</strong>);
+</pre>
+<h2 id="layout_details">
+  Layout Details
+</h2>
+
+<h3 id="imports">
+  Imports
+</h3>
+
+<p>
+  Zero or more <strong><code>import</code></strong> elements may be used inside
+  the <strong><code>data</code></strong> element. These allow easy reference to
+  classes inside your layout file, just like in Java.
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.view.View"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+</pre>
+<p>
+  Now, View may be used within your binding expression:
+</p>
+
+<pre>
+&lt;<strong>TextView
+   android:text="&commat;{user.lastName}"
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"
+   android:visibility="&commat;{user.isAdult ? View.VISIBLE : View.GONE}"</strong>/&gt;
+</pre>
+<p>
+  When there are class name conflicts, one of the classes may be renamed to an
+  “alias:”
+</p>
+
+<pre>
+&lt;<strong>import type="android.view.View"</strong>/&gt;
+&lt;<strong>import type="com.example.real.estate.View"
+        alias="Vista"</strong>/&gt;
+</pre>
+<p>
+  Now, <strong><code>Vista</code></strong> may be used to reference the
+  <code>com.example.real.estate.View</code> and
+  <strong><code>View</code></strong> may be used to reference
+  <code>android.view.View</code> within the layout file. Imported types may be
+  used as type references in variables and expressions:
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="com.example.User"</strong>/&gt;
+    &lt;<strong>import type="java.util.List"</strong>/&gt;
+    &lt;<strong>variable name="user" type="User"</strong>/&gt;
+    &lt;<strong>variable name="userList" type="List&amp;lt;User&gt;"</strong>/&gt;
+    &lt;/<strong>data</strong>&gt;
+</pre>
+<p class="note">
+  <strong>Note</strong>: Android Studio does not yet handle imports so the
+  autocomplete for imported variables may not work in your IDE. Your
+  application will still compile fine and you can work around the IDE issue by
+  using fully qualified names in your variable definitions.
+</p>
+
+<pre>
+&lt;<strong>TextView
+   android:text="&commat;{((User)(user.connection)).lastName}"
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+<p>
+  Imported types may also be used when referencing static fields and methods in
+  expressions:
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="com.example.MyStringUtils"</strong>/&gt;
+    &lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+…
+&lt;<strong>TextView
+   android:text="&commat;{MyStringUtils.capitalize(user.lastName)}"
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+<p>
+  Just as in Java, <code>java.lang.*</code> is imported automatically.
+</p>
+
+<h3 id="variables">
+  Variables
+</h3>
+
+<p>
+  Any number of <strong><code>variable</code></strong> elements may be used
+  inside the <strong><code>data</code></strong> element. Each
+  <strong><code>variable</code></strong> element describes a property that may
+  be set on the layout to be used in binding expressions within the layout
+  file.
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.graphics.drawable.Drawable"</strong>/&gt;
+    &lt;<strong>variable name="user"  type="com.example.User"</strong>/&gt;
+    &lt;<strong>variable name="image" type="Drawable"</strong>/&gt;
+    &lt;<strong>variable name="note"  type="String"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+</pre>
+<p>
+  The variable types are inspected at compile time, so if a variable implements
+  <a href="#observable_objects">Observable</a> or is an <a href=
+  "#observable_collections">observable collection</a>, that should be reflected
+  in the type. If the variable is a base class or interface that does not
+  implement the Observable* interface, the variables will <strong>not
+  be</strong> observed!
+</p>
+
+<p>
+  When there are different layout files for various configurations (e.g.
+  landscape or portrait), the variables will be combined. There must not be
+  conflicting variable definitions between these layout files.
+</p>
+
+<p>
+  The generated binding class will have a setter and getter for each of the
+  described variables. The variables will take the default Java values until
+  the setter is called &mdash; <code>null</code> for reference types,
+  <code>0</code> for <code>int</code>, <code>false</code> for
+  <code>boolean</code>, etc.
+</p>
+
+<h3 id="custom_binding_class_names">
+  Custom Binding Class Names
+</h3>
+
+<p>
+  By default, a Binding class is generated based on the name of the layout
+  file, starting it with upper-case, removing underscores ( _ ) and
+  capitalizing the following letter and then suffixing “Binding”. This class
+  will be placed in a databinding package under the module package. For
+  example, the layout file <code>contact_item.xml</code> will generate
+  <code>ContactItemBinding</code>. If the module package is
+  <code>com.example.my.app</code>, then it will be placed in
+  <code>com.example.my.app.databinding</code>.
+</p>
+
+<p>
+  Binding classes may be renamed or placed in different packages by adjusting
+  the <strong><code>class</code></strong> attribute of the
+  <strong><code>data</code></strong> element. For example:
+</p>
+
+<pre>
+&lt;<strong>data class="ContactItem"</strong>&gt;
+    ...
+&lt;/<strong>data</strong>&gt;
+</pre>
+<p>
+  This generates the binding class as <code>ContactItem</code> in the
+  databinding package in the module package. If the class should be generated
+  in a different package within the module package, it may be prefixed with
+  “.”:
+</p>
+
+<pre>
+&lt;<strong>data class=".ContactItem"</strong>&gt;
+    ...
+&lt;/<strong>data</strong>&gt;
+</pre>
+<p>
+  In this case, <code>ContactItem</code> is generated in the module package
+  directly. Any package may be used if the full package is provided:
+</p>
+
+<pre>
+&lt;<strong>data class="com.example.ContactItem"</strong>&gt;
+    ...
+&lt;/<strong>data</strong>&gt;
+</pre>
+<h3 id="includes">
+  Includes
+</h3>
+
+<p>
+  Variables may be passed into an included layout&apos;s binding from the
+  containing layout by using the application namespace and the variable name in
+  an attribute:
+</p>
+
+<pre>
+<em>&lt;?</em><strong>xml version="1.0" encoding="utf-8"</strong><em>?&gt;
+</em>&lt;<strong>layout xmlns:android="http://schemas.android.com/apk/res/android"
+</strong>       <strong> xmlns:bind="http://schemas.android.com/apk/res-auto"</strong>&gt;
+   &lt;<strong>data</strong>&gt;
+       &lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
+   &lt;/<strong>data</strong>&gt;
+   &lt;<strong>LinearLayout
+       android:orientation="vertical"
+       android:layout_width="match_parent"
+       android:layout_height="match_parent"</strong>&gt;
+       &lt;<strong>include layout="&commat;layout/name"
+           bind:user="&commat;{user}"</strong>/&gt;
+       &lt;<strong>include layout="&commat;layout/contact"
+           bind:user="&commat;{user}"</strong>/&gt;
+   &lt;/<strong>LinearLayout</strong>&gt;
+&lt;/<strong>layout</strong>&gt;
+</pre>
+<p>
+  Here, there must be a <code>user</code> variable in both the
+  <code>name.xml</code> and <code>contact.xml</code> layout files.
+</p>
+
+<h3 id="expression_language">
+  Expression Language
+</h3>
+
+<h4 id="common_features">
+  Common Features
+</h4>
+
+<p>
+  The expression language looks a lot like a Java expression. These are the
+  same:
+</p>
+
+<ul>
+  <li>Mathematical <strong><code>+ - / * %</code></strong>
+  </li>
+
+  <li>String concatenation <strong><code>+</code></strong>
+  </li>
+
+  <li>
+    <code>L</code>ogical <strong><code>&& ||</code></strong>
+  </li>
+
+  <li>Binary <strong><code>&</code> <code>|</code> <code>^</code></strong>
+  </li>
+
+  <li>Unary <strong><code>+ - ! ~</code></strong>
+  </li>
+
+  <li>Shift <strong><code>&gt;&gt; &gt;&gt;&gt; &lt;&lt;</code></strong>
+  </li>
+
+  <li>Comparison <strong><code>== &gt; &lt; &gt;= &lt;=</code></strong>
+  </li>
+
+  <li>
+    <strong><code>instanceof</code></strong>
+  </li>
+
+  <li>Grouping <strong><code>()</code></strong>
+  </li>
+
+  <li>Literals - character, String, numeric, <strong><code>null</code></strong>
+  </li>
+
+  <li>Cast
+  </li>
+
+  <li>Method calls
+  </li>
+
+  <li>Field access
+  </li>
+
+  <li>Array access <strong><code>[]</code></strong>
+  </li>
+
+  <li>Ternary operator <strong><code>?:</code></strong>
+  </li>
+</ul>
+
+<p>
+  Examples:
+</p>
+
+<pre>
+<strong>android:text="&commat;{String.valueOf(index + 1)}"
+android:visibility="&commat;{age &amp;lt; 13 ? View.GONE : View.VISIBLE}"
+android:transitionName=&apos;&commat;{"image_" + id}&apos;</strong>
+</pre>
+<h4 id="missing_operations">
+  Missing Operations
+</h4>
+
+<p>
+  A few operations are missing from the expression syntax that you can use in
+  Java.
+</p>
+
+<ul>
+  <li>
+    <strong><code>this</code></strong>
+  </li>
+
+  <li>
+    <strong><code>super</code></strong>
+  </li>
+
+  <li>
+    <strong><code>new</code></strong>
+  </li>
+
+  <li>Explicit generic invocation
+  </li>
+</ul>
+
+<h4 id="null_coalescing_operator">
+  Null Coalescing Operator
+</h4>
+
+<p>
+  The null coalescing operator (<strong><code>??</code></strong>) chooses the
+  left operand if it is not null or the right if it is null.
+</p>
+
+<pre>
+<strong>android:text="&commat;{user.displayName ?? user.lastName}"</strong>
+</pre>
+<p>
+  This is functionally equivalent to:
+</p>
+
+<pre>
+<strong>android:text="&commat;{user.displayName != null ? user.displayName : user.lastName}"</strong>
+</pre>
+<h4 id="property_reference">
+  Property Reference
+</h4>
+
+<p>
+  The first was already discussed in the <a href=
+  "#writing_your_first_data_binding_expressions">Writing your first data
+  binding expressions</a> above: short form JavaBean references. When an
+  expression references a property on a class, it uses the same format for
+  fields, getters, and ObservableFields.
+</p>
+
+<pre>
+<strong>android:text="&commat;{user.lastName}"</strong>
+</pre>
+<h4>
+  Avoiding NullPointerException
+</h4>
+
+<p>
+  Generated data binding code automatically checks for nulls and avoid null
+  pointer exceptions. For example, in the expression
+  <code>&commat;{user.name}</code>, if <code>user</code> is null,
+  <code>user.name</code> will be assigned its default value (null). If you were
+  referencing <code>user.age</code>, where age is an <code>int</code>, then it
+  would default to 0.
+</p>
+
+<h4 id="collections">
+  Collections
+</h4>
+
+<p>
+  Common collections: arrays, lists, sparse lists, and maps, may be accessed
+  using the <code>[]</code> operator for convenience.
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.util.SparseArray"</strong>/&gt;
+    &lt;<strong>import type="java.util.Map"</strong>/&gt;
+    &lt;<strong>import type="java.util.List"</strong>/&gt;
+    &lt;<strong>variable name="list" type="List&lt;String&gt;"</strong>/&gt;
+    &lt;<strong>variable name="sparse" type="SparseArray&amp;lt;String&gt;"</strong>/&gt;
+    &lt;<strong>variable name="map" type="Map&amp;lt;String, String&gt;"</strong>/&gt;
+    &lt;<strong>variable name="index" type="int"</strong>/&gt;
+    &lt;<strong>variable name="key" type="String"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+…
+<strong>android:text="&commat;{list[index]}"
+</strong>…
+<strong>android:text="&commat;{sparse[index]}"
+</strong>…
+<strong>android:text="&commat;{map[key]}"
+</strong>
+</pre>
+<h4 id="string_literals">
+  String Literals
+</h4>
+
+<p>
+  When using single quotes around the attribute value, it is easy to use double
+  quotes in the expression:
+</p>
+
+<pre>
+<strong>android:text=&apos;&commat;{map["firstName"]}&apos;</strong>
+</pre>
+<p>
+  It is also possible to use double quotes to surround the attribute value.
+  When doing so, String literals should either use the &amp;quot; or back quote
+  (`).
+</p>
+
+<pre>
+<strong>android:text="&commat;{map[`firstName`}"
+android:text="&commat;{map[&amp;quot;firstName&amp;quot;]}"</strong>
+</pre>
+<h4 id="resources">
+  Resources
+</h4>
+
+<p>
+  It is possible to access resources as part of expressions using the normal
+  syntax:
+</p>
+
+<pre>
+<strong>android:padding="&commat;{large? &commat;dimen/largePadding : &commat;dimen/smallPadding}"</strong>
+</pre>
+<p>
+  Format strings and plurals may be evaluated by providing parameters:
+</p>
+
+<pre>
+<strong>android:text="&commat;{&commat;string/nameFormat(firstName, lastName)}"
+android:text="&commat;{&commat;plurals/banana(bananaCount)}"</strong>
+</pre>
+<p>
+  When a plural takes multiple parameters, all parameters should be passed:
+</p>
+
+<pre>
+
+  Have an orange
+  Have %d oranges
+
+android:text="<strong>&commat{&commatplurals/orange(orangeCount, orangeCount)}</strong>"
+</pre>
+<p>
+  Some resources require explicit type evaluation.
+</p>
+
+<table>
+  <tr>
+    <th>
+      Type
+    </th>
+    <th>
+      Normal Reference
+    </th>
+    <th>
+      Expression Reference
+    </th>
+  </tr>
+
+  <tr>
+    <td>
+      <pre>
+String[]
+</pre>
+    </td>
+    <td>
+      &commat;array
+    </td>
+    <td>
+      &commat;stringArray
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      int[]
+    </td>
+    <td>
+      &commat;array
+    </td>
+    <td>
+      &commat;intArray
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      TypedArray
+    </td>
+    <td>
+      &commat;array
+    </td>
+    <td>
+      &commat;typedArray
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      Animator
+    </td>
+    <td>
+      &commat;animator
+    </td>
+    <td>
+      &commat;animator
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      StateListAnimator
+    </td>
+    <td>
+      &commat;animator
+    </td>
+    <td>
+      &commat;stateListAnimator
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      color <code>int</code>
+    </td>
+    <td>
+      <pre>
+&commat;color
+</pre>
+    </td>
+    <td>
+      &commat;color
+    </td>
+  </tr>
+
+  <tr>
+    <td>
+      ColorStateList
+    </td>
+    <td>
+      &commat;color
+    </td>
+    <td>
+      &commat;colorStateList
+    </td>
+  </tr>
+</table>
+
+<h2 id="data_objects">
+  Data Objects
+</h2>
+
+<p>
+  Any plain old Java object (POJO) may be used for data binding, but modifying
+  a POJO will not cause the UI to update. The real power of data binding can be
+  used by giving your data objects the ability to notify when data changes.
+  There are three different data change notification mechanisms,
+  <code>Observable</code> objects, <code>ObservableField</code>s, and
+  <code>observable collections</code>.
+</p>
+
+<p>
+  When one of these observable data object is bound to the UI and a property of
+  the data object changes, the UI will be updated automatically.
+</p>
+
+<h3 id="observable_objects">
+  Observable Objects
+</h3>
+
+<p>
+  A class implementing <code>android.databinding.Observable</code> interface
+  will allow the binding to attach a single listener to a bound object to
+  listen for changes of all properties on that object.
+</p>
+
+<p>
+  The <code>Observable</code> interface has a mechanism to add and remove
+  listeners, but notifying is up to the developer. To make development easier,
+  a base class, <code>BaseObservable,</code> was created to implement the
+  listener registration mechanism. The data class implementer is still
+  responsible for notifying when the properties change. This is done by
+  assigning a <code>Bindable</code> annotation to the getter and notifying in
+  the setter.
+</p>
+
+<pre>
+<strong>private static class </strong>User <strong>extends </strong>BaseObservable {
+   <strong>private </strong>String <strong>firstName</strong>;
+   <strong>private </strong>String <strong>lastName</strong>;
+   &commat;Bindable
+   <strong>public </strong>String getFirstName() {
+       <strong>return this</strong>.<strong>firstName</strong>;
+   }
+   &commat;Bindable
+   <strong>public </strong>String getFirstName() {
+       <strong>return this</strong>.<strong>lastName</strong>;
+   }
+   <strong>public void </strong>setFirstName(String firstName) {
+       <strong>this</strong>.<strong>firstName </strong>= firstName;
+       notifyPropertyChanged(BR.firstName);
+   }
+   <strong>public void </strong>setLastName(String lastName) {
+       <strong>this</strong>.<strong>lastName </strong>= lastName;
+       notifyPropertyChanged(BR.lastName);
+   }
+}
+</pre>
+<p>
+  The <code>Bindable</code> annotation generates an entry in the BR class file
+  during compilation. The BR class file will be generated in the module
+  package.If the base class for data classes cannot be changed, the
+  <code>Observable</code> interface may be implemented using the convenient
+  <code>PropertyChangeRegistry</code> to store and notify listeners
+  efficiently.
+</p>
+
+<h3 id="observablefields">
+  ObservableFields
+</h3>
+
+<p>
+  A little work is involved in creating Observable classes, so developers who
+  want to save time or have few properties may use ObservableFields.
+  ObservableFields are self-contained observable objects that have a single
+  field. There are versions for all primitive types and one for reference
+  types. To use, create a public final field in the data class:
+</p>
+
+<pre>
+<strong>private static class </strong>User <strong>extends </strong>BaseObservable {
+   <strong>public final </strong>ObservableField&lt;String&gt; <strong>firstName </strong>=
+       <strong>new </strong>ObservableField&lt;&gt;();
+   <strong>public final </strong>ObservableField&lt;String&gt; <strong>lastName </strong>=
+       <strong>new </strong>ObservableField&lt;&gt;();
+   <strong>public final </strong>ObservableInt <strong>age </strong>= <strong>new </strong>ObservableInt();
+}
+</pre>
+<p>
+  That&apos;s it! To access the value, use the set and get accessor methods:
+</p>
+
+<pre>
+user.<strong>firstName</strong>.set(<strong>"Google"</strong>);
+<strong>int </strong>age = user.<strong>age</strong>.get();
+</pre>
+<h3 id="observable_collections">
+  Observable Collections
+</h3>
+
+<p>
+  Some applications use more dynamic structures to hold data. Observable
+  collections allow keyed access to these data objects.ObservableArrayMap is
+  useful when the key is a reference type, such as String.
+</p>
+
+<pre>
+ObservableArrayMap&lt;String, Object&gt; user = <strong>new </strong>ObservableArrayMap&lt;&gt;();
+user.put(<strong>"firstName"</strong>, <strong>"Google"</strong>);
+user.put(<strong>"lastName"</strong>, <strong>"Inc."</strong>);
+user.put(<strong>"age"</strong>, 17);
+</pre>
+<p>
+  In the layout, the map may be accessed through the String keys:
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.databinding.ObservableMap"</strong>/&gt;
+    &lt;<strong>variable name="user" type="ObservableMap&amp;lt;String, Object&gt;"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+…
+&lt;<strong>TextView
+   android:text=&apos;&commat;{user["lastName"]}&apos;
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+&lt;<strong>TextView
+   android:text=&apos;&commat;{String.valueOf(1 + (Integer)user["age"])}&apos;
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+<p>
+  ObservableArrayList is useful when the key is an integer:
+</p>
+
+<pre>
+ObservableArrayList&lt;Object&gt; user = <strong>new </strong>ObservableArrayList&lt;&gt;();
+user.add(<strong>"Google"</strong>);
+user.add(<strong>"Inc."</strong>);
+user.add(17);
+</pre>
+<p>
+  In the layout, the list may be accessed through the indices:
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.databinding.ObservableList"</strong>/&gt;
+    &lt;<strong>import type="com.example.my.app.Fields"</strong>/&gt;
+    &lt;<strong>variable name="user" type="ObservableList&amp;lt;Object&gt;"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+…
+&lt;<strong>TextView
+   android:text=&apos;&commat;{user[Fields.LAST_NAME]}&apos;
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+&lt;<strong>TextView
+   android:text=&apos;&commat;{String.valueOf(1 + (Integer)user[Fields.AGE])}&apos;
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+<h2 id="generated_binding">
+  Generated Binding
+</h2>
+
+<p>
+  The generated binding class links the layout variables with the Views within
+  the layout. As discussed earlier, the name and package of the Binding may be
+  <a href="#custom_binding_class_names">customized</a>. The Generated binding
+  classes all extend <code>android.databinding.ViewDataBinding</code>.
+</p>
+
+<h3 id="creating">
+  Creating
+</h3>
+
+<p>
+  The binding should be created soon after inflation to ensure that the View
+  hierarchy is not disturbed prior to binding to the Views with expressions
+  within the layout. There are a few ways to bind to a layout. The most common
+  is to use the static methods on the Binding class.The inflate method inflates
+  the View hierarchy and binds to it all it one step. There is a simpler
+  version that only takes a <code>LayoutInflater</code> and one that takes a
+  <code>ViewGroup</code> as well:
+</p>
+
+<pre>
+MyLayoutBinding binding = MyLayoutBinding.<em>inflate</em>(<strong>layoutInflater</strong>);
+MyLayoutBinding binding = MyLayoutBinding.<em>inflate</em>(LayoutInflater, viewGroup, false);
+</pre>
+<p>
+  If the layout was inflated using a different mechanism, it may be bound
+  separately:
+</p>
+
+<pre>
+MyLayoutBinding binding = MyLayoutBinding.<em>bind</em>(viewRoot);
+</pre>
+<p>
+  Sometimes the binding cannot be known in advance. In such cases, the binding
+  can be created using the DataBindingUtil class:
+</p>
+
+<pre>
+ViewDataBinding binding = DataBindingUtil.<em>inflate</em>(LayoutInflater, layoutId,
+    parent, attachToParent);
+ViewDataBinding binding = DataBindingUtil.<em>bindTo</em>(viewRoot, layoutId);
+</pre>
+<h3 id="views_with_ids">
+  Views With IDs
+</h3>
+
+<p>
+  A public final field will be generated for each View with an ID in the
+  layout. The binding does a single pass on the View hierarchy, extracting the
+  Views with IDs. This mechanism can be faster than calling findViewById for
+  several Views. For example:
+</p>
+
+<pre>
+&lt;<strong>layout xmlns:android="http://schemas.android.com/apk/res/android"</strong>&gt;
+   &lt;<strong>data</strong>&gt;
+       &lt;<strong>variable name="user" type="com.example.User"</strong>/&gt;
+   &lt;/<strong>data</strong>&gt;
+   &lt;<strong>LinearLayout
+       android:orientation="vertical"
+       android:layout_width="match_parent"
+       android:layout_height="match_parent"</strong>&gt;
+       &lt;<strong>TextView android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           android:text="&commat;{user.firstName}"</strong>
+   <strong>android:id="&commat;+id/firstName"</strong>/&gt;
+       &lt;<strong>TextView android:layout_width="wrap_content"
+           android:layout_height="wrap_content"
+           android:text="&commat;{user.lastName}"</strong>
+  <strong>android:id="&commat;+id/lastName"</strong>/&gt;
+   &lt;/<strong>LinearLayout</strong>&gt;
+&lt;/<strong>layout</strong>&gt;
+</pre>
+<p>
+  Will generate a binding class with:
+</p>
+
+<pre>
+<strong>public final </strong>TextView <strong>firstName</strong>;
+<strong>public final </strong>TextView <strong>lastName</strong>;
+</pre>
+<p>
+  IDs are not nearly as necessary as without data binding, but there are still
+  some instances where access to Views are still necessary from code.
+</p>
+
+<h3 id="variables2">
+  Variables
+</h3>
+
+<p>
+  Each variable will be given accessor methods.
+</p>
+
+<pre>
+&lt;<strong>data</strong>&gt;
+    &lt;<strong>import type="android.graphics.drawable.Drawable"</strong>/&gt;
+    &lt;<strong>variable name="user"  type="com.example.User"</strong>/&gt;
+    &lt;<strong>variable name="image" type="Drawable"</strong>/&gt;
+    &lt;<strong>variable name="note"  type="String"</strong>/&gt;
+&lt;/<strong>data</strong>&gt;
+</pre>
+<p>
+  will generate setters and getters in the binding:
+</p>
+
+<pre>
+<strong>public abstract </strong>com.example.User getUser();
+<strong>public abstract void </strong>setUser(com.example.User user);
+<strong>public abstract </strong>Drawable getImage();
+<strong>public abstract void </strong>setImage(Drawable image);
+<strong>public abstract </strong>String getNote();
+<strong>public abstract void </strong>setNote(String note);
+</pre>
+<h3 id="viewstubs">
+  ViewStubs
+</h3>
+
+<p>
+  ViewStubs are a little different from normal Views. They start off invisible
+  and when they either are made visible or are explicitly told to inflate, they
+  replace themselves in the layout by inflating another layout.
+</p>
+
+<p>
+  Because the ViewStub essentially disappears from the View hierarchy, the View
+  in the binding object must also disappear to allow collection. Because the
+  Views are final, a ViewStubProxy object takes the place of the ViewStub,
+  giving the developer access to the ViewStub when it exists and also access to
+  the inflated View hierarchy when the ViewStub has been inflated.
+</p>
+
+<p>
+  When inflating another layout, a binding must be established for the new
+  layout. Therefore, the ViewStubProxy must listen to the ViewStub&apos;s
+  OnInflateListener and establish the binding at that time. Since only one can
+  exist, the ViewStubProxy allows the developer to set an OnInflateListener on
+  it that it will call after establishing the binding.
+</p>
+
+<h3 id="advanced_binding">
+  Advanced Binding
+</h3>
+
+<h4 id="dynamic_variables">
+  Dynamic Variables
+</h4>
+
+<p>
+  At times, the specific binding class won&apos;t be known. For example, a
+  RecyclerView Adapter operating against arbitrary layouts won&apos;t know the
+  specific binding class. It still must assign the binding value during the
+  onBindViewHolder.
+</p>
+
+<p>
+  In this example, all layouts that the RecyclerView binds to have an "item"
+  variable. The BindingHolder has a getBinding method returning the
+  <code>ViewDataBinding</code> base.
+</p>
+
+<pre>
+<strong>public void </strong>onBindViewHolder(BindingHolder holder, <strong>int </strong>position) {
+   <strong>final </strong>T item = <strong>mItems</strong>.get(position);
+   holder.getBinding().setVariable(BR.item, item);
+   holder.getBinding().executePendingBindings();
+}
+</pre>
+<h4 id="immediate_binding">
+  Immediate Binding
+</h4>
+
+<p>
+  When a variable or observable changes, the binding will be scheduled to
+  change before the next frame. There are times, however, when binding must be
+  executed immediately. To force execution, use the
+  <code>executePendingBindings()</code> method.
+</p>
+
+<h4>
+  Background Thread
+</h4>
+
+<p>
+  You can change your data model in a background thread as long as it is not a
+  collection. Data binding will localize each variable / field while evaluating
+  to avoid any concurrency issues.
+</p>
+
+<h2 id="attribute_setters">
+  Attribute Setters
+</h2>
+
+<p>
+  Whenever a bound value changes, the generated binding class must call a
+  setter method on the View with the binding expression. The data binding
+  framework has ways to customize which method to call to set the value.
+</p>
+
+<h3 id="automatic_setters">
+  Automatic Setters
+</h3>
+For an attribute, data binding tries to find the method setAttribute. The
+namespace for the attribute does not matter, only the attribute name itself.
+<p>
+  For example, an expression associated with TextView&apos;s attribute
+  <strong><code>android:text</code></strong> will look for a setText(String).
+  If the expression returns an int, data binding will search for a setText(int)
+  method. Be careful to have the expression return the correct type, casting if
+  necessary. Note that data binding will work even if no attribute exists with
+  the given name. You can then easily "create" attributes for any setter by
+  using data binding. For example, support DrawerLayout doesn&apos;t have any
+  attributes, but plenty of setters. You can use the automatic setters to use
+  one of these.
+</p>
+
+<pre>
+&lt;android.support.v4.widget.<strong>DrawerLayout
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    app:scrimColor="&commat;{&commat;color/scrim}"
+    app:drawerListener="&commat;{fragment.drawerListener}"/&gt;</strong>
+</pre>
+<h3 id="renamed_setters">
+  Renamed Setters
+</h3>
+
+<p>
+  Some attributes have setters that don&apos;t match by name. For these
+  methods, an attribute may be associated with the setter through
+  BindingMethods annotation. This must be associated with a class and contains
+  BindingMethod annotations, one for each renamed method. For example, the
+  <strong><code>android:tint</code></strong> attribute is really associated
+  with setImageTintList, not setTint.
+</p>
+
+<pre>
+&commat;BindingMethods({
+       &commat;BindingMethod(type = <strong>"android.widget.ImageView"</strong>,
+                      attribute = <strong>"android:tint"</strong>,
+                      method = <strong>"setImageTintList"</strong>),
+})
+</pre>
+<p>
+  It is unlikely that developers will need to rename setters; the android
+  framework attributes have already been implemented.
+</p>
+
+<h3 id="custom_setters">
+  Custom Setters
+</h3>
+
+<p>
+  Some attributes need custom binding logic. For example, there is no
+  associated setter for the <strong><code>android:paddingLeft</code></strong>
+  attribute. Instead, <code>setPadding(left, top, right, bottom)</code> exists.
+  A static binding adapter method with the <code>BindingAdapter</code>
+  annotation allows the developer to customize how a setter for an attribute is
+  called.
+</p>
+
+<p>
+  The android attributes have already had <code>BindingAdapter</code>s created.
+  For example, here is the one for <code>paddingLeft</code>:
+</p>
+
+<pre>
+
+&commat;BindingAdapter(<strong>"android:paddingLeft"</strong>)
+<strong>public static void </strong>setPaddingLeft(View view, <strong>int </strong>padding) {
+   view.setPadding(padding,
+                   view.getPaddingTop(),
+                   view.getPaddingRight(),
+                   view.getPaddingBottom());
+}
+</pre>
+<p>
+  Binding adapters are useful for other types of customization. For example, a
+  custom loader can be called off-thread to load an image.
+</p>
+
+<p>
+  Developer-created binding adapters will override the data binding default
+  adapters when there is a conflict.
+</p>
+
+<p>
+  You can also have adapters that receive multiple parameters.
+</p>
+
+<pre>
+&commat;BindingAdapter({<strong>"bind:imageUrl"</strong>, <strong>"bind:error"</strong>})
+<strong>public static void </strong>loadImage(ImageView view, String url, Drawable error) {
+   Picasso.<em>with</em>(view.getContext()).load(url).error(error).into(view);
+}
+</pre>
+<pre>
+&lt;ImageView app:imageUrl=“&commat;{venue.imageUrl}”
+app:error=“&commat;{&commat;drawable/venueError}”/&gt;
+</pre>
+
+<p>
+  This adapter will be called if both <strong>imageUrl</strong> and
+  <strong>error</strong> are used for an ImageView and <em>imageUrl</em> is a
+  string and <em>error</em> is a drawable.
+</p>
+
+<ul>
+  <li>Custom namespaces are ignored during matching.
+  </li>
+
+  <li>You can also write adapters for android namespace.
+  </li>
+</ul>
+
+<h2 id="converters">
+  Converters
+</h2>
+
+<h3 id="object_conversions">
+  Object Conversions
+</h3>
+
+<p>
+  When an Object is returned from a binding expression, a setter will be chosen
+  from the automatic, renamed, and custom setters. The Object will be cast to a
+  parameter type of the chosen setter.
+</p>
+
+<p>
+  This is a convenience for those using ObservableMaps to hold data. for
+  example:
+</p>
+
+<pre>
+&lt;<strong>TextView
+   android:text=&apos;&commat;{userMap["lastName"]}&apos;
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+
+<p>
+The <code>userMap</code> returns an Object and that Object will be automatically cast to
+  parameter type found in the setter <code>setText(CharSequence)</code>. When there
+  may be confusion about the parameter type, the developer will need
+  to cast in the expression.
+</p>
+
+<h3 id="custom_conversions">Custom Conversions</h3>
+
+<p>
+  Sometimes conversions should be automatic between specific types. For
+  example, when setting the background:
+</p>
+
+<pre>
+&lt;<strong>View
+   android:background="&commat;{isError ? &commat;color/red : &commat;color/white}"
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
+<p>
+  Here, the background takes a <code>Drawable</code>, but the color is an
+  integer. Whenever a <code>Drawable</code> is expected and an integer is
+  returned, the <code>int</code> should be converted to a
+  <code>ColorDrawable</code>. This conversion is done using a static method
+  with a BindingConversion annotation:
+</p>
+
+<pre>
+&commat;BindingConversion
+<strong>public static </strong>ColorDrawable convertColorToDrawable(<strong>int </strong>color) {
+   <strong>return new </strong>ColorDrawable(color);
+}
+</pre>
+<p>
+  Note that conversions only happen at the setter level, so it is <strong>not
+  allowed</strong> to mix types like this:
+</p>
+
+<pre>
+&lt;<strong>View
+   android:background="&commat;{isError ? &commat;drawable/error : &commat;color/white}"
+   android:layout_width="wrap_content"
+   android:layout_height="wrap_content"</strong>/&gt;
+</pre>
diff --git a/docs/html/tools/data-binding/index.jd b/docs/html/tools/data-binding/index.jd
new file mode 100644
index 0000000..4ad11b6
--- /dev/null
+++ b/docs/html/tools/data-binding/index.jd
@@ -0,0 +1,18 @@
+page.title=Android Data Binding Library
+page.metaDescription=
+
+@jd:body
+
+<p>
+  Some text here.
+</p>
+
+
+
+<!--  <h2>Related Resources</h2>
+  <div class="resource-widget resource-flow-layout col-16"
+    data-query="tag:engagement"
+    data-sortOrder="random"
+    data-cardSizes="6x2"
+    data-maxResults="3">
+  </div> -->
diff --git a/docs/html/tools/performance/allocation-tracker/index.jd b/docs/html/tools/performance/allocation-tracker/index.jd
new file mode 100644
index 0000000..e71b584
--- /dev/null
+++ b/docs/html/tools/performance/allocation-tracker/index.jd
@@ -0,0 +1,148 @@
+page.title=Allocation Tracker Walkthrough
+meta.tags="android, performance, profiling, tools, memoryleaks, memoryheap"
+page.tags="android", "performance", "profiling", "tools", "memoryleaks", "memoryheap"
+page.metaDescription=Record you app's memory allocations with their call stack to identify code that allocates and frees objects unnecessarily.
+page.image=tools/performance/thumbnails/tools_allocation_tracker.png
+page.article=true
+
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithAllocationTracker">Working with Allocation Tracker</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/heap-viewer/index.html">
+    Heap Viewer Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/memory-monitor/index.html">
+    Memory Monitor Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/comparison.html">
+    Comparison: Memory Monitor, Heap Viewer, Allocation Tracker</a>
+  <li><a href="{@docRoot}tools/performance/traceview/index.html">
+    Traceview Walkthrough</a></li>
+</ul>
+
+</div>
+
+
+  <p>This walkthrough shows the basic usage and workflow for the Allocation Tracker tool in Android
+  Studio. Allocation Tracker records an app's memory allocations and lists all
+  allocated objects for the profiling cycle with their call stack, size, and allocating code.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Identifying where many similar object types, from roughly the same call stack, are
+    allocated and deallocated over a very short period of time.</li>
+
+    <li>Finding the places in your code that may contribute to inefficient memory use.</li>
+  </ul>
+
+  <p>Before using Allocation Tracker, profile your code with the
+  <a href="{@docRoot}tools/performance/memory-monitor/index.html">Memory
+  Monitor Tool</a>. If you see many garbage collection events in a short amount of time, use
+  <a href="{@docRoot}tools/performance/heap-viewer/index.html">Heap
+  Viewer</a> to identify candidate object types, and Allocation Tracker to determine where this is
+  happening in your code.</p>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+
+    <li>Application code. Use your own code, or the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+  <h2 id="WorkingWithAllocationTracker">Working with Allocation Tracker</h2>
+
+  <p>Allocation Tracker records each memory allocation that your app performs during the profiling
+  cycle. You tell Allocation Tracker to start recording and it logs allocations
+  until you tell it to stop.</p>
+
+<hr>
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image01.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Steps for starting Allocation Tracker.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+
+    <li>Click the <b>Android</b> button at the bottom of your Android Studio window.</li>
+
+    <li>Click the RECORD button
+        <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image02.png">
+        (Start Allocation Tracking tooltip).</li>
+
+    <li>Interact with your application.</li>
+
+    <li>Click the (same) STOP button (Stop Allocation Tracking tooltip).</li>
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="7">
+
+  <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/allocation-tracker/gettingstarted_image03.png"
+         alt=""
+         width="440px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Example of Allocation Tracker output.
+      </p>
+    </div>
+
+    <li>After a few seconds, a pane with your recorded data opens.
+
+    <p>Note that allocations are logged on
+      the device, and the data file is transferred to the host computer, parsed for information, and
+      displayed.</p></li>
+
+    <li>The pane populates with a table.
+
+    <ul>
+      <li>Each row represents a memory allocation event.</li>
+
+      <li>Each column represents information about the allocation, such as the object type,
+      the thread, and its size. </li>
+
+      <li>The columns are movable, resizable, and sortable.</li>
+    </ul>
+
+    <p>Use the Filter to show only allocations from your app.</li>
+
+    <li>Click on an object to see its full stack trace.</li>
+  </ol>
+</div></li>
+</ul>
diff --git a/docs/html/tools/performance/batterystats-battery-historian/charts.jd b/docs/html/tools/performance/batterystats-battery-historian/charts.jd
new file mode 100644
index 0000000..cbe9d85
--- /dev/null
+++ b/docs/html/tools/performance/batterystats-battery-historian/charts.jd
@@ -0,0 +1,124 @@
+page.title=Battery Historian Charts
+meta.tags="android, performance, profiling, tools, battery, historian, batterydrain
+page.tags="android", performance", "profiling", "tools", "battery", "historian" "batterydrain"
+page.metaDescription=Examine and interpret the collected battery usage data in your browser.
+page.image=tools/performance/thumbnails/tools_battery_historian.png
+page.article=true
+
+@jd:body
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#BatteryHistorianCharts">Battery Historian Charts</a></li>
+  <li><a href="#FilteringBatterystats">Filtering batterystats output</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/batterystats-battery-historian/index.html">
+    Batterystats &amp; Battery Historian Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/systrace/index.html">
+    Systrace Walkthrough</a></li>
+</ul>
+
+</div>
+
+
+  <p id="BatteryHistorianCharts">
+    The Battery Historian chart graphs power-relevant events over time.</p>
+
+  <p>Each row shows a colored bar segment when a system component is active
+   and thus drawing current from the battery. The chart does <i>not</i> show <i>how much</i> battery was used by the
+  component, only that the app was active. Charts are organized by category.</p>
+
+  <div class="figure" style="">
+  <img src="{@docRoot}images/tools/performance/batterystats-battery-historian/gettingstarted_image02.png"
+         alt=""
+         height="" />
+    <p class="img-caption">
+      <strong>Figure 1. </strong>Example of Battery Historian output.
+    </p>
+  </div>
+
+  <h3>Battery usage categories</h3>
+
+  <ul>
+    <li><b>battery_level</b>: When the battery level was recorded and logged.
+    Reported in percent, where 093 is 93%. Provides an overall measure of how fast the battery
+    is draining.</li>
+
+    <li><b>top</b>: The application running at the top; usually, the application that is visible to
+    the user. If you want to measure battery drain while your app is active, make sure
+    it's the top app. If you want to measure battery drain while your app is in
+    the background, make sure it's <i>not</i> the top app.</li>
+
+    <li><b>wifi_running</b>: Shows that the Wi-Fi network connection was active.</li>
+
+    <li><b>screen</b>: Screen is turned on.</li>
+
+    <li><b>phone_in_call</b>: Recorded when the phone is in a call.</li>
+
+    <li><b>wake_lock</b>: App wakes up, grabs a lock, does small work, then goes back to sleep.
+    This is one of the most important pieces of information. Waking up the phone is expensive, so
+    if you see lots of short bars here, that might be a problem.</li>
+
+    <li><b>running</b>: Shows when the CPU is awake. Check whether it is awake and asleep
+      when you expect it to be.</li>
+
+    <li><b>wake_reason</b>: The last thing that caused the kernel to wake up. If
+    it's your app, determine whether it was necessary.</li>
+
+    <li><b>mobile_radio</b>: Shows when the radio was on. Starting the radio is battery expensive.
+    Many narrow bars close to each other can indicate opportunities for
+    batching and other optimizations.</li>
+
+    <li><b>gps</b>: Indicates when the GPS was on. Make sure this is what you expect.</li>
+
+    <li><b>sync:</b> Shows when an app was syncing with a backend. The sync bar also shows which
+    app did the syncing. For users, this can show apps where they might turn syncing off to save
+    battery. Developers should sync as little as possible and only as often as necessary.</li>
+  </ul>
+
+
+  <p class="note"><strong>Note:</strong>
+    Not every chart will show every category.</p>
+
+  <h2 id="FilteringBatterystats">Filtering batterystats output</h2>
+
+  <p>You can gather additional information from the <code>batterystats.txt</code> file
+    where you saved the output from the batterystats command.</p>
+
+  <div class="figure" style="">
+<img src="{@docRoot}images/tools/performance/batterystats-battery-historian/gettingstarted_image03.png"
+         alt=""
+         width="340px" />
+    <p class="img-caption">
+      <strong>Figure 2.</strong>Example of filtered batterystats output.
+    </p>
+  </div>
+
+  <p>Open the file in a text editor and search for:</p>
+
+  <ol>
+    <li><b><code>Battery History</code></b>: A time series of power-relevant events, such as
+    screen, Wi-Fi, and app launch. These are also visible through Battery Historian.</li>
+
+    <li><b><code>Per-PID Stats</code></b>: How long each process ran.</li>
+
+    <li><b><code>Statistics since last charge</code></b>: System-wide statistics, such as
+    cell signal levels and screen brightness. Provides an overall picture of what's happening
+    with the device. This information is especially useful
+    to make sure no external events are affecting your experiment.</li>
+
+    <li><b><code>Estimated power use (mAh)</code></b> by UID and peripheral: This is currently an
+    extremely rough estimate and should not be considered experiment data.</li>
+
+    <li><b><code>Per-app mobile ms per packet</code></b>: Radio-awake-time divided by packets sent.
+    An efficient app will transfer all its traffic in batches, so the lower this number the
+    better.</li>
+
+    <li><b><code>All partial wake locks</code></b>: All app-held wakelocks, by aggregate
+    duration and count.</li>
+  </ol>
diff --git a/docs/html/tools/performance/batterystats-battery-historian/index.jd b/docs/html/tools/performance/batterystats-battery-historian/index.jd
new file mode 100644
index 0000000..2072df9
--- /dev/null
+++ b/docs/html/tools/performance/batterystats-battery-historian/index.jd
@@ -0,0 +1,129 @@
+page.title=Batterystats &amp; Battery Historian Walkthrough
+meta.tags="android, performance, profiling, tools, battery, batterystats, historian, batterydrain
+page.tags="android", "performance", "profiling", "tools", "battery", "batterystats", "historian", "batterydrain"
+page.metaDescription=Collect battery usage data from your device and display it graphically in your browser.
+page.image=tools/performance/thumbnails/tools_battery_historian.png
+page.article=true
+
+
+@jd:body
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/batterystats-battery-historian/charts.html">
+    Battery Historian Charts</a></li>
+  <li><a href="{@docRoot}tools/performance/systrace/index.html">
+    Systrace Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows the basic usage and workflow for the Batterystats tool and the Battery
+  Historian script.</p>
+
+  <p>Batterystats collects battery data from your device, and Battery Historian converts that data
+  into an HTML visualization that you can view in your Browser. Batterystats is part of the Android
+  framework, and Battery Historian is open-sourced and available on GitHub at <a href=
+  "https://github.com/google/battery-historian">https://github.com/google/battery-historian</a>.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Showing you where and how processes are drawing current from the battery.</li>
+
+    <li>Identifying tasks in your app that could be deferred or even removed to improve battery
+    life.</li>
+  </ul>
+
+  <h2>Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled running Android 5.0 or higher.</li>
+  </ul>
+
+  <h2>Working with Batterystats &amp; Battery Historian</h2>
+
+  <div class="sidebox-wrapper" style="width:400px;">
+      <div class="sidebox" style="width:350px;">
+        <h2>Summary</h2>
+          <code>
+            <p><b>https://github.com/google/battery-historian</b></p>
+            <p>&gt; adb kill-server</p>
+            <p>&gt; adb devices</p>
+            <p>&gt; adb shell dumpsys batterystats --reset</p>
+            <p>&lt;disconnect and play with app&gt;...&lt;reconnect&gt;</p>
+            <p>&gt; adb devices</p>
+            <p>&gt;adb shell dumpsys batterystats &gt; batterystats.txt</p>
+            <p>&gt; python historian.py batterystats.txt &gt; batterystats.html</p>
+          </code>
+      </div>
+  </div>
+
+  <ol>
+
+    <li>Download the open-source Battery Historion Python script from GitHub (<a href=
+    "https://github.com/google/battery-historian">https://github.com/google/battery-historian</a>).
+    </li>
+
+    <li>Unzip the file to extract the Battery Historian folder. Inside the folder,
+      find the <code>historian.py</code> file
+      and move it to the Desktop or another <em>writable</em> directory.</li>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>On your computer, open a Terminal window.</li>
+
+    <li>Change to the directory where you've saved <code>historian.py</code>,
+      <br>for example:
+      <code>cd ~/Desktop</code></li>
+
+    <li>Shut down your running adb server.
+      <br><code>&gt; adb kill-server</code></li>
+
+    <li>Restart adb and check for connected devices.
+      <br><code>&gt; adb devices</code>
+      <br><img src="{@docRoot}images/tools/performance/batterystats-battery-historian/gettingstarted_image01.png">
+      <br>If you don't see any devices, make sure your phone is connected, and USB Debugging
+      is turned on, and then kill and restart adb.</li>
+
+    <li>Reset battery data gathering.
+      <br><code>&gt; adb shell dumpsys batterystats --reset</code>
+      <p>Resetting erases old battery collection data; otherewise, the output will be huge.</p>
+    </li>
+
+    <li>Disconnect your device from your computer so that you are only drawing current from the
+    device's battery.</li>
+
+    <li>Play with your app for a short time.</li>
+
+    <li>Reconnect your phone.</li>
+
+    <li>Make sure your phone is recognized: <code>&gt; adb devices</code></li>
+
+    <li>Dump all battery data. This can take a while:
+      <br><code>&gt; adb shell dumpsys batterystats &gt; batterystats.txt</code></li>
+
+    <li>Create a HTML version of the data dump for Battery Historian:
+       <br><code>&gt; python historian.py batterystats.txt &gt; batterystats.html</code></li>
+
+    <li>Open the <code>batterystats.htm</code> file in your browser.</li>
+
+    <li>Continue with <a href="{@docRoot}tools/performance/batterystats-battery-historian/charts.html">
+        Battery Historian Charts</a>.
+    </li>
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/batterystats-battery-historian/gettingstarted_image02.png"
+         alt=""
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Battery Historian output.
+      </p>
+    </div>
+  </ol>
+
+
+
diff --git a/docs/html/tools/performance/comparison.jd b/docs/html/tools/performance/comparison.jd
new file mode 100644
index 0000000..cf4b7120
--- /dev/null
+++ b/docs/html/tools/performance/comparison.jd
@@ -0,0 +1,133 @@
+page.title=Memory Profilers
+meta.tags="android, performance, profiling, tools, memory, memoryleaks, garbagecollection"
+page.tags="android", "performance", "profiling", "tools", "memory", "memoryleaks", "garbagecollection"
+page.metaDescription=Heap Viewer, Memory Monitor, and Allocation Tracker are complementary tools that visualize the memory your app uses.
+page.image=tools/performance/thumbnails/tools_memory_monitor.png
+page.article=true
+
+@jd:body
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#MemoryMonitor">Memory Monitor</a></li>
+  <li><a href="#HeapViewer">Heap Viewer</a></li>
+  <li><a href="#AllocationTracker">Allocation Tracker</a></li>
+
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/memory-monitor/index.html">
+    Memory Monitor Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/heap-viewer/index.html">
+    Heap Viewer Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/allocation-tracker/index.html">
+    Allocation Tracker Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>Heap Viewer, Memory Monitor, and Allocation Tracker are complementary tools that visualize the
+  memory your app uses.</p>
+
+  <ol>
+    <li>Use the
+    <a href="{@docRoot}tools/performance/memory-monitor/index.html">
+    Memory Monitor Tool</a> to find out whether undesirable garbage collection (GC) event patterns might
+    be causing your performance problems.</li>
+
+    <li>Run
+    <a href="{@docRoot}tools/performance/heap-viewer/index.html">
+    Heap Viewer</a> to identify object types that get or stay allocated
+    unexpectedely or unecessarily.</li>
+
+    <li>Use
+    <a href="{@docRoot}tools/performance/allocation-tracker/index.html">
+    Allocation Tracker</a> to identify where in your code the problem might be.</li>
+  </ol>
+
+  <h2 id="MemoryMonitor">Memory Monitor</h2>
+
+<div>
+  <div class="figure" style="">
+    <img src="{@docRoot}images/tools/performance/compare_MemoryMonitor.png"
+         alt=""
+         height="" />
+    <p class="img-caption">
+      <strong>Figure 1. </strong>Memory Monitor.
+    </p>
+  </div>
+
+  <ul>
+    <li>Shows available and used memory as they both change over time <i>for your app</i> in a
+    graph, with dips indicating Garbage Collection (GC) events.</li>
+
+    <li>Provides a quick way to test whether app slowness might be related
+    to excessive GC events.</li>
+
+    <li>Provides a quick way to see whether app crashes might be related
+    to running out of memory.</li>
+
+    <li>Runs live on your application and updates about once a second.</li>
+
+    <li>Helps quickly identify the potential of memory leaks.</li>
+
+    <li>Helps identify GC patterns for your application and determine whether
+      they are healthy and what you expect.</li>
+
+    <li>Is easy to use, and it is easy to interpret what you see.</li>
+
+    <li>However, Memory Monitor does not tell you which objects are the cause
+      of your problems, or where in your code it might be.</li>
+  </ul>
+
+    <h2 id="HeapViewer">Heap Viewer</h2>
+
+  <div class="figure" style="">
+    <img src="{@docRoot}images/tools/performance/compare_HeapViewer.png"
+         alt=""
+         height="" />
+    <p class="img-caption">
+      <strong>Figure 2. </strong>Heap Viewer.
+    </p>
+  </div>
+
+  <ul>
+    <li>Shows snapshots of a number of objects allocated by type.</li>
+
+    <li>Samples data every time a garbage collection event occurs
+      naturally or triggered by you.</li>
+
+    <li>Helps identify which object types might be involved in memory leaks.</li>
+
+    <li>However, you have to look for changes over time yourself by tracking what's
+    happening in the graph.</li>
+    <br><br><br><br>
+  </ul>
+
+    <h2 id="AllocationTracker">Allocation Tracker</h2>
+
+  <div class="figure" style="">
+    <img src="{@docRoot}images/tools/performance/compare_AllocationTracker.png"
+         alt=""ge
+         height="" />
+    <p class="img-caption">
+      <strong>Figure 3. </strong>Allocation Tracker.
+    </p>
+  </div>
+
+  <ul>
+    <li>Shows when and where your code allocates object types, their size, allocating thread, and
+    stack traces.</li>
+
+    <li>Helps recognize memory churn through recurring allocation/deallocation patterns.</li>
+
+    <li>Can be used in combination with Heap Viewer to track down memory leaks. For example, if you
+    see a bitmap object resident on the heap, you can find its allocation location with Allocation
+    Tracker.</li>
+
+    <li>However, it takes time and experience to learn to interpret the output from this tool.</li>
+
+  </ul>
diff --git a/docs/html/tools/performance/debug-gpu-overdraw/index.jd b/docs/html/tools/performance/debug-gpu-overdraw/index.jd
new file mode 100644
index 0000000..e6b85fd
--- /dev/null
+++ b/docs/html/tools/performance/debug-gpu-overdraw/index.jd
@@ -0,0 +1,156 @@
+page.title=Debug GPU Overdraw Walkthrough
+meta.tags="android, performance, profiling, tools, rendering, overdraw"
+page.tags="android", "performance", "profiling", "tools",  "rendering", "overdraw"
+page.metaDescription=Use color-coding to show how many times each pixel is redrawn on the screen to reduce rendering overhead.
+page.image=tools/performance/thumbnails/tools_debug_gpu_overdraw.png
+page.article=true
+
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#VisualizingOverdraw">Visualizing Overdraw</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/profile-gpu-rendering/index.html">
+    Profile GPU Rendering Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/index.html">
+    Hierarchy Viewer Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows how to visualize overdraw on your mobile device by color-coding
+  interface elements based on how often they are drawn underneath.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Showing where an app might be doing more rendering work than necessary.</li>
+
+    <li>Helping you see where you might be able to reduce rendering overhead.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+  </ul>
+
+
+  <h2 id="VisualizingOverdraw">Visualizing Overdraw on your Mobile Device</h2>
+
+  <ul class="no-bullet">
+  <!-- this also hides bullet, by default outside box -->
+  <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+      <img
+    src="{@docRoot}images/tools/performance/debug-gpu-overdraw/gettingstarted_image01.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Steps for turning on Debug GPU Overdraw.
+      </p>
+    </div>
+
+    <li>On your mobile device, go to <b>Settings</b> and tap <b>Developer Options</b>.</li>
+
+    <li>In the <em>Hardware accelerated rendering</em> section,
+      select <b>Debug GPU Overdraw</b>.</li>
+
+    <li>In the <b>Debug GPU overdraw</b> popup, select <b>Show overdraw areas</b>.</li>
+ </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="5">
+
+     <div class="figure" style="padding-right:100px">
+      <img
+    src="{@docRoot}images/tools/performance/debug-gpu-overdraw/gettingstarted_image02.png"
+         alt=""
+         width="180px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Example of<br>Debug GPU Overdraw output.
+      </p>
+    </div>
+
+    <li>Don't panic as your screen turns into a delirium of colors.
+      The coloring is provided to help you diagnose your app's display behavior.</li>
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+ <ol class="padded" start="6">
+
+     <div class="figure" style="">
+      <img
+    src="{@docRoot}images/tools/performance/debug-gpu-overdraw/gettingstarted_image03.png"
+         alt=""
+         width="300px" />
+      <p class="img-caption">
+        <strong>Figure 3. </strong>Color key for Debug GPU Overdraw output.
+      </p>
+    </div>
+
+    <br><br>
+    <li>The colors are hinting at the amount of overdraw on your screen for each pixel, as
+      follows:
+
+      <ul>
+        <li><b>True color:</b> No overdraw</li>
+        <li><b>Blue:</b> Overdrawn once</li>
+        <li><b>Green:</b> Overdrawn twice</li>
+        <li><b>Pink:</b> Overdrawn three times</li>
+        <li><b>Red:</b> Overdrawn four or more times</li>
+      </ul>
+    </li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+ <ol class="padded" start="7">
+
+    <div class="figure" style="">
+      <img
+    src="{@docRoot}images/tools/performance/debug-gpu-overdraw/gettingstarted_image04.png"
+         alt=""
+         width="300px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Examples of undesirable and desirable
+          <br>Debug GPU Overdraw output.
+      </p>
+    </div>
+
+    <br><br><br>
+    <li>Some overdraw is unavoidable. As you are tuning your app's
+      user interface, the goal is to arrive at a visualization that shows mostly true
+      colors and 1X overdraw in blue.</li>
+
+  </ol>
+</div></li>
+</ul>
diff --git a/docs/html/tools/performance/heap-viewer/index.jd b/docs/html/tools/performance/heap-viewer/index.jd
new file mode 100644
index 0000000..9ca0c47
--- /dev/null
+++ b/docs/html/tools/performance/heap-viewer/index.jd
@@ -0,0 +1,177 @@
+page.title=Heap Viewer Walkthrough
+meta.tags="android, performance, profiling, tools, memory, memoryleaks, memoryheap"
+page.tags="android", "performance", "profiling", "tools", "memory", "memoryleaks", "memoryheap"
+page.metaDescription=Report in real-time how many objects of what types and sizes your application is allocating and find memory leaks.
+page.image=tools/performance/thumbnails/tools_heap_viewer.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithHeapViewer">Working with Heap Viewer</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/memory-monitor/index.html">
+    Memory Monitor Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/allocation-tracker/index.html">
+    Allocation Tracker Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/comparison.html">
+    Comparison: Memory Monitor, Heap Viewer, Allocation Tracker</a>
+  <li><a href="{@docRoot}tools/performance/traceview/index.html">
+    Traceview Walkthrough</a></li>
+</ul>
+
+</div>
+
+
+  <p>This walkthrough shows the basic usage and workflow for the Heap Viewer tool. Heap Viewer
+  reports in real-time what <i>types</i> of objects your application has allocated, how many, and
+  their sizes on the heap.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Getting a sense of how your app allocates and frees memory.</li>
+
+    <li>Identifying memory leaks.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device running Android 5.0 or higher with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+
+    <li>Application code. Use your own code, or the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+  <h2 id="WorkingWithHeapViewer">Working with Heap Viewer</h2>
+
+  <ul class="no-bullet">
+  <!-- this also hides bullet, by default outside box -->
+  <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/heap-viewer/gettingstarted_image01.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Starting Android Device Monitor.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+
+    <li>Start the Android Device Monitor from Android Studio: <b>Tools -&gt; Android -&gt; Android
+    Device</b> <b>Monitor</b>.
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="4">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/heap-viewer/gettingstarted_image02.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Steps for Using Heap Viewer.
+      </p>
+    </div>
+
+    <li>Make sure your device and application are showing in the <b>Devices</b> tab.</li>
+
+    <li>Click the <b>DDMS</b> button, because the Heap Viewer is one of the DDMS tools.</li>
+
+    <li>Click the <b>Heap</b> tab, which is where your data will appear.</li>
+
+    <li>In the <b>Devices</b> tab, select the app you want to monitor.</li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="8">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/heap-viewer/gettingstarted_image03.png"
+         alt=""
+         width="300px"  />
+      <p class="img-caption">
+        <strong>Figure 3. </strong>Update Heap button.
+      </p>
+    </div>
+
+    <li>To start monitoring, click the Update Heap button, which looks like a green can.</li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="9">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/heap-viewer/gettingstarted_image04.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Triggering GC (Garbage Collection).
+      </p>
+    </div>
+
+    <li>Note the <em>Heap updates will happen
+      after every GC for this client.</em> message.</li>
+
+    <li>Press the <strong>Cause CG</strong> button to
+      trigger a garbage collection event.
+    </li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="11">
+
+   <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/heap-viewer/gettingstarted_image05.png"
+         alt=""
+         width="480px" />
+      <p class="img-caption">
+        <strong>Figure 5. </strong>Example Heap Viewer output.
+      </p>
+    </div>
+
+    <li>Click a data type to see detailed information on its current allocations on the
+      heap.</li>
+
+ </ol>
+</div></li>
+
+  <p class="note"><b>Note:</b> To visualize allocation changes over time, combine
+    several snapshots of the bar graph into an animated gif or video.</p>
+ </ul>
diff --git a/docs/html/tools/performance/hierarchy-viewer/index.jd b/docs/html/tools/performance/hierarchy-viewer/index.jd
new file mode 100644
index 0000000..ebf23e5
--- /dev/null
+++ b/docs/html/tools/performance/hierarchy-viewer/index.jd
@@ -0,0 +1,330 @@
+page.title=Hierarchy Viewer Walkthrough
+meta.tags="android, performance, profiling, tools, rendering, hierarchyviewer"
+page.tags="android", "performance", "profiling", "tools", "rendering", "hierarchyviewer"
+page.metaDescription=Visualize your app's view hierarchy to help you simplify your layouts.
+page.image=tools/performance/thumbnails/tools_hierarchy_viewer.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithHierarchyViewer">Working with Hierarchy Viewer</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/setup.html">
+    Device Setup for Hierarchy Viewer</a></li>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/profiling.html">
+    Profiling with Hierarchy Viewer</a></li>
+  <li><a href=
+    "http://developer.android.com/tools/debugging/debugging-ui.html#viewhierarchy">Hierarchy Viewer
+    </a></li>
+  <li><a href="/guide/topics/ui/overview.html#Layout">View Hierarchies</a></li>
+  <li><a href="{@docRoot}tools/performance/importing-legacy-apps.html">
+    Importing Legacy Apps into Android Studio<a></li>
+  <li><a href="{@docRoot}tools/device.html">Using Hardware Devices</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows the basic usage and workflow for the Hierarchy Viewer tool.</p>
+
+  <p>The Hierarchy Viewer tool visualizes your app's <a href=
+  "http://developer.android.com/guide/topics/ui/overview.html#Layout">view hierarchy</a> and
+  profiles the relative rendering speed for each view.
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Simplifying your view hierarchy to reduce overdraw, and make it easier to manage.</li>
+
+    <li>Finding potential rendering performance bottlenecks related to the structure and shape of your
+    view hierarchy.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device set up to work with Hierarchy Viewer:</li>
+
+    <li style="list-style: none; display: inline">
+      <ol>
+        <li>You must have <a href=
+        "http://developer.android.com/tools/device.html#developer-device-options">Developer
+        Options</a> enabled on your mobile device. You must use a physical device to get
+        accurate measurements.</li>
+
+        <li>Set an {@code ANDROID_HVPROTO} environment variable on the desktop machine
+          that is connected to your device. For more information, see
+          <a href="{@docRoot}tools/performance/hierarchy-viewer/setup.html">Device Setup for Hierarchy Viewer</a>.</li>
+      </ol>
+    </li>
+
+    <li>Debuggable app code with a view hierarchy. Use your own code, or the code for the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+  <h2 id="WorkingWithHierarchyViewer">Working with Hierarchy Viewer</h2>
+
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+     <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image001.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Starting Android Device Monitor.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+
+    <li>From Android Studio, start the Android Device Monitor: <b>Tools &gt; Android &gt;
+    Android Device Monitor</b>.</li>
+
+    <li>Allow <b>USB Debugging</b> on your phone (if asked).</li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="6">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image005.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Android Device Monitor.
+      </p>
+    </div>
+
+    <li>Figure 2 illustrates what is initially shown in the Device Monitor tool. This varies
+      depending on your setup.
+      <p>Make sure your device
+      and the package for your application are showing in the Devices (DDMS mode) or Windows
+      (Hierarchy Viewer mode) tab. You can choose <b>Window &gt; Reset Perspective</b> to get
+      back to the default arrangement.</p>
+      <p>If the app does not appear, make sure you
+      followed the <a href="{@docRoot}tools/performance/hierarchy-viewer/setup.html"> device
+      setup instructions</a>, then start over at step 1.</p></li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="7">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image002.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 3. </strong>Changing Perspective to Hierarchy Viewer.
+     </p>
+    </div>
+
+    <li>In Android Device Monitor (ADM), in the menu bar, choose <b>Window &gt; Open
+    Perspective</b>, and in the popup click <b>Hierarchy View</b>.<br>
+
+    <p>OR</p>
+    <p> Click the <b>Hierarchy View</b> button if it's already visible.<br>
+    <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image003.png">
+    </p></li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="9">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image006.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Hierarchy Viewer layout.
+     </p>
+    </div>
+
+    <li>If not already open, the Hierarchy View panes open.<br>
+      The example screen in Figure&nbsp;4 shows an example of these panes.</li>
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="10">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image004.png"
+         alt=""
+         width="240px" />
+      <p class="img-caption">
+        <strong>Figure 5. </strong>Resetting the Perspective.
+      </p>
+    </div>
+
+    <li>If you see a different window arrangement, in Android Device Manager, use
+    <b>Window &gt; Reset Perspective</b> to return to the default layout for this tutorial.
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="11">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image007.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 6. </strong>Populated Hierarchy Viewer.
+      </p>
+    </div>
+
+    <li>Double-click your application in the Windows tab. This populates the panes with the
+      view hierarchy of your application.
+      This display is a static representation of the complete view hierarchy defined for the
+      app.</li>
+
+    <li>You can adjust the sizes of the panes and ADM will preserve your
+      arrangement in future sessions.</li>
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="13">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image008.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+      <strong>Figure 7. </strong>Hierarchy Viewer panes.
+      </p>
+    </div>
+
+    <li>If necessary, click the <b>Layout View</b> tab to hide the Console and show a wireframe of
+    your layout. The outline of the currently selected view is red. Click an outline to select
+    it.</li>
+
+    <li>The rest of the panes:
+
+      <ul>
+        <li>The <b>Tree Overview</b> in the upper right gives you a bird's-eye view of your
+        app's complete <a href=
+        "http://developer.android.com/guide/topics/ui/overview.html#Layout">View</a> <a href=
+        "http://developer.android.com/guide/topics/ui/overview.html#Layout">Hierarchy</a>.</li>
+
+        <li>In the <b>Tree Overview</b>, move the gray viewport rectangle to change what section of
+        your hierarchy shows in the <b>Tree View</b> pane (in the center).</li>
+
+        <li>In the <b>Tree View</b>, you can drag and zoom the tree using your mouse.</li>
+      </ul>
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="15">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image009.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 7. </strong>Parts of the View node display.
+      </p>
+    </div>
+
+    <li>Click on a View node to display details. Here is an annotated close-up of a node
+      and its details.</li>
+
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="16">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image010.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 8. </strong>Location of View Properties tab.
+      </p>
+    </div>
+
+    <li>Click the <b>View Properties</b> tab at the top right (next to the Windows tab) to see
+        properties of the selected View node.</li>
+
+   </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="17">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image011.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 9. </strong>Rendering a view in a popup.
+      </p>
+    </div>
+
+    <li>Double-click a View node in the Tree View to render it in a popup window.</li>
+
+  </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="18">
+
+  <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image012.png"
+         alt=""
+         width="240px" />
+      <p class="img-caption">
+        <strong>Figure 10. </strong>Node with its type and id.
+      </p>
+    </div>
+
+    <li>Nodes in the Tree View show a Type, which indicates the View class,
+      and an id, which is the view identifier in your code.</li>
+
+  </ol>
+</div></li>
+</ul>
diff --git a/docs/html/tools/performance/hierarchy-viewer/profiling.jd b/docs/html/tools/performance/hierarchy-viewer/profiling.jd
new file mode 100644
index 0000000..b505228
--- /dev/null
+++ b/docs/html/tools/performance/hierarchy-viewer/profiling.jd
@@ -0,0 +1,169 @@
+page.title=Profiling with Hierarchy Viewer
+meta.tags="android, performance, profiling, tools, rendering, hierarchyviewer
+page.tags="android", "performance", "profiling", "tools", "rendering", "hierarchyviewer"
+page.metaDescription=Profile the relative rendering speed for each view.
+page.image=tools/performance/thumbnails/tools_hierarchy_viewer_profiling.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#ProfilingWithHierarchyViewer">Profiling with Hierarchy Viewer</a></li>
+  <li><a href="#InterpretingResults">Interpreting Profiling Results</a></li>
+
+</ul>
+</div>
+
+<p>This walkthrough shows you how to profile your app's view hiearchy with
+  Hierarchy Viewer, and how to interpret the results.</p>
+
+<h2 id="WhatYouNeed">Prerequisites</h2>
+
+<ul>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/setup.html">
+    Device Setup for Hierarchy Viewer</a></li>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/index.html">
+    Hierarchy Viewer Walkthrough</a></li>
+</ul>
+
+<h2 id="ProfilingWithHierarchyViewer">Profiling Steps</h2>
+
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+
+  <ol class="padded">
+
+  <div class="figure" style="">
+<img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image014.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>View hierarchy after profiling.
+      </p>
+    </div>
+
+    <li>Start Hierarchy Viewer for your app.</li>
+
+    <li>In the <b>Tree View</b> or the <b>Layout View</b>, click on the View node whose
+      children you want to profile.</li>
+
+    <li>To start profiling, click the small button with three circles
+<img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image013.png">
+      at the top of the Tree View.
+
+    </li>
+
+    <li>For large view hierarchies, profiling may take a few seconds.</li>
+
+    <li>Each view in your subtree gets three dots, which can be green, yellow, or red.
+
+      <ul>
+        <li>The left dot represents the Draw Process of the rendering pipeline.</li>
+        <li>The middle dot represents the Layout Phase.</li>
+        <li>The right dot represents the Execute Phase.</li>
+      </ul>
+    </li>
+
+</ol></div>
+
+</li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="5">
+
+    <div class="figure" style="">
+<img src="{@docRoot}images/tools/performance/hierarchy-viewer/gettingstarted_image015.png"
+         alt=""
+         width="240px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>How the colored dots relate<br>to the rendering pipeline.
+      </p>
+    </div>
+
+    <li>These dots roughly correspond to the Measure,
+     Layout, and Draw
+      phases of the processing pipeline.</li>
+
+    <li>The color of the dots indicates the relative performance
+      of this node in respect to all other profiled nodes.
+
+      <ul>
+        <li><strong>Green</strong> means the view renders faster than at least
+          half of the other views.</li>
+
+        <li><strong>Yellow</strong> means the view renders faster than the bottom
+          half of the other views.</li>
+
+        <li><strong>Red</strong> means the view is among the slowest
+         half of views.</li>
+      </ul>
+    </li>
+
+    </ol>
+</div></li>
+</ul>
+
+  <h2 id="InterpretingResults">Interpreting Hierarchy Viewer Profiling Results</h2>
+
+    <p>Hierarchy Viewer measures the <em>relative performance</em> of a
+      node</b>, so there are always red nodes in a profile, and it
+      doesn't necessarily mean that view is too slow for the users of
+      your app.</p>
+
+    <p>Hierarchy Viewer software rasterizes your Activity to acquire the timing
+      information. Rasterization is the process of taking a high-level primitive, such as a
+      circle or a vector font, and turning it into pixels on the screen. Typically,
+      rasterization is done by the GPU on your device, but in the case of
+      software rasterization, rendering is done on the CPU with
+      ordinary software. This means that the absolute
+      reported timings are correct relative to each other, but are bloated and vary
+      depending on the overall and changing CPU workload on your device and PC. Profile
+      several times to get a feel for the average measurements.</p>
+
+    <p>The following are guidelines for interpreting Hierarchy Viewer profiling output.</p>
+
+    <p>A red node is a potential problem in any situation where your app has
+      unexpectedly slow performance. In a relative setting, there is always a
+      slowest node; make sure it is the node you expect.
+      The following examples illustrate how to interpret red dots.</p>
+
+      <ul>
+        <li>Look for red dots in leaf nodes or view groups with only a few children. This
+          might point to a problem. Your app may not be slow, or it may not be slow on your
+          device, but you need to be aware of why that dot is red.
+          <a href="{@docRoot}tools/performance/systrace/index.html"> Systrace</a> or
+          <a href="{@docRoot}tools/performance/traceview/index.html"> Traceview</a>
+          can give you additional information. </li>
+
+        <li>If you have a view group with many children and a red measure phase, take a
+          look at the children to see how they are performing.</li>
+
+        <li>A view with yellow or even red dots might not be performing slowly on the
+          device. That's where the actual numbers are helpful.
+          <a href="{@docRoot}tools/performance/systrace/index.html"> Systrace</a> or
+          <a href="{@docRoot}tools/performance/traceview/index.html"> Traceview</a>
+          can give you additional information.</li>
+
+        <li>If the root view of a hierarchy has a red measure phase, red layout phase, and
+          yellow draw phase, this is somewhat typical, because it's the
+          parent of all the other views.</li>
+
+        <li>If a leaf node in a tree with 20+ views has a red draw phase, this <i>is</i> a
+          problem. Check your OnDraw method for code that shouldn't be
+          there.</li>
+       </ul>
diff --git a/docs/html/tools/performance/hierarchy-viewer/setup.jd b/docs/html/tools/performance/hierarchy-viewer/setup.jd
new file mode 100644
index 0000000..aaac1ca
--- /dev/null
+++ b/docs/html/tools/performance/hierarchy-viewer/setup.jd
@@ -0,0 +1,89 @@
+page.title=Device Setup for Hierarchy Viewer
+meta.tags="android, performance, profiling, tools, rendering, hierarchyviewer"
+page.tags="android", "performance", "profiling", "tools", "rendering", "hierarchyviewer"
+page.metaDescription=Set up your mobile device to work with Hierarchy Viewer.
+page.image=tools/performance/thumbnails/tools_hierarchy_viewer.png
+page.article=true
+
+@jd:body
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/index.html">
+    Hierarchy Viewer Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/profiling.html">
+    Profiling with Hierarchy Viewer</a></li>
+</ul>
+
+</div>
+
+    <p>To run Hierarchy Viewer, you must enable Developer Options on your mobile device and perform
+      some setup on your computer.</p>
+
+    <h2>Configuring Devices</h2>
+
+    <ol>
+      <li><p>Enable <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    on your mobile device.</p></li>
+
+    <li>Depending on the type of device you have, do one of the following:
+      <ul>
+        <li>If you have a locked device running Android 4.0 or lower, follow the instructions
+          for <a href=
+               "https://github.com/romainguy/ViewServer">installing and configuring ViewServer</a>.
+        </li>
+        <li>If you have an unlocked device running Android 4.0 or lower,
+          no further configuration is needed.</li>
+        <li>If you have a device running Android 4.1 or higher, you must set an environment
+          variable on your development machine. For more information,
+          see <a href="#hvproto-variable">Setting the ANDROID_HVPROTO variable</a>
+      </ul>
+    </li>
+    </ol>
+
+
+    <h2 id="hvproto-variable">Setting the ANDROID_HVPROTO variable</h2>
+
+    <h3>Windows</h3>
+
+    <ol>
+      <li>Click <b>My Computer &gt; Property &gt; Advanced &gt; Environment Variables.</b></li>
+
+      <li>Click <b>New.</b></li>
+
+      <li>In variables name put: <code>ANDROID_HVPROTO</code></li>
+
+      <li>In variable value put: <code>ddm</code></li>
+
+      <li>Click <b>OK</b><./li>
+    </ol>
+
+    <h3>Mac</h3>
+
+    <ol>
+      <li>Edit <code>~/.bash_profile</code></li>
+
+      <li>Add:
+        <br><code>#Hierarchy Viewer Variable
+        <br>export ANDROID_HVPROTO=ddm</code>
+      </li>
+
+      <li><code>source ~/.bash_profile</code></li>
+    </ol>
+
+    <h3>Linux</h3>
+
+    <ol>
+      <li>Edit <code>~/.bash_profile</code></li>
+
+      <li>Add:
+
+        <br><code>#Hierarchy Viewer Variable
+        <br>export ANDROID_HVPROTO=ddm</code>
+      </li>
+
+    <li><code>source ~/.bash_profile</code></li>
+  </ol>
diff --git a/docs/html/tools/performance/importing-legacy-apps.jd b/docs/html/tools/performance/importing-legacy-apps.jd
new file mode 100644
index 0000000..cee3519
--- /dev/null
+++ b/docs/html/tools/performance/importing-legacy-apps.jd
@@ -0,0 +1,149 @@
+page.title=Importing Legacy Apps into Android Studio
+meta.tags="android, performance, profiling, tools"
+page.tags="android", "performance", "profiling", "tools"
+page.metaDescription=Required changes when importing legacy apps into Android Studio.
+page.article=true
+
+@jd:body
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#StepsForImporting">Steps for Importing</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="/tools/device.html">Using Hardware Devices</a></li>
+  <li><a href="/tools/help/index.html">Tools</a></li>
+</ul>
+
+</div>
+
+
+  <p>Importing some pre-Android-1.0 projects into Android 1.0 or newer can trigger a series of
+  errors. This document shows you how to resolve them, using a version of the Sunshine app used in
+  the <a href="https://www.udacity.com/course/ud853">Android Fundamentals Udacity Course</a> as an
+  example.</p>
+
+  <p><b>CAVEAT:</b> As with all documentation of this kind, the details are likely to vary for each
+  application and each update of Android Studio.</p>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>The latest version of <a href="http://developer.android.com/sdk/index.html">Android
+    Studio</a> (this document uses version 1.1).</li>
+
+    <li>It helps to know how to <a href="https://developer.android.com/training/index.html">build
+    and run apps from Android Studio</a> on your device.</li>
+
+    <li>To use Sunshine, you need to download code from <a href=
+    "https://github.com/">github.com</a>. More info at <a href=
+    "https://help.github.com/">help.github.com</a>.</li>
+  </ul>
+
+  <h2 id="StepsForImporting">Steps for Importing Sunshine into Android Studio 1.1.0</h2>
+
+  <ol>
+    <li>Download Sunshine ZIP from GitHub: <a href=
+    "https://github.com/udacity/sunshine/tree/6.10-update-map-intent">https://github.com/udacity/sunshine/tree/6.10-update-map-intent</a>.
+    (If you are having any problems with Android Studio or the app, use the following version, or
+    your own app, to follow along with the example.<a href=
+    "https://github.com/udacity/sunshine/tree/3.13-add-share-action-provider">https://github.com/udacity/sunshine/tree/3.13-add-share-action-provider</a>)
+
+    <li>Unzip the application to extract the code folder.</li>
+
+    <li>Start Android Studio. (This works best if you close all projects, then restart.)</li>
+
+    <li>Click <b>Import</b> <b>project (Eclipse ADT, Gradle, etc.)</b>.
+      <br><img src="{@docRoot}images/tools/performance/import_image001.png">
+    </li>
+
+    <li>In the popup, find and select the Sunshine-6-10-updated-map-intent folder and click
+      <b>OK</b>.
+      <br><img src="{@docRoot}images/tools/performance/import_image002.png">
+    </li>
+
+    <li>If prompted, choose a destination folder for your project. If prompted to choose a build
+    system, choose Gradle. (These prompts vary, depending on your project and Android Studio
+    version.) If you need more guidance, see this <a href=
+    "http://www.lynda.com/articles/eclipse-into-android-studio">Lynda tutorial</a>.</li>
+
+    <li>Wait for the import to complete. If you see no errors, you are now ready to work with your
+    app.
+
+    <p><b>If you get a Gradle error:</b></p>
+
+    <li>If you get a Gradle error, you have some extra work to do.(Because the Import
+    didn&#40t finish, at this point, you may only see the <b>Gradle
+    Scripts</b> directory in your Project view.)</li>
+
+    <li>You may see the link <b>Install missing platform(s) and sync
+    project</b>, or a link to install missing build tools.
+    Click whatever link and
+    proceed.</li>
+
+    <li>The next time through, your build will fail with:
+      <br><img src="{@docRoot}images/tools/performance/import_image003.png">
+    </li>
+
+    <li>Click the <b>Fix plugin version and re-import project</b> link
+    in the error message. This will rebuild the app and present you with new of errors.
+      <br><img src="{@docRoot}images/tools/performance/import_image004.png">
+    </li>
+
+    <li>Click the <b>Gradle Settings</b> link in the error message.</li>
+
+    <li>Check the <b>Use auto-import</b> and click <b>OK</b>.
+      <br><img src="{@docRoot}images/tools/performance/import_image005.png">
+    </li>
+
+    <li>Expand the project hierarchy and find the <b>build.gradle file</b>.The file you are looking
+      for is not the one showing at the top level, but the one inside <b>Sunshine</b> <b>&gt;</b>
+      <b>app &gt; build.gradle</b>, as shown below.
+      <br><img src="{@docRoot}images/tools/performance/import_image006.png">
+   </li>
+
+    <li>Double-click the <code>build.gradle</code> file.</li>
+
+    <li>Make the following changes to the file:</li>
+      <ul>
+        <li>Set <code>compileSdkVersion 21</code></li>
+
+        <li>Set <code>targetSdkVersion 21</code></li>
+
+        <li>Replace <code>runProguard</code> with <code>minifyEnabled</code></li>
+      </ul>
+
+      <p>Your file should look like this: </p>
+        <img src="{@docRoot}images/tools/performance/import_image007.png">
+    </li>
+
+    <li>Save (Ctrl-S).</li>
+
+  <p>For the following two messages (Steps 18/19), what you see might vary. You might see either
+  message or both messages in sequence. Click the appropriate links to continue until the Language
+  Level Changed dialog opens.</p>
+
+    <li>In the code view bar, click the <b>Try again</b> link.
+      <br><img src="{@docRoot}images/tools/performance/import_image008.png">
+    </li>
+
+    <li>If you see these warnings, click the <b>Sync now</b> link.
+      <br><img src="{@docRoot}images/tools/performance/import_image009.png">
+    </li>
+
+    <li>In the Language Level Changed dialog, click <b>Yes</b>. And if you get the Gradle Running
+      dialog, <b>Yes</b> again.
+      <br><img src="{@docRoot}images/tools/performance/import_image010.png">
+    </li>
+
+    <li>After the project reloads, run the app on your device. (If it crashes the first time, try
+    again, and it will run.)
+    <br><img src="{@docRoot}images/tools/performance/import_image011.png">
+    </li>
+  </ol>
+
diff --git a/docs/html/tools/performance/index.jd b/docs/html/tools/performance/index.jd
new file mode 100644
index 0000000..fa5af86
--- /dev/null
+++ b/docs/html/tools/performance/index.jd
@@ -0,0 +1,73 @@
+page.title=Performance Profiling Tools
+meta.tags="android, develop, performance, profiling, tools, gather"
+page.tags="android", "develop", "performance", "profiling", "tools" "gather"
+page.metaDescription=Android Studio profiling tools for evaluating your app's performance.
+page.article=true
+
+@jd:body
+
+  <p>Putting pixels on the screen involves four primary pieces of hardware.
+  To greatly simplify, the CPU computes display lists, the GPU renders images to
+  the display, the memory stores images and data, and the battery provides
+  electrical power. Each of these pieces of hardware has constraints; pushing
+  or exceeding those constraints causes your app to be slow, have
+  bad display performance, or exhaust the battery.
+
+  <p>To discover what causes your specific performance problems, you need to
+  take a look under the hood, use tools to collect data about your app's
+  execution behavior, surface that data as lists and
+  graphics, understand and analyze what you see, and improve your code.</p>
+
+  <p>Android Studio and your device provide profiling tools to record and
+  visualize the rendering, compute, memory, and battery performance of your
+  app.</p>
+
+<h2 id="rendering-tools">Rendering Analysis Tools</h2>
+
+<p>Visualize the rendering behavior and performance of your app.</p>
+
+<div class="dynamic-grid">
+  <div class="resource-widget resource-flow-layout landing col-12"
+    data-query="collection:tools/performance/rendering"
+    data-cardSizes="9x3"
+    data-maxResults="6">
+  </div>
+</div>
+
+<h2 id="memory-tools">Memory Analysis Tools</h2>
+
+<p>Visualize the memory behavior and performance of your app.</p>
+
+<div class="dynamic-grid">
+  <div class="resource-widget resource-flow-layout landing col-12"
+    data-query="collection:tools/performance/memory"
+    data-cardSizes="9x3"
+    data-maxResults="6">
+  </div>
+</div>
+
+<h2 id="cpu-tools">Compute Analysis Tools</h2>
+
+<p>Visualize the CPU behavior and performance of your app.</p>
+
+<div class="dynamic-grid">
+  <div class="resource-widget resource-flow-layout landing col-12"
+    data-query="collection:tools/performance/cpu"
+    data-cardSizes="9x3"
+    data-maxResults="4">
+  </div>
+</div>
+
+<h2 id="battery-tools">Battery Analysis Tools</h2>
+
+<p>Visualize the battery behavior and performance of your app.</p>
+
+<div class="dynamic-grid">
+  <div class="resource-widget resource-flow-layout landing col-12"
+    data-query="collection:tools/performance/battery"
+    data-cardSizes="9x3"
+    data-maxResults="4">
+  </div>
+</div>
+
+
diff --git a/docs/html/tools/performance/memory-monitor/index.jd b/docs/html/tools/performance/memory-monitor/index.jd
new file mode 100644
index 0000000..756ca14
--- /dev/null
+++ b/docs/html/tools/performance/memory-monitor/index.jd
@@ -0,0 +1,172 @@
+page.title=Memory Monitor Walkthrough
+meta.tags="android, performance, profiling, tools, memory, memoryleaks, garbagecollection, memorymonitor"
+page.tags="android", "performance", "profiling", "tools", "memory", "memoryleaks", "garbagecollection", "memorymonitor"
+page.metaDescription=Graph memory usage and garbage collection events for your app in real-time.
+page.image=tools/performance/thumbnails/tools_memory_monitor.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithMemoryMonitor">Working with Memory Monitor</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/heap-viewer/index.html">
+    Heap Viewer Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/allocation-tracker/index.html">
+    Allocation Tracker Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/comparison.html">
+    Comparison: Memory Monitor, Heap Viewer, Allocation Tracker</a>
+  <li><a href="{@docRoot}tools/performance/traceview/index.html">
+    Traceview Walkthrough</a></li>
+</ul>
+
+</div>
+
+
+  <p>This walkthrough shows the basic usage and workflow for the Memory Monitor tool in Android
+  Studio. Memory Monitor reports in real-time how your app allocates memory.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Showing available and used memory in a graph, and garbage collection events over time.</li>
+
+    <li>Quickly testing whether app slowness might be related
+    to excessive garbage collection events.</li>
+
+    <li>Quickly testing whether app crashes may be related to running out of
+    memory.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+
+    <li>An Application with USB Debugging enabled. Use your own, or the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+  <h2 id="WorkingWithMemoryMonitor">Working with Memory Monitor</h2>
+
+ <ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+  <img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image001.png"
+         alt=""
+         width="300px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Starting Memory Monitor.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source,
+      and run it on your device.</li></li>
+
+    <li>In Android Studio, choose <b>Tools &gt; Android &gt; Memory Monitor.</b></li>
+
+ </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="4">
+
+    <div class="figure" style="">
+  <img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image002.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Choosing the device and Activity to monitor.
+      </p>
+    </div>
+
+    <li>This opens the Memory Monitor pane.</li>
+
+    <li>Choose your device from the drop-down menu at the top left of the pane.</li>
+
+    <li>Choose your Activity from the drop-down menu at the top right of the pane.</li>
+
+ </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="7">
+
+    <div class="figure" style="">
+  <img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image003.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 3. </strong>Allocated and free memory in Memory Monitor.
+      </p>
+    </div>
+
+    <li>Once Memory Monitor starts tracking your device, a stacked graph appears,
+      tracking memory usage over time.
+
+      <p>Dark blue: Amount of memory that your app
+      is currently using.</p>
+
+      <p>Light blue: Available, unallocated memory.</p>
+    </li>
+
+    <li>Over time, this graph updates, showing changes in memory usage.</li>
+
+    <li>As your app allocates and frees memory, the allocated amount shown in the
+      graph changes.</li>
+
+    <li>When you see the allocated memory drop by a large amount, a garbage
+      collection (GC) event has occurred.</li>
+
+ </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="11">
+
+    <div class="figure" style="">
+  <img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image005.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Forcing a GC (Garbage Collection) event.
+      </p>
+    </div>
+
+    <li>You can force a garbage collection event by clicking on the garbage truck
+      icon
+<img src="{@docRoot}images/tools/performance/memory-monitor/gettingstarted_image004.png">.
+    </li>
+
+ </ol>
+</div></li>
+</ul>
+
+
diff --git a/docs/html/tools/performance/profile-gpu-rendering/index.jd b/docs/html/tools/performance/profile-gpu-rendering/index.jd
new file mode 100644
index 0000000..74862b5
--- /dev/null
+++ b/docs/html/tools/performance/profile-gpu-rendering/index.jd
@@ -0,0 +1,181 @@
+page.title=Profiling GPU Rendering Walkthrough
+meta.tags="android, performance, profiling, tools, rendering, gpu"
+page.tags="android", "performance", "profiling", "tools", "rendering", "gpu"
+page.metaDescription=Overlay a graph on your device, showing how long it takes to render UI elements relative to the 16-ms-per-frame benchmark.
+page.image=tools/performance/thumbnails/tools_profile_gpu_rendering.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#ProfileGPURendering">Profile GPU Rendering</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/debug-gpu-overdraw/index.html">
+    Debug GPU Overdraw Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/hierarchy-viewer/index.html">
+    Hierarchy Viewer Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows how to use Profile GPU Rendering on your mobile device.</p>
+
+  <p>Profile GPU Rendering gives you a quick visual representation of how much time it takes to
+  render the frames of a UI window relative to the 16-ms-per-frame benchmark.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Quickly seeing how a UI window performs against the 16-ms-per-frame target.</li>
+
+    <li>Identifying whether any part of the rendering pipeline stands out in using processing
+    time.</li>
+
+    <li>Looking for spikes in frame rendering time associated with user or program actions.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device running at least Android 4.1 with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+  </ul>
+
+<h2 id="ProfileGPURendering">Working with Profile GPU Rendering</h2>
+
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+  <div class="figure" style="">
+      <img
+src="{@docRoot}images/tools/performance/profile-gpu-rendering/gettingstarted_image001.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Turning on Profile GPU Rendering.
+      </p>
+    </div>
+
+    <li>On your mobile device, go to <b>Settings &gt;</b> <b>Developer Options</b>.</li>
+
+    <li>In the <em>Monitoring</em> section, select <b>Profile GPU Rendering</b>.</li>
+
+    <li>In the Profile GPU Rendering popup, choose <b>On screen as bars</b> to overlay the graphs
+    on the screen of your mobile device.</li>
+
+    <li>Go to the app that you want to profile.</li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+
+  <div class="figure" style="">
+    <img
+src="{@docRoot}images/tools/performance/profile-gpu-rendering/gettingstarted_image002.png"
+         alt=""
+         width="400px" />
+    <p class="img-caption">
+      <strong>Figure 2. </strong>Screen when Profile GPU Rendering is on.
+    </p>
+  </div>
+
+  <h3>What you see:</h3>
+
+    <ul>
+      <li>For each visible application, the tool displays a graph.</li>
+
+      <li>The horizontal axis shows time elapsing, and the vertical axis time per frame in
+        milliseconds.</li>
+
+      <li>As you interact with your application, vertical bars show up on your screen, appearing
+        from left to right, graphing frame performance over time.</li>
+
+      <li>Each vertical bar represents one frame of rendering.
+        The taller the bar, the longer it took to render.</li>
+
+      <li>The green line marks the 16 millisecond target. Every time a frame crosses the green line,
+        your app is missing a frame, and your users may see this as stuttering images.
+    </ul>
+
+</div></li>
+
+<li style="list-style-type:none;><!-- fix issue with visible disc -->
+<div style="overflow:hidden">
+<hr>
+
+  <h3>The Profile GPU Rendering Graph</h3>
+
+    <img
+src="{@docRoot}images/tools/performance/profile-gpu-rendering/gettingstarted_image003.png"
+         alt=""
+         height="" />
+    <p class="img-caption">
+      <strong>Figure 3. </strong>Enlarged Annotated Profile GPU Rendering graph.
+    </p>
+
+  <p>In this enlarged image of the Profile GPU Rending graph you can see the colored sections
+    of the graph, and what phase of the rendering pipeline each color represents.</p>
+
+  <ul>
+    <li>The <b>green line</b> represents 16 milliseconds. To achieve 60 frames per second,
+      the vertical bar for each frame needs
+      to stay below this 16 ms mark. Any time a bar pushes above this line, there may be pauses in
+      the animations.</li>
+
+    <li>Each bar has a blue, purple (only for Android version 4.0 and higher),
+      red, and orange component.</p>
+
+    <li>The <b>blue</b> section of the bar represents the time used to create and update the
+      View's display lists. If this part of the bar is tall, there may be a
+      lot of custom view drawing, or a lot of work in onDraw methods.</li>
+
+    <li>Android 4.0 and higher: The <b>purple</b> section of the bar represents the time spent
+      transferring resources to the render thread.</li>
+
+    <li>The <b>red</b> section of the bar represents the time spent by
+      Android's 2D renderer issuing commands to OpenGL to draw and redraw
+      display lists. The height of this bar is directly proportional to the sum of the time it takes each
+      display list to execute&mdash;more display lists equals a taller red bar.</li>
+
+    <li>The <b>orange</b> section of the bar represents the time the CPU is waiting for the GPU to
+      finish its work. If this bar gets tall, it means the app is doing too much work on the GPU.
+    </li>
+  </ul>
+
+  <p class="note"><strong>Note:</strong>
+    While this tool is named Profile GPU Rendering, all monitored processes actually
+    occur in the CPU. Rendering happens by submitting commands to the GPU, and the GPU renders the
+    screen asynchronously. In certain situations, the GPU can have too much work to do,
+    and your CPU will have to wait before it can submit new commands.
+    When this happens, you'll see spikes in the Process (orange bar) and Execute (red bar)
+    stages, and the sommand submission will block until more room is made on the
+    GPU command queue.
+  </p>
+
+  </div></li>
+</ul>
+
+
+
+
diff --git a/docs/html/tools/performance/systrace/index.jd b/docs/html/tools/performance/systrace/index.jd
new file mode 100644
index 0000000..97099a0
--- /dev/null
+++ b/docs/html/tools/performance/systrace/index.jd
@@ -0,0 +1,182 @@
+page.title=Systrace Walkthrough
+meta.tags="android, performance, profiling, tools, compute, systrace"
+page.tags="android", "performance", "profiling", "tools", "compute", "systrace"
+page.metaDescription=Collect system and application process execution data to identify performance bottlenecks.
+page.image=tools/performance/thumbnails/tools_systrace.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithSystrace">Working with Systrace</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/traceview/index.html">
+    Traceview Walkthrough</a></li>
+    <li><a href="{@docRoot}tools/performance/allocation-tracker/index.html">
+    Allocation Tracker Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows the basic usage and workflow for the Systrace tool in the Android
+  Device Monitor.</p>
+
+  <p>Systrace collects system and application process execution data and generates detailed,
+  interactive reports from devices running Android 4.1 and higher.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Evaluating container performance.</li>
+
+    <li>Finding performance bottlenecks in the execution of your code.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>Android SDK Tools 20.</li>
+
+    <li><a href="http://www.python.org/">Python</a> installed and included in your development
+    computer's execution path.</li>
+
+    <li>A mobile device running at least Android 4.1 with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    and USB Debugging enabled in Developer Options.</li>
+
+    <li>Application code. Use your own code, or the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+  <h2 id="WorkingWithSystrace">Working with Systrace</h2>
+
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/systrace/gettingstarted_image001.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Starting Android Device Monitor.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+
+    <li>From Android Studio, start the Android Device Monitor: <b>Tools -&gt; Android -&gt; Android
+    Device</b> <b>Monitor</b>.
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="4">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/systrace/gettingstarted_image003.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Steps for starting Systrace.
+      </p>
+    </div>
+
+    <li>Make sure your
+      device and the package for your application are showing in the Devices (DDMS mode) or
+      Windows (Hierarchy Viewer mode) tab.
+
+      <p>You can choose <b>Window &gt; Reset Perspective</b> to
+      get back to the default arrangement.</p>
+    </li>
+
+    <li>Click the <b>DDMS</b> button, because Systrace is one of the DDMS tools.</li>
+
+    <li>Click the <b>Systrace</b> button
+      <img src="{@docRoot}images/tools/performance/systrace/gettingstarted_image002.png">.</li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="7">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/systrace/gettingstarted_image004.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+       <strong>Figure 3. </strong>Steps for creating a trace.
+      </p>
+    </div>
+
+    <li>In the <b>Android System Trace</b> popup, choose your settings for the trace.
+
+      <ul>
+        <li><b>Destination File:</b> Where the trace is stored as an HTML file. Default is in
+        your home directory as <code>trace.html</code>.</li>
+
+        <li><b>Trace Duration:</b> Default is 5 seconds,
+          and 30 seconds is a good time to choose.</li>
+
+        <li><b>Trace Buffer size:</b> Default is unlimited.</li>
+
+        <li><b>Enable Application Traces from:</b> Make sure your app is selected.</li>
+
+        <li><b>Select tags to enable:</b> Choose at least one value to trace, for example Graphics
+        and View System.</li>
+      </ul>
+    </li>
+
+    <li>Click <b>OK</b> to start tracing.</li>
+
+    <li>Interact with your app.</li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="10">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/systrace/gettingstarted_image005.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Example systrace output in browser.
+      </p>
+    </div>
+
+    <li>When the trace is done, you are automatically returned to Android Device Monitor.</li>
+
+    <li>Go to your home directory, or the directory you chose as the file destination.</li>
+
+    <li>Open the <code>trace.html</code> file in your browser.</li>
+
+   </ol>
+</div></li>
+</ul>
+
+
diff --git a/docs/html/tools/performance/thumbnails/tools_allocation_tracker.png b/docs/html/tools/performance/thumbnails/tools_allocation_tracker.png
new file mode 100644
index 0000000..cbae4cd
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_allocation_tracker.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_battery_historian.png b/docs/html/tools/performance/thumbnails/tools_battery_historian.png
new file mode 100644
index 0000000..d1d58ac
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_battery_historian.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_debug_gpu_overdraw.png b/docs/html/tools/performance/thumbnails/tools_debug_gpu_overdraw.png
new file mode 100644
index 0000000..ff402d0
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_debug_gpu_overdraw.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_heap_viewer.png b/docs/html/tools/performance/thumbnails/tools_heap_viewer.png
new file mode 100644
index 0000000..d9028d0
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_heap_viewer.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer.png b/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer.png
new file mode 100644
index 0000000..064efea
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer_profiling.png b/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer_profiling.png
new file mode 100644
index 0000000..e9824a4
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_hierarchy_viewer_profiling.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_memory_monitor.png b/docs/html/tools/performance/thumbnails/tools_memory_monitor.png
new file mode 100644
index 0000000..c761141
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_memory_monitor.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_profile_gpu_rendering.png b/docs/html/tools/performance/thumbnails/tools_profile_gpu_rendering.png
new file mode 100644
index 0000000..c86fb14
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_profile_gpu_rendering.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_systrace.png b/docs/html/tools/performance/thumbnails/tools_systrace.png
new file mode 100644
index 0000000..567a8a7
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_systrace.png
Binary files differ
diff --git a/docs/html/tools/performance/thumbnails/tools_traceview.png b/docs/html/tools/performance/thumbnails/tools_traceview.png
new file mode 100644
index 0000000..16e6bdd
--- /dev/null
+++ b/docs/html/tools/performance/thumbnails/tools_traceview.png
Binary files differ
diff --git a/docs/html/tools/performance/traceview/index.jd b/docs/html/tools/performance/traceview/index.jd
new file mode 100644
index 0000000..4a3f190
--- /dev/null
+++ b/docs/html/tools/performance/traceview/index.jd
@@ -0,0 +1,292 @@
+page.title=Traceview Walkthrough
+meta.tags="android, performance, profiling, tools, compute, traceview"
+page.tags="android", "performance", "profiling", "tools", "compute", "traceview"
+page.metaDescription=Log method execution over time and inspect execution data, per-thread timelines, and call stacks to track down performance issues in your source code.
+page.image=tools/performance/thumbnails/tools_traceview.png
+page.article=true
+
+@jd:body
+
+<style>
+  .no-bullet {
+    list-style-type: none;
+  }
+  .padded {
+    padding-left: 10px;
+  }
+</style>
+
+<div id="tb" style="margin-left: 7px; margin-bottom: 5px;">
+
+<h2>In this document</h2>
+<ul>
+  <li><a href="#WhatYouNeed">Prerequisites</a></li>
+  <li><a href="#WorkingWithTraceview">Working with Traceview</a></li>
+</ul>
+
+<h2>You should also read</h2>
+<ul>
+  <li><a href="{@docRoot}tools/performance/heap-viewer/index.html">
+    Heap Viewer Walkthrough</a></li>
+  <li><a href="{@docRoot}tools/performance/systrace/index.html">
+    Systrace Walkthrough</a></li>
+</ul>
+
+</div>
+
+  <p>This walkthrough shows the basic usage and workflow for the Traceview tool. Traceview logs
+  method execution over time and shows execution data, per-thread timelines, and call stacks.</p>
+
+  <p>What it's good for:</p>
+
+  <ul>
+    <li>Tracking down performance problems in your source code.</li>
+  </ul>
+
+  <h2 id="WhatYouNeed">Prerequisites</h2>
+
+  <ul>
+    <li>A mobile device with <a href=
+    "http://developer.android.com/tools/device.html#developer-device-options">Developer Options</a>
+    enabled.</li>
+
+    <li>Application code. Use your own code, or the <a href=
+    "https://github.com/udacity/Sunshine-Version-2">Sunshine</a> sample app from the <a href=
+    "https://www.udacity.com/course/ud853">Android Fundamentals Udacity course</a>.</li>
+  </ul>
+
+<h2 id="WorkingWithTraceview">Working with Traceview</h2>
+
+<ul class="no-bullet">
+<!-- this also hides bullet, by default outside box -->
+ <li><div style="overflow:hidden">
+  <ol class="padded">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image001.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 1. </strong>Steps for starting Android Device Monitor.
+      </p>
+    </div>
+
+    <li>Connect your mobile device to your computer.</li>
+
+    <li>Open your application in Android Studio, build the source, and run it on your device.</li>
+
+    <li>Start the Android Device Monitor from Android Studio: <b>Tools -&gt; Android -&gt; Android
+    Device</b> <b>Monitor</b>.
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="4">
+
+      <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image002.png"
+           alt=""
+           width="400px" />
+      <p class="img-caption">
+        <strong>Figure 2. </strong>Steps for starting Traceview.
+      </p>
+    </div>
+
+    <li>Make sure your device
+      and the package for your application are showing in the <b>Devices</b> (DDMS mode) or
+      <b>Windows</b> (Hierarchy Viewer mode) tab.
+
+      <p>If necessary choose <b>Window &gt; Reset
+      Perspective</b> to get back to the default pane arrangement.</p></li>
+
+    <li>Click the <b>DDMS</b> button, because Traceview is one of the DDMS tools.</li>
+
+    <li>Select the app you want to profile.
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="7">
+
+      <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image004.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 3. </strong>Starting profiling.
+      </p>
+    </div>
+
+    <li>Click the Start method profiling
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image003.png">
+        button.
+    </li>
+
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="8">
+
+     <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image005.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 4. </strong>Choosing profiling options.
+      </p>
+    </div>
+
+    <li>In the <b>Profiling Options</b> popup:
+
+      <ul>
+        <li>Choose <b>Sample based profiling</b></li>
+
+        <li>Keep the default sampling rate of 1000 microseconds.</li>
+
+        <li>Click <b>OK</b>.</li>
+      </ul>
+    </li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="9">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image007.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 5. </strong>Stopping profiling.
+      </p>
+    </div>
+
+
+    <li>Interact with your application. If you are aware of performance issues that
+      your users experience, perform those actions.</li>
+
+    <li>Click the Stop method profiling
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image006.png">
+      button.</li>
+
+    <li>Wait for the trace to load. This may take a few seconds if you recorded for a
+      long time.</li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="12">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image008.png"
+         alt=""
+         width="440px" />
+      <p class="img-caption">
+        <strong>Figure 6. </strong>Traceview output panes.
+      </p>
+    </div>
+
+    <li>Traceview has two panels: <b>Timeline</b> pane and <b>Profile</b> pane, which
+      are described below.</li>
+
+    <li>Use the <b>Find</b> box at the bottom to filter your profile results. For
+      example, if you are interested in finding the running time for a function, you can
+      search for it, and the tool will highlight it in the timeline.
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="14">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image009.png"
+         alt=""
+         width="400px" />
+      <p class="img-caption">
+        <strong>Figure 7. </strong>Annotated timeline panel.
+      </p>
+    </div>
+
+    <li>The <b>Timeline</b> pane visualizes how your code executes over time.
+
+      <ul>
+        <li>Each row shows a thread.</li>
+
+        <li>Each bar on the timeline is a method executing.</li>
+
+        <li>Each color is for a different method; every time a method executes, you see
+          a the same color bar.</li>
+
+        <li>The width of its bar indicates how long the method takes to execute.</li>
+      </ul>
+    </li>
+
+    <li>When you are zoomed out, a bar indicates when a method is executing.</li>
+
+ </ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="16">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image010.png"
+         alt=""
+         width="300px" />
+       <p class="img-caption">
+        <strong>Figure 8. </strong>Segment for method on the timeline.
+      </p>
+    </div>
+
+    <li>Zoom into the graph, and the bar for each method expands into a colored
+      U-shape, where the left side of the U indicates the start, and the right side
+      the end of the method's execution.</li>
+</ol>
+</div></li>
+
+<li><div style="overflow:hidden">
+<hr>
+  <ol class="padded" start="17">
+
+    <div class="figure" style="">
+      <img src="{@docRoot}images/tools/performance/traceview/gettingstarted_image011.png"
+         alt=""
+         width="440px" />
+      <p class="img-caption">
+        <strong>Figure 9. </strong>Traceview Profiling pane with callstack.
+      </p>
+    </div>
+
+    <li>The <b>Profiling</b> pane shows a list of methods.
+
+      <ul>
+        <li>Select a method to see who called it (Parent) and who it's
+          calling (Children).</li>
+
+        <li>The selected method is also highlighted in the <b>Timeline</b> pane.</li>
+
+        <li>The columns show exclusive and inclusive CPU and real times, percentages,
+        ratios, and how often a method was called.</li>
+
+        <li>The <em>exclusive time</em> is the time spent just in the method itself, which can
+        help you find issues within that specific method.</li>
+
+        <li>The <em>inclusive time</em> is for the method and all methods it calls, which
+        can help you find problems with your call tree.</li>
+
+      <li>The <b>Calls+Rec</b> column shows how many times a method was called recursively,
+        which can help you track down performance issues.</li>
+      </ul>
+    </li>
+  </ol>
+</div></li>
+</ul>
diff --git a/docs/html/tools/sdk/ndk/index.jd b/docs/html/tools/sdk/ndk/index.jd
index ae15bc1..90116d4 100644
--- a/docs/html/tools/sdk/ndk/index.jd
+++ b/docs/html/tools/sdk/ndk/index.jd
@@ -1,4470 +1,21 @@
-ndk=true
-page.template=sdk
-
-
-ndk.mac64_download=android-ndk-r10e-darwin-x86_64.bin
-ndk.mac64_bytes=388937326
-ndk.mac64_checksum=2cb8893a5701603519d38a7e04c50e81
-
-ndk.linux64_download=android-ndk-r10e-linux-x86_64.bin
-ndk.linux64_bytes=401522849
-ndk.linux64_checksum=19af543b068bdb7f27787c2bc69aba7f
-
-ndk.linux32_download=android-ndk-r10e-linux-x86.bin
-ndk.linux32_bytes=394281908
-ndk.linux32_checksum=c3edd3273029da1cbd2f62c48249e978
-
-ndk.win64_download=android-ndk-r10e-windows-x86_64.exe
-ndk.win64_bytes=419616132
-ndk.win64_checksum=8412bb4991a95e08fda50b5a44d95df7
-
-ndk.win32_download=android-ndk-r10e-windows-x86.exe
-ndk.win32_bytes=396563176
-ndk.win32_checksum=1a82445baaf62aec3a46386ab1e5772c
-
-
-
 page.title=Android NDK
 @jd:body
 
 
 
-
-<div id="tos" style="display:none;width:760px;height:0;margin:0 auto">
-
-<div id="download" class="ndk" style="
-z-index: 99;
-width: 720px;
-position: absolute;
-margin: -70px 0;
-padding: 14px;
-background: white;
-border: 1px solid #999;
-box-shadow: -10px 10px 50px #888;
--moz-box-shadow: -10px 10px 50px #888;
--webkit-box-shadow: -10px 10px 50px #888;">
-<p>Before installing the Android NDK, you must agree to the following terms and conditions.</p>
-<div class="sdk-terms" style="width:auto" onfocus="this.blur()">
-<h2 class="norule">Terms and Conditions</h2>
-This is the Android Software Development Kit License Agreement
-
-<h3>1. Introduction</h3>
-1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and
-specifically including the Android system files, packaged APIs, and Google APIs add-ons) is
-licensed to you subject to the terms of this License Agreement. This License Agreement forms a
-legally binding contract between you and Google in relation to your use of the SDK.
-
-1.2 “Android” means the Android software stack for devices, as made available under the Android
-Open Source Project, which is located at the following URL: http://source.android.com/, as updated
-from time to time.
-
-1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600
-Amphitheatre Parkway, Mountain View, CA 94043, United States.
-
-
-<h3>2. Accepting this License Agreement</h3>
-2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the
-SDK if you do not accept this License Agreement.
-
-2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
-
-2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred
-from receiving the SDK under the laws of the United States or other countries including the country
-in which you are resident or from which you use the SDK.
-
-2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other
-entity, you represent and warrant that you have full legal authority to bind your employer or such
-entity to this License Agreement. If you do not have the requisite authority, you may not accept
-the License Agreement or use the SDK on behalf of your employer or other entity.
-
-
-<h3>3. SDK License from Google</h3>
-3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide,
-royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop
-applications to run on the Android platform.
-
-3.2 You agree that Google or third parties own all legal right, title and interest in and to the
-SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property
-Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law,
-and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
-
-3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement.
-Except to the extent required by applicable third party licenses, you may not: (a) copy (except for
-backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create
-derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile
-handset or any other hardware device except a personal computer, combine any part of the SDK with
-other software, or distribute any software or device incorporating a part of the SDK.
-
-3.4 You agree that you will not take any actions that may cause or result in the fragmentation of
-Android, including but not limited to distributing, participating in the creation of, or promoting
-in any way a software development kit derived from the SDK.
-
-3.5 Use, reproduction and distribution of components of the SDK licensed under an open source
-software license are governed solely by the terms of that open source software license and not this
-License Agreement.
-
-3.6 You agree that the form and nature of the SDK that Google provides may change without prior
-notice to you and that future versions of the SDK may be incompatible with applications developed
-on previous versions of the SDK. You agree that Google may stop (permanently or temporarily)
-providing the SDK (or any features within the SDK) to you or to users generally at Google's sole
-discretion, without prior notice to you.
-
-3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names,
-trademarks, service marks, logos, domain names, or other distinctive brand features.
-
-3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including
-copyright and trademark notices) that may be affixed to or contained within the SDK.
-
-
-<h3>4. Use of the SDK by You</h3>
-4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under
-this License Agreement in or to any software applications that you develop using the SDK, including
-any intellectual property rights that subsist in those applications.
-
-4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a)
-this License Agreement and (b) any applicable law, regulation or generally accepted practices or
-guidelines in the relevant jurisdictions (including any laws regarding the export of data or
-software to and from the United States or other relevant countries).
-
-4.3 You agree that if you use the SDK to develop applications for general public users, you will
-protect the privacy and legal rights of those users. If the users provide you with user names,
-passwords, or other login information or personal information, you must make the users aware that
-the information will be available to your application, and you must provide legally adequate
-privacy notice and protection for those users. If your application stores personal or sensitive
-information provided by users, it must do so securely. If the user provides your application with
-Google Account information, your application may only use that information to access the user's
-Google Account when, and for the limited purposes for which, the user has given you permission to
-do so.
-
-4.4 You agree that you will not engage in any activity with the SDK, including the development or
-distribution of an application, that interferes with, disrupts, damages, or accesses in an
-unauthorized manner the servers, networks, or other properties or services of any third party
-including, but not limited to, Google or any mobile communications carrier.
-
-4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or
-to any third party for) any data, content, or resources that you create, transmit or display
-through Android and/or applications for Android, and for the consequences of your actions
-(including any loss or damage which Google may suffer) by doing so.
-
-4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or
-to any third party for) any breach of your obligations under this License Agreement, any applicable
-third party contract or Terms of Service, or any applicable law or regulation, and for the
-consequences (including any loss or damage which Google or any third party may suffer) of any such
-breach.
-
-
-<h3>5. Your Developer Credentials</h3>
-5.1 You agree that you are responsible for maintaining the confidentiality of any developer
-credentials that may be issued to you by Google or which you may choose yourself and that you will
-be solely responsible for all applications that are developed under your developer credentials.
-
-
-<h3>6. Privacy and Information</h3>
-6.1 In order to continually innovate and improve the SDK, Google may collect certain usage
-statistics from the software including but not limited to a unique identifier, associated IP
-address, version number of the software, and information on which tools and/or services in the SDK
-are being used and how they are being used. Before any of this information is collected, the SDK
-will notify you and seek your consent. If you withhold consent, the information will not be
-collected.
-
-6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in
-accordance with Google's Privacy Policy.
-
-
-<h3>7. Third Party Applications</h3>
-7.1 If you use the SDK to run applications developed by a third party or that access data, content
-or resources provided by a third party, you agree that Google is not responsible for those
-applications, data, content, or resources. You understand that all data, content or resources which
-you may access through such third party applications are the sole responsibility of the person from
-which they originated and that Google is not liable for any loss or damage that you may experience
-as a result of the use or access of any of those third party applications, data, content, or
-resources.
-
-7.2 You should be aware the data, content, and resources presented to you through such a third
-party application may be protected by intellectual property rights which are owned by the providers
-(or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell,
-distribute or create derivative works based on these data, content, or resources (either in whole
-or in part) unless you have been specifically given permission to do so by the relevant owners.
-
-7.3 You acknowledge that your use of such third party applications, data, content, or resources may
-be subject to separate terms between you and the relevant third party. In that case, this License
-Agreement does not affect your legal relationship with these third parties.
-
-
-<h3>8. Using Android APIs</h3>
-8.1 Google Data APIs
-
-8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be
-protected by intellectual property rights which are owned by Google or those parties that provide
-the data (or by other persons or companies on their behalf). Your use of any such API may be
-subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or
-create derivative works based on this data (either in whole or in part) unless allowed by the
-relevant Terms of Service.
-
-8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you
-shall retrieve data only with the user's explicit consent and only when, and for the limited
-purposes for which, the user has given you permission to do so.
-
-
-<h3>9. Terminating this License Agreement</h3>
-9.1 This License Agreement will continue to apply until terminated by either you or Google as set
-out below.
-
-9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK
-and any relevant developer credentials.
-
-9.3 Google may at any time, terminate this License Agreement with you if:
-(A) you have breached any provision of this License Agreement; or
-(B) Google is required to do so by law; or
-(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated
-its relationship with Google or ceased to offer certain parts of the SDK to you; or
-(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country
-in which you are resident or from which you use the service, or the provision of the SDK or certain
-SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
-
-9.4 When this License Agreement comes to an end, all of the legal rights, obligations and
-liabilities that you and Google have benefited from, been subject to (or which have accrued over
-time whilst this License Agreement has been in force) or which are expressed to continue
-indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall
-continue to apply to such rights, obligations and liabilities indefinitely.
-
-
-<h3>10. DISCLAIMER OF WARRANTIES</h3>
-10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE
-SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
-
-10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE
-SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR
-COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
-
-10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-
-
-<h3>11. LIMITATION OF LIABILITY</h3>
-11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS
-LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY
-LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN
-AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
-
-
-<h3>12. Indemnification</h3>
-12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless
-Google, its affiliates and their respective directors, officers, employees and agents from and
-against any and all claims, actions, suits or proceedings, as well as any and all losses,
-liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or
-accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes
-any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of
-any person or defames any person or violates their rights of publicity or privacy, and (c) any
-non-compliance by you with this License Agreement.
-
-
-<h3>13. Changes to the License Agreement</h3>
-13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK.
-When these changes are made, Google will make a new version of the License Agreement available on
-the website where the SDK is made available.
-
-
-<h3>14. General Legal Terms</h3>
-14.1 This License Agreement constitutes the whole legal agreement between you and Google and
-governs your use of the SDK (excluding any services which Google may provide to you under a
-separate written agreement), and completely replaces any prior agreements between you and Google in
-relation to the SDK.
-
-14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is
-contained in this License Agreement (or which Google has the benefit of under any applicable law),
-this will not be taken to be a formal waiver of Google's rights and that those rights or remedies
-will still be available to Google.
-
-14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any
-provision of this License Agreement is invalid, then that provision will be removed from this
-License Agreement without affecting the rest of this License Agreement. The remaining provisions of
-this License Agreement will continue to be valid and enforceable.
-
-14.4 You acknowledge and agree that each member of the group of companies of which Google is the
-parent shall be third party beneficiaries to this License Agreement and that such other companies
-shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that
-confers a benefit on (or rights in favor of) them. Other than this, no other person or company
-shall be third party beneficiaries to this License Agreement.
-
-14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST
-COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE
-LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
-
-14.6 The rights granted in this License Agreement may not be assigned or transferred by either you
-or Google without the prior written approval of the other party. Neither you nor Google shall be
-permitted to delegate their responsibilities or obligations under this License Agreement without
-the prior written approval of the other party.
-
-14.7 This License Agreement, and your relationship with Google under this License Agreement, shall
-be governed by the laws of the State of California without regard to its conflict of laws
-provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located
-within the county of Santa Clara, California to resolve any legal matter arising from this License
-Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for
-injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
-
-
-<em>November 13, 2012</em>
-</div>
-
-
-
-<div id="sdk-terms-form">
-<p>
-<input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" />
-<label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label>
-</p>
-<p><a href="" class="button disabled ndk" id="downloadForRealz" onclick="return onDownloadNdkForRealz(this);"></a></p>
-</div>
-
-
-
-</div>
-</div>
-
- <div id="qv-wrapper">
-    <div id="qv">
-      <h2>In this document</h2>
-
-      <ol>
-        <li><a href="#Downloads">Downloads</a></li>
-        <li><a href="#Revisions">Revisions</a></li>
-        <li><a href="#Reqs">System and Software Requirements</a></li>
-        <li><a href="#Installing">Installing the NDK</a></li>
-        <li><a href="#GetStarted">Getting Started with the NDK</a>
-          <ol>
-            <li><a href="#Using">Using the NDK</a></li>
-          </ol>
-        </li>
-        <li><a href="#Contents">Contents of the NDK</a>
-          <ol>
-            <li><a href="#Tools">Development tools</a></li>
-            <li><a href="#Docs">Documentation</a></li>
-            <li><a href="#Samples">Sample apps</a></li>
-          </ol>
-        </li>
-      </ol>
-    </div>
-  </div>
-
   <p>The NDK is a toolset that allows you to implement parts
-  of your app using native-code languages such as C and C++. For certain types of apps,
-  this can be helpful so you can reuse existing code libraries written in these
-  languages, but most apps do not need the Android NDK.</p>
+  of your app using native-code languages such as C and C++. Typically, good use cases for the NDK
+  are CPU-intensive applications such as game engines, signal processing, and physics simulation.
+  </p>
 
   <p>Before downloading the NDK, you should understand that <strong>the NDK
    will not benefit most apps</strong>. As a developer, you need to balance its benefits
   against its drawbacks. Notably, using native code on Android
   generally does not result in a noticable performance improvement,
   but it always increases your app complexity. In general, you should only use the NDK
-  if it is essential to your app&mdash;never because you simply prefer to program in C/C++.</p>
+  if it is essential to your app&mdash;never because you simply prefer to program in C/C++.
+  When examining whether or not you should develop in native code, think about your requirements and
+  see if the Android framework APIs provide the functionality that you need.</p>
 
-  <p>Typical good candidates for the NDK are CPU-intensive workloads such as game engines,
-  signal processing, physics simulation, and so on. When examining
-  whether or not you should develop in native code, think about your requirements and see if the
-  Android framework APIs provide the functionality that you need.</p>
-
-
-<h2 id="Downloads">Downloads</h2>
-
-
-<script>
-$('#Downloads').after($('#download-table'));
-</script>
-
-<h2 id="Revisions">Revisions</h2>
-
-<p>The following sections provide information about releases of the NDK.</p>
-
-<div class="toggle-content opened">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-opened.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 10e</a> <em>(May 2015)</em>
- </p>
- <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
-        <li>Integrated the workaround for Cortex-A53 Erratum 843419 into the
-        {@code aarch64-linux-android-4.9} linker. For more information on this workaround, see
-        <a href="https://sourceware.org/ml/binutils/2015-03/msg00446.html">Workaround for cortex-a53
-        erratum 843419.</a></li>
-
-         <li>Added Clang 3.6; {@code NDK_TOOLCHAIN_VERSION=clang} now picks that version
-         of Clang by default.</li>
-
-         <li>Removed Clang 3.4.</li>
-
-         <li>Removed GCC 4.6.</li>
-
-         <li>Implemented multithreading support in {@code ld.gold} for all architectures. It can
-         now link with or without support for multithreading; the default is to do it without.
-            <ul>
-            <li>To compile with multithreading, use the {@code --threads} option.</li>
-            <li>To compile without multithreading, use the {@code --no-threads} option.</li>
-            </ul>
-            </li>
-
-         <li>Upgraded GDB/gdbserver to 7.7 for all architectures.</li>
-
-         <li>Removed the NDK package for 32-bit Darwin.</li>
-      </ul>
-      </dd>
-   <dl>
-
-
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-        <li>Fixed a crash that occurred when there were OpenMP loops outside of the main thread.</li>
-
-        <li>Fixed a GCC 4.9 internal compiler error (<i>ICE</i>) that occured when the user declared
-        {@code #pragma GCC optimize ("O0")}, but had a different level of optimization specified
-        on the command line. The {@code pragma} takes precedence.</li>
-
-        <li>Fixed an error that used to produce a crash with the following error message:
-<pre>
-in add_stores, at var-tracking.c:6000
-</pre>
-        </li>
-
-        <li>Implemented a workaround for a Clang 3.5 issue in which LLVM auto-vectorization
-        generates {@code llvm.cttz.v2i64()}, an instruction with no counterpart in the ARM
-        instruction set.</li>
-     </ul>
-     </dd>
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-        <li>Made the following header and library fixes:</li>
-           <ul>
-           <li>Fixed {@code PROPERTY_*} in {@code media/NdkMediaDrm.h}.</li>
-           <li>Fixed {@code sys/ucontext.h} for {@code mips64}.</li>
-           <li>Dropped the Clang version check for {@code __builtin_isnan} and
-           {@code __builtin_isinf}.</li>
-           <li>Added {@code android-21/arch-mips/usr/include/asm/reg.h}
-           and {@code android-21/arch-mips64/usr/include/asm/reg.h}.</li>
-           </ul>
-           </li>
-
-        <li>Fixed a spurious array-bounds warning that GCC 4.9 produced for x86, and reenabled the
-        array bounds warning that GCC 4.9 had produced for ARM. The warning for ARM had
-        previously been unconditionally disabled.</li>
-
-        <li>Fixed Clang 3.5 for {@code mips} and {@code mips64} to create a writable
-            {@code .gcc_except_table} section, thus matching GCC behavior. This change allows you
-            to avoid the following linker warning:
-
-<pre>
-.../ld: warning: creating a DT_TEXTREL in a shared object
-</pre>
-            </li>
-
-        <li>Backported a fix for {@code compiler-rt} issues that were causing crashes when Clang
-        compiled for {@code mips64}. For more information, see LLVM Issue
-        <a href="http://llvm.org/bugs/show_bug.cgi?id=20098">20098</a>.</li>
-
-        <li>Fixed Clang 3.5 crashes that occurred on non-ASCII comments. (Issue
-        <a href="https://code.google.com/p/android/issues/detail?id=81440">81440</a>)</li>
-
-        <li>Fixed {@code stlport collate::compare} to return {@code -1} and {@code 1}. Previously,
-        it had returned arbitrary signed numbers.</li>
-
-        <li>Fixed {@code ndk-gdb} for 64-bit ABIs. (Issue
-        <a href="https://code.google.com/p/android/issues/detail?id=118300">118300</a>)</li>
-
-        <li>Fixed the crash that the HelloComputeNDK sample for RenderScript was producing on
-        Android 4.4 (Android API level 19). For more information, see
-        <a href="http://stackoverflow.com/questions/28057049/targeting-pre-lollipop-devices-using-renderscript-from-ndk-c">this page</a>.</li>
-
-        <li>Fixed {@code libc++ __wrap_iter} for GCC. For more information, see LLVM Issue
-        <a href="http://llvm.org/bugs/show_bug.cgi?id=22355">22355</a>.</li>
-
-        <li>Fixed {@code .asm} support for ABI {@code x86_64}.</li>
-
-        <li>Implemented a workaround for the GCC 4.8 {@code stlport} issue. (Issue
-        <a href="https://android-review.googlesource.com/#/c/127773">127773</a>)</li>
-
-        <li>Removed the trailing directory separator {@code \\} from the project path in Windows.
-        (Issue <a href="https://code.google.com/p/android/issues/detail?id=160584">160584</a>)
-        </li>
-
-        <li>Fixed a {@code no rule to make target} error that occurred when compiling a single
-        {@code .c} file by executing the {@code ndk-build.cmd} command from {@code gradle}. (Issue
-        <a href="https://code.google.com/p/android/issues/detail?id=66937">66937</a>)</li>
-
-        <li>Added the {@code libatomic.a} and {@code libgomp.a} libraries that had been missing from
-        the following host toolchains:
-        <ul>
-           <li>{@code aarch64-linux-android-4.9}</li>
-           <li>{@code mips64el-linux-android-4.9}</li>
-           <li>{@code mipsel-linux-android-4.9}</li>
-           <li>{@code x86_64-4.9}</li>
-        </ul>
-     </ul>
-     </dd>
-
-     <dt>Other changes:</dt>
-     <dd>
-       <ul>
-       <li>Added {@code ld.gold} for {@code aarch64}. The default linker remains {@code ld.bfd}.
-       To explicitly enable {@code ld.gold}, add {@code -fuse-ld=gold} to the
-       {@code LOCAL_LDFLAGS} or {@code APP_LDFLAGS} variable.</li>
-
-       <li>Built the MIPS and MIPS64 toolchains with {@code binutils-2.25}, which provides improved
-       R6 support.</li>
-
-       <li>Made {@code -fstandalone-debug} (full debug info) a default option for Clang.</li>
-
-       <li>Replaced {@code -fstack-protector} with {@code -fstack-protector-strong} for
-       the ARM, AArch64, X86, and X86_64 toolchains for GCC 4.9, Clang 3.5, and
-       Clang 3.6.</li>
-
-       <li>Added the {@code --package} command-line switch to {@code ndk-gdb} to allow the build
-       system to override the package name. (Issue
-       <a href="https://code.google.com/p/android/issues/detail?id=56189">56189</a>)</li>
-
-       <li> Deprecated {@code -mno-ldc1-stc1} for MIPS.  This option may not work with the new
-       {@code -fpxx} and {@code -mno-odd-spreg} options, or with the FPXX ABI.</li>
-
-       <li>Added MIPS MSA and R6 detection to {@code cpu-features}.</li>
-
-     </ul>
-     </dd>
-
-   </dl>
- </div>
-</div>
-
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 10d</a> <em>(December 2014)</em>
- </p>
- <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
-        <li>Made GCC 4.8 the default for all 32-bit ABIs.  Deprecated GCC 4.6, and
-            will remove it next release. To restore previous behavior, either add
-            <code>NDK_TOOLCHAIN_VERSION=4.6</code> to ndk-build, or
-            add <code>--toolchain=arm-linux-androideabi-4.6</code> when executing
-            <code>make-standalone-toolchain.sh</code> on the command line. GCC 4.9 remains the
-            default for 64-bit ABIs.</li>
-
-         <li>Stopped all x86[_64] toolchains from adding <code>-mstackrealign</code> by default. The
-             NDK toolchain assumes a 16-byte stack alignment. The tools and options used by default
-             enforce this rule. A user writing assembly code must make sure to preserve stack
-             alignment, and ensure that other compilers also comply with this rule.
-             (GCC bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496">38496</a>)</li>
-
-         <li>Added Address Sanitizer functionality to Clang 3.5 support to the ARM and x86 ABIs.
-             For more information on this change, see the
-             <a href="https://code.google.com/p/address-sanitizer/wiki/Android">Address
-             Sanitizer</a> project.</li>
-
-         <li>Introduced the requirement, starting from API level 21, to use <code>-fPIE -pie
-             </code> when building. In API levels 16 and higher, ndk-build uses <code>PIE</code>
-             when building. This change has a number of implications, which are discussed in
-             <a href="https://code.google.com/p/android-developer-preview/issues/detail?id=888">
-             Developer Preview Issue 888</a>.
-             These implications do not apply to shared libraries.</li>
-      </ul>
-      </dd>
-   <dl>
-
-
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-        <li>Made more fixes related to
-            <a href="https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00906.html">
-            A53 Errata #835769</a> in the aarch64-linux-android-4.9 linker. As part of this, GCC
-            passes a new option, <code>--fix-cortex-a53-835769</code>, when
-            <code>-mfix-cortex-a53-835769</code> (enabled by default) is specified.
-            For more information, see this
-            <a href="https://sourceware.org/ml/binutils/2014-10/msg00198.html">binutils message</a>
-            and this
-            <a href="https://sourceware.org/ml/binutils/2014-11/msg00287.html">binutils message</a>.
-            </li>
-
-        <li>Documented a fix to a libc++ <code>sscanf/vsscanf</code> hang that occurred in API level
-            21. The fix itself had been implemented in r10c.
-            (Issue <a href="http://b.android.com/77988">77988</a>)</li>
-
-        <li>Fixed an AutoFDO (<code>-fauto-profile</code>) crash that occurred with GCC 4.9 when
-            <code>-Os</code> was specified. (Issue <a href="http://b.android.com/77571">77571</a>)</li>
-     </ul>
-     </dd>
-
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-        <li>Made the following header and library fixes:</li>
-           <ul>
-        <li>Added <code>posix_memalign</code> to API level 16. Also, added a prototype in
-            <code>stdlib.h</code> to API levels 16 to 19.
-            (Issue <a href="http://b.android.com/77861">77861</a>)</li>
-        <li>Fixed <code>stdatomic.h</code> so that it includes <code>&lt;atomic&gt;</code> only for
-            C++11.</li>
-        <li>Modified the following headers for standalone use: <code>sys/user.h</code>, and
-            <code>gl2ext.h</code>, <code>dlext.h</code>, <code>fts.h</code>, <code>sgidefs.h</code>
-            for API level 21.</li>
-        <li>Modified <code>sys/user.h</code> to rename <code>mxcsr_mask</code> as <code>mxcr_mask</code>,
-            and to change the data type for <code>u_ar0</code></li> from <code>unsigned long</code>
-            to </code>struct user_regs_struct*</code>.
-        <li>Changed <code>sysconf()</code> return value type from <code>int</code> to
-            <code>long</code>.</li>
-           </ul>
-
-        <li>Fixed ndk-build's handling of <code>thumb</code> for <code>LOCAL_ARM_MODE</code>: In
-            r10d, ndk-build adds <code>LOCAL_LDFLAGS+=-mthumb</code> by default, unless one of the
-            following conditions applies:</li>
-          <ul>
-            <li>You have set <code>LOCAL_ARM_MODE</code> equal to <code>arm</code>.</li>
-            <li>You are doing a debug build (with settings such as <code>APP_OPTIM=debug</code> and
-            <code>AndroidManifest.xml</code> containing <code>android:debuggable="true"</code>),
-            where ARM mode is the default in order to retain compatibility with earlier toolchains.
-            (Issue <a href="http://b.android.com/74040">74040</a>)</li>
-          </ul>
-
-        <li>Fixed <code>LOCAL_SRC_FILES</code> in ndk-build to use Windows absolute paths.
-            (Issue <a href="http://b.android.com/74333">74333</a>)</li>
-
-        <li>Removed bash-specific code from ndk-gdb. (Issue <a href="http://b.android.com/73338">73338</a>)</li>
-
-        <li>Removed bash-specific code from <code>make-standalone-toolchain.sh</code>.
-            (Issue <a href="http://b.android.com/74145">74145)</a></li>
-
-        <li>Revised documentation concerning a fix for <code>System.loadLibrary()</code> transitive
-            dependencies. (Issue <a href="http://b.android.com/41790">41790</a>)</li>
-
-        <li>Fixed a problem that was preventing 64-bit packages from extracting on Ubuntu 14.04 and
-            OS X 10.10 (Yosemite). (Issue <a href="http://b.android.com/78148">78148</a>)</li>
-
-        <li>Fixed an issue with <code>LOCAL_PCH</code> to improve Clang support. (Issue
-            <a href="http://b.android.com/77575">77575</a>)</li>
-
-        <li>Clarified "requires executable stack" warning from ld.gold. (Issue
-            <a href="http://b.android.com/79115">79115</a>)</li>
-     </ul>
-     </dd>
-
-   </dl>
- </div>
-</div>
-
-
-
-
-
-
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 10c</a> <em>(October 2014)</em>
- </p>
- <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
- <li>Made the following changes to download structure:</li>
-       <ul>
-       <li>Each package now contains both the 32- and the 64-bit headers, libraries, and tools for
-       its respective platform.</li>
-       <li>STL libraries with debugging info no longer need be downloaded separately.</li>
-       </ul>
-  <li>Changed everything previously called <code>Android-L</code> to the official release
-  designation: <code>android-21</code>.</li>
-  <li>Updated GCC 4.9 by rebasing to the <code>google</code> branch
-  of the GCC repository. Major differences from the upstream version of GCC 4.9 include:</li>
-
-  <ul>
-  <li>The <code>-O2</code> option now turns on vectorization, without loop peeling but with more
-  aggressive unrolling.</li>
-  <li>Enhancements to FDO and <a href="https://gcc.gnu.org/wiki/LightweightIpo#LIPO_-_Profile_Feedback_Based_Lightweight_IPO">
-  LIPO</a></li>
-  <p>For more detailed information, see <em>Important bug fixes</em> below.</p>
-  </ul>
-
-  <li>Added Clang 3.5 support to all hosts: <code>NDK_TOOLCHAIN_VERSION=clang</code>
-  now picks Clang 3.5. Note that:</li>
-  <ul>
-
-  <li>ARM and x86 default to using the integrated assembler. If this causes issues, use
-  <code>-fno-integrated-as</code> as a workaround.</code>
-  <li>Clang 3.5 issues more warnings for unused flags, such as the <code>-finline-functions</code>
-  option that GCC supports.</li>
-  <p>When migrating from projects using GCC, you can use
-  <code>-Wno-invalid-command-line-argument</code> and <code>-Wno-unused-command-line-argument</code>
-  to ignore the unused flags until you're able decide on what to do with them longer-term.</p>
-
-     </ul>
-  <li>Made it possible to enter ART debugging mode, when debugging on an Android 5.0 device using
-  ART as its virtual machine, by specifying the <code>art-on</code> option. For more information,
-  see <code>prebuilt/common/gdb/common.setup</code> in the directory containing the NDK.</li>
-  <li>Removed support for Clang 3.3.</li>
-  <li>Deprecated GCC 4.6, and may remove it from future releases.</li>
-  <li>Updated mclinker to 2.8 with Identical Code Folding ("ICF") support. Specify ICF using the
-  <code>--icf</code> option.</li>
-  <li>Broadened <code>arm_neon.h</code> support in x86 and x86_64, attaining coverage of ~93% of
-  NEON intrinsics. For more information about NEON support:
-     <ul>
-     <li>Navigate to the NDK Programmer's Guide (<code>docs/Programmers_Guide/html/</code>), and see
-     Architectures and CPUs > Neon.</li>
-     <li>Examine the updated <code>hello-neon</code> sample in <code>samples/</code>.
-     <li>See Intel's guide to <a href="https://software.intel.com/en-us/blogs/2012/12/12/from-arm-neon-to-intel-mmxsse-automatic-porting-solution-tips-and-tricks"> porting from ARM NEON to Intel SSE.</a></li>
-     </ul>
-  <li>Documented support for <code>_FORTIFY_SOURCE</code> in <code>headers/libs/android-21</code>,
-  which appeared in r10 (when <code>android-21</code> was still called <code>Android-L</code>),
-  but had no documentation.</li>
-      </ul>
-      </dd>
-   <dl>
-
-
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Fixed an internal compiler error with GCC4.9/aarch64 that was causing the following
-       error message (Issue <a href="http://b.android.com/77564">77564</a>):</li>
-<pre>
-internal compiler error: in simplify_const_unary_operation, at simplify-rtx.c:1539
-</pre>
-       <li>Fixed incorrect code generation from GCC4.9/arm. (Issue
-       <a href="http://b.android.com/77567">77567<a>)</li>
-       <li>Fixed an internal compiler error with GCC4.9/mips involving inline-assembly. (Issue
-       <a href="http://b.android.com/77568">77568</a>)</li>
-       <li>Fixed incorrect code that GCC4.9/arm was generating for <code>x = (cond) ? y : x</code>.
-       (Issue <a href="http://b.android.com/77569">77569</a>)</li>
-       <li>Fixed GCC4.9/aarch64 and Clang3.5/aarch64 to work around the
-       <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20141006/116322.html">
-       Cortex-A53 erratum (835769)</a>  by default.  Disable the workaround by specifying
-       <code>-mno-fix-cortex-a53-835769</code>.</li>
-     </ul>
-     </dd>
-
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-     <li>Made the following header and library fixes to <code>android-21</code>:
-        <ul>
-
-        <li>Added more TV keycodes: <code>android/keycodes.h</code></li>
-        <li>Added more constants and six new sensor functions to <code>android/sensor.h</code>:
-        <code>ASensorManager_getDefaultSensorEx</code>, <code>ASensor_getFifoMaxEventCount</code>,
-        <code>ASensor_getFifoReservedEventCount</code>, <code>ASensor_getStringType</code>,
-        <code>ASensor_getReportingMode</code>, and <code>ASensor_isWakeUpSensor</code>.</li>
-        <li>Fixed <code>stdatomic.h</code> to improve compatibility with GCC 4.6, and provide support
-        for the <code>&lt;atomic&gt;</code> header.</li>
-        <li>Added <code>sys/ucontext.h</code> and <code>sys/user.h</code> to all API levels. The
-        <code>signal.h</code> header now includes <code>&lt;sys/ucontext.h&gt;</code>.  You may
-        remove any existing definition of <code>struct ucontext</code>.</li>
-        <li>Added <code>posix_memalign</code> to API levels 17, 18, and 19.</li>
-        <li>Added the following functions to all architectures:
-        <code>android_set_abort_message</code>, <code>posix_fadvise</code>,
-        <code>posix_fadvise64</code>, <code>pthread_gettid_np</code>.</li>
-        <li>Added the required permissions to the <code>native-media/AndroidManifest.xml</code>
-        sample.
-        (Issue <a href="https://android-review.googlesource.com/#/c/106640/">106640</a>)</li>
-        <li>Added <code>clock_nanosleep</code> and <code>clock_settime</code> to API level 21. (Issue
-        <a href="http://b.android.com/77372">77372</a>)
-        <li>Removed the following symbols from all architectures:
-        <code>get_malloc_leak_info</code>, <code>free_malloc_leak_info</code>,
-        <code>__srget</code>, <code>__swbuf</code>, <code>__srefill</code>, <code>__swsetup</code>,
-        <code>__sdidinit</code>, <code>__sflags</code>, <code>__sfp</code>,
-        <code>__sinit</code>, <code>__smakebuf</code>, <code>__sflush</code>, <code>__sread</code>,
-        <code>__swrite</code>, <code>__sseek</code>, <code>__sclose</code>,
-        <code>_fwalk</code>, <code>__sglue</code>, <code>__get_thread</code>, <code>__wait4</code>,
-        <code>__futex_wake</code>, <code>__open</code>, <code>__get_tls</code>,
-        <code>__getdents64</code>, and <code>dlmalloc</code>.</li>
-        <li>Removed the following functions from the 64-bit architectures: <code>basename_r</code>,
-        <code>dirname_r</code>, <code>__isthreaded</code>, <code>_flush_cache</code> (mips64).</li>
-        <li>Removed the following function from the 32-bit architectures:
-        <code>__signalfd4</code>.</li>
-        <li>Changed the type of the third argument from <code>size_t</code> to <code>int</code> in
-        the following functions: <code>strtoll_l</code>, <code>strtoull_l</code>,
-        <code>wcstoll_l</code>, and <code>wcstoull_l</code>.</li>
-        <li>Restored the following functions to the 64-bit architecture: <code>arc4random</code>,
-        <code>arc4random_buf</code>, and <code>arc4random_uniform</code>.</li>
-        <li>Moved <code>cxa_*</code> and the <code>new</code> and <code>delete</code> operators back
-        to <code>libstdc++.so</code>. This change restores r9d behavior; previous versions of r10
-        contained dummy files.</li>
-
-        </ul>
-     <li>Restored MXU support in GCC 4.8 and 4.9 for mips. This support had been absent from
-     r10 and r10b because those versions of GCC had been compiled with binutils-2.24, which did
-     not support MXU. It now does.</li>
-     <li>Fixed <code>--toolchain=</code> in <code>make-standalone-toolchain.sh</code> so that it
-     now properly supports use of a suffix specifying a version of Clang.</li>
-     <li>Fixed the libc++/armeabi <code>strtod()</code> functions.</li>
-     <li>Made fixes to NDK documentation in <code>docs/</code>.</li>
-     </ul>
-     </dd>
-
-     <dt>Other changes:</dt>
-     <dd>
-       <ul>
-       <li>Enhanced <code>cpu-features</code> to detect ARMv8 support for the following
-       instruction sets: AES, CRC32, SHA2, SHA1, and 64-bit PMULL/PMULL2. (Issue
-       <a href="https://android-review.googlesource.com/#/c/106360/">106360</a>)</li>
-
-       <li>Modified ndk-build to use <code>*-gcc-ar</code>, which is available in GCC 4.8, GCC 4.9, and
-       Clang. Clang specifies it, instead of <code>*-ar</code>. This setting brings improved LTO
-       support.</li>
-
-       <li>Removed the <code>include-fixed/linux/a.out.h</code> and
-       <code>include-fixed/linux/compiler.h</code> headers from the GCC compiler.
-       (Issue <a href ="http://b.android.com/73728">73728</a>)</li>
-
-       <li>Fixed an issue related to <code>-flto</code> with GCC 4.8 on Mac OS X. The error message
-       read:</li>
-
-       <pre>
-.../ld: error: .../libexec/gcc/arm-linux-androideabi/4.9/liblto_plugin.so
-Symbol not found: _environ
-</pre>
-
-       <li>Fixed a typo in <code>build-binary.mk.</code> (Issue
-       <a href="http://b.android.com/76992">76992</a>)</li>
-     </ul>
-     </dd>
-
-   <dt>Important known issues:</dt>
-     <dd>
-     <ul>
-     <li>Specifying -Os (<code>-fauto-profile</code>) in GCC4.9 may cause crashing.
-     (Issue <a href="http://b.android.com/77571">77571</a>)</li>
-     </ul>
-     </dd>
-
-   </dl>
- </div>
-</div>
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 10b</a> <em>(September 2014)</em>
- </p>
- <div class="toggle-content-toggleme">
-   <dl>
-
-        <dt>Important notes:</dt>
-     <dd>
-     <ul>
-      <li>Because of the 512MB size restriction on downloadable packages, the following 32-bit items are not in the 32-bit NDK download packages. Instead, they reside in the 64-bit ones:</li>
-      <ul>
-      <li>Android-L headers</li>
-      <li>GCC 4.9</li>
-      </ul>
-     <li>Currently, the only Renderscript support provided by the NDK is for 32-bit Renderscript with Android 4.4 (API level 19). You cannot build HelloComputeNDK (the only Renderscript sample) with any other combination of Renderscript (32- or 64-bit) and Android version.</li>
-     <li>To compile native-codec, you must use a 64-bit NDK package, which is where all the Android-L headers are located. </li>
-     </ul>
-     </dd>
-
-
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-     <li>Fixed gdb 7.6 in GCC 4.8/4.9. (Issues <a href="http://b.android.com/74112">74112</a> and <a href="http://b.android.com/74371">74371</a>.)</li>
-     <li>Fixed GCC 4.8/4.9 for x86, so that they no longer enable <code>-msse4.2</code> and <code>-mpopcnt</code> by default. (Issue <a href="http://b.android.com/73843">73843</a>.)</li>
-     </ul>
-     </dd>
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-     <li>Removed <code>stdio.h</code> from the <code>include-fixed/</code> directories of all versions of GCC. (Issue <a href="http://b.android.com/73728">73728</a>.)</li>
-     <li>Removed duplicate header files from the Windows packages in the <code>platforms/android-L/arch-*/usr/include/linux/netfilter*/</code> directories. (Issue <a href="https://code.google.com/p/android/issues/detail?id=73704">73704</a>.)</li>
-     <li>Fixed a problem that prevented Clang from building HelloComputeNDK.</li>
-     <li>Fixed atexit. (Issue <a href="http://b.android.com/66595">66595</a>.)</li>
-     <li>Made various fixes to the docs in <code>docs/</code> and <code>sources/third_party/googletest/README.NDK</code>. (Issue <a href="http://b.android.com/74069">74069</a>.)</li>
-     <li>Made the following fixes to the Android-L headers:</li>
-     <ol>
-     <li>Added the following functions to <code>ctype.h</code> and <code>wchar.h</code>: <code>dn_expand()</code>, <code>grantpt()</code>, <code> inet_nsap_addr()</code>, <code>inet_nsap_ntoa()</code>, <code>insque()</code>, <code>nsdispatch()</code>, <code>posix_openpt()</code>, <code>__pthread_cleanup_pop()</code>, <code>__pthread_cleanup_push()</code>, <code>remque()</code>, <code>setfsgid()</code>, <code>setfsuid()</code>, <code>splice()</code>, <code>tee()</code>, <code>twalk()</code> (Issue <a href = "http://b.android.com/73719">73719</a>), and 42 <code>*_l()</code> functions.</li>
-
-    <li>Renamed <code>cmsg_nxthdr</code> to <code>__cmsg_nxthdr</code>.</li>
-
-    <li>Removed <code>__libc_malloc_dispatch</code>.</li>
-
-    <li>Changed the <code>ptrace()</code> prototype to <code>long ptrace(int, ...);</code>.</li>
-
-    <li>Removed <code>sha1.h</code>.</li>
-
-    <li>Extended <code>android_dlextinfo</code> in <code>android/dlext.h</code>.</li>
-
-    <li>Annotated <code>__NDK_FPABI__</code> for functions receiving or returning float- or double-type values in <code>stdlib.h</code>, <code>time.h</code>, <code>wchar.h</code>, and <code>complex.h</code>.</li>
-    </ol>
-     </ul>
-     </dd>
-
-     <dt>Other changes:</dt>
-     <dd>
-     <ul>
-        <li>Updated <code>mipsel-linux-android-4.9</code> and <code>mips64el-linux-android-4.9</code>, implementing a new multilib directory layout, and providing support for gdb-7.7</li>
-        <li>Enhanced <code>cpu-features</code> to detect more arm64 features.  (Change list <a href="https://android-review.googlesource.com/#/c/100339">100339</a>.)</li>
-     </dd>
-     </ul>
-
-   </dl>
- </div>
-</div>
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 10</a> <em>(July 2014)</em>
- </p>
- <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
-        <li>Added 3 new ABIs, all 64-bit: arm64-v8a, x86_64, mips64.</li> Note that:
-        <ul>
-           <li>GCC 4.9 is the default compiler for 64-bit ABIs. Clang is currently version 3.4.
-<code>NDK_TOOLCHAIN_VERSION=clang</code>
-      may not work for arm64-v8a and mips64.</li>
-           <li>Android-L is the first level with 64-bit support.  Note that this API
-level is a temporary one, and only for L-preview. An actual API level number will replace it at
-L-release.</li>
-           <li>This release includes now includes <code>all32</code> and <code>all64</code>
-settings for <code>APP_ABI</code>.
-              <ul>
-              <li><code>APP_ABI=all32</code> is equivalent to
-<code>APP_ABI=armeabi,armeabi-v7a,x86,mips</code>.</li>
-              <li><code>APP_ABI=all64</code> is equivalent to
-<code>APP_ABI=arm64-v8a,x86_64,mips64</code>.</li>
-              <li><code>APP_ABI=all</code> selects all ABIs.</li>
-              </ul>
-           <li>The new GNU libstdc++ in Android-L contains all <code>&lt;tr1/cmath&gt;</code>
-Before defining your own math function, check <code>_GLIBCXX_USE_C99_MATH_TR1</code> to see a
-function with that name already exists, in order to avoid "multiple definition" errors from the
-linker.</li>
-           <li>The cpu-features library has been updated for the ARMv8 kernel.  The existing
-cpu-features library may fail to detect the presence of NEON on the ARMv8 platform. Recompile your
-code with the new version.</li>
-        </ul>
-        <li>Added a new <code>platforms/android-L/</code> API directory. It includes:</li>
-        <ul>
-           <li>Updated Bionic headers, which had not changed from Android API levels 3
-(Cupcake) to 19 (KitKat). This new version, for level L, is to be synchronized with AOSP.</li>
-           <li>New media APIs and a native-codec sample.</li>
-           <li>An updated <code>Android.h</code> header for SLES/OpenSLES, enabling support for
-single-precision, floating-point audio format in AudioPlayer.</li>
-           <li>GLES 3.1 and AEP extensions to <code>libGLESv3.so.</code></li>
-           <li>GLES2 and GLES3 headers updated to the latest official Khronos versions.</li>
-        </ul>
-        <li>Added GCC 4.9 compilers to the 32-/64-bit ABIs.  GCC 4.9 is the default (only) compiler
-for 64-bit ABIs, as previously mentioned.  For 32-bit ABIs, you must explcitly enable GCC 4.9, as
-GCC 4.6 is still the default.</li>
-        <ul>
-           <li>For ndk-build, enable 32-bit, GCC 4.9 building either by adding
-<code>NDK_TOOLCHAIN_VERSION=4.9</code> to <code>Application.mk</code>, or exporting it as an
-environment variable from the command line.</li>
-           <li>For a standalone toolchain, use the <code>--toolchain=</code> option in the
-<code>make-standalone-toolchain.sh</code> script. For example: <code>--toolchain=arm-linux-androideabi-4.9.</code></li>
-        </ul>
-        <li>Upgraded GDB to version 7.6 in GCC 4.8/4.9 and x86*. Since GDB is still at version GDB-7.3.x in
-GCC 4.6 (the default for ARM and MIPS), you must set
-<code>NDK_TOOLCHAIN_VERSION=4.8</code> or <code>4.9</code> to enable ndk-gdb to select GDB 7.6.</li>
-        <li>Added the <code>-mssse3</code> build option to provide SSSE3 support, and made it the default for ABI x86
-(upgrading from SSE3). The image released by Google does not contain SSSE3 instructions.</li>
-        <li>Updated GCC 4.8 to 4.8.3.</li>
-        <li>Improved ARM libc++ EH support by switching from gabi++ to libc++abi. For details, see the "C++ Support" section of the documentation.
-  Note that:</li>
-        <ul>
-           <li>All tests except for locale now pass for Clang 3.4 and GCC 4.8. For more
-information, see the "C++ Support" section of the documentation.</li>
-           <li>The libc++ libraries for X86 and MIPS libc++ still use gabi++.</li>
-           <li>GCC 4.7 and later can now use &lt;atomic&gt;.</li>
-           <li>You must add <code>-fno-strict-aliasing</code> if you use <code> &lt;list&gt;</code>, because <code>__list_imp::_end</code>_ breaks
-      TBAA rules.  (Issue <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61571">61571</a>.)</li>
-           <li>As of GCC 4.6, LIBCXX_FORCE_REBUILD:=true no longer rebuilds libc++. Rebuilding it
-requires the use of a different compiler. Note that Clang 3.3 is untested.</li>
-        </ul>
-        <li>mclinker is now version 2.7, and has aarch64 Linux support.</li>
-        <li>Added precompiled header support for headers specified by <code>LOCAL_PCH</code>.  (Issue <a href="http://b.android.com/25412">25412</a>).</li>
-      </dd>
-   <dl>
-
-
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Fixed libc++ so that it now compiles <code>std::feof</code>, etc. (Issue <a
-href="http://b.android.com/66668">66668</a>).</li>
-       <li>Fixed a Clang 3.3/3.4 atomic library call that caused crashes in some of the libc++
-tests for ABI armeabi.</li>
-       <li>Fixed Clang 3.4 crashes that were occurring on reading precompiled headers. (Issue <a
-href="http://b.android.com/66657">66657</a>).</li>
-       <li>Fixed the Clang 3.3/3.4 <code>-O3</code> assert on:</li>
-       <code>llvm-3.2/llvm/include/llvm/MDBuilder.h:64: llvm::MDNode*
-llvm::MDBuilder::createBranchWeights(llvm::ArrayRef<unsigned int>): Assertion Weights.size() >= 2
-&& "Need at least two branch weights!"</code> (Issue <a href="http://b.android.com/57381">57381</a>).
-       <li>Fixed the following Clang 3.3/3.4 crash:</li>
-       <code>Assertion failed: (!Fn && "cast failed but able to resolve overload expression!!"), function CheckCXXCStyleCast, file
-Volumes/data/ndk-toolchain/src/llvm-3.3/llvm/tools/clang/lib/Sema/SemaCast.cpp, line 2018</code>.
-(Issue <a href="http://b.android.com/66950">66950</a>).
-     </ul>
-     </dd>
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Fixed headers:</li>
-       <ul>
-          <li>Fixed 32-bit <code>ssize_t</code> to be <code>int</code> instead of <code>long
-int</code>.</li>
-          <li>Fixed <code>WCHAR_MIN</code> and <code>WCHAR_MAX</code> so that they they take
-appropriate signs according to the architecture they're running on:</li>
-          <ul>
-             <li>X86/MIPS: signed.
-             <li>ARM: unsigned.
-             <li>To force X86/MIPS to default to unsigned, use
-<code>-D__WCHAR_UNSIGNED__</code>.</li>
-             <li>To force <code>wchar_t</code> to be 16 bits, use <code>-fshort-wchar</code>.</li>
-          </ul>
-          <li>Removed non-existent symbols from 32-bit <code>libc.so</code>, and added <code>pread64</code>,
-<code>pwrite64</code>, <code>ftruncate64</code> for
-Android API level 12 and higher. (Issue <a href="http://b.android.com/69319">69319</a>). For more
-information, see the commit message accompanying AOSP change list
-     <a href="https://android-review.googlesource.com/#/c/94137">94137</a>.</li>
-       </ul>
-       <li>Fixed GCC warning about redefinition of <code>putchar</code>. Warning message reads:</li>
-       <code>include/stdio.h:236:5: warning: conflicts with previous declaration here
-[-Wattributes] int  putchar(int);</code> (Change list <a
-href="https://android-review.googlesource.com/#/c/91185">91185</a>).
-       <li>Fixed <code>make-standalone-toolchain.sh --stl=libc++</code> so that it:</li>
-       <ul>
-          <li>Copies <code>cxxabi.h</code>. (Issue <a
-href="http://b.android.com/68001">68001</a>).</li>
-          <li>Runs in directories other than the NDK install directory. (Issues <a
-href="http://b.android.com/67690">67690</a> and <a href="http://b.android.com/68647">68647</a>).</li>
-       </ul>
-       <li>Fixed GCC/Windows to quote arguments only when necessary for spawning processes in
-external programs. This change decreases the likelihood of exceeding the 32K length limit.</li>
-       <li>Fixed an issue that made it impossible to adjust the <code>APP_PLATFORM</code>
-environment variable.</li>
-       <li>Fixed the implementation of <code>IsSystemLibrary()</code> in crazy_linker so that it
-uses <code>strrchr()</code>
-  instead of <code>strchr()</code> to find the library path's true basename.</li>
-       <li>Fixed native-audio's inability to build in debug mode.</li>
-       <li>Fixed gdb's inability to print extreme floating-point numbers. (Issue <a
-href="http://b.android.com/69203">69203</a>).</li>
-       <li>Fixed Clang 3.4 inability to compile with <code>-Wl,-shared</code> (as opposed to
-<code>-shared</code>, which
-  had no compilation issues).  The problem was that Clang added <code>-pie</code> for Android
-targets if neither <code>-shared</code> nor <code>-static</code> existed. This behavior, which was
-incorrect, caused the linker to complain that <code>-shared</code> and <code>-pie</code> could not
-co-exist.</li>
-
-     </ul>
-     </dd>
-
-
-     <dt>Other changes:</dt>
-     <dd>
-     <ul>
-        <li>Added <code>arm_neon.h</code> to the x86 toolchain so that it now emulates ~47% of
-Neon. There is currently no support for 64-bit types. For more information, see the section on ARM
-Neon intrinsics support in the x86 documentation.</li>
-        <li>Ported ARM/GOT_PREL optimization (present in GCC 4.6 built from the GCC google branch) to
-ARM GCC 4.8/4.9.  This optimization sometimes reduces instruction count when accessing global
-variables.  As an example, see the build.sh script in
-<code>$NDK/tests/build/b14811006-GOT_PREL-optimization/</code>.</li>
-        <li>Added ARM version for STL gabi++, stlport, and libc++. They now have both it and Thumb
-mode.</li>
-        <li>It is now possible to call the make-standalone-toolchain.sh script with
-<code>--toolchain=x86_64-linux-android-4.9</code>, which is equivalent to
-<code>--toolchain=x86_64-4.9</code>.</li>
-     </dd>
-     </ul>
-   </dl>
- </div>
-</div>
-
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 9d</a> <em>(March 2014)</em>
- </p>
- <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
-        <li>Added support for the Clang 3.4 compiler. The
-<code>NDK_TOOLCHAIN_VERSION=clang</code> option now picks Clang 3.4. GCC 4.6 is
-still the default compiler.</li>
-        <li>Added <code>APP_ABI=armeabi-v7a-hard</code>, with
-additional multilib option <code>-mfloat-abi=hard</code>. These options are for
-use with ARM GCC 4.6/4.8 and Clang 3.3/3.4 (which use 4.8's assembler, linker,
-and libs). When using these options, note the following changes:</li>
-        <ul>
-           <li> When executing the <code>ndk-build</code> script, add the
-following options for armeabi-v7a target:
-<pre>TARGET_CFLAGS += -mhard-float -D_NDK_MATH_NO_SOFTFP=1
-TARGET_LDFLAGS += -Wl,--no-warn-mismatch -lm_hard</pre>
-The built library is copied to <code>libs/armeabi-v7a</code>. For make to
-behave as expected, you cannot specify both <code>armeabi-v7a</code> and
-<code>armeabi-v7a-hard</code> as make targets (i.e., on the APP_ABI= line).
-Doing so causes one of them to be ignored. Note that <code>APP_ABI=all</code>
-is still equivalent to
-<code>armeabi armeabi-v7a x86 mips</code>.</li>
-           <li>The <code>make-standalone-toolchain.sh</code> script copies
-additional libaries under <code>/hard</code> directories.
-      Add the above <code>CFLAGS</code> and <code>LFLAGS</code> to your
-makefile to enable GCC or Clang to link with
-      libraries in <code>/hard</code>.</li>
-        </ul>
-        <li>Added the yasm assembler, as well as <code>LOCAL_ASMFLAGS</code>
-and <code>EXPORT_ASMFLAGS</code> flags for x86
-targets. The <code>ndk-build</code> script uses
-<code>prebuilts/*/bin/yasm*</code> to build <code>LOCAL_SRC_FILES</code> that
-have the <code>.asm</code> extension.</li>
-        <li>Updated MClinker to 2.6.0, which adds <code>-gc-sections</code>
-support.</li>
-        <li>Added experimental libc++ support (upstream r201101).  Use this new
-feature by following these steps:
-        <ul>
-           <li>Add <code>APP_STL := c++_static</code> or <code>APP_STL :=
-c++_shared</code> in <code>Application.mk</code>.
-      You may rebuild from source via <code>LIBCXX_FORCE_REBUILD :=
-true</code></li>
-           <li>Execute <code>make-standalone-toolchain.sh --stl=libc++</code>
-to create a standalone toolchain with libc++ headers/lib.</li>
-        </ul>
-        For more information, see
-<code>CPLUSPLUS-SUPPORT.html</code>.
-(Issue <a href="http://b.android.com/36496">36496</a>)</li>
-      </ul>
-      </dd>
-   <dl>
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Fixed an uncaught throw from an unexpected
-exception handler for GCC 4.6/4.8 ARM EABI. (GCC Issue <a
-href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59392">59392</a>)</li>
-       <li>Fixed GCC 4.8 so that it now correctly resolves partial
-specialization of a template with
-  a dependent, non-type template argument. (GCC Issue <a
-href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59052">59052</a>)</li>
-       <li>Added more modules to prebuilt python (Issue <a
-href="http://b.android.com/59902">59902</a>):
-               <ul>
-                 <li>Mac OS X: <code>zlib</code>, <code>bz2</code>,
-<code>_curses</code>, <code>_curses_panel</code>, <code>_hashlib</code>,
-<code>_ssl</code></li>
-                 <li>Linux: <code>zlib</code>, <code>nis</code>,
-<code>crypt</code>, <code>_curses</code>, and <code>_curses_panel</code></li>
-               </ul>
-       <li>Fixed the x86 and MIPS gdbserver
-<code>event_getmsg_helper</code>.</li>
-       <li>Fixed numerous issues in the RenderScript NDK toolchain, including
-issues with compatibility across older devices and C++ reflection.</li>
-<br>
-     </ul>
-     </dd>
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Header fixes:
-         <ul>
-           <li>Fixed a missing <code>#include &lt;sys/types.h&gt;</code> in
-<code>android/asset_manager.h</code> for Android API level 13 and higher.
-     (Issue <a href="http://b.android.com/64988">64988</a>)</li>
-           <li>Fixed a missing <code>#include <stdint.h></code> in
-<code>android/rect_manager.h</code> for Android API level 14 and higher.</li>
-           <li>Added <code>JNICALL</code> to <code>JNI_OnLoad</code> and
-<code>JNI_OnUnload</code> in <code>jni.h</code>. Note that <code>JNICALL</code>
- is defined as <code>__NDK_FPABI__</code> For more information, see
-<code>sys/cdefs.h</code>.</li>
-           <li>Updated the following headers so that they can be included
-without the need to
-manually include their dependencies (Issue <a
-href="http://b.android.com/64679">64679</a>):</li>
-<pre>
-android/tts.h
-EGL/eglext.h
-fts.h
-GLES/glext.h
-GLES2/gl2ext.h
-OMXAL/OpenMAXSL_Android.h
-SLES/OpenSLES_Android.h
-sys/prctl.h
-sys/utime.h
-</pre>
-           <li>Added <code>sys/cachectl.h</code> for all architectures. MIPS
-developers can now include this header instead of writing <code>#ifdef
-__mips__</code>.</li>
-           <li></code>Fixed <code>platforms/android-18/include/android/input.h
-</code> by adding <code>__NDK_FPABI__</code> to functions taking or returning
-float or double values.</li>
-           <li>Fixed MIPS <code>struct stat</code>, which was incorrectly set
-to its 64-bit counterpart for Android API level 12 and later. This wrong
-setting was a
-regression introduced in release r9c.</li>
-           <li>Defined <code>__PTHREAD_MUTEX_INIT_VALUE</code>,
-<code>__PTHREAD_RECURSIVE_MUTEX_INIT_VALUE</code>,
-     and <code>__PTHREAD_ERRORCHECK_MUTEX_INIT_VALUE</code> for Android API
-level 9 and lower.</li>
-           <li>Added <code>scalbln</code>, <code>scalblnf</code>, and
-<code>scalblnl</code> to x86 <code>libm.so</code> for APIs 18 and later.</li>
-           <li>Fixed a typo in
-<code>sources/android/support/include/iconv.h</code>.
-     (Issue <a href="http://b.android.com/63806">63806</a>)</li>
-
-         </ul>
-       </li>
-       <li>Fixed gabi++ <code>std::unexpected()</code> to call
-<code>std::terminate()</code> so that
-  a user-defined <code>std::terminate()</code> handler has a chance to run.
-</li>
-       <li>Fixed gabi++ to catch <code>std::nullptr</code>.</li>
-       <li>Fixed samples Teapot and MoreTeapots:
-         <ul>
-      <li>Solved a problem with Tegra 2 and 3 chips by changing specular
-variables to use medium precision. Values for specular power can now be less
-than 1.0. </li>
-      <li>Changed the samples so that pressing the volume button restores
-immersive mode and invalidates
-<code>SYSTEM_UI_FLAG_IMMERSIVE_STICKY</code>. Screen rotation does not
-trigger <code>onSystemUiVisibilityChange</code>, and so does not restore
-immersive mode.</li>
-         </ul>
-        </li>
-        <li>Fixed the <code>ndk-build</code> script to add
-<code>-rpath-link=$SYSROOT/usr/lib</code> and
-<code>-rpath-link=$TARGET_OUT</code> in order to use <code>ld.bfd</code> to
-link executables. (Issue  <a href="http://b.android.com/64266">64266</a>)</li>
-        <li>Removed <code>-Bsymbolic</code> from all STL builds.</li>
-        <li>Fixed <code>ndk-gdb-py.cmd</code> by setting <code>SHELL</code> as
-an environment variable
-instead of passing it to
-  <code>python.exe</code>, which ignores the setting.
-  (Issue <a href="http://b.android.com/63054">63054</a>)</li>
-        <li>Fixed the <code>make-standalone-toolchain.sh</code> script so that
-the <code>--stl=stlport</code> option copies the gabi++ headers instead of
-symlinking them; the <code>cmd.exe</code> and MinGW shells do not understand
-symlinks created by cygwin.</li>
-     </ul>
-     </dd>
-
-     <dt>Other changes:</dt>
-     <dd>
-     <ul>
-        <li>Applied execution permissions to all <code>*cmd</code> scripts
-previously intended for use only in the <code>cmd.exe</code> shell, in case
-developers prefer to use <code>ndk-build.cmd</code> in cygwin instead of the
-recommended <code>ndk-build</code> script.</li>
-        <li>Improved the speed of the <code>make-standalone-toolchain.sh</code>
-script by moving instead of copying if the specified destination directory does
-not exist.</li>
-     </dd>
-     </ul>
-   </dl>
- </div>
-</div>
-
-<div class="toggle-content closed">
- <p>
-   <a href="#" onclick="return toggleContent(this)"> <img
-     src="/assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-   >Android NDK, Revision 9c</a> <em>(December 2013)</em>
- </p>
- <div class="toggle-content-toggleme">
-<p>This is a bug-fix-only release.</p>
-   <dl>
-     <dt>Important bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Fixed a problem with GCC 4.8 ARM, in which the stack pointer is
-restored too early. This problem prevented the frame pointer from reliably
-accessing a variable in the stack frame. (GCC Issue <a
-href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854">58854</a>)</li>
-<li>Fixed a problem with GCC 4.8 libstdc++, in which a bug in
-std::nth_element was causing generation of code that produced a random
-segfault. (Issue <a
-href="https://code.google.com/p/android/issues/detail?id=62910">62910</a>)</li>
-           <li>Fixed GCC 4.8 ICE in cc1/cc1plus with
-<code>-fuse-ld=mcld</code>, so that the following error no longer occurs:
-<pre>cc1: internal compiler error: in common_handle_option, at
-opts.c:1774</pre></li>
-           <li>Fixed <code>-mhard-float</code> support for
-<code>__builtin</code> math functions. For ongoing information on fixes for
-<code>-mhard-float</code> with STL, please follow Issue <a
-href="http://b.android.com/61784">61784</a>.</li>
-     </ul>
-     </dd>
-
-     <dt>Other bug fixes:</dt>
-     <dd>
-     <ul>
-       <li>Header fixes:
-         <ul>
-           <li>Changed prototype of <code>poll</code> to <code>poll(struct
-pollfd *, nfds_t, int);</code> in <code>poll.h</code>.</li>
-           <li>Added <code>utimensat</code> to <code>libc.so</code> for Android
-API levels 12 and 19. These libraries are now included for all Android API
-levels 12 through 19.</li>
-<li>Introduced <code>futimens</code> into <code>libc.so</code>, for Android API
-level 19.</li>
-<li>Added missing <code>clock_settime()</code> and
-<code>clock_nanosleep()</code> to <code>time.h</code> for Android API level 8
-and higher.</li>
-<li>Added <code>CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE,
-CLOCK_MONOTONIC_COARSE, CLOCK_BOOTTIME, CLOCK_REALTIME_ALARM,</code> and
-<code>CLOCK_BOOTTIME_ALARM</code> in <code>time.h.</code></li>
-<li>Removed obsolete <code>CLOCK_REALTIME_HR</code> and
-<code>CLOCK_MONOTONIC_HR.</code></li>
-         </ul>
-       </li>
-       <li>In samples Teapot, MoreTeapots, and
-<code>source/android/ndk_helper</code>:
-         <ul>
-<li>Changed them so that they now use a hard-float abi for armeabi-v7a.</li>
-<li>Updated them to use immersive mode on Android API level 19 and
-higher.</li>
-<li>Fixed a problem with <code>Check_ReleaseStringUTFChars</code> in
-<code>/system/lib/libdvm.so</code> that was causing crashes on x86 devices.</li>
-         </ul>
-        </li>
-<li>Fixed <code>ndk-build</code> fails that happen in cygwin when the NDK
-package is
-referenced via symlink.</li>
-<li>Fixed <code>ndk-build.cmd</code> fails that happen in windows
-<code>cmd.exe</code> when
-<code>LOCAL_SRC_FILES</code> contains absolute paths. (Issue <a
-href="https://android-review.googlesource.com/#/c/69992">69992</a>)</li>
-<li>Fixed the <code>ndk-stack</code> script to proceed even when it can't parse
-a frame due to inability to find a routine, filename, or line number. In any of
-these cases, it prints <code>??</code>.</li>
-<li>Fixed the <code>ndk-stack</code> stack for windows-x64_64 targets so that
-it no longer erroneously matches a frame line with a line in the
-<code>stack:</code> section that doesn't contain <code>pc</code>,
-<code>eip</code>, or <code>ip</code>. For example:
-<pre>I/DEBUG   ( 1151):     #00  5f09db68  401f01c4
-/system/lib/libc.so</pre></li>
-<li>Fixed gabi++ so that it:
-     <ul>
-         <li>Does not use malloc() to allocate C++ thread-local
-  objects.</li>
-         <li>Avoids deadlocks in gabi++ in cases where libc.debug.malloc is
-non-zero in userdebug/eng Android platform builds.</li>
-     </ul>
-     </ul>
-     </dd>
-
-     <dt>Other changes:</dt>
-     <dd>
-     <ul>
-       <li>Added <code>LOCAL_EXPORT_LDFLAGS</code>.</li>
-<li>Introduced the <code>NDK_PROJECT_PATH=null</code> setting for use in an
-integrated build system where options are explicitly passed to
-<code>ndk-build</code>. With this setting, <code>ndk-build</code> makes no
-attempt to look for <code>NDK_PROJECT_PATH.</code> This setting also prevents
-variables from deriving default settings from NDK_PROJECT_PATH. As a result,
-the following variables must now be explicitly specified (with their default
-values if such exist): <code>NDK_OUT, NDK_LIBS_OUT, APP_BUILD_SCRIPT,
-NDK_DEBUG</code> (optional, default to 0), and other <code>APP_*</code>'s
-contained in <code>Application.mk</code>.</li>
-<li><code>APP_ABI</code> can now be enumerated in a comma-delimited list. For
-example:
-<pre>APP_ABI := "armeabi,armeabi-v7a"</pre></li>
-<li>Provided the ability to rebuild all of STL with debugging info in an
-optional, separate package called
-<code>android-ndk-r9c-cxx-stl-libs-with-debugging-info.zip</code>, using the
-<code>-g</code> option. This option
-helps the <code>ndk-stack</code> script provide better a stack dump across STL.
-This change should not affect the code/size of the final, stripped file.</li>
-<li>Enhanced <code>hello-jni</code> samples to report <code>APP_ABI</code> at
-compilation.</li>
-<li>Used the <code>ar</code> tool in Deterministic mode (option
-<code>-D</code>) to build static libraries.  (Issue <a
-href="http://b.android.com/60705">60705</a>)</li>
-     </ul>
-     </dd>
-
-   </dl>
- </div>
-</div>
-
-<div class="toggle-content closed">
-  <p>
-    <a href="#" onclick="return toggleContent(this)"> <img
-      src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-    >Android NDK, Revision 9b</a> <em>(October 2013)</em>
-  </p>
-  <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-      <ul>
-        <li>Updated {@code include/android/*h} and {@code math.h} for all Android API levels up to
-          18, including the addition of levels 13, 15, 16 and 17.
-          For information on added APIs, see commit messages for Changes
-          <a href="https://android-review.googlesource.com/68012">68012</a> and
-          <a href="https://android-review.googlesource.com/68014">68014</a>.
-          (Issues <a href="http://b.android.com/47150">47150</a>,
-           <a href="http://b.android.com/58528">58528</a>, and
-           <a href="http://b.android.com/38423">38423</a>)</li>
-        <li>Added support for Android API level 19, including Renderscript binding.</li>
-        <li>Added support for <code>-mhard-float</code> in the existing armeabi-v7a ABI. For more
-          information and current restrictions on Clang, see
-          {@code tests/device/hard-float/jni/Android.mk}.</li>
-        <li>Migrated from GNU Compiler Collection (GCC) 4.8 to 4.8.2, and added diagnostic color
-          support. To enable diagnostic colors, set <code>-fdiagnostics-color=auto</code>,
-          <code>-fdiagnostics-color=always,</code> or export {@code GCC_COLORS} as shown below:
-<pre>
-GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
-</pre>
-          For more information, see
-          <a href="http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html">GCC
-          Language Independent Options</a>.
-        </li>
-        <li>Added two new samples to demonstrate OpenGL ES 3.0 features: Teapot and MoreTeapots.
-          These samples run on devices with Android 4.1 (API level 16) and higher.</li>
-        <li>Deprecated GCC 4.7 and Clang 3.2 support, which will be removed in the next
-          release.</li>
-      </ul>
-      </dd>
-
-      <dt>Important bug fixes:</dt>
-      <dd>
-      <ul>
-        <li>Fixed problem with ARM GCC 4.6 {@code thumb2} failing to generate 16-bit relative jump
-          tables. (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48328">GCC Issue</a>)</li>
-        <li>Fixed GCC 4.8 internal compiler error (ICE) on
-          {@code g++.dg/cpp0x/lambda/lambda-defarg3.C}.
-          (<a href="https://android-review.googlesource.com/62770">Change 62770</a>,
-          <a href="http://gcc.gnu.org/ml/gcc/2013-07/msg00424.html">GCC Issue</a>)</li>
-        <li>Fixed a problem with Windows 32-bit {@code *-gdb.exe} executables failing to launch.
-          (<a href="http://b.android.com/58975">Issue 58975</a>)</li>
-        <li>Fixed GCC 4.8 ICE when building bullet library. The error message is as follows:
-          <pre>internal compiler error: verify_flow_info failed</pre>
-          (<a href="http://b.android.com/58916">Issue 58916</a>,
-           <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58165">GCC Issue</a>)</li>
-        <li>Modified GDB/ARM build to skip {@code ARM.exidx} data for unwinding in prologue code and
-          added a command ({@code set arm exidx-unwinding}) to control exidx-based stack unwinding.
-          (<a href="http://b.android.com/55826">Issue 55826</a>)</li>
-        <li>Fixed Clang 3.3 MIPS compiler problem where HI and LO registers are incorrectly
-          reused.</li>
-        <li>Fixed issue with MIPS 4.7 ICE in {@code dbx_reg_number}. The error message is as
-follows:
-<pre>
-external/icu4c/i18n/decimfmt.cpp:1322:1:
-internal compiler error: in dbx_reg_number, at dwarf2out.c:10185
-</pre>
-          (<a href="http://gcc.gnu.org/ml/gcc-patches/2012-12/msg00830.html">GCC Patch</a>)
-
-        </li>
-
-      </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-      <dd>
-      <ul>
-        <li>Header fixes
-          <ul>
-            <li>Fixed the ARM {@code WCHAR_MIN} and {@code WCHAR_MAX} to be unsigned according to
-              spec (the X86/MIPS versions are signed). Define {@code _WCHAR_IS_ALWAYS_SIGNED} to
-              restore old behavior. (<a href="http://b.android.com/57749">Issue 57749</a>)</li>
-            <li>Fixed {@code include/netinet/tcp.h} to contain {@code TCP_INFO} state enum.
-              (<a href="http://b.android.com/38881">Issue 38881</a>)</li>
-            <li>Fixed the {@code cdefs_elh.h} macro {@code _C_LABEL_STRING} to stop generating
-               warnings in the GCC 4.8 toolchain when using c++11 mode.
-              (<a href="http://b.android.com/58135">Issue 58135</a>,
-               <a href="http://b.android.com/58652">Issue 58652</a>)</li>
-            <li>Removed non-existent functions {@code imaxabs} and {@code imaxdiv} from header
-              {@code inttypes.h}.</li>
-            <li>Fixed issue with {@code pthread_exit()} return values and {@code pthread_self()}.
-                 (<a href="http://b.android.com/60686">Issue 60686</a>)</li>
-            <li>Added missing {@code mkdtemp()} function, which already exists in {@code bionic}
-              header {@code stdlib.h}.</li>
-          </ul>
-        </li>
-        <li>Fixed problem building {@code samples/gles3jni} with Clang on Android API level 11.</li>
-        <li>Fixed MCLinker to allow multiple occurrences of the following options:
-          {@code -gc-sections} and {@code --eh-frame-hdr}.</li>
-        <li>Fixed MCLinker to accept the {@code --no-warn-mismatch} option.</li>
-        <li>Modified {@code cpu-features} option to not assume all VFPv4 devices support IDIV.
-          Now this option only adds IDIV to white-listed devices, including Nexus 4.
-          (<a href="http://b.android.com/57637">Issue 57637</a>)</li>
-        <li>Fixed problem with {@code android_native_app_glue.c} erroneously logging errors on event
-          predispatch operations.</li>
-        <li>Fixed all operations on {@code gabi++} terminate and unexpected_handler to be
-          thread-safe.</li>
-        <li>Fixed several issues with Clang <code>-integrated-as</code> option so it can pass
-          tests for {@code ssax-instructions} and {@code fenv}.</li>
-        <li>Fixed GCC 4.6/4.7/4.8 compiler to pass the linker option {@code --eh-frame-hdr} even
-          for static executables. For more information, see the
-          <a href="http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00969.html">GCC patch</a>.</li>
-        <li>Fixed extra apostrophe in <code>CPU-ARCH-ABIS.html</code>. For more information, see
-          <code>NDK-DEPENDS.html</code>. (<a href="http://b.android.com/60142">Issue 60142</a>)</li>
-        <li>Fixed extra quotes in ndk-build output on Windows.
-          (<a href="http://b.android.com/60649">Issue 60649</a>)</li>
-        <li>Fixed Clang 3.3 to compile ARM's built-in, atomic operations such as
-          {@code __atomic_fetch_add}, {@code __atomic_fetch_sub}, and {@code __atomic_fetch_or}.
-          </li>
-        <li>Fixed Clang 3.3 ICE with customized {@code vfprintf}.
-          (<a href="http://llvm.org/bugs/show_bug.cgi?id=16344">Clang issue</a>)
-        </li>
-      </ul>
-      </dd>
-
-      <dt>Other changes:</dt>
-      <dd>
-      <ul>
-        <li>Enabled OpenMP for all GCC builds. To use this feature, add the following flags to your
-          build settings:
-<pre>
-LOCAL_CFLAGS += -fopenmp
-LOCAL_LDFLAGS += -fopenmp
-</pre>
-          For code examples, see {@code tests/device/test-openmp}</li>
-        <li>Reduced the size of {@code ld.mcld} significantly (1.5MB vs. {@code ld.bfd} 3.5MB and
-          {@code ld.gold} 7.5MB), resulting in a speed improvement of approximately 20%.</li>
-        <li>Added <code>LOCAL_CONLYFLAGS</code> and <code>APP_CONLYFLAGS</code> to specify
-          options applicable to C only but not C++. The existing <code>LOCAL_CFLAGS</code>
-          and <code>APP_CFLAGS</code> are also used for C++ compilation (to save trouble of
-          specifying most options twice), so options such as <code>-std=gnu99</code> may fail in
-          g++ builds with a warning and clang++ builds with an error.</li>
-        <li>Added {@code gabi++} array helper functions.</li>
-        <li>Modified GCC builds so that all {@code libgcc.a} files are built with
-          <code>-funwind-tables</code> to allow the stack to be unwound past previously blocked
-          points, such as <code>__aeabi_idiv0</code>.</li>
-        <li>Added Ingenic MXU support in MIPS GCC4.6/4.7/4.8 with new <code>-mmxu</code>
-option.</li>
-        <li>Extended MIPS GCC4.6/4.7/4.8 <code>-mldc1-sdc1</code> to control ldxc1/sdxc1 too</li>
-        <li>Added crazy linker. For more information, see
-          {@code sources/android/crazy_linker/README.TXT}.</li>
-        <li>Fixed {@code bitmap-plasma} to draw to full screen rather than a 200x200 pixel
-area.</li>
-        <li>Reduced linux and darwin toolchain sizes by 25% by creating symlinks to identical files.
-          </li>
-      </ul>
-      </dd>
-
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p>
-    <a href="#" onclick="return toggleContent(this)"> <img
-      src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
-    >Android NDK, Revision 9</a> <em>(July 2013)</em>
-  </p>
-  <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-        <ul>
-          <li>Added support for Android 4.3 (API level 18). For more information, see
-            {@code STABLE-APIS.html} and new code examples in {@code samples/gles3jni/README}.
-          <li>Added headers and libraries for OpenGL ES 3.0, which is supported by Android 4.3
-            (API level 18) and higher.</li>
-          <li>Added GNU Compiler Collection (GCC) 4.8 compiler to the NDK. Since GCC 4.6 is still
-            the default, you must explicitly enable this option:
-            <ul>
-              <li>For {@code ndk-build} builds, export {@code NDK_TOOLCHAIN_VERSION=4.8} or
-                add it in {@code Application.mk}.</li>
-              <li>For standalone builds, use the {@code --toolchain=} option in
-                {@code make-standalone-toolchain.sh}, for example:<br>
-                {@code --toolchain=arm-linux-androideabi-4.8}</li>
-            </ul>
-            <p class="note"><strong>Note:</strong>
-            The {@code -Wunused-local-typedefs} option is enabled by {@code -Wall}. Be
-            sure to add {@code __attribute__((unused))} if you use compile-time asserts like
-            {@code sources/cxx-stl/stlport/stlport/stl/config/features.h}, line #311. For more
-            information, see
-            <a href="https://android-review.googlesource.com/#/c/55460">Change 55460</a></p>
-            <p class="note"><strong>Note:</strong>
-            In the GCC 4.7 release and later, ARM compilers generate unaligned access code by
-            default for ARMv6 and higher build targets. You may need to add the
-            {@code -mno-unaligned-access} build option when building for kernels that do not support
-            this feature.</p>
-          </li>
-          <li>Added Clang 3.3 support. The {@code NDK_TOOLCHAIN_VERSION=clang} build option
-            now picks Clang 3.3 by default.
-            <p class="note"><strong>Note:</strong>
-             Both GCC 4.4.3 and Clang 3.1 are deprecated, and will be removed from the next NDK
-             release.</p></li>
-          <li>Updated GNU Project Debugger (GDB) to support python 2.7.5.</li>
-          <li>Added MCLinker to support Windows hosts. Since {@code ld.gold}
-            is the default where available, you must add {@code -fuse-ld=mcld} in
-            {@code LOCAL_LDFLAGS} or {@code APP_LDFLAGS} to enable MCLinker.</li>
-          <li>Added {@code ndk-depends} tool which prints ELF library dependencies.
-            For more information, see {@code NDK-DEPENDS.html}.
-            (<a href="http://b.android.com/53486">Issue 53486</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Important bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>Fixed potential event handling issue in {@code android_native_app_glue}.
-            (<a href="http://b.android.com/41755">Issue 41755</a>)</li>
-          <li>Fixed ARM/GCC-4.7 build to generate sufficient alignment for NEON load and store
-            instructions VST and VLD.
-            (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271">GCC Issue 57271</a>)</li>
-          <li>Fixed a GCC 4.4.3/4.6/4.7 internal compiler error (ICE) for a constant negative index
-            value on a string literal.
-            (<a href="http://b.android.com/54623">Issue 54623</a>)</li>
-          <li>Fixed GCC 4.7 segmentation fault for constant initialization with an object address.
-            (<a href="http://b.android.com/56508">Issue 56508</a>)</li>
-          <li>Fixed GCC 4.6 ARM segmentation fault for <code>-O</code> values when using Boost
-            1.52.0. (<a href="http://b.android.com/42891">Issue 42891</a>)
-          <li>Fixed {@code libc.so} and {@code libc.a} to support the {@code wait4()} function.
-            (<a href="http://b.android.com/19854">Issue 19854</a>)</li>
-          <li>Updated the x86 libc.so and libc.a files to include the {@code clone()}
-            function.</li>
-          <li>Fixed {@code LOCAL_SHORT_COMMANDS} bug where the {@code linker.list} file is
-            empty or not used.</li>
-          <li>Fixed GCC MIPS build on Mac OS to use CFI directives, without which
-            {@code ld.mcld --eh-frame-hdr} fails frequently.</li>
-          <li>Fixed Clang 3.2 X86/MIPS internal compiler error in {@code llvm/lib/VMCore/Value.cpp}.
-            (<a href="https://android-review.googlesource.com/#/c/59021">Change 59021</a>)</li>
-          <li>Fixed GCC 4.7 64-bit Windows assembler crash. (Error: {@code out of memory allocating
-            4294967280 bytes}).</li>
-          <li>Updated {@code ndk-gdb} script so that the {@code --start} or {@code --launch} actions
-            now wait for the GNU Debug Server, so that it can more reliably hit breakpoints set
-            early in the execution path (such as breakpoints in JNI code).
-            (<a href="http://b.android.com/41278">Issue 41278</a>)
-            <p class="note"><strong>Note:</strong>
-              This feature requires jdb and produces warning about pending breakpoints.
-              Specify the {@code --nowait} option to restore previous behavior.
-            </p>
-          </li>
-          <li>Fixed GDB crash when library list is empty.</li>
-          <li>Fixed GDB crash when using a {@code stepi} command past a {@code bx pc} or
-            {@code blx pc} Thumb instruction.
-            (<a href="http://b.android.com/56962">Issue 56962</a>,
-             <a href="http://b.android.com/36149">Issue 36149</a>)</li>
-          <li>Fixed MIPS {@code gdbserver} to look for {@code DT_MIPS_RLD_MAP} instead of
-            {@code DT_DEBUG}. (<a href="http://b.android.com/56586">Issue 56586</a>)</li>
-          <li>Fixed a circular dependency in the ndk-build script, for example: If A-&gt;B and
-            B-&gt;B, then B was dropped from build.
-            (<a href="http://b.android.com/56690">Issue 56690</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>Fixed the {@code ndk-build} script to enable you to specify a version of Clang as a
-            command line option (e.g., {@code NDK_TOOLCHAIN_VERSION=clang3.2}). Previously, only
-            specifying the version as an environment variable worked.</li>
-          <li>Fixed gabi++ size of {@code _Unwind_Exception} to be 24 for MIPS build targets when
-            using the Clang compiler.
-            (<a href="https://android-review.googlesource.com/#/c/54141">Change 54141</a>)</li>
-          <li>Fixed the {@code ndk-build} script to ensure that built libraries are actually
-            removed from projects that include prebuilt static libraries when using the
-            {@code ndk-build clean} command.
-            (<a href="https://android-review.googlesource.com/#/c/54461">Change 54461</a>,
-             <a href="https://android-review.googlesource.com/#/c/54480">Change 54480</a>)</li>
-          <li>Modified the {@code NDK_ANALYZE=1} option to be less verbose.</li>
-          <li>Fixed {@code gnu-libstdc++/Android.mk} to include a {@code backward/} path for builds
-            that use backward compability.
-            (<a href="http://b.android.com/53404">Issue 53404</a>)</li>
-          <li>Fixed a problem where {@code stlport new} sometimes returned random values.</li>
-          <li>Fixed {@code ndk-gdb} to match the order of {@code CPU_ABIS}, not {@code APP_ABIS}.
-            (<a href="http://b.android.com/54033">Issue 54033</a>)</li>
-          <li>Fixed a problem where the NDK 64-bit build on MacOSX choses the wrong path for
-            compiler.
-            (<a href="http://b.android.com/53769">Issue 53769</a>)</li>
-          <li>Fixed build scripts to detect 64-bit Windows Vista.
-            (<a href="http://b.android.com/54485">Issue 54485</a>)</li>
-          <li>Fixed x86 {@code ntonl/swap32} error: {@code invalid 'asm': operand number
-            out of range}.
-            (<a href="http://b.android.com/54465">Issue 54465</a>,
-             <a href="https://android-review.googlesource.com/#/c/57242">Change 57242</a>)</li>
-          <li>Fixed {@code ld.gold} to merge string literals.</li>
-          <li>Fixed {@code ld.gold} to handle large symbol alignment.</li>
-          <li>Updated {@code ld.gold} to enable the {@code --sort-section=name} option.</li>
-          <li>Fixed GCC 4.4.3/4.6/4.7 to suppress the {@code -export-dynamic} option for
-            statically linked programs. GCC no longer adds an {@code .interp} section for statically
-            linked programs.</li>
-          <li>Fixed GCC 4.4.3 {@code stlport} compilation error about inconsistent {@code typedef}
-            of {@code _Unwind_Control_Block}.
-            (<a href="http://b.android.com/54426">Issue 54426</a>)</li>
-          <li>Fixed {@code awk} scripts to handle {@code AndroidManifest.xml} files created on
-            Windows which may contain trailing {@code \r} characters and cause build errors.
-            (<a href="http://b.android.com/42548">Issue 42548</a>)</li>
-          <li>Fixed {@code make-standalone-toolchain.sh} to probe the {@code prebuilts/}
-            directory to detect if the host is 32 bit or 64 bit.</li>
-          <li>Fixed the Clang 3.2 {@code -integrated-as} option.</li>
-          <li>Fixed the Clang 3.2 ARM EHABI compact model {@code pr1} and {@code pr2} handler data.
-            </li>
-          <li>Added Clang {@code -mllvm -arm-enable-ehabi} option to fix the following Clang error:
-            <pre>clang: for the -arm-enable-ehabi option: may only occur zero or one times!</pre>
-            </li>
-          <li>Fixed build failure when there is no {@code uses-sdk} element in application
-            manifest. (<a href="http://b.android.com/57015">Issue 57015</a>)</li>
-        </ul>
-
-      </dd>
-      <dt>Other changes:</dt>
-      <dd>
-        <ul>
-          <li>Header Fixes
-            <ul>
-              <li>Modified headers to make {@code __set_errno} an inlined function, since
-                {@code __set_errno} in {@code errno.h} is deprecated, and {@code libc.so} no longer
-                exports it.</li>
-              <li>Modified {@code elf.h} to include {@code stdint.h}.
-                (<a href="http://b.android.com/55443">Issue 55443</a>)</li>
-              <li>Fixed {@code sys/un.h} to be included independently of other headers.
-                (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
-              <li>Fixed all of the {@code MotionEvent_getHistorical} API family to take the
-                {@code const AInputEvent* motion_event}.
-                (<a href="http://b.android.com/55873">Issue 55873</a>)</li>
-              <li>Fixed {@code malloc_usable_size} to take {@code const void*}.
-                (<a href="http://b.android.com/55725">Issue 55725</a>)</li>
-              <li>Fixed stdint.h to be more compatible with C99.
-                (<a href="https://android-review.googlesource.com/#/c/46821">Change 46821</a>)</li>
-              <li>Modified {@code wchar.h} to not redefine {@code WCHAR_MAX} and
-                {@code WCHAR_MIN}</li>
-              <li>Fixed {@code &lt;inttypes.h&gt;} declaration for pointer-related {@code PRI} and
-                {@code SCN} macros. (<a href="http://b.android.com/57218">Issue 57218</a>)</li>
-              <li>Changed the {@code sys/cdefs.h} header so that {@code __WCHAR_TYPE__} is 32-bit
-                for API levels less than 9, which means that {@code wchat_t} is 32-bit for all
-                API levels. To restore the previous behavior, define the {@code _WCHAR_IS_8BIT}
-                boolean variable. (<a href="http://b.android.com/57267">Issue 57267</a>)</li>
-            </ul>
-          </li>
-          <li>Added more formatting in NDK {@code docs/} and miscellaneous documentation fixes.
-            </li>
-          <li>Added support for a thin archive technique when building static libraries.
-            (<a href="http://b.android.com/40303">Issue 40303</a>)</li>
-          <li>Updated script {@code make-standalone-toolchain.sh} to support the {@code stlport}
-            library in addition to {@code gnustl}, when you specify the option
-            {@code --stl=stlport}. For more information, see {@code STANDALONE-TOOLCHAIN.html}.</li>
-          <li>Updated the {@code make-standalone-toolchain.sh} script so that the
-            {@code --llvm-version=} option creates the {@code $TOOLCHAIN_PREFIX-clang} and
-            {@code $TOOLCHAIN_PREFIX-clang++} scripts in addition to {@code clang} and
-            {@code clang++}, to avoid using the host's clang and clang++ definitions by accident.
-            </li>
-          <li>Added two flags to re-enable two optimizations in upstream Clang but disabled in
-              NDK for better compatibility with code compiled by GCC:
-            <ul>
-              <li>Added a {@code -fcxx-missing-return-semantics} flag to re-enable <em>missing
-return
-                semantics</em> in Clang 3.2+. Normally, all paths should terminate with a return
-                statement for a value-returning function. If this is not the case, clang inserts
-                an undefined instruction (or trap in debug mode) at the path without a return
-                statement. If you are sure your code is correct, use this flag to allow the
-                optimizer to take advantage of the undefined behavior. If you are not sure, do not
-                use this flag. The caller may still receive a random incorrect value, but the
-                optimizer will not exploit it and make your code harder to debug.</li>
-              <li>Added a {@code -fglobal-ctor-const-promotion} flag to re-enable
-                promoting global variables with static constructor to be constants. With this flag,
-                the global variable optimization pass of LLVM tries to evaluate the global
-                variables with static constructors and promote them to global constants. Although
-                this optimization is correct, it may cause some incompatability with code compiled
-                by GCC. For example, code may do {@code const_cast} to cast the constant to mutable
-                and modify it. In GCC, the variable is in read-write and the code is run by
-                accident. In Clang, the const variable is in read-only memory and may cause your
-                application to crash.</li>
-            </ul>
-          </li>
-          <li>Added {@code -mldc1-sdc1} to the MIPS GCC and Clang compilers. By default, compilers
-            align 8-byte objects properly and emit the {@code ldc1} and {@code sdc1} instructions
-            to move them around. If your app uses a custom allocator that does not always align
-            with a new object's 8-byte boundary in the same way as the default allocator, your app
-            may crash due to {@code ldc1} and {@code sdc1} operations on unaligned memory. In this
-            case, use the {@code -mno-ldc1-sdc1} flag to workaround the problem.</li>
-          <li>Downgraded the event severity from warning to info if {@code APP_PLATFORM_LEVEL} is
-            larger than {@code APP_MIN_PLATFORM_LEVEL}. The {@code APP_PLATFORM_LEVEL} may be lower
-            than {@code APP_PLATFORM} in {@code jni/Application.mk} because the NDK does not have
-            headers for all levels. In this case, the actual level is shifted downwards. The
-            {@code APP_MIN_PLATFORM_LEVEL} is specified by the {@code android:minSdkVersion} in
-            your application's manifest.
-            (<a href="http://b.android.com/39752">Issue 39752</a>)</li>
-          <li>Added the {@code android_getCpuIdArm()} and {@code android_setCpuArm()} methods to
-            {@code cpu-features.c}. This addition enables easier retrieval of the ARM CPUID
-            information. (<a href="http://b.android.com/53689">Issue 53689</a>)</li>
-          <li>Modified {@code ndk-build} to use GCC 4.7's {@code as/ld} for Clang compiling.
-            <p class="note"><strong>Note:</strong>
-              In GCC 4.7, {@code monotonic_clock} and {@code is_monotonic} have been renamed to
-              {@code steady_clock} and {@code is_steady}, respectively.</p></li>
-          <li>Added the following new warnings to the {@code ndk-build} script:
-            <ul>
-              <li>Added warnings if {@code LOCAL_LDLIBS/LDFLAGS} are used in static library
-                modules.</li>
-              <li>Added a warning if a configuration has no module to build.</li>
-              <li>Added a warning for non-system libraries being used in
-                {@code LOCAL_LDLIBS/LDFLAGS} of a shared library or executable modules.</li>
-            </ul>
-          </li>
-          <li>Updated build scripts, so that if {@code APP_MODULES} is not defined and only static
-            libraries are listed in {@code Android.mk}, the script force-builds all of them.
-            (<a href="http://b.android.com/53502">Issue 53502</a>)</li>
-          <li>Updated {@code ndk-build} to support absolute paths in {@code LOCAL_SRC_FILES}.</li>
-          <li>Removed the {@code *-gdbtui} executables, which are duplicates of the {@code *-gdb}
-            executables with the {@code -tui} option enabled.</li>
-          <li>Updated the build scripts to warn you when the Edison Design Group (EDG) compiler
-            front-end turns {@code _STLP_HAS_INCLUDE_NEXT} back on.
-            (<a href="http://b.android.com/53646">Issue 53646</a>)</li>
-          <li>Added the environment variable {@code NDK_LIBS_OUT} to allow overriding of the
-            path for {@code libraries/gdbserver} from the default {@code $PROJECT/libs}.
-            For more information, see {@code OVERVIEW.html}.</li>
-          <li>Changed ndk-build script defaults to compile code with format string protection
-            {@code -Wformat -Werror=format-security}. You may set
-            {@code LOCAL_DISABLE_FORMAT_STRING_CHECKS=true} to disable it.
-            For more information, see {@code ANDROID-MK.html}</li>
-          <li>Added STL pretty-print support in {@code ndk-gdb-py}. For more information, see
-            {@code NDK-GDB.html}.</li>
-          <li>Added tests based on the googletest frameworks.</li>
-          <li>Added a notification to the toolchain build script that warns you if the current shell
-            is not {@code bash}.</li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 8e</a> <em>(March 2013)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-        <ul>
-          <li>Added 64-bit host toolchain set (package name suffix {@code *-x86_64.*}). For more
-            information, see {@code CHANGES.HTML} and {@code NDK-BUILD.html}.</li>
-          <li>Added Clang 3.2 compiler. GCC 4.6 is still the default. For information on using the
-            Clang compiler, see {@code CHANGES.HTML}.</li>
-          <li>Added static code analyzer for Linux/MacOSX hosts. For information on using the
-            analyzer, see {@code CHANGES.HTML}.</li>
-          <li>Added MCLinker for Linux/MacOSX hosts as an experimental feature. The {@code ld.gold}
-            linker is the default where available, so you must explicitly enable it. For more
-            information, see {@code CHANGES.HTML}.</li>
-          <li>Updated ndk-build to use topological sort for module dependencies, which means the
-            build automatically sorts out the order of libraries specified in
-            {@code LOCAL_STATIC_LIBRARIES}, {@code LOCAL_WHOLE_STATIC_LIBRARIES} and
-            {@code LOCAL_SHARED_LIBRARIES}. For more information, see {@code CHANGES.HTML}.
-            (<a href="http://b.android.com/39378">Issue 39378</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Important bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>Fixed build script to build all toolchains in {@code -O2}. Toolchains in previous
-            releases were incorrectly built without optimization.</li>
-          <li>Fixed build script which unconditionally builds Clang/llvm for MacOSX in 64-bit.</li>
-          <li>Fixed GCC 4.6/4.7 internal compiler error:
-            {@code gen_thumb_movhi_clobber at config/arm/arm.md:5832}.
-            (<a href="http://b.android.com/52732">Issue 52732</a>)</li>
-          <li>Fixed build problem where GCC/ARM 4.6/4.7 fails to link code using 64-bit atomic
-            built-in functions.
-            (<a href="http://b.android.com/41297">Issue 41297</a>)</li>
-          <li>Fixed GCC 4.7 linker DIV usage mismatch errors.
-          (<a href="http://sourceware.org/ml/binutils/2012-12/msg00202.html">Sourceware Issue</a>)
-          <li>Fixed GCC 4.7 internal compiler error {@code build_data_member_initialization, at
-            cp/semantics.c:5790}.</li>
-          <li>Fixed GCC 4.7 internal compiler error {@code redirect_eh_edge_1, at tree-eh.c:2214}.
-            (<a href="http://b.android.com/52909">Issue 52909</a>)</li>
-          <li>Fixed a GCC 4.7 segfault.
-            (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245">GCC Issue</a>)</li>
-          <li>Fixed {@code &lt;chrono&gt;} clock resolution and enabled {@code steady_clock}.
-            (<a href="http://b.android.com/39680">Issue 39680</a>)</li>
-          <li>Fixed toolchain to enable {@code _GLIBCXX_HAS_GTHREADS} for GCC 4.7 libstdc++.
-            (<a href="http://b.android.com/41770">Issue 41770</a>,
-             <a href="http://b.android.com/41859">Issue 41859</a>)</li>
-          <li>Fixed problem with the X86 MXX/SSE code failing to link due to missing
-            {@code posix_memalign}.
-            (<a href="https://android-review.googlesource.com/#/c/51872">Change 51872</a>)</li>
-          <li>Fixed GCC4.7/X86 segmentation fault in {@code i386.c}, function
-            {@code distance_non_agu_define_in_bb()}.
-            (<a href="https://android-review.googlesource.com/#/c/50383">Change 50383</a>)</li>
-          <li>Fixed GCC4.7/X86 to restore earlier {@code cmov} behavior.
-            (<a href="http://gcc.gnu.org/viewcvs?view=revision&revision=193554">GCC Issue</a>)</li>
-          <li>Fixed handling NULL return value of {@code setlocale()} in libstdc++/GCC4.7.
-            (<a href="http://b.android.com/46718">Issue 46718</a>)
-          <li>Fixed {@code ld.gold} runtime undefined reference to {@code __exidx_start} and
-            {@code __exidx_start_end}.
-            (<a href="https://android-review.googlesource.com/#/c/52134">Change 52134</a>)</li>
-          <li>Fixed Clang 3.1 internal compiler error when using Eigen library.
-            (<a href="http://b.android.com/41246">Issue 41246</a>)</li>
-          <li>Fixed Clang 3.1 internal compiler error including {@code &lt;chrono&gt;} in C++11
-mode.
-            (<a href="http://b.android.com/39600">Issue 39600</a>)</li>
-          <li>Fixed Clang 3.1 internal compiler error when generating object code for a method
-            call to a uniform initialized {@code rvalue}.
-            (<a href="http://b.android.com/41387">Issue 41387</a>)</li>
-          <li>Fixed Clang 3.1/X86 stack realignment.
-            (<a href="https://android-review.googlesource.com/#/c/52154">Change 52154</a>)</li>
-          <li>Fixed problem with GNU Debugger (GDB) SIGILL when debugging on Android 4.1.2.
-            (<a href="http://b.android.com/40941">Issue 40941</a>)</li>
-          <li>Fixed problem where GDB cannot set {@code source:line} breakpoints when symbols
-contain
-            long, indirect file paths.
-            (<a href="http://b.android.com/42448">Issue 42448</a>)</li>
-          <li>Fixed GDB {@code read_program_header} for MIPS PIE executables.
-            (<a href="https://android-review.googlesource.com/#/c/49592">Change 49592</a>)</li>
-          <li>Fixed {@code STLport} segmentation fault in {@code uncaught_exception()}.
-            (<a href="https://android-review.googlesource.com/#/c/50236">Change 50236</a>)</li>
-          <li>Fixed {@code STLport} bus error in exception handling due to unaligned access of
-            {@code DW_EH_PE_udata2}, {@code DW_EH_PE_udata4}, and {@code DW_EH_PE_udata8}.</li>
-          <li>Fixed Gabi++ infinite recursion problem with {@code nothrow new[]} operator.
-            (<a href="http://b.android.com/52833">Issue 52833</a>)</li>
-          <li>Fixed Gabi++ wrong offset to exception handler pointer.
-            (<a href="https://android-review.googlesource.com/#/c/53446">Change 53446</a>)</li>
-          <li>Removed Gabi++ redundant free on exception object
-            (<a href="https://android-review.googlesource.com/#/c/53447">Change 53447</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>Fixed NDK headers:
-            <ul>
-              <li>Removed redundant definitions of {@code size_t}, {@code ssize_t}, and
-                {@code ptrdiff_t}.</li>
-              <li>Fixed MIPS and ARM {@code fenv.h} header.</li>
-              <li>Fixed {@code stddef.h} to not redefine {@code offsetof} since it already exists
-                in the toolchain.</li>
-              <li>Fixed {@code elf.h} to contain {@code Elf32_auxv_t} and {@code Elf64_auxv_t}.
-                (<a href="http://b.android.com/38441">Issue 38441</a>)
-                </li>
-              <li>Fixed the {@code #ifdef} C++ definitions in the
-                {@code OpenSLES_AndroidConfiguration.h} header file.
-                (<a href="http://b.android.com/53163">Issue 53163</a>)
-                </li>
-            </ul>
-          </li>
-          <li>Fixed {@code STLport} to abort after out of memory error instead of silently exiting.
-            </li>
-          <li>Fixed system and Gabi++ headers to be able to compile with API level 8 and lower.</li>
-          <li>Fixed {@code cpufeatures} to not parse {@code /proc/self/auxv}.
-            (<a href="http://b.android.com/43055">Issue 43055</a>)</li>
-          <li>Fixed {@code ld.gold} to not depend on host libstdc++ and on Windows platforms,
-            to not depend on the {@code libgcc_sjlj_1.dll} library.</li>
-          <li>Fixed Clang 3.1 which emits inconsistent register list in {@code .vsave} and fails
-            assembler.
-            (<a href="https://android-review.googlesource.com/#/c/49930">Change 49930</a>)</li>
-          <li>Fixed Clang 3.1 to be able to compile libgabi++ and pass the {@code test-stlport}
-            tests for MIPS build targets.
-            (<a href="https://android-review.googlesource.com/#/c/51961">Change 51961</a>)</li>
-          <li>Fixed Clang 3.1 to only enable exception by default for C++, not for C.</li>
-          <li>Fixed several issues in Clang 3.1 to pass most GNU exception tests.</li>
-          <li>Fixed scripts {@code clang} and {@code clang++} in standalone NDK compiler to detect
-            {@code -cc1} and to not specify {@code -target} when found.</li>
-          <li>Fixed {@code ndk-build} to observe {@code NDK_APP_OUT} set in {@code Application.mk}.
-            </li>
-          <li>Fixed X86 {@code libc.so} and {@code lib.a} which were missing the {@code sigsetjmp}
-            and {@code siglongjmp} functions already declared in {@code setjmp.h}.
-            (<a href="http://b.android.com/19851">Issue 19851</a>)</li>
-          <li>Patched GCC 4.4.3/4.6/4.7 libstdc++ to work with Clang in C++ 11.
-            (<a href="http://clang.llvm.org/cxx_status.html">Clang Issue</a>)</li>
-          <li>Fixed cygwin path in argument passed to {@code HOST_AWK}.</li>
-          <li>Fixed {@code ndk-build} script warning in windows when running from project's JNI
-            directory.
-            (<a href="http://b.android.com/40192">Issue 40192</a>)</li>
-          <li>Fixed problem where the {@code ndk-build} script does not build if makefile has
-            trailing whitespace in the {@code LOCAL_PATH} definition.
-            (<a href="http://b.android.com/42841">Issue 42841</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Other changes:</dt>
-      <dd>
-        <ul>
-          <li>Enabled threading support in GCC/MIPS toolchain.</li>
-          <li>Updated GCC exception handling helpers {@code __cxa_begin_cleanup} and
-            {@code __cxa_type_match} to have <em>default</em> visibility from the previous
-            <em>hidden</em> visibility in GNU libstdc++. For more information, see
-            {@code CHANGES.HTML}.</li>
-          <li>Updated build scripts so that Gabi++ and STLport static libraries are now built with
-            hidden visibility except for exception handling helpers.</li>
-          <li>Updated build so that {@code STLport} is built for ARM in Thumb mode.</li>
-          <li>Added support for {@code std::set_new_handler} in Gabi++.
-            (<a href="http://b.android.com/52805">Issue 52805</a>)</li>
-          <li>Enabled {@code FUTEX} system call in GNU libstdc++.</li>
-          <li>Updated {@code ndk-build} so that it  no longer copies prebuilt static library to
-            a project's {@code obj/local/&lt;abi&gt;/} directory.
-            (<a href="http://b.android.com/40302">Issue 40302</a>)</li>
-          <li>Removed {@code __ARM_ARCH_5*__} from ARM {@code toolchains/*/setup.mk} script.
-            (<a href="http://b.android.com/21132">Issue 21132</a>)</li>
-          <li>Built additional GNU libstdc++ libraries in thumb for ARM.</li>
-          <li>Enabled MIPS floating-point {@code madd/msub/nmadd/nmsub/recip/rsqrt}
-            instructions with 32-bit FPU.</li>
-          <li>Enabled graphite loop optimizer in GCC 4.6 and 4.7 to allow more optimizations:
-            {@code -fgraphite}, {@code -fgraphite-identity}, {@code -floop-block}, {@code
--floop-flatten},
-            {@code -floop-interchange}, {@code -floop-strip-mine}, {@code -floop-parallelize-all},
-            and {@code -ftree-loop-linear}.
-            (<a href="http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html">info</a>)</li>
-          <li>Enabled {@code polly} for Clang 3.1 on Linux and Max OS X 32-bit hosts which analyzes
-            and optimizes memory access. (<a href="http://polly.llvm.org">info</a>)</li>
-          <li>Enabled {@code -flto} in GCC 4.7, 4.6, Clang 3.2 and Clang 3.1 on linux (Clang LTO
-            via LLVMgold.so). MIPS compiler targets are not supported because {@code ld.gold}
-            is not available.</li>
-          <li>Enabled {@code --plugin} and {@code --plugin-opt} for {@code ld.gold} in GCC 4.6/4.7.
-            </li>
-          <li>Enabled {@code --text-reorder} for {@code ld.gold} in GCC 4.7.</li>
-          <li>Configured GNU libstdc++ with {@code _GLIBCXX_USE_C99_MATH} which undefines the
-            {@code isinf} script in the bionic header. For more information, see
-            {@code CHANGES.html}.</li>
-          <li>Added {@code APP_LDFLAGS} to the build scripts. For more information, see
-            {@code ANDROID-MK.html}.</li>
-          <li>Updated build scripts to allow {@code NDK_LOG=0} to disable the {@code NDK_LOG}.</li>
-          <li>Updated build scripts to allow {@code NDK_HOST_32BIT=0} to disable the host developer
-            environment 32-bit toolchain.</li>
-          <li>Changed the default GCC/X86 flags {@code -march=} and {@code -mtune=} from
-            {@code pentiumpro} and {@code generic} to {@code i686} and {@code atom}.</li>
-          <li>Enhanced toolchain build scripts:
-            <ul>
-              <li>Fixed a race condition in {@code build-gcc.sh} for the {@code mingw} build type
-                which was preventing a significant amount of parallel build processing.</li>
-              <li>Updated {@code build-gabi++.sh} and {@code build-stlport.sh} so they can now run
-                from the NDK package.
-                (<a href="http://b.android.com/52835">Issue 52835</a>)
-                </li>
-              <li>Fixed {@code run-tests.sh} in the {@code MSys} utilities collection.</li>
-              <li>Improved 64-bit host toolchain and Canadian Cross build support.</li>
-              <li>Updated {@code build-mingw64-toolchain.sh} script to more recent version.</li>
-              <li>Added option to build {@code libgnustl_static.a} and {@code stlport_static.a}
-                without hidden visibility.</li>
-            </ul>
-          </li>
-        </ul>
-
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 8d</a> <em>(December 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-      <dd>
-        <ul>
-          <li>Added the GNU Compiler Collection (GCC) 4.7 compiler to the NDK. The GCC 4.6 compiler
-            is still the default, so you must to explicitly enable the new version as follows:
-            <ul>
-              <li>For {@code ndk-build}, export the {@code NDK_TOOLCHAIN_VERSION=4.7} variable
-                <em>or</em> add it to {@code Application.mk}.</li>
-              <li>For standalone builds, add the {@code --toolchain=} option to
-                {@code make-standalone-toolchain.sh}, for example:
-                <pre>--toolchain=arm-linux-androideabi-4.7</pre></li>
-            </ul>
-            <p class="note">
-              <strong>Note:</strong> This feature is experimental. Please try it and
-              <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p>
-          </li>
-          <li>Added {@code stlport} exception support via gabi++.  Note that the new gabi++
-            depends on {@code dlopen} and related code, meaning that:
-            <ul>
-              <li>You can no longer build a <em>static</em> executable using the {@code -static}
-                option or include {@code libstlport_static.a} using
-                {@code APP_STL := stlport_static}. (You can still use the {@code -static} option
-                with a standalone toolchain.) Compiling a <em>dynamic</em> executable using
-                {@code include $(BUILD_EXECUTABLE)} continues to work because the compiler
-                automatically adds the {@code -ldl} option.</li>
-              <li>If your project links using {@code -nostdlib} and {-Wl,--no-undefined}, you
-                must manually include the {@code -ldl} option.</li>
-            </ul>
-              For more information, see {@code CPLUSPLUS-SUPPORT.html}.
-
-              <p class="note">
-                <strong>Note:</strong> This feature is experimental and works better with the GCC
-                4.6/4.7 compilers than with GCC 4.4.3 or Clang 3.1. Please try it and
-                <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p>
-          </li>
-          <li>Added a {@code -mstack-protector-guard=} option for x86 to choose between a
-            <em>global</em> default path which is compatible with older Android C library (bionic)
-            and a new <em>tls</em> path (%gs:20) for {@code -fstack-protector},
-            {@code -fstack-protector-all} and {@code -fstack-protector-strong} using the GCC 4.6
-            and higher compilers.
-
-            <p class="note">
-              <strong>Note:</strong> The {@code -mstack-protector-guard} setting itself does not
-              enable any {@code -fstack-protector*} options.</p>
-          </li>
-          <li>Added {@code android_setCpu()} function to
-            {@code sources/android/cpufeatures/cpu-features.c} for use when auto-detection via
-            {@code /proc} is not possible in Android 4.1 and higher.
-            (<a href="http://code.google.com/p/chromium/issues/detail?id=164154">Chromium Issue
-            164154</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Important bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>Fixed unnecessary rebuild of object files when using the {@code ndk-build} script.
-            (<a href="http://b.android.com/39810">Issue 39810</a>)</li>
-          <li>Fixed a linker failure with the NDK 8c release for Mac OS X 10.6.x that produced the
-            following error:
-            <pre>
-dyld: lazy symbol binding failed: Symbol not found: _memmem
-Referenced from: ...../arm-linux-androideabi/bin/ld
-Expected in: /usr/lib/libSystem.B.dylib</pre>
-            This problem was caused by building on Mac OS X 10.7, which produced binaries that were
-            not compatible with Mac OS 10.6.x and the NDK.
-          </li>
-          <li>Removed the {@code -x c++} options from the Clang++ standalone build script.
-          (<a href="http://b.android.com/39089">Issue 39089</a>)</li>
-          <li>Fixed issues using the {@code NDK_TOOLCHAIN_VERSION=clang3.1} option in Cygwin.
-           (<a href="http://b.android.com/39585">Issue 39585</a>)</li>
-          <li>Fixed the {@code make-standalone-toolchain.sh} script to allow generation of a
-            standalone toolchain using the Cygwin or MinGW environments. The resulting toolchain
-            can be used in Cygwin, MingGW or CMD.exe environments.
-            (<a href="http://b.android.com/39915">Issue 39915</a>,
-            <a href="http://b.android.com/39585">Issue 39585</a>)</li>
-          <li>Added missing {@code SL_IID_ANDROIDBUFFERQUEUESOURCE} option in android-14 builds for
-            ARM and X86.
-            (<a href="http://b.android.com/40625">Issue 40625</a>)</li>
-          <li>Fixed x86 CPU detection for the {@code ANDROID_CPU_X86_FEATURE_MOVBE} feature.
-            (<a href="http://b.android.com/39317">Issue 39317</a>)</li>
-          <li>Fixed an issue preventing the Standard Template Library (STL) from using C++
-            sources that do not have a {@code .cpp} file extension.</li>
-          <li>Fixed GCC 4.6 ARM internal compiler error <em>at reload1.c:1061</em>.
-            (<a href="http://b.android.com/20862">Issue 20862</a>)</li>
-          <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at emit-rtl.c:1954</em>.
-            (<a href="http://b.android.com/22336">Issue 22336</a>)</li>
-          <li>Fixed GCC 4.4.3 ARM internal compiler error <em>at postreload.c:396</em>.
-            (<a href="http://b.android.com/22345">Issue 22345</a>)</li>
-          <li>Fixed problem with GCC 4.6/4.7 skipping lambda functions.
-            (<a href="http://b.android.com/35933">Issue 35933</a>)</li>
-        </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-      <dd>
-        <ul>
-          <li>NDK header file fixes:
-            <ul>
-              <li>Fixed {@code __WINT_TYPE__} and {@code wint_t} to be the same type.</li>
-              <li>Corrected typo in {@code android/bitmap.h}.
-                (<a href="http://b.android.com/15134">Issue 15134</a>)
-              </li>
-              <li>Corrected typo in {@code errno.h}.</li>
-              <li>Added check for the presence of {@code __STDC_VERSION__} in {@code sys/cdefs.h}.
-                (<a href="http://b.android.com/14627">Issue 14627</a>)
-              </li>
-              <li>Reorganized headers in {@code byteswap.h} and {@code dirent.h}.</li>
-              <li>Fixed {@code limits.h} to include {@code page.h} which provides {@code PAGE_SIZE}
-                settings.
-                (<a href="http://b.android.com/39983">Issue 39983</a>)
-              </li>
-              <li>Fixed return type of {@code glGetAttribLocation()} and
-                {@code glGetUniformLocation()} from {@code int} to {@code GLint}.</li>
-              <li>Fixed {@code __BYTE_ORDER} constant for x86 builds.
-                (<a href="http://b.android.com/39824">Issue 39824</a>)
-              </li>
-            </ul>
-          </li>
-          <li>Fixed {@code ndk-build} script to not overwrite {@code -Os} with {@code -O2} for ARM
-            builds.</li>
-          <li>Fixed build scripts to allow overwriting of {@code HOST_AWK}, {@code HOST_SED}, and
-            {@code HOST_MAKE} settings.</li>
-          <li>Fixed issue for {@code ld.gold} on {@code fsck_msdos} builds linking objects built by
-            the Intel C/C++ compiler (ICC).</li>
-          <li>Fixed ARM EHABI support in Clang to conform to specifications.</li>
-          <li>Fixed GNU Debugger (GDB) to shorten the time spent on walking the target's link map
-            during {@code solib} events.
-            (<a href="http://b.android.com/38402">Issue 38402</a>)</li>
-          <li>Fixed missing {@code libgcc.a} file when linking shared libraries.</li>
-        </ul>
-      </dd>
-
-      <dt>Other changes:</dt>
-      <dd>
-        <ul>
-          <li>Backported 64-bit built-in atomic functions for ARM to GCC 4.6.</li>
-          <li>Added documentation for audio output latency, along with other documentation and
-            fixes.</li>
-          <li>Fixed debug builds with Clang so that non-void functions now raise a {@code SIGILL}
-            signal for paths without a return statement.</li>
-          <li>Updated {@code make-standalone-toolchain.sh} to accept the suffix {@code -clang3.1}
-            which is equivalent to adding {@code --llvm-version=3.1} to the GCC 4.6 toolchain.</li>
-          <li>Updated GCC and Clang bug report URL to:
-            <a
-href="http://source.android.com/source/report-bugs.html">http://source.android.com/source/report-bug
-s.html</a></li>
-          <li>Added ARM ELF support to {@code llvm-objdump}.</li>
-          <li>Suppressed <em>treating c input as c++</em> warning for Clang builds.</li>
-          <li>Updated build so that only the 32-bit version of {@code libiberty.a} is built and
-            placed in {@code lib32/}.</li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 8c</a> <em>(November 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <dl>
-      <dt>Important changes:</dt>
-
-      <dd>
-        <ul>
-          <li>Added the Clang 3.1 compiler to the NDK. The GNU Compiler Collection (GCC) 4.6 is
-          still the default, so you must explicitly enable the Clang compiler option as follows:
-            <ul>
-              <li>For {@code ndk-build}, export {@code NDK_TOOLCHAIN_VERSION=clang3.1} <em>or</em>
-                add this environment variable setting to {@code Application.mk}.</li>
-              <li>For standalone builds, add {@code --llvm-version=3.1} to
-                {@code make-standalone-toolchain.sh} and replace {@code CC} and {@code CXX} in your
-                makefile with {@code &lt;tool-path&gt;/bin/clang} and
-                {@code &lt;tool-path&gt;/bin/clang++}. See {@code STANDALONE-TOOLCHAIN.html} for
-                details.</li>
-            </ul>
-            <p class="note"><strong>Note:</strong> This feature is experimental. Please try it and
-            <a href="http://code.google.com/p/android/issues/list">report any issues</a>.</p></li>
-          <li>Added Gold linker {@code ld.gold} for the Windows toolchain. Gold linker is also the
-            default for ARM and X86 on all hosts. You may override it to use the {@code ld.bfd}
-            linker by adding {@code LOCAL_LDFLAGS += -fuse-ld=bfd} to {@code Android.mk}, or by
-passing
-            {@code -fuse-ld=bfd} to the g++/clang++ command line that does the linking.</li>
-          <li>Added checks for spaces in the NDK path to the {@code ndk-build[.cmd]} and
-            {@code ndk-gdb} scripts, to prevent build errors that are difficult to diagnose.</li>
-          <li>Made the following changes to API level handling:
-            <ul>
-              <li>Modified build logic so that projects that specify {@code android-10} through
-                {@code android-13} in {@code APP_PLATFORM}, {@code project.properties} or
-                {@code default.properties} link against {@code android-9} instead of
-                {@code android-14}.
-              <li>Updated build so that executables using android-16 (Jelly Bean) or higher are
-                compiled with the {@code -fPIE} option for position-independent executables (PIE).
-                A new {@code APP_PIE} option allows you to control this behavior. See {@code
-                APPLICATION-MK.html} for details.
-                <p class="note">
-                  <strong>Note:</strong> All API levels above 14 still link against {@code
-                  platforms/android-14} and no new {@code platforms/android-N} have been added.
-                </p></li>
-              <li>Modified {@code ndk-build} to provide warnings if the adjusted API level is larger
-              than {@code android:minSdkVersion} in the project's {@code AndroidManifest.xml}.</li>
-            </ul>
-          </li>
-          <li>Updated the {@code cpu-features} helper library to include more ARM-specific features.
-          See {@code sources/android/cpufeatures/cpu-features.h} for details.</li>
-          <li>Modified the long double on the X86 platform to be 8 bytes. This data type is now the
-          same size as a double, but is still treated as a distinct type.</li>
-          <li>Updated build for {@code APP_ABI=armeabi-v7a}:
-            <ul>
-              <li>Modified this build type to pass the {@code -march=armv7-a} parameter
-              to the linker. This change ensures that v7-specific libraries and {@code crt*.o} are
-              linked correctly.</li>
-              <li>Added {@code -mfpu=vfpv3-d16} to {@code ndk-build} instead of the
-              {@code -mfpu=vfp} option used in previous releases.</li>
-            </ul>
-          </li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Important bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed an issue where running {@code make-standalone-toolchain.sh} with root privileges
-            resulted in the stand alone tool chain being inaccessible to some users.
-            (<a href="http://b.android.com/35279">Issue 35279</a>)
-            <ul>
-              <li>All files and executables in the NDK release package are set to have read and
-                execute permissions for all.</li>
-              <li>The ownership/group of {@code libstdc++.a} is now preserved when copied.</li>
-            </ul>
-          </li>
-          <li>Removed redundant {@code \r} from Windows prebuilt {@code echo.exe}. The redundant
-          {@code \r} caused {@code gdb.setup} to fail in the GNU Debugger (GDB) because it
-          incorrectly became part of the path.
-          (<a href="http://b.android.com/36054">Issue 36054</a>)</li>
-          <li>Fixed Windows parallel builds that sometimes failed due to timing issues in the
-          {@code host-mkdir} implementation.
-          (<a href="http://b.android.com/25875">Issue 25875</a>)</li>
-          <li>Fixed GCC 4.4.3 GNU {@code libstdc++} to <em>not</em> merge {@code typeinfo} names by
-          default. For more details, see
-          {@code toolchain repo gcc/gcc-4.4.3/libstdc++-v3/libsupc++/typeinfo}.
-          (<a href="http://b.android.com/22165">Issue 22165</a>)</li>
-          <li>Fixed problem on {@code null} context in GCC 4.6
-          {@code cp/mangle.c::write_unscoped_name}, where GCC may crash when the context is
-          {@code null} and dereferenced in {@code TREE_CODE}.</li>
-          <li>Fixed GCC 4.4.3 crashes on ARM NEON-specific type definitions for floats.
-          (<a href="http://b.android.com/34613">Issue 34613</a>)</li>
-          <li>Fixed the {@code STLport} internal {@code _IteWrapper::operator*()} implementation
-          where a stale stack location holding the dereferenced value was returned and caused
-          runtime crashes.
-          (<a href="http://b.android.com/38630">Issue 38630</a>)</li>
-
-          <li>ARM-specific fixes:
-            <ul>
-              <li>Fixed ARM GCC 4.4.3/4.6 {@code g++} to not warn that the <em>mangling of
-              &lt;va_list&gt; was changed in GCC 4.4</em>. The workaround using the
-              {@code -Wno-psabi} switch to avoid this warning is no longer required.</li>
-              <li>Fixed an issue when a project with {@code .arm} or {@code .neon} suffixes in
-              {@code LOCAL_SRC_FILES} also used {@code APP_STL}. With {@code APP_STL}, the
-              {@code ndk-build} script searches for C++ files in {@code LOCAL_SRC_FILES} before
-              adding STL {@code header/lib} paths to compilation. Modified {@code ndk-build} to
-              filter out {@code .arm} and {@code .neon} suffixes before the search, otherwise items
-              in {@code LOCAL_SRC_FILES} like {@code myfile.cpp.arm.neon} won't be compiled as C++
-              code.</li>
-              <li>Fixed {@code binutils-2.21/ld.bfd} to be capable of linking object from older
-              binutils without {@code tag_FP_arch}, which was producing <em>assertion fail</em>
-              error messages in GNU Binutils.
-              (<a href="http://b.android.com/35209">Issue 35209</a>)
-              </li>
-              <li>Removed <em>Unknown EABI object attribute 44</em> warning when
-              {@code binutils-2.19/ld} links prebuilt object by newer {@code binutils-2.21}</li>
-              <li>Fixed an issue in GNU {@code stdc++} compilation with both {@code -mthumb} and
-              {@code -march=armv7-a}, by modifying {@code make-standalone-toolchain.sh} to populate
-              {@code headers/libs} in sub-directory {@code armv7-a/thumb}.
-              (<a href="http://b.android.com/35616">Issue 35616</a>)
-              </li>
-              <li>Fixed <em>unresolvable R_ARM_THM_CALL relocation</em> error.
-              (<a href="http://b.android.com/35342">Issue 35342</a>)
-              </li>
-              <li>Fixed internal compiler error at {@code reload1.c:3633}, caused by the ARM
-              back-end expecting the wrong operand type when sign-extend from {@code char}.
-              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50099">GCC Issue 50099</a>)</li>
-              <li>Fixed internal compiler error with negative shift amount.
-              (<a href="http://gcc.gnu.org/ml/gcc-patches/2011-10/msg00594.html">GCC Issue</a>)</li>
-            </ul>
-          </li>
-
-          <li>Fixed {@code -fstack-protector} for X86, which is also the default for the
-          {@code ndk-build} x86 ABI target.</li>
-
-          <li>MIPS-specific fixes:
-            <ul>
-              <li>Fixed {@code STLport} endian-ness by setting {@code _STLP_LITTLE_ENDIAN} to 1 when
-              compiling MIPS {@code libstlport_*}.</li>
-              <li>Fixed GCC {@code __builtin_unreachable} issue when compiling LLVM.
-              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54369">GCC Issue 54369</a>)</li>
-              <li>Backported fix for {@code cc1} compile process consuming 100% CPU.
-              (<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50380">GCC Issue 50380</a>)</li>
-            </ul>
-          </li>
-
-          <li>GNU Debugger-specific fixes:
-            <ul>
-              <li>Disabled Python support in gdb-7.x at build, otherwise the gdb-7.x configure
-              function may pick up whatever Python version is available on the host and build
-              {@code gdb} with a hard-wired dependency on a specific version of Python.
-              (<a href="http://b.android.com/36120">Issue 36120</a>)
-              </li>
-              <li>Fixed {@code ndk-gdb} when {@code APP_ABI} contains {@code all} and matchs none
-              of the known architectures.
-              (<a href="http://b.android.com/35392">Issue 35392</a>)
-              </li>
-              <li>Fixed Windows pathname support, by keeping the {@code :} character if it looks
-              like it could be part of a Windows path starting with a drive letter.
-              (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12843">GDB Issue 12843</a>)
-              </li>
-              <li>Fixed adding of hardware breakpoint support for ARM in {@code gdbserver}.
-              (<a href="http://sourceware.org/ml/gdb-patches/2011-09/msg00200.html">GDB Issue</a>)
-              </li>
-              <li>Added fix to only read the current {@code solibs} when the linker is consistent.
-              This change speeds up {@code solib} event handling.
-              (<a href="http://b.android.com/37677">Issue 37677</a>)
-              </li>
-              <li>Added fix to make repeated attempts to find {@code solib} breakpoints. GDB now
-              retries {@code enable_break()} during every call to {@code svr4_current_sos()} until
-              it succeeds.
-              (<a href="https://android-review.googlesource.com/#/c/43563">Change 43563</a>)</li>
-              <li>Fixed an issue where {@code gdb} would not stop on breakpoints placed in
-              {@code dlopen-ed} libraries.
-              (<a href="http://b.android.com/34856">Issue 34856</a>)
-              </li>
-              <li>Fixed {@code SIGILL} in dynamic linker when calling {@code dlopen()}, on system
-              where {@code /system/bin/linker} is stripped of symbols and
-              {@code rtld_db_dlactivity()} is implemented as {@code Thumb}, due to not preserving
-              {@code LSB} of {@code sym_addr}.
-              (<a href="http://b.android.com/37147">Issue 37147</a>)
-              </li>
-            </ul>
-          </li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Other bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed NDK headers:
-            <ul>
-              <li>Fixed {@code arch-mips/include/asm/*} code that was incorrectly removed from
-              original kernel. (<a href="https://android-review.googlesource.com/#/c/43335">Change
-              43335</a>)</li>
-              <li>Replaced struct member data {@code __unused} with {@code __linux_unused} in
-              {@code linux/sysctl.h} and {@code linux/icmp.h} to avoid conflict with
-              {@code #define __unused} in {@code sys/cdefs.h}.</li>
-              <li>Fixed {@code fenv.h} for enclosed C functions with {@code __BEGIN_DECLS} and
-              {@code __END_DECLS}.</li>
-              <li>Removed unimplemented functions in {@code malloc.h}.</li>
-              <li>Fixed {@code stdint.h} defintion of {@code uint64_t} for ANSI compilers.
-              (<a href="http://b.android.com/1952">Issue 1952</a>)</li>
-              <li>Fixed preprocessor macros in {@code &lt;arch&gt;/include/machine/*}.</li>
-              <li>Replaced {@code link.h} for MIPS with new version supporting all platforms.</li>
-              <li>Removed {@code linux-unistd.h}</li>
-              <li>Move GLibc-specific macros {@code LONG_LONG_MIN}, {@code LONG_LONG_MAX} and
-              {@code ULONG_LONG_MAX} from {@code &lt;pthread.h&gt;} to {@code
-&lt;limits.h&gt;}.</li>
-            </ul>
-          </li>
-          <li>Fixed a buffer overflow in {@code ndk-stack-parser}.</li>
-          <li>Fixed {@code _STLP_USE_EXCEPTIONS}, when not defined, to omit all declarations
-          and uses of {@code __Named_exception}. Compiling and use of {@code __Named_exception}
-          settings only occurs when {@code STLport} is allowed to use exceptions.</li>
-          <li>Fixed building of Linux-only NDK packages without also building Windows code. Use the
-          following settings to perform this type of build:
-          <pre>./build/tools/make-release.sh --force --systems=linux-x86</pre></li>
-          <li>Fixed {@code libc.so} so it does not export {@code atexit()} and {@code __do_handler}.
-          These symbols are exported for ARM builds by the system version of the C library to
-          support legacy native libraries. NDK-generated should never reference them directly.
-          Instead, each shared library or executable should embed its own version of these symbols,
-          provided by {@code crtbegin_*.o}.
-          <p>If your project is linked with the {@code -nostdlib -Wl,--no-undefined} options, you
-          must provide your own {@code __dso_handle} because {@code crtbegin_so.o} is not linked in
-          this case. The content of {@code __dso_handle} does not matter, as shown in the following
-          example code:</p>
-<pre>
-extern "C" {
-  extern void *__dso_handle __attribute__((__visibility__ ("hidden")));
-  void *__dso_handle;
-}
-</pre>
-          </li>
-          <li>Fixed symbol decoder for ARM used in {@code objdump} for {@code plt} entries to
-          generate a more readable form {@code function@plt}.</li>
-          <li>Removed the following symbols, introduced in GCC 4.6 {@code libgcc.a}, from
-          the X86 platform {@code libc.so} library: {@code __aeabi_idiv0}, {@code __aeabi_ldiv0},
-          {@code __aeabi_unwind_cpp_pr1}, and {@code __aeabi_unwind_cpp_pr2}.</li>
-          <li>Removed unused {@code .ctors}, {@code .dtors}, and {@code .eh_frame} in MIPS
-          {@code crt*_so.S}.</li>
-          <li>Updated {@code ndk-gdb} so that it only takes the last line of output for
-          {@code ndk-build} {@code DUMP_XXXX}. This change ensures that if {@code Application.mk} or
-          {@code Android.mk} print something with {@code $(info ...)} syntax, it does not get
-          injected into the result of {@code DUMP_XXXX}.
-          (<a href="https://groups.google.com/d/msg/android-ndk/-/ew0lTWGr1UEJ">More info</a>)</li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Other changes:</dt>
-
-      <dd>
-        <ul>
-          <li>Removed {@code arch-x86} and {@code arch-mips} headers from
-          {@code platforms/android-[3,4,5,8]}. Those headers were incomplete, since both X86 and
-          MIPS ABIs are only supported at API 9 or higher.</li>
-          <li>Simplified c++ include path in standalone packages, as shown below.
-          (<a href="http://b.android.com/35279">Issue 35279</a>)
-<pre>
-&lt;path&gt;/arm-linux-androideabi/include/c++/4.6.x-google
-  to:
-&lt;path&gt;/include/c++/4.6/
-</pre></li>
-          <li>Fixed {@code ndk-build} to recognize more C++ file extensions by default:
-          {@code .cc .cp .cxx .cpp .CPP .c++ .C}. You may still use {@code LOCAL_CPP_EXTENSION} to
-          overwrite these extension settings.</li>
-          <li>Fixed an issue in {@code samples/san-angeles} that caused a black screen or freeze
-          frame on re-launch.</li>
-          <li>Replaced deprecated APIs in NDK samples.
-          (<a href="http://b.android.com/20017">Issue 20017</a>)
-            <ul>
-              <li>{@code hello-gl2} from android-5 to android-7</li>
-              <li>{@code native-activity} from android-9 to android-10</li>
-              <li>{@code native-audio} from android-9 to android-10</li>
-              <li>{@code native-plasma} from android-9 to android-10</li>
-            </ul>
-          </li>
-          <li>Added new branding for Android executables with a simpler scheme in section
-          {@code .note.android.ident} (defined in {@code crtbegin_static/dynamic.o}) so that
-          debugging tools can act accordingly. The structure member and values are defined as
-          follows:
-<pre>
-static const struct {
-  int32_t namesz;  /* = 8,  sizeof ("Android") */
-  int32_t descsz;  /* = 1 * sizeof(int32_t) */
-  int32_t type;    /* = 1, ABI_NOTETYPE */
-  char name[sizeof "Android"];  /* = "Android" */
-  int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */
-}
-</pre>
-            <p>The previous branding options in section {@code .note.ABI-tag} are deprecated.</p>
-          </li>
-          <li>Added a new script {@code run-tests-all.sh} which calls {@code run-tests.sh} and
-          {@code standalone/run.sh} with various conditions. The script {@code run-tests.sh} runs
-          without the {@code --abi} option, and is enhanced to compile most of the tests for all
-          supported ABIs and run on all attached devices</li>
-        </ul>
-      </dd>
-    </dl>
-
-  </div>
-</div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 8b</a> <em>(July 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>The main features of this release are a new GNU Compiler Collection (GCC) 4.6 toolchain and
-GNU Debugger (GDB) 7.3.x which adds debugging support for the Android 4.1 (API Level 16) system
-image.</p>
-
-    <dl>
-      <dt>Important bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed {@code LOCAL_SHORT_COMMANDS} issues on Mac OS, Windows Cygwin environments for
-static libraries. List file generation is faster, and it is not regenerated to avoid repeated
-project rebuilds.</li>
-          <li>Fixed several issues in {@code ndk-gdb}:
-            <ul>
-              <li>Updated tool to pass flags {@code -e}, {@code -d} and {@code -s} to adb more
-consistently.</li>
-              <li>Updated tool to accept device serial names containing spaces.</li>
-              <li>Updated tool to retrieve {@code /system/bin/link} information, so {@code gdb} on
-the host can set a breakpoint in {@code __dl_rtld_db_dlactivity} and be aware of linker activity
-(e.g., rescan {@code solib} symbols when {@code dlopen()} is called).</li>
-            </ul>
-          </li>
-          <li>Fixed {@code ndk-build clean} on Windows, which was failing to remove
-{@code ./libs/*/lib*.so}.</li>
-          <li>Fixed {@code ndk-build.cmd} to return a non-zero {@code ERRORLEVEL} when {@code make}
-fails.</li>
-          <li>Fixed {@code libc.so} to stop incorrectly exporting the {@code __exidx_start} and
-{@code __exidx_end} symbols.</li>
-          <li>Fixed {@code SEGV} when unwinding the stack past {@code __libc_init} for ARM and
-MIPS.</li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Important changes:</dt>
-
-      <dd>
-        <ul>
-          <li>Added GCC 4.6 toolchain ({@code binutils} 2.21 with {@code gold} and GDB 7.3.x) to
-co-exist with the original GCC 4.4.3 toolchain ({@code binutils} 2.19 and GDB 6.6).
-            <ul>
-              <li>GCC 4.6 is now the default toolchain. You may set {@code
-NDK_TOOLCHAIN_VERSION=4.4.3} in {@code Application.mk} to select the original one.</li>
-              <li>Support for the {@code gold} linker is only available for ARM and x86
-architectures on Linux and Mac OS hosts. This support is disabled by default. Add {@code
-LOCAL_LDLIBS += -fuse-ld=gold} in {@code Android.mk} to enable it.</li>
-              <li>Programs compiled with {@code -fPIE} require the new {@code GDB} for debugging,
-including binaries in Android 4.1 (API Level 16) system images.</li>
-              <li>The {@code binutils} 2.21 {@code ld} tool contains back-ported fixes from
-version 2.22:
-                <ul>
-                  <li>Fixed {@code ld --gc-sections}, which incorrectly retains zombie references to
-external libraries. (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=13177">more
-info</a>).</li>
-                  <li>Fixed ARM {@code strip} command to preserve the original {@code p_align} and
-{@code p_flags} in {@code GNU_RELRO} section if they are valid. Without this fix, programs
-built with {@code -fPIE} could not be debugged. (<a
-href="http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf.c.diff?cvsroot=src&r1=1.552&r2=1.553">mor
-e info</a>)</li>
-                </ul>
-              </li>
-              <li>Disabled {@code sincos()} optimization for compatibility with older
-                platforms.</li>
-            </ul>
-          </li>
-
-          <li>Updated build options to enable the Never eXecute (NX) bit and {@code relro}/{@code
-bind_now} protections by default:
-            <ul>
-              <li>Added {@code --noexecstack} to assembler and {@code -z noexecstack} to linker
-that provides NX protection against buffer overflow attacks by enabling NX bit on stack and
-heap.</li>
-              <li>Added {@code -z relro} and  {@code -z now} to linker for hardening of internal
-data sections after linking to guard against security vulnerabilities caused by memory corruption.
-(more info: <a href="http://www.akkadia.org/drepper/nonselsec.pdf">1</a>,
-<a href="http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html">2</a>)</li>
-
-              <li>These features can be disabled using the following options:
-                <ol>
-                  <li>Disable NX protection by setting the {@code --execstack} option for the
-assembler and {@code -z execstack} for the linker.</li>
-                  <li>Disable hardening of internal data by setting the {@code -z norelro} and
-{@code -z lazy} options for the linker.</li>
-                  <li>Disable these protections in the NDK {@code jni/Android.mk} by setting the
-following options:
-<pre>
-LOCAL_DISABLE_NO_EXECUTE=true  # disable "--noexecstack" and "-z noexecstack"
-DISABLE_RELRO=true             # disable "-z relro" and "-z now"
-</pre>
-                  </li>
-                </ol>
-                <p>See {@code docs/ANDROID-MK.html} for more details.</p>
-              </li>
-            </ul>
-          </li>
-
-          <li>Added branding for Android executables with the {@code .note.ABI-tag} section (in
-{@code crtbegin_static/dynamic.o}) so that debugging tools can act accordingly. The structure
-member and values are defined as follows:
-<pre>
-static const struct {
-  int32_t namesz;  /* = 4,  sizeof ("GNU") */
-  int32_t descsz;  /* = 6 * sizeof(int32_t) */
-  int32_t type;    /* = 1 */
-  char  name[sizeof "GNU"];  /* = "GNU" */
-  int32_t os;      /* = 0 */
-  int32_t major;   /* = 2 */
-  int32_t minor;   /* = 6 */
-  int32_t teeny;   /* = 15 */
-  int32_t os_variant;  /* = 1 */
-  int32_t android_api; /* = 3, 4, 5, 8, 9, 14 */
-}</pre>
-          </li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Other bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed {@code mips-linux-gnu} relocation truncated to fit {@code R_MIPS_TLS_LDM} issue.
-            (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12637">more info</a>)</li>
-          <li>Fixed {@code ld} tool segfaults when using {@code --gc-sections}.
-            (<a href="http://sourceware.org/bugzilla/show_bug.cgi?id=12845">more info</a>)
-          </li>
-          <li>Fixed MIPS {@code GOT_PAGE} counting issue.
-            (<a href="http://sourceware.org/ml/binutils/2011-05/msg00198.html">more info</a>)</li>
-          <li>Fixed follow warning symbol link for {@code mips_elf_count_got_symbols}.</li>
-          <li>Fixed follow warning symbol link for {@code mips_elf_allocate_lazy_stub}.</li>
-          <li>Moved MIPS {@code .dynamic} to the data segment, so that it is writable.</li>
-          <li>Replaced hard-coded values for symbols with correct segment sizes for MIPS.</li>
-          <li>Removed the {@code -mno-shared} option from the defaults in the MIPS toolchain.
-The default for Android toolchain is {@code -fPIC} (or {@code -fpic} if supported). If you do not
-explicitly specify {@code -mshared}, {@code -fpic}, {@code -fPIC}, {@code -fpie}, or {@code -fPIE},
-the MIPS compiler adds {@code -mno-shared} that turns off PIC. Fixed compiler not to add
-{@code -mno-shared} in this case.</li>
-          <li>Fixed wrong package names in samples {@code hello-jni} and {@code two-libs} so that
-the {@code tests} project underneath it can compile.</li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Other Changes:</dt>
-
-      <dd>
-        <ul>
-          <li>Changed locations of binaries:
-            <ul>
-              <li>Moved {@code gdbserver} from
-{@code toolchain/&lt;arch-os-ver&gt;/prebuilt/gdbserver} to
-{@code prebuilt/android-&lt;arch&gt;/gdbserver/gdbserver}.</li>
-              <li>Renamed x86 toolchain prefix from {@code i686-android-linux-} to
-{@code i686-linux-android-}.</li>
-              <li>Moved {@code sources/cxx-stl/gnu-libstdc++/include} and {@code lib} to
-{@code sources/cxx-stl/gnu-libstdc++/4.6} when compiled with GCC 4.6, or
-{@code sources/cxx-stl/gnu-libstdc++/4.4.3} when compiled with GCC 4.4.3.</li>
-              <li>Moved {@code libbfd.a} and {@code libintl.a} from {@code lib/} to {@code
-lib32/}.</li>
-            </ul>
-          </li>
-
-          <li>Added and improved various scripts in the rebuild and test NDK toolchain:
-            <ul>
-              <li>Added {@code build-mingw64-toolchain.sh} to generate a new Linux-hosted toolchain
-that generates Win32 and Win64 executables.</li>
-              <li>Improved speed of {@code download-toolchain-sources.sh} by using the {@code
-clone} command and only using {@code checkout} for the directories that are needed to build the NDK
-toolchain binaries.</li>
-              <li>Added {@code build-host-gcc.sh} and {@code build-host-gdb.sh} scripts.</li>
-              <li>Added {@code tests/check-release.sh} to check the content of a given NDK
-installation directory, or an existing NDK package.</li>
-              <li>Rewrote the {@code tests/standalone/run.sh} standalone tests .</li>
-            </ul>
-          </li>
-          <li>Removed {@code if_dl.h} header from all platforms and architectures. The {@code
-AF_LINK} and {@code sockaddr_dl} elements it describes are specific to BSD (i.e., they don't exist
-in Linux).</li>
-        </ul>
-      </dd>
-    </dl>
-
-  </div>
-</div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 8</a> <em>(May 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>This release of the NDK includes support for MIPS ABI and a few additional fixes.</p>
-
-    <dl>
-      <dt>New features:</dt>
-
-      <dd>
-        <ul>
-          <li>Added support for the MIPS ABI, which allows you to generate machine code that runs on
-            compatible MIPS-based Android devices. Major features for MIPS include MIPS-specific
-            toolchains, system headers, libraries and debugging support. For more details regarding
-            MIPS support, see {@code docs/CPU-MIPS.html} in the NDK package.
-
-              <p>By default, code is generated for ARM-based devices. You can add {@code mips} to
-              your {@code APP_ABI} definition in your {@code Application.mk} file to build
-              for MIPS platforms. For example, the following line instructs {@code ndk-build}
-              to build your code for three distinct ABIs:</p>
-
-              <pre>APP_ABI := armeabi armeabi-v7a <strong>mips</strong></pre>
-
-              <p>Unless you rely on architecture-specific assembly sources, such as ARM assembly
-              code, you should not need to touch your {@code Android.mk} files to build MIPS
-              machine code.</p>
-          </li>
-
-          <li>You can build a standalone MIPS toolchain using the {@code --arch=mips}
-          option when calling <code>make-standalone-toolchain.sh</code>. See
-          {@code docs/STANDALONE-TOOLCHAIN.html} for more details.
-          </li>
-        </ul>
-
-        <p class="note"><strong>Note:</strong> To ensure that your applications are available
-to users only if their devices are capable of running them, Google Play filters applications based
-on the instruction set information included in your application ? no action is needed on your part
-to enable the filtering. Additionally, the Android system itself also checks your application at
-install time and allows the installation to continue only if the application provides a library that
-is compiled for the device's CPU architecture.</p>
-      </dd>
-
-      <dt>Important bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed a typo in GAbi++ implementation where the result of {@code
-          dynamic_cast&lt;D&gt;(b)} of base class object {@code b} to derived class {@code D} is
-          incorrectly adjusted in the opposite direction from the base class.
-          (<a href="http://b.android.com/28721">Issue 28721</a>)
-          </li>
-          <li>Fixed an issue in which {@code make-standalone-toolchain.sh} fails to copy
-          {@code libsupc++.*}.</li>
-        </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed {@code ndk-build.cmd} to ensure that {@code ndk-build.cmd} works correctly even
-          if the user has redefined the {@code SHELL} environment variable, which may be changed
-          when installing a variety of development tools in Windows environments.
-          </li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 7c</a> <em>(April 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>This release of the NDK includes an important fix for Tegra2-based devices, and a few
-additional fixes and improvements:</p>
-
-    <dl>
-      <dt>Important bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed GNU STL armeabi-v7a binaries to not crash on non-NEON
-  devices. The files provided with NDK r7b were not configured properly,
-  resulting in crashes on Tegra2-based devices and others when trying to use
-  certain floating-point functions (e.g., {@code cosf}, {@code sinf}, {@code expf}).</li>
-        </ul>
-      </dd>
-
-      <dt>Important changes:</dt>
-
-      <dd>
-        <ul>
-          <li>Added support for custom output directories through the {@code NDK_OUT}
-  environment variable. When defined, this variable is used to store all
-  intermediate generated files, instead of {@code $PROJECT_PATH/obj}. The variable is
-  also recognized by {@code ndk-gdb}. </li>
-          <li>Added support for building modules with hundreds or even thousands of source
-  files by defining {@code LOCAL_SHORT_COMMANDS} to {@code true} in your {@code Android.mk}.
-            <p>This change forces the NDK build system to put most linker or archiver options
-  into list files, as a work-around for command-line length limitations.
-  See {@code docs/ANDROID-MK.html} for details.</p>
-          </li>
-        </ul>
-      </dd>
-
-      <dt>Other bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Fixed {@code android_getCpuCount()} implementation in the {@code cpufeatures}
-helper library. On certain devices, where cores are enabled dynamically by the system, the previous
-implementation would report the total number of <em>active</em> cores the first time the function
-was called, rather than the total number of <em>physically available</em> cores.</li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 7b</a> <em>(February 2012)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>This release of the NDK includes fixes for native Windows builds, Cygwin and many other
-      improvements:</p>
-
-    <dl>
-      <dt>Important bug fixes:</dt>
-
-      <dd>
-        <ul>
-          <li>Updated {@code sys/atomics.h} to avoid correctness issues
-            on some multi-core ARM-based devices. Rebuild your unmodified sources with this
-            version of the NDK and this problem should be completely eliminated.
-            For more details, read {@code docs/ANDROID-ATOMICS.html}.</li>
-          <li>Reverted to {@code binutils} 2.19 to fix debugging issues that
-            appeared in NDK r7 (which switched to {@code binutils} 2.20.1).</li>
-          <li>Fixed {@code ndk-build} on 32-bit Linux. A packaging error put a 64-bit version
-            of the {@code awk} executable under {@code prebuilt/linux-x86/bin} in NDK r7.</li>
-          <li>Fixed native Windows build ({@code ndk-build.cmd}). Other build modes were not
-            affected. The fixes include:
-            <ul>
-              <li>Removed an infinite loop / stack overflow bug that happened when trying
-                to call {@code ndk-build.cmd} from a directory that was <em>not</em> the top of
-                your project path (e.g., in any sub-directory of it).</li>
-              <li>Fixed a problem where the auto-generated dependency files were ignored. This
-                meant that updating a header didn't trigger recompilation of sources that included
-                it.</li>
-              <li>Fixed a problem where special characters in files or paths, other than spaces and
-                quotes, were not correctly handled.</li>
-            </ul>
-          </li>
-          <li>Fixed the standalone toolchain to generate proper binaries when using
-            {@code -lstdc++} (i.e., linking against the GNU {@code libstdc++} C++ runtime). You
-            should use {@code -lgnustl_shared} if you want to link against the shared library
-            version or {@code -lstdc++} for the static version.
-
-            <p>See {@code docs/STANDALONE-TOOLCHAIN.html} for more details about this fix.</p>
-          </li>
-          <li>Fixed {@code gnustl_shared} on Cygwin. The linker complained that it couldn't find
-            {@code libsupc++.a} even though the file was at the right location.</li>
-          <li>Fixed Cygwin C++ link when not using any specific C++ runtime through
-            {@code APP_STL}.</li>
-        </ul>
-      </dd>
-    </dl>
-
-    <dl>
-      <dt>Other changes:</dt>
-
-      <dd>
-        <ul>
-          <li>When your application uses the GNU {@code libstdc++} runtime, the compiler will
-            no longer forcibly enable exceptions and RTTI. This change results in smaller code.
-            <p>If you need these features, you must do one of the following:</p>
-            <ul>
-              <li>Enable exceptions and/or RTTI explicitly in your modules or
-                {@code Application.mk}. (recommended)</li>
-              <li>Define {@code APP_GNUSTL_FORCE_CPP_FEATURES} to {@code 'exceptions'},
-                {@code 'rtti'} or both in your {@code Application.mk}. See
-                {@code docs/APPLICATION-MK.html} for more details.</li>
-            </ul>
-          </li>
-          <li>{@code ndk-gdb} now works properly when your application has private services
-            running in independent processes. It debugs the main application process, instead of the
-            first process listed by {@code ps}, which is usually a service process.</li>
-          <li>Fixed a rare bug where NDK r7 would fail to honor the {@code LOCAL_ARM_MODE} value
-            and always compile certain source files (but not all) to 32-bit instructions.</li>
-          <li>{@code STLport}: Refresh the sources to match the Android platform version. This
-            update fixes a few minor bugs:
-            <ul>
-               <li>Fixed instantiation of an incomplete type</li>
-               <li>Fixed minor "==" versus "=" typo</li>
-               <li>Used {@code memmove} instead of {@code memcpy} in {@code string::assign}</li>
-               <li>Added better handling of {@code IsNANorINF}, {@code IsINF}, {@code IsNegNAN},
-                 etc.</li>
-             </ul>
-             <p>For complete details, see the commit log.</p>
-          </li>
-          <li>{@code STLport}: Removed 5 unnecessary static initializers from the library.</li>
-          <li>The GNU libstdc++ libraries for armeabi-v7a were mistakenly compiled for
-            armeabi instead. This change had no impact on correctness, but using the right
-            ABI should provide slightly better performance.</li>
-          <li>The {@code cpu-features} helper library was updated to report three optional
-            x86 CPU features ({@code SSSE3}, {@code MOVBE} and {@code POPCNT}). See
-            {@code docs/CPU-FEATURES.html} for more details.</li>
-          <li>{@code docs/NDK-BUILD.html} was updated to mention {@code NDK_APPLICATION_MK} instead
-            of {@code NDK_APP_APPLICATION_MK} to select a custom {@code Application.mk} file.</li>
-          <li>Cygwin: {@code ndk-build} no longer creates an empty "NUL" file in the current
-            directory when invoked.</li>
-          <li>Cygwin: Added better automatic dependency detection. In the previous version, it
-            didn't work properly in the following cases:
-            <ul>
-              <li>When the Cygwin drive prefix was not {@code /cygdrive}.</li>
-              <li>When using drive-less mounts, for example, when Cygwin would translate
-                {@code /home} to {@code \\server\subdir} instead of {@code C:\Some\Dir}.</li>
-            </ul>
-          </li>
-          <li>Cygwin: {@code ndk-build} does not try to use the native Windows tools under
-            {@code $NDK/prebuilt/windows/bin} with certain versions of Cygwin and/or GNU Make.</li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 7</a> <em>(November 2011)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>This release of the NDK includes new features to support the Android 4.0 platform as well
-    as many other additions and improvements:</p>
-
-    <dl>
-      <dt>New features</dt>
-
-      <dd>
-        <ul>
-          <li>Added official NDK APIs for Android 4.0 (API level 14), which adds the following
-          native features to the platform:
-
-            <ul>
-              <li>Added native multimedia API based on the Khronos Group OpenMAX AL? 1.0.1
-              standard. The new <code>&lt;OMXAL/OpenMAXAL.h&gt;</code> and
-              <code>&lt;OMXAL/OpenMAXAL_Android.h&gt;</code> headers allow applications targeting
-              API level 14 to perform multimedia output directly from native code by using a new
-              Android-specific buffer queue interface. For more details, see
-              <code>docs/openmaxal/index.html</code> and <a href=
-              "http://www.khronos.org/openmax/">http://www.khronos.org/openmax/</a>.</li>
-
-              <li>Updated the native audio API based on the Khronos Group OpenSL ES 1.0.1?
-              standard. With API Level 14, you can now decode compressed audio (e.g. MP3, AAC,
-              Vorbis) to PCM. For more details, see <code>docs/opensles/index.html</code> and
-              <a href=
-              "http://www.khronos.org/opensles">http://www.khronos.org/opensles/</a>.</li>
-            </ul>
-          </li>
-
-          <li>Added CCache support. To speed up large rebuilds, define the
-          <code>NDK_CCACHE</code> environment variable to <code>ccache</code> (or the path to
-          your <code>ccache</code> binary). When declared, the NDK build system automatically
-          uses CCache when compiling any source file. For example:
-            <pre>
-export NDK_CCACHE=ccache
-</pre>
-          <p class="note"><strong>Note:</strong> CCache is not included in the NDK release
-          so you must have it installed prior to using it. For more information about CCache, see
-          <a href="http://ccache.samba.org">http://ccache.samba.org</a>.</p>
-          </li>
-
-          <li>Added support for setting <code>APP_ABI</code> to <code>all</code> to indicate that
-          you want to build your NDK modules for all the ABIs supported by your given NDK
-          release. This means that either one of the following two lines in your
-          <code>Application.mk</code> are equivalent with this release:
-            <pre>
-APP_ABI := all
-APP_ABI := armeabi armeabi-v7a x86
-</pre>
-
-            <p>This also works if you define <code>APP_ABI</code> when calling
-            <code>ndk-build</code> from the command-line, which is a quick way to check that your
-            project builds for all supported ABIs without changing the project's
-            <code>Application.mk file</code>. For example:</p>
-            <pre>
-ndk-build APP_ABI=all
-</pre>
-          </li>
-
-          <li>Added a <code>LOCAL_CPP_FEATURES</code> variable in <code>Android.mk</code> that
-          allows you to declare which C++ features (RTTI or Exceptions) your module uses. This
-          ensures that the final linking works correctly if you have prebuilt modules that depend
-          on these features. See <code>docs/ANDROID-MK.html</code> and
-          <code>docs/CPLUSPLUS-SUPPORT.html</code> for more details.</li>
-
-          <li>Shortened paths to source and object files that are used in build commands. When
-          invoking <code>$NDK/ndk-build</code> from your project path, the paths to the source,
-          object, and binary files that are passed to the build commands are significantly
-          shorter now, because they are passed relative to the current directory. This is useful
-          when building projects with a lot of source files, to avoid limits on the maximum
-          command line length supported by your host operating system. The behavior is unchanged
-          if you invoke <code>ndk-build</code> from a sub-directory of your project tree, or if
-          you define <code>NDK_PROJECT_PATH</code> to point to a specific directory.</li>
-        </ul>
-      </dd>
-
-      <dt>Experimental features</dt>
-
-      <dd>
-        You can now build your NDK source files on Windows <em>without</em> Cygwin by calling the
-        <code>ndk-build.cmd</code> script from the command line from your project path. The
-        script takes exactly the same arguments as the original <code>ndk-build</code> script.
-        The Windows NDK package comes with its own prebuilt binaries for GNU Make, Awk and other
-        tools required by the build. You should not need to install anything else to get a
-        working build system.
-
-        <p class="caution"><strong>Important:</strong> <code>ndk-gdb</code> does not work on
-        Windows, so you still need Cygwin to debug.</p>
-
-        <p>This feature is still experimental, so feel free to try it and report issues on the
-        <a href="http://b.android.com">public bug database</a> or <a href=
-        "http://groups.google.com/group/android-ndk">public forum</a>. All samples and unit tests
-        shipped with the NDK succesfully compile with this feature.</p>
-      </dd>
-
-      <dt>Important bug fixes</dt>
-
-      <dd>
-        <ul>
-          <li>Imported shared libraries are now installed by default to the target installation
-          location (<code>libs/&lt;abi&gt;</code>) if <code>APP_MODULES</code> is not defined in
-          your <code>Application.mk</code>. For example, if a top-level module <code>foo</code>
-          imports a module <code>bar</code>, then both <code>libfoo.so</code> and
-          <code>libbar.so</code> are copied to the install location. Previously, only
-          <code>libfoo.so</code> was copied, unless you listed <code>bar</code> in your
-          <code>APP_MODULES</code> too. If you define <code>APP_MODULES</code> explicitly, the
-          behavior is unchanged.</li>
-
-          <li><code>ndk-gdb</code> now works correctly for activities with multiple categories in
-          their MAIN intent filters.</li>
-
-          <li>Static library imports are now properly transitive. For example, if a top-level
-          module <code>foo</code> imports static library <code>bar</code> that imports static
-          library <code>zoo</code>, the <code>libfoo.so</code> will now be linked against both
-          <code>libbar.a</code> and <code>libzoo.a</code>.</li>
-        </ul>
-      </dd>
-
-      <dt>Other changes</dt>
-
-      <dd>
-        <ul>
-          <li><code>docs/NATIVE-ACTIVITY.HTML</code>: Fixed typo. The minimum API level should be
-          9, not 8 for native activities.</li>
-
-          <li><code>docs/STABLE-APIS.html</code>: Added missing documentation listing EGL as a
-          supported stable API, starting from API level 9.</li>
-
-          <li><code>download-toolchain-sources.sh</code>: Updated to download the toolchain
-          sources from <a href="http://android.googlesource.com">android.googlesource.com</a>,
-          which is the new location for the AOSP servers.</li>
-
-          <li>Added a new C++ support runtime named <code>gabi++</code>. More details about it
-          are available in the updated <code>docs/CPLUSPLUS-SUPPORT.html</code>.</li>
-
-          <li>Added a new C++ support runtime named <code>gnustl_shared</code> that corresponds
-          to the shared library version of GNU libstdc++ v3 (GPLv3 license). See more info at
-          <code>docs/CPLUSPLUS-SUPPORT.html</code></li>
-
-          <li>Added support for RTTI in the STLport C++ runtimes (no support for
-          exceptions).</li>
-
-          <li>Added support for multiple file extensions in <code>LOCAL_CPP_EXTENSION</code>. For
-          example, to compile both <code>foo.cpp</code> and <code>bar.cxx</code> as C++ sources,
-          declare the following:
-            <pre>
-LOCAL_CPP_EXTENSION := .cpp .cxx
-</pre>
-          </li>
-
-          <li>Removed many unwanted exported symbols from the link-time shared system libraries
-          provided by the NDK. This ensures that code generated with the standalone toolchain
-          doesn't risk to accidentally depend on a non-stable ABI symbol (e.g. any libgcc.a
-          symbol that changes each time the toolchain used to build the platform is changed)</li>
-
-          <li>Refreshed the EGL and OpenGLES Khronos headers to support more extensions. Note
-          that this does <em>not</em> change the NDK ABIs for the corresponding libraries,
-          because each extension must be probed at runtime by the client application.
-
-            <p>The extensions that are available depend on your actual device and GPU drivers,
-            not the platform version the device runs on. The header changes simply add new
-            constants and types to make it easier to use the extensions when they have been
-            probed with <code>eglGetProcAddress()</code> or <code>glGetProcAddress()</code>. The
-            following list describes the newly supported extensions:</p>
-
-            <dl>
-              <dt>GLES 1.x</dt>
-
-              <dd>
-                <ul>
-                  <li><code>GL_OES_vertex_array_object</code></li>
-
-                  <li><code>GL_OES_EGL_image_external</code></li>
-
-                  <li><code>GL_APPLE_texture_2D_limited_npot</code></li>
-
-                  <li><code>GL_EXT_blend_minmax</code></li>
-
-                  <li><code>GL_EXT_discard_framebuffer</code></li>
-
-                  <li><code>GL_EXT_multi_draw_arrays</code></li>
-
-                  <li><code>GL_EXT_read_format_bgra</code></li>
-
-                  <li><code>GL_EXT_texture_filter_anisotropic</code></li>
-
-                  <li><code>GL_EXT_texture_format_BGRA8888</code></li>
-
-                  <li><code>GL_EXT_texture_lod_bias</code></li>
-
-                  <li><code>GL_IMG_read_format</code></li>
-
-                  <li><code>GL_IMG_texture_compression_pvrtc</code></li>
-
-                  <li><code>GL_IMG_texture_env_enhanced_fixed_function</code></li>
-
-                  <li><code>GL_IMG_user_clip_plane</code></li>
-
-                  <li><code>GL_IMG_multisampled_render_to_texture</code></li>
-
-                  <li><code>GL_NV_fence</code></li>
-
-                  <li><code>GL_QCOM_driver_control</code></li>
-
-                  <li><code>GL_QCOM_extended_get</code></li>
-
-                  <li><code>GL_QCOM_extended_get2</code></li>
-
-                  <li><code>GL_QCOM_perfmon_global_mode</code></li>
-
-                  <li><code>GL_QCOM_writeonly_rendering</code></li>
-
-                  <li><code>GL_QCOM_tiled_rendering</code></li>
-                </ul>
-              </dd>
-
-              <dt>GLES 2.0</dt>
-
-              <dd>
-                <ul>
-                  <li><code>GL_OES_element_index_uint</code></li>
-
-                  <li><code>GL_OES_get_program_binary</code></li>
-
-                  <li><code>GL_OES_mapbuffer</code></li>
-
-                  <li><code>GL_OES_packed_depth_stencil</code></li>
-
-                  <li><code>GL_OES_texture_3D</code></li>
-
-                  <li><code>GL_OES_texture_float</code></li>
-
-                  <li><code>GL_OES_texture_float_linear</code></li>
-
-                  <li><code>GL_OES_texture_half_float_linear</code></li>
-
-                  <li><code>GL_OES_texture_npot</code></li>
-
-                  <li><code>GL_OES_vertex_array_object</code></li>
-
-                  <li><code>GL_OES_EGL_image_external</code></li>
-
-                  <li><code>GL_AMD_program_binary_Z400</code></li>
-
-                  <li><code>GL_EXT_blend_minmax</code></li>
-
-                  <li><code>GL_EXT_discard_framebuffer</code></li>
-
-                  <li><code>GL_EXT_multi_draw_arrays</code></li>
-
-                  <li><code>GL_EXT_read_format_bgra</code></li>
-
-                  <li><code>GL_EXT_texture_format_BGRA8888</code></li>
-
-                  <li><code>GL_EXT_texture_compression_dxt1</code></li>
-
-                  <li><code>GL_IMG_program_binary</code></li>
-
-                  <li><code>GL_IMG_read_format</code></li>
-
-                  <li><code>GL_IMG_shader_binary</code></li>
-
-                  <li><code>GL_IMG_texture_compression_pvrtc</code></li>
-
-                  <li><code>GL_IMG_multisampled_render_to_texture</code></li>
-
-                  <li><code>GL_NV_coverage_sample</code></li>
-
-                  <li><code>GL_NV_depth_nonlinear</code></li>
-
-                  <li><code>GL_QCOM_extended_get</code></li>
-
-                  <li><code>GL_QCOM_extended_get2</code></li>
-
-                  <li><code>GL_QCOM_writeonly_rendering</code></li>
-
-                  <li><code>GL_QCOM_tiled_rendering</code></li>
-                </ul>
-              </dd>
-
-              <dt>EGL</dt>
-
-              <dd>
-                <ul>
-                  <li><code>EGL_ANDROID_recordable</code></li>
-
-                  <li><code>EGL_NV_system_time</code></li>
-                </ul>
-              </dd>
-            </dl>
-          </li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 6b</a> <em>(August 2011)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>This release of the NDK does not include any new features compared to r6. The r6b release
-      addresses the following issues in the r6 release:</p>
-      <dl>
-        <dt>Important bug fixes</dt>
-        <dd>
-          <ul>
-            <li>Fixed the build when <code>APP_ABI="armeabi x86"</code> is used for
-            multi-architecture builds.</li>
-            <li>Fixed the location of prebuilt STLport binaries in the NDK release package.
-            A bug in the packaging script placed them in the wrong location.</li>
-            <li>Fixed <code>atexit()</code> usage in shared libraries with the x86standalone
-            toolchain.</li>
-            <li>Fixed <code>make-standalone-toolchain.sh --arch=x86</code>. It used to fail
-            to copy the proper GNU libstdc++ binaries to the right location.</li>
-            <li>Fixed the standalone toolchain linker warnings about missing the definition and
-            size for the <code>__dso_handle</code> symbol (ARM only).</li>
-            <li>Fixed the inclusion order of <code>$(SYSROOT)/usr/include</code> for x86 builds.
-            See the <a href="http://b.android.com/18540">bug</a> for
-            more information.</li>
-            <li>Fixed the definitions of <code>ptrdiff_t</code> and <code>size_t</code> in
-            x86-specific systems when they are used with the x86 standalone toolchain.</li>
-          </ul>
-        </dd>
-      </dl>
-  </div>
-</div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 6</a> <em>(July 2011)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>This release of the NDK includes support for the x86 ABI and other minor changes.
-      For detailed information describing the changes in this release, read the
-      <code>CHANGES.HTML</code> document included in the NDK package.
-      </p>
-      <dl>
-        <dt>General notes:</dt>
-        <dd>
-          <ul>
-            <li>Adds support for the x86 ABI, which allows you to generate machine code
-            that runs on compatible x86-based Android devices. Major features for x86
-            include x86-specific toolchains, system headers, libraries and
-            debugging support. For all of the details regarding x86 support,
-            see <code>docs/CPU-X86.html</code> in the NDK package.
-
-              <p>By default, code is generated for ARM-based devices, but you can add x86 to your
-              <code>APP_ABI</code> definition in your <code>Application.mk</code> file to build
-              for x86 platforms. For example, the following line instructs <code>ndk-build</code>
-              to build your code for three distinct ABIs:</p>
-
-              <pre>APP_ABI := armeabi armeabi-v7a x86</pre>
-
-              <p>Unless you rely on ARM-based assembly sources, you shouldn't need to touch
-              your <code>Android.mk</code> files to build x86 machine code.</p>
-
-            </li>
-
-            <li>You can build a standalone x86 toolchain using the
-<code>--toolchain=x86-4.4.3</code>
-            option when calling <code>make-standalone-toolchain.sh</code>. See
-            <code>docs/STANDALONE-TOOLCHAIN.html</code> for more details.
-            </li>
-            <li>The new <code>ndk-stack</code> tool lets you translate stack traces in
-            <code>logcat</code> that are generated by native code. The tool translates
-            instruction addresses into a readable format that contains things such
-            as the function, source file, and line number corresponding to each stack frame.
-            For more information and a usage example, see <code>docs/NDK-STACK.html</code>.
-            </li>
-          </ul>
-        </dd>
-        <dt>Other changes:</dt>
-        <dd><code>arm-eabi-4.4.0</code>, which had been deprecated since NDK r5, has been
-        removed from the NDK distribution.</dd>
-
-      </dl>
-    </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 5c</a> <em>(June 2011)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-    <p>This release of the NDK does not include any new features compared to r5b. The r5c release
-    addresses the following problems in the r5b release:</p>
-    <dl>
-      <dt>Important bug fixes:</dt>
-      <dd>
-        <ul>
-          <li><code>ndk-build</code>: Fixed a rare bug that appeared when trying to perform parallel
-          builds of debuggable projects.</li>
-
-          <li>Fixed a typo that prevented <code>LOCAL_WHOLE_STATIC_LIBRARIES</code> to work
-          correctly with the new toolchain and added documentation for this in
-          <code>docs/ANDROID-MK.html</code>.</li>
-
-          <li>Fixed a bug where code linked against <code>gnustl_static</code> crashed when run on
-          platform releases older than API level 8 (Android 2.2).</li>
-
-          <li><code>ndk-gdb</code>: Fixed a bug that caused a segmentation fault when debugging
-Android 3.0
-          or newer devices.</li>
-
-          <li><code>&lt;android/input.h&gt;</code>: Two functions that were introduced in API level
-          9 (Android 2.3) were incorrect and are fixed. While this breaks the source API, the
-          binary interface to the system is unchanged. The incorrect functions were missing a
-          <code>history_index</code> parameter, and the correct definitions are shown below:
-<pre>
-float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event,
-                                           size_t pointer_index,
-                                           size_t history_index);
-
-float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event,
-                                           size_t pointer_index,
-                                           size_t history_index);
-</pre>
-          </li>
-
-          <li>Updated the C library ARM binary for API level 9 (Android 2.3) to correctly expose at
-          link time new functions that were added in that API level (for example,
-          <code>pthread_rwlock_init</code>).</li>
-
-        </ul>
-      </dd>
-
-      <dt>Minor improvements and fixes:</dt>
-      <dd>
-        <ul>
-          <li>Object files are now always linked in the order they appear in
-          <code>LOCAL_SRC_FILES</code>. This was not the case previously because the files were
-          grouped by source extensions instead.</li>
-
-          <li>When <code>import-module</code> fails, it now prints the list of directories that
-          were searched. This is useful to check that the <code>NDK_MODULE_PATH</code> definition
-          used by the build system is correct.</li>
-
-          <li>When <code>import-module</code> succeeds, it now prints the directory where the
-          module was found to the log (visible with <code>NDK_LOG=1</code>).</li>
-
-          <li>Increased the build speed of debuggable applications when there is a very large number
-          of include directories in the project.</li>
-
-          <li><code>ndk-gdb</code>: Better detection of <code>adb shell</code> failures and improved
-          error messages.</li>
-
-          <li><code>&lt;pthread.h&gt;</code>: Fixed the definition of
-          <code>PTHREAD_RWLOCK_INITIALIZER</code> for API level 9 (Android 2.3) and higher.</li>
-
-          <li>Fixed an issue where a module could import itself, resulting in an infinite loop in
-          GNU Make.</li>
-
-          <li>Fixed a bug that caused the build to fail if <code>LOCAL_ARM_NEON</code> was set to
-          true (typo in <code>build/core/build-binary.mk</code>).</li>
-
-          <li>Fixed a bug that prevented the compilation of <code>.s</code> assembly files
-          (<code>.S</code> files were okay).</li>
-        </ul>
-      </dd>
-    </dl>
-  </div>
-</div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 5b</a> <em>(January 2011)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>This release of the NDK does not include any new features compared to r5. The r5b release
-addresses the
-      following problems in the r5 release:
-      </p>
-      <ul>
-    <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special
-    toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on
-Ubuntu 8.04 or higher. </li>
-    <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain.
-    The previous binary generated invalid thumb instruction sequences when
-    dealing with signed chars.</li>
-    <li>Adds missing documentation for the
-    "gnustl_static" value for APP_STL, that allows you to link against
-    a static library version of GNU libstdc++. </li> the
-    <li>Fixed the following <code>ndk-build</code> issues:
-      <ul>
-        <li>A bug that created inconsistent dependency files when a
-        compilation error occured on Windows. This prevented a proper build after
-        the error was fixed in the source code.</li>
-        <li>A Cygwin-specific bug where using very short paths for
-        the Android NDK installation or the project path led to the
-        generation of invalid dependency files. This made incremental builds
-        impossible.</li>
-        <li>A typo that prevented the cpufeatures library from working correctly
-        with the new NDK toolchain.</li>
-        <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code>
-        from GNU Make for every source or object file, which caused problems
-        with very large source trees. In case this doesn't work properly, define
-<code>NDK_USE_CYGPATH=1</code> in your
-        environment to use <code>cygpath -m</code> again.</li>
-        <li>The Cygwin installation now notifies the user of invalid installation paths that
-contain spaces. Previously, an invalid path
-        would output an error that complained about an incorrect version of GNU Make, even if the
-right one was installed.
-      </ul>
-    </li>
-  <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from
-working properly when
-  it contained multiple directories separated with a colon. </li>
-  <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit
-  generated machine code, instead of relying on the host tag, which
-  allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts
-now also support
-  using a 32-bit host toolchain.</li>
-  <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to
-<code>&lt;netinet/in.h&gt;</code>.</li>
-  <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and
-<code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code>&lt;netinet/in6.h&gt;</code>.</li>
-  <li>'asm' was replaced with '__asm__' in <code>&lt;asm/byteorder.h&gt;</code> to allow
-compilation with <code>-std=c99</code>.</li>
-  </ul>
-  </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 5</a> <em>(December 2010)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>This release of the NDK includes many new APIs, most of which are introduced to
-         support the development of games and similar applications that make extensive use
-         of native code. Using the APIs, developers have direct native access to events, audio,
-         graphics and window management, assets, and storage. Developers can also implement the
-         Android application lifecycle in native code with help from the new
-         {@link android.app.NativeActivity} class. For detailed information describing the changes
-in this
-         release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK
-package.
-      </p>
-      <dl>
-        <dt>General notes:</dt>
-        <dd>
-          <ul>
-            <li>Adds support for native activities, which allows you to implement the
-            Android application lifecycle in native code.</li>
-
-            <li>Adds native support for the following:
-
-              <ul>
-
-                <li>Input subsystem (such as the keyboard and touch screen)</li>
-
-                <li>Access to sensor data (accelerometer, compass, gyroscope, etc).</li>
-
-                <li>Event loop APIs to wait for things such as input and sensor events.</li>
-
-                <li>Window and surface subsystem</li>
-
-                <li>Audio APIs based on the OpenSL ES standard that support playback and recording
-                as well as control over platform audio effects</li>
-
-                <li>Access to assets packaged in an <code>.apk</code> file.</li>
-
-              </ul>
-            </li>
-
-            <li>Includes a new toolchain (based on GCC 4.4.3), which generates better code, and can
-also now
-            be used as a standalone cross-compiler, for people who want to build their stuff with
-            <code>./configure &amp;&amp; make</code>. See
-            docs/STANDALONE-TOOLCHAIN.html for the details. The binaries for GCC 4.4.0 are still
-provided,
-            but the 4.2.1 binaries were removed.</li>
-
-            <li>Adds support for prebuilt static and shared libraries (docs/PREBUILTS.html) and
-module
-            exports and imports to make sharing and reuse of third-party modules much easier
-            (docs/IMPORT-MODULE.html explains why).</li>
-
-            <li>Provides a default C++ STL implementation (based on STLport) as a helper module. It
-can be used either
-            as a static or shared library (details and usage examples are in
-sources/android/stlport/README). Prebuilt
-            binaries for STLport (static or shared) and GNU libstdc++ (static only) are also
-provided if you choose to
-            compile against those libraries instead of the default C++ STL implementation.
-            C++ Exceptions and RTTI are not supported in the default STL implementation. For more
-information, see
-            docs/CPLUSPLUS-SUPPORT.HTML.</li>
-
-            <li>Includes improvements to the <code>cpufeatures</code> helper library that improves
-reporting
-            of the CPU type (some devices previously reported ARMv7 CPU when the device really was
-an ARMv6). We
-            recommend developers that use this library to rebuild their applications then
-            upload to Google Play to benefit from the improvements.</li>
-
-            <li>Adds an EGL library that lets you create and manage OpenGL ES textures and
-              services.</li>
-
-            <li>Adds new sample applications, <code>native-plasma</code> and
-<code>native-activity</code>,
-            to demonstrate how to write a native activity.</li>
-
-            <li>Includes many bugfixes and other small improvements; see docs/CHANGES.html for a
-more
-              detailed list of changes.</li>
-          </ul>
-        </dd>
-      </dl>
-    </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 4b</a> <em>(June 2010)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <dl>
-        <dt>NDK r4b notes:</dt>
-
-        <dd>
-          <p>Includes fixes for several issues in the NDK build and debugging scripts &mdash; if
-          you are using NDK r4, we recommend downloading the NDK r4b build. For detailed
-          information describing the changes in this release, read the CHANGES.TXT document
-          included in the downloaded NDK package.</p>
-        </dd>
-      </dl>
-
-      <dl>
-        <dt>General notes:</dt>
-
-        <dd>
-          <ul>
-            <li>Provides a simplified build system through the new <code>ndk-build</code> build
-            command.</li>
-
-            <li>Adds support for easy native debugging of generated machine code on production
-            devices through the new <code>ndk-gdb</code> command.</li>
-
-            <li>Adds a new Android-specific ABI for ARM-based CPU architectures,
-            <code>armeabi-v7a</code>. The new ABI extends the existing <code>armeabi</code> ABI to
-            include these CPU instruction set extensions:
-
-              <ul>
-                <li>Thumb-2 instructions</li>
-
-                <li>VFP hardware FPU instructions (VFPv3-D16)</li>
-
-                <li>Optional support for ARM Advanced SIMD (NEON) GCC intrinsics and VFPv3-D32.
-                Supported by devices such as Verizon Droid by Motorola, Google Nexus One, and
-                others.</li>
-              </ul>
-            </li>
-
-            <li>Adds a new <code>cpufeatures</code> static library (with sources) that lets your
-            app detect the host device's CPU features at runtime. Specifically, applications can
-            check for ARMv7-A support, as well as VFPv3-D32 and NEON support, then provide separate
-            code paths as needed.</li>
-
-            <li>Adds a sample application, <code>hello-neon</code>, that illustrates how to use the
-            <code>cpufeatures</code> library to check CPU features and then provide an optimized
-            code path using NEON instrinsics, if supported by the CPU.</li>
-
-            <li>Lets you generate machine code for either or both of the instruction sets supported
-            by the NDK. For example, you can build for both ARMv5 and ARMv7-A architectures at the
-            same time and have everything stored to your application's final
-            <code>.apk</code>.</li>
-
-            <li>To ensure that your applications are available to users only if their devices are
-            capable of running them, Google Play now filters applications based on the
-            instruction set information included in your application &mdash; no action is needed on
-            your part to enable the filtering. Additionally, the Android system itself also checks
-            your application at install time and allows the installation to continue only if the
-            application provides a library that is compiled for the device's CPU architecture.</li>
-
-            <li>Adds support for Android 2.2, including a new stable API for accessing the pixel
-            buffers of {@link android.graphics.Bitmap} objects from native code.</li>
-          </ul>
-        </dd>
-      </dl>
-    </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 3</a> <em>(March 2010)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <dl>
-        <dt>General notes:</dt>
-
-        <dd>
-          <ul>
-            <li>Adds OpenGL ES 2.0 native library support.</li>
-
-            <li>Adds a sample application,<code>hello-gl2</code>, that illustrates the use of
-            OpenGL ES 2.0 vertex and fragment shaders.</li>
-
-            <li>The toolchain binaries have been refreshed for this release with GCC 4.4.0, which
-            should generate slightly more compact and efficient machine code than the previous one
-            (4.2.1). The NDK also still provides the 4.2.1 binaries, which you can optionally use
-            to build your machine code.</li>
-          </ul>
-        </dd>
-      </dl>
-    </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 2</a> <em>(September 2009)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>Originally released as "Android 1.6 NDK, Release 1".</p>
-
-      <dl>
-        <dt>General notes:</dt>
-
-        <dd>
-          <ul>
-            <li>Adds OpenGL ES 1.1 native library support.</li>
-
-            <li>Adds a sample application, <code>san-angeles</code>, that renders 3D graphics
-            through the native OpenGL ES APIs, while managing activity lifecycle with a {@link
-            android.opengl.GLSurfaceView} object.</li>
-          </ul>
-        </dd>
-      </dl>
-    </div>
-  </div>
-
-<div class="toggle-content closed">
-  <p><a href="#" onclick="return toggleContent(this)">
-    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img"
-      alt="">Android NDK, Revision 1</a> <em>(June 2009)</em>
-  </p>
-
-  <div class="toggle-content-toggleme">
-      <p>Originally released as "Android 1.5 NDK, Release 1".</p>
-
-      <dl>
-        <dt>General notes:</dt>
-
-        <dd>
-          <ul>
-            <li>Includes compiler support (GCC) for ARMv5TE instructions, including Thumb-1
-            instructions.</li>
-
-            <li>Includes system headers for stable native APIs, documentation, and sample
-            applications.</li>
-          </ul>
-        </dd>
-      </dl>
-    </div>
-  </div>
-
-
-
-
-
-<!-- ####################### END OF RELEASE NOTES ####################### -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  <h2 id="Reqs">System and Software Requirements</h2>
-
-  <p>The sections below describe the system and software requirements for using the Android NDK, as
-  well as platform compatibility considerations that affect appplications using libraries produced
-  with the NDK.</p>
-
-  <h4>The Android SDK</h4>
-
-  <ul>
-    <li>A complete Android SDK installation (including all dependencies) is required.</li>
-
-    <li>Android 1.5 SDK or later version is required.</li>
-  </ul>
-
-  <h4>Supported operating systems</h4>
-
-  <ul>
-    <li>Windows XP (32-bit) or Vista (32- or 64-bit)</li>
-
-    <li>Mac OS X 10.4.8 or later (x86 only)</li>
-
-    <li>Linux (32 or 64-bit; Ubuntu 8.04, or other Linux distributions using GLibc 2.7 or
-later)</li>
-  </ul>
-
-  <h4>Required development tools</h4>
-
-  <ul>
-    <li>For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU
-    Make might work but have not been tested.</li>
-
-    <li>A recent version of awk (either GNU Awk or Nawk) is also required.</li>
-
-    <li>For Windows, <a href="http://www.cygwin.com">Cygwin</a> 1.7 or higher is required. The NDK
-    will <em>not</em> work with Cygwin 1.5 installations.</li>
-  </ul>
-
-  <h4 id="platform-compat">Android platform compatibility</h4>
-
-  <ul>
-    <li>The native libraries created by the Android NDK can only be used on devices running
-      specific minimum Android platform versions. The minimum required platform version depends on
-      the CPU architecture of the devices you are targeting. The following table details which
-      Android platform versions are compatible with native code developed for specific CPU
-      architectures.
-
-    <table style="margin:1em;">
-      <tr>
-        <th>Native Code CPU Architecture Used</th>
-        <th>Compatible Android Platform(s)</th>
-      </tr>
-
-      <tr>
-        <td>ARM, ARM-NEON</td>
-        <td>Android 1.5 (API Level 3) and higher</td>
-      </tr>
-
-      <tr>
-        <td>x86</td>
-        <td>Android 2.3 (API Level 9) and higher</td>
-      </tr>
-
-      <tr>
-        <td>MIPS</td>
-        <td>Android 2.3 (API Level 9) and higher</td>
-      </tr>
-    </table>
-
-      <p>These requirements mean you can use native libraries produced with the NDK in
-      applications that are deployable to ARM-based devices running Android 1.5 or later. If you are
-      deploying native libraries to x86 and MIPS-based devices, your application must target Android
-      2.3 or later.</p>
-    </li>
-
-    <li>To ensure compatibility, an application using a native library produced with the NDK
-    <em>must</em> declare a <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html"><code>
-      &lt;uses-sdk&gt;</code></a> element in its manifest file, with an
-      <code>android:minSdkVersion</code> attribute value of "3" or higher. For example:
-
-<pre style="margin:1em;">
-&lt;manifest&gt;
-  &lt;uses-sdk android:minSdkVersion="3" /&gt;
-  ...
-&lt;/manifest&gt;
-</pre>
-    </li>
-
-    <li>If you use this NDK to create a native library that uses the OpenGL ES APIs, the
-    application containing the library can be deployed only to devices running the minimum platform
-    versions described in the table below. To ensure compatibility, make sure that your application
-    declares the proper <code>android:minSdkVersion</code> attribute value, as shown in the
-    following table.</li>
-
-    <li style="list-style: none; display: inline">
-      <table style="margin:1em;">
-        <tr>
-          <th>OpenGL ES Version Used</th>
-
-          <th>Compatible Android Platform(s)</th>
-
-          <th>Required uses-sdk Attribute</th>
-        </tr>
-
-        <tr>
-          <td>OpenGL ES 1.1</td>
-
-          <td>Android 1.6 (API Level 4) and higher</td>
-
-          <td><code>android:minSdkVersion="4"</code></td>
-        </tr>
-
-        <tr>
-          <td>OpenGL ES 2.0</td>
-
-          <td>Android 2.0 (API Level 5) and higher</td>
-
-          <td><code>android:minSdkVersion="5"</code></td>
-        </tr>
-      </table>
-
-      <p>For more information about API Level and its relationship to Android platform versions,
-      see <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">Android API
-Levels</a>.</p>
-    </li>
-
-    <li>Additionally, an application using the OpenGL ES APIs should declare a
-    <code>&lt;uses-feature&gt;</code> element in its manifest, with an
-    <code>android:glEsVersion</code> attribute that specifies the minimum OpenGl ES version
-    required by the application. This ensures that Google Play will show your application only
-    to users whose devices are capable of supporting your application. For example:
-      <pre style="margin:1em;">
-&lt;manifest&gt;
-<!-- Declare that the application uses the OpenGL ES 2.0 API and is designed
-     to run only on devices that support OpenGL ES 2.0 or higher. -->
-  &lt;uses-feature android:glEsVersion="0x00020000" /&gt;
-  ...
-&lt;/manifest&gt;
-</pre>
-
-      <p>For more information, see the <a href=
-
-"{@docRoot}guide/topics/manifest/uses-feature-element.html"><code>&lt;uses-feature&gt;</code></a>
-      documentation.</p>
-    </li>
-
-    <li>If you use this NDK to create a native library that uses the API to access Android {@link
-    android.graphics.Bitmap} pixel buffers or utilizes native activities, the application
-    containing the library can be deployed only to devices running Android 2.2 (API level 8) or
-    higher. To ensure compatibility, make sure that your application declares <code>&lt;uses-sdk
-    android:minSdkVersion="8" /&gt;</code> attribute value in its manifest.</li>
-  </ul>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  <h2 id="Installing">Installing the NDK</h2>
-  <p>Installing the NDK on your development computer is straightforward and involves extracting the
-  NDK from its download package.</p>
-
-  <p>Before you get started make sure that you have downloaded the latest <a href=
-  "{@docRoot}sdk/index.html">Android SDK</a> and upgraded your applications and environment as
-  needed. The NDK is compatible with older platform versions but not older versions of the SDK
-tools.
-  Also, take a moment to review the <a href="#Reqs">System and
-Software Requirements</a>
-  for the NDK, if you haven't already.</p>
-
-  <p>To install the NDK, first download the appropriate package from the table at the top of this
-  page. Then, follow the procedure for your development platform:</p>
-       <ul>
-       <li>On Linux and Mac OS X (Darwin):
-          <ul>
-          <ol>
-          <li>Download the appropriate package from this page.</li>
-          <li>Open a terminal window.</li>
-          <li>Go to the directory to which you downloaded the package.</li>
-          <li>Run <code>chmod a+x</code> on the downloaded package.</li>
-          <li>Execute the package. For example:</li>
-          <pre>
-ndk$ chmod a+x android-ndk-r10c-darwin-x86_64.bin
-ndk$ ./android-ndk-r10c-darwin-x86_64.bin
-          </pre>
-          <p>The folder containing the NDK extracts itself.</p>
-          <p>Note that you can also use a program like 7z to extract the package.</p>
-          </ol>
-          </ul>
-    <li>On Windows:</li>
-       <ul>
-       <ol>
-       <li>Download the appropriate package from this page.</li>
-       <li>Navigate to the folder to which you downloaded the package.</li>
-       <li>Double-click the downloaded file. The folder containing the NDK extracts itself.</li>
-       </ol>
-       </ul>
-     </ul>When uncompressed, the NDK files are contained in a directory called
-    <code>android-ndk-&lt;version&gt;</code>. You can rename the NDK directory if necessary and you
-    can move it to any location on your computer. This documentation refers to the NDK directory as
-    <code>&lt;ndk&gt;</code>.
-
-
-  <p>You are now ready to start working with the NDK.</p>
-
-
-<h2 id="GetStarted">Getting Started with the NDK</h2>
-
-<p>Once you've installed the NDK successfully, take a few minutes to read the documentation
-included in the NDK. You can find the documentation in the <code>&lt;ndk&gt;/docs/</code>
-directory. In particular, please read the OVERVIEW.HTML document completely, so that you
-understand the intent of the NDK and how to use it.</p>
-
-<p>If you used a previous version of the NDK, take a moment to review the list of NDK changes in
-the CHANGES.HTML document.</p>
-
-<p>Here's the general outline of how you work with the NDK tools:</p>
-
-<ol>
-  <li>Place your native sources under <code>&lt;project&gt;/jni/...</code></li>
-
-  <li>Create <code>&lt;project&gt;/jni/Android.mk</code> to describe your native sources to the
-  NDK build system</li>
-
-  <li>Optional: Create <code>&lt;project&gt;/jni/Application.mk</code>.</li>
-
-  <li>Build your native code by running the 'ndk-build' script from your project's directory. It
-  is located in the top-level NDK directory:
-    <pre class="no-pretty-print">cd &lt;project&gt;
-&lt;ndk&gt;/ndk-build
-</pre>
-
-    <p>The build tools copy the stripped, shared libraries needed by your application to the
-    proper location in the application's project directory.</p>
-  </li>
-
-  <li>Finally, compile your application using the SDK tools in the usual way. The SDK build tools
-  will package the shared libraries in the application's deployable <code>.apk</code> file.</li>
-</ol>
-
-<p>For complete information on all of the steps listed above, please see the documentation
-included with the NDK package.</p>
-
-
-<h3 id="Using">Using the NDK</h3>
-
-<p>The Android framework provides two ways to use native code:</p>
-
-<ul>
-  <li>Write your application using the Android framework and use JNI to access the APIs provided
-  by the Android NDK. This technique allows you to take advantage of the convenience of the
-  Android framework, but still allows you to write native code when necessary. If you use this
-  approach, your application must target specific, minimum Android platform levels, see <a
-  href="#platform-compat">Android platform compatibility</a> for more information.</li>
-
-  <li>
-    <p>Write a native activity, which allows you to implement the lifecycle callbacks in native
-    code. The Android SDK provides the {@link android.app.NativeActivity} class, which is a
-    convenience class that notifies your
-    native code of any activity lifecycle callbacks (<code>onCreate()</code>,
-<code>onPause()</code>,
-    <code>onResume()</code>, etc). You can implement the callbacks in your native code to handle
-    these events when they occur. Applications that use native activities must be run on Android
-    2.3 (API Level 9) or later.</p>
-
-    <p>You cannot access features such as Services and Content Providers natively, so if you want
-    to use them or any other framework API, you can still write JNI code to do so.</p>
-  </li>
-</ul>
-
-
-
-
-
-  <h2 id="Contents">Contents of the NDK</h2>
-
-  <p>The NDK contains the APIs, documentation, and sample
-  applications that help you write your native code. Specifically:</p>
-
-  <ul>
-    <li>A set of tools and build files used to generate native code libraries from C and C++
-    sources</li>
-
-    <li>A way to embed the corresponding native libraries into an application package file
-    (<code>.apk</code>) that can be deployed on Android devices</li>
-
-    <li>A set of native system headers and libraries that will be supported in all future versions
-    of the Android platform, starting from Android 1.5. Applications that use native activities
-    must be run on Android 2.3 or later.</li>
-
-    <li>Documentation, samples, and tutorials</li>
-  </ul>
-
-  <p>The latest release of the NDK supports the following instruction sets:</p>
-
-  <ul>
-    <li>ARMv5TE, including Thumb-1 instructions (see {@code docs/CPU-ARCH-ABIS.html} for more
-information)</li>
-
-    <li>ARMv7-A, including Thumb-2 and VFPv3-D16 instructions, with optional support for
-    NEON/VFPv3-D32 instructions (see {@code docs/CPU-ARM-NEON.html} for more information)</li>
-
-    <li>x86 instructions (see {@code docs/CPU-X86.html} for more information)</li>
-
-    <li>MIPS instructions (see {@code docs/CPU-MIPS.html} for more information)</li>
-  </ul>
-
-  <p>ARMv5TE machine code will run on all ARM-based Android devices. ARMv7-A will run only on
-  devices such as the Verizon Droid or Google Nexus One that have a compatible CPU. The main
-  difference between the two instruction sets is that ARMv7-A supports hardware FPU, Thumb-2, and
-  NEON instructions. You can target either or both of the instruction sets &mdash; ARMv5TE is the
-  default, but switching to ARMv7-A is as easy as adding a single line to the application's
-  <code>Application.mk</code> file, without needing to change anything else in the file. You can
-also build for
-  both architectures at the same time and have everything stored in the final <code>.apk</code>.
-  Complete information is provided in the CPU-ARCH-ABIS.HTML in the NDK package.</p>
-
-  <p>The NDK provides stable headers for libc (the C library), libm (the Math library), OpenGL ES
-  (3D graphics library), the JNI interface, and other libraries, as listed in the <a href=
-  "#Tools">Development tools</a> section.</p>
-
-
-  <h3 id="Tools">Development tools</h3>
-
-  <p>The NDK includes a set of cross-toolchains (compilers, linkers, etc.) that can generate
-  native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.</p>
-
-  <p>It provides a set of system headers for stable native APIs that are guaranteed to be supported
-  in all later releases of the platform:</p>
-
-  <ul>
-    <li>libc (C library) headers</li>
-
-    <li>libm (math library) headers</li>
-
-    <li>JNI interface headers</li>
-
-    <li>libz (Zlib compression) headers</li>
-
-    <li>liblog (Android logging) header</li>
-
-    <li>OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers</li>
-
-    <li>libjnigraphics (Pixel buffer access) header (for Android 2.2 and above).</li>
-
-    <li>A Minimal set of headers for C++ support</li>
-
-    <li>OpenSL ES native audio libraries</li>
-
-    <li>Android native application APIS</li>
-  </ul>
-
-  <p>The NDK also provides a build system that lets you work efficiently with your sources, without
-  having to handle the toolchain/platform/CPU/ABI details. You create very short build files to
-  describe which sources to compile and which Android application will use them &mdash; the build
-  system compiles the sources and places the shared libraries directly in your application
-  project.</p>
-
-  <p class="caution"><strong>Important:</strong> With the exception of the libraries listed above,
-  native system libraries in the Android platform are <em>not</em> stable and may change in future
-  platform versions. Your applications should <em>only</em> make use of the stable native system
-  libraries provided in this NDK.</p>
-
-
-
-  <h3 id="Docs">Documentation</h3>
-
-  <p>The NDK package includes a set of documentation that describes the capabilities of the NDK and
-  how to use it to create shared libraries for your Android applications. In this release, the
-  documentation is provided only in the downloadable NDK package. You can find the documentation in
-  the <code>&lt;ndk&gt;/docs/</code> directory. Included are these files (partial listing):</p>
-
-  <ul>
-    <li>
-    INSTALL.HTML &mdash; describes how to install the NDK and configure it for your host
-    system</li>
-
-    <li>OVERVIEW.HTML &mdash; provides an overview of the NDK capabilities and usage</li>
-
-    <li>ANDROID-MK.HTML &mdash; describes the use of the Android.mk file, which defines the native
-    sources you want to compile</li>
-
-    <li>APPLICATION-MK.HTML &mdash; describes the use of the Application.mk file, which describes
-    the native sources required by your Android application</li>
-    <li>CPLUSPLUS-SUPPORT.HTML &mdash; describes the C++ support provided in the Android NDK</li>
-    <li>CPU-ARCH-ABIS.HTML &mdash; a description of supported CPU architectures and how to target
-    them.</li>
-
-    <li>CPU-FEATURES.HTML &mdash; a description of the <code>cpufeatures</code> static library that
-    lets your application code detect the target device's CPU family and the optional features at
-    runtime.</li>
-
-    <li>CHANGES.HTML &mdash; a complete list of changes to the NDK across all releases.</li>
-
-    <li>DEVELOPMENT.HTML &mdash; describes how to modify the NDK and generate release packages for
-it</li>
-
-    <li>HOWTO.HTML &mdash; information about common tasks associated with NDK development</li>
-
-    <li>IMPORT-MODULE.HTML &mdash; describes how to share and reuse modules</li>
-
-    <li>LICENSES.HTML  &mdash; information about the various open source licenses that govern the
-Android NDK</li>
-
-    <li>NATIVE-ACTIVITY.HTML &mdash; describes how to implement native activities</li>
-
-    <li>NDK-BUILD.HTML &mdash; describes the usage of the ndk-build script</li>
-
-    <li>NDK-GDB.HTML &mdash; describes how to use the native code debugger</li>
-
-    <li>PREBUILTS.HTML &mdash; information about how shared and static prebuilt libraries work </li>
-
-    <li>STANDALONE-TOOLCHAIN.HTML &mdash; describes how to use Android NDK toolchain as a standalone
-    compiler (still in beta).</li>
-
-    <li>SYSTEM-ISSUES.HTML &mdash; known issues in the Android system images that you should be
-    aware of, if you are developing using the NDK.</li>
-
-    <li>STABLE-APIS.HTML &mdash; a complete list of the stable APIs exposed by headers in the
-    NDK.</li>
-
-  </ul>
-
-  <p>Additionally, the package includes detailed information about the "bionic" C library provided
-  with the Android platform that you should be aware of, if you are developing using the NDK. You
-  can find the documentation in the <code>&lt;ndk&gt;/docs/system/libc/</code> directory:</p>
-
-  <ul>
-    <li>OVERVIEW.HTML &mdash; provides an overview of the "bionic" C library and the features it
-    offers.</li>
-  </ul>
-
-
-
-
-
-<h3 id="Samples">Sample apps</h3>
-
-<p>The NDK includes sample applications that illustrate how to use native code in your Android
-  applications:</p>
-
-  <ul>
-    <li><code>hello-jni</code> &mdash; a simple application that loads a string from a native
-    method implemented in a shared library and then displays it in the application UI.</li>
-
-    <li><code>two-libs</code> &mdash; a simple application that loads a shared library dynamically
-    and calls a native method provided by the library. In this case, the method is implemented in a
-    static library imported by the shared library.</li>
-
-    <li><code>san-angeles</code> &mdash; a simple application that renders 3D graphics through the
-    native OpenGL ES APIs, while managing activity lifecycle with a {@link
-    android.opengl.GLSurfaceView} object.</li>
-
-    <li><code>hello-gl2</code> &mdash; a simple application that renders a triangle using OpenGL ES
-    2.0 vertex and fragment shaders.</li>
-
-    <li><code>hello-neon</code> &mdash; a simple application that shows how to use the
-    <code>cpufeatures</code> library to check CPU capabilities at runtime, then use NEON intrinsics
-    if supported by the CPU. Specifically, the application implements two versions of a tiny
-    benchmark for a FIR filter loop, a C version and a NEON-optimized version for devices that
-    support it.</li>
-
-    <li><code>bitmap-plasma</code> &mdash; a simple application that demonstrates how to access the
-    pixel buffers of Android {@link android.graphics.Bitmap} objects from native code, and uses
-    this to generate an old-school "plasma" effect.</li>
-
-    <li><code>native-activity</code> &mdash; a simple application that demonstrates how to use the
-    native-app-glue static library to create a native activity</li>
-
-    <li><code>native-plasma</code> &mdash; a version of bitmap-plasma implemented with a native
-    activity.</li>
-  </ul>
-
-  <p>For each sample, the NDK includes the corresponding C source code and the necessary Android.mk
-  and Application.mk files. There are located under <code>&lt;ndk&gt;/samples/&lt;name&gt;/</code>
-  and their source code can be found under <code>&lt;ndk&gt;/samples/&lt;name&gt;/jni/</code>.</p>
-
-  <p>You can build the shared libraries for the sample apps by going into
-  <code>&lt;ndk&gt;/samples/&lt;name&gt;/</code> then calling the <code>ndk-build</code> command.
-  The generated shared libraries will be located under
-  <code>&lt;ndk&gt;/samples/&lt;name&gt;/libs/armeabi/</code> for (ARMv5TE machine code) and/or
-  <code>&lt;ndk&gt;/samples/&lt;name&gt;/libs/armeabi-v7a/</code> for (ARMv7 machine code).</p>
-
-  <p>Next, build the sample Android applications that use the shared libraries:</p>
-
-  <ul>
-    <li>If you are developing in Eclipse with ADT, use the New Project Wizard to create a new
-    Android project for each sample, using the "Import from Existing Source" option and importing
-    the source from <code>&lt;ndk&gt;/samples/&lt;name&gt;/</code>. Then, set up an AVD,
-    if necessary, and build/run the application in the emulator.</li>
-
-    <li>If you are developing with Ant, use the <code>android</code> tool to create the build file
-    for each of the sample projects at <code>&lt;ndk&gt;/samples/&lt;name&gt;/</code>.
-    Then set up an AVD, if necessary, build your project in the usual way, and run it in the
-    emulator.</li>
-
-  </ul>
-
-  <p>For more information about developing with the Android SDK tools and what
-  you need to do to create, build, and run your applications, see
-  the <a href="{@docRoot}tools/workflow/index.html">Overview</a>
-  section for developing on Android.</p>
-
-
-
-  <h4 id="hello-jni">Exploring the hello-jni Sample</h4>
-
-  <p>The hello-jni sample is a simple demonstration on how to use JNI from an Android application.
-  The HelloJni activity receives a string from a simple C function and displays it in a
-  TextView.</p>
-
-  <p>The main components of the sample include:</p>
-
-  <ul>
-    <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
-    file, a <code>src/</code> and <code>res</code> directories, and a main activity)</li>
-
-    <li>A <code>jni/</code> directory that includes the implemented source file for the native code
-    as well as the Android.mk file</li>
-
-    <li>A <code>tests/</code> directory that contains unit test code.</li>
-  </ul>
-
-  <ol>
-    <li>Create a new project in Eclipse from the existing sample source or use the
-    <code>android</code> tool to update the project so it generates a build.xml file that you can
-    use to build the sample.
-
-      <ul>
-        <li>In Eclipse:
-
-          <ol type="a">
-            <li>Click <strong>File &gt; New Android Project...</strong></li>
-
-            <li>Select the <strong>Create project from existing source</strong> radio button.</li>
-
-            <li>Select any API level above Android 1.5.</li>
-
-            <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
-            the <code>&lt;ndk-root&gt;/samples/hello-jni</code> directory.</li>
-
-            <li>Click <strong>Finish</strong>.</li>
-          </ol>
-        </li>
-
-        <li>On the command line:
-
-          <ol type="a">
-            <li>Change to the <code>&lt;ndk-root&gt;/samples/hello-jni</code> directory.</li>
-
-            <li>Run the following command to generate a build.xml file:
-              <pre class="no-pretty-print">android update project -p . -s</pre>
-            </li>
-          </ol>
-        </li>
-      </ul>
-    </li>
-
-    <li>Compile the native code using the <code>ndk-build</code> command.
-      <pre class="no-pretty-print">
-cd &lt;ndk-root&gt;/samples/hello-jni
-&lt;ndk_root&gt;/ndk-build
-</pre>
-    </li>
-
-    <li>Build and install the application as you would a normal Android application. If you are
-    using Eclipse, run the application to build and install it on a device. If you are using Ant,
-    run the following commands from the project directory:
-      <pre class="no-pretty-print">
-ant debug
-adb install bin/HelloJni-debug.apk
-</pre>
-    </li>
-  </ol>
-
-  <p>When you run the application on the device, the string <code>Hello JNI</code> should appear on
-  your device. You can explore the rest of the samples that are located in the
-  <code>&lt;ndk-root&gt;/samples</code> directory for more examples on how to use the JNI.</p>
-
-
-
-  <h4 id="native-activity">Exploring the native-activity Sample Application</h4>
-
-  <p>The native-activity sample provided with the Android NDK demonstrates how to use the
-  android_native_app_glue static library. This static library makes creating a native activity
-  easier by providing you with an implementation that handles your callbacks in another thread, so
-  you do not have to worry about them blocking your main UI thread. The main parts of the sample
-  are described below:</p>
-
-  <ul>
-    <li>The familiar basic structure of an Android application (an <code>AndroidManifest.xml</code>
-    file, a <code>src/</code> and <code>res</code> directories). The AndroidManifest.xml declares
-    that the application is native and specifies the .so file of the native activity. See {@link
-    android.app.NativeActivity} for the source or see the
-    <code>&lt;ndk_root&gt;/platforms/samples/native-activity/AndroidManifest.xml</code> file.</li>
-
-    <li>A <code>jni/</code> directory contains the native activity, main.c, which uses the
-    <code>android_native_app_glue.h</code> interface to implement the activity. The Android.mk that
-    describes the native module to the build system also exists here.</li>
-  </ul>
-
-  <p>To build this sample application:</p>
-
-  <ol>
-    <li>Create a new project in Eclipse from the existing sample source or use the
-    <code>android</code> tool to update the project so it generates a build.xml file that you can
-    use to build the sample.
-
-      <ul>
-        <li>In Eclipse:
-
-          <ol type="a">
-            <li>Click <strong>File &gt; New Android Project...</strong></li>
-
-            <li>Select the <strong>Create project from existing source</strong> radio button.</li>
-
-            <li>Select any API level above Android 2.3.</li>
-
-            <li>In the <strong>Location</strong> field, click <strong>Browse...</strong> and select
-            the <code>&lt;ndk-root&gt;/samples/native-activity</code> directory.</li>
-
-            <li>Click <strong>Finish</strong>.</li>
-          </ol>
-        </li>
-
-        <li>On the command line:
-
-          <ol type="a">
-            <li>Change to the <code>&lt;ndk-root&gt;/samples/native-activity</code> directory.</li>
-
-            <li>Run the following command to generate a build.xml file:
-              <pre class="no-pretty-print">
-android update project -p . -s
-</pre>
-            </li>
-          </ol>
-        </li>
-      </ul>
-    </li>
-
-    <li>Compile the native code using the <code>ndk-build</code> command.
-      <pre class="no-pretty-print">
-cd &lt;ndk-root&gt;/platforms/samples/android-9/samples/native-activity
-&lt;ndk_root&gt;/ndk-build
-</pre>
-    </li>
-
-    <li>Build and install the application as you would a normal Android application. If you are
-    using Eclipse, run the application to build and install it on a device. If you are using Ant,
-    run the following commands in the project directory, then run the application on the device:
-      <pre class="no-pretty-print">
-ant debug
-adb install bin/NativeActivity-debug.apk
-</pre>
-    </li>
-  </ol>
+  <a class="dac-hero-cta" href="{@docRoot}ndk/index.html">
+     <span class="dac-sprite dac-auto-chevron"></span> NDK Documentation and Downloads</a>
diff --git a/docs/html/tools/support-library/features.jd b/docs/html/tools/support-library/features.jd
index 573baad..926578a 100644
--- a/docs/html/tools/support-library/features.jd
+++ b/docs/html/tools/support-library/features.jd
@@ -22,6 +22,8 @@
       <li><a href="#v8">v8 Support Library</a></li>
       <li><a href="#v13">v13 Support Library</a></li>
       <li><a href="#v17-leanback">v17 Leanback Library</a></li>
+      <li><a href="#annotations">Annotations Support Library</a></li>
+      <li><a href="#design">Design Support Library</a></li>
     </ol>
 
     <h2>See also</h2>
@@ -131,11 +133,11 @@
   API reference.
 </p>
 
-<p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v4/} directory after
-  you download the Android Support Libraries. The library does not contain user interface
-  resources. To include it in your application project, follow the instructions for
-  <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
-  resources</a>.</p>
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v4/} directory. The library does not contain user
+interface resources. To include it in your application project, follow the instructions for
+<a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
+resources</a>.</p>
 
 <p class="caution"><strong>Caution:</strong> Using dynamic dependencies, especially for higher version
 numbers, can cause unexpected version updates and regression incompatibilities.</p>
@@ -158,10 +160,11 @@
 </p>
 
 <p>
-  This library is located in the {@code &lt;sdk&gt;/extras/android/support/multidex/} directory
-  after you download the Android Support Libraries. The library does not contain user interface
-  resources. To include it in your application project, follow the instructions for <a href=
-  "{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
+  After you download the Android Support Libraries, this library is located in the
+  {@code &lt;sdk&gt;/extras/android/support/multidex/} directory. The library does not contain
+  user interface resources. To include it in your application project, follow the instructions
+  for
+  <a href= "{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
   resources</a>.
 </p>
 
@@ -218,11 +221,11 @@
   </li>
 </ul>
 
-<p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v7/appcompat/}
-  directory after you download the Android Support Libraries. The library contains user
-  interface resources. To include it in your application project, follow the instructions for
-  <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with
-  resources</a>.</p>
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v7/appcompat/} directory. The library contains user
+interface resources. To include it in your application project, follow the instructions for
+<a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with
+resources</a>.</p>
 
 <p>The Gradle build script dependency identifier for this library is as follows:</p>
 
@@ -239,9 +242,8 @@
 on any app. These cards are useful for material design
 implementations, and are used extensively in layouts for TV apps.</p>
 
-<p>This library is located in the
-{@code &lt;sdk&gt;/extras/android/support/v7/cardview/} directory after you
-download the Android Support Libraries. The library contains user interface
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v7/cardview/} directory. The library contains user interface
 resources. To include it in your application project, follow the instructions
 for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding
 libraries with resources</a>.</p>
@@ -256,13 +258,14 @@
 
 <h3 id="v7-gridlayout">v7 gridlayout library</h3>
 
-<p>This library adds support for the {@link android.support.v7.widget.GridLayout} class, which
-  allows you to arrange user interface elements using a grid of rectangular cells.
-  For detailed information about the v7 gridlayout library APIs, see the
-  {@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p>
+<p>After you download the Android Support Libraries, this library adds support for the
+{@link android.support.v7.widget.GridLayout} class, which
+allows you to arrange user interface elements using a grid of rectangular cells.
+For detailed information about the v7 gridlayout library APIs, see the
+{@link android.support.v7.widget android.support.v7.widget} package in the API reference.</p>
 
 <p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v7/gridlayout/}
-  directory after you download the Android Support Libraries. The library contains user
+  directory . The library contains user
   interface resources. To include it in your application project, follow the instructions for
   <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries with
   resources</a>.</p>
@@ -323,12 +326,11 @@
 from an album cover, and use those colors to build a color-coordinated song
 title card.</p>
 
-<p>This library is located in the
-{@code &lt;sdk&gt;/extras/android/support/v7/palette/} directory after
-  you download the Android Support Libraries. The library does not contain user interface
-  resources. To include it in your application project, follow the instructions for
-  <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
-  resources</a>.</p>
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v7/palette/} directory. The library does not contain
+user interface resources. To include it in your application project, follow the instructions for
+<a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
+resources</a>.</p>
 
 <p>The Gradle build script dependency identifier for this library is as follows:</p>
 
@@ -346,10 +348,9 @@
 widget</a>, a view for efficiently displaying large data sets by providing a
 limited window of data items.</p>
 
-<p>This library is located in the
-{@code &lt;sdk&gt;/extras/android/support/v7/recyclerview/} directory after you
-download the Android Support Libraries. The library contains user interface
-resources. To include it in your application project, follow the instructions
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v7/recyclerview/} directory. The library contains
+user interface resources. To include it in your application project, follow the instructions
 for <a href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding
 libraries with resources</a>.</p>
 
@@ -363,6 +364,12 @@
 
 <h2 id="v8">v8 Support Library</h2>
 
+<p>This library is designed to be used with Android 2.2 (API level 8) and higher.
+  This library provides specific feature sets and can be included in your application
+  independently from other libraries.</p>
+
+<h3 id="v8-renderscript">v8 renderscript library</h3>
+
 <p>This library is designed to be used with Android (API level 8) and higher. It adds support for
   the <a href="{@docRoot}guide/topics/renderscript/compute.html">RenderScript</a> computation
   framework. These APIs are included in the {@link android.support.v8.renderscript} package. You
@@ -374,9 +381,20 @@
 
 <p class="note">
   <strong>Note:</strong> Use of RenderScript with the support library is supported with Android
-  Studio and Gradle-based builds, as well as the Eclipse plugin and Ant build tools.
+  Studio and Gradle-based builds, as well as the Eclipse plugin and Ant build tools. The
+  renderscript library is located in the <code>build-tools/$VERSION/renderscript/</code> folder. 
 </p>
 
+<p>The following example shows the Gradle build script properties for this library:</p>
+
+<pre>
+defaultConfig {
+    renderscriptTargetApi 18
+    renderscriptSupportModeEnabled true
+}
+</pre>
+
+
 
 <h2 id="v13">v13 Support Library</h2>
 
@@ -389,11 +407,11 @@
   android.support.v13} package in the API reference.
 </p>
 
-<p>This library is located in the {@code &lt;sdk&gt;/extras/android/support/v13/} directory after
-  you download the Android Support Libraries. The library does not contain user interface
-  resources. To include it in your application project, follow the instructions for
-  <a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
-  resources</a>.</p>
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v13/} directory. The library does not contain user
+interface resources. To include it in your application project, follow the instructions for
+<a href="{@docRoot}tools/support-library/setup.html#libs-without-res">Adding libraries without
+resources</a>.</p>
 
 <p>The Gradle build script dependency identifier for this library is as follows:</p>
 
@@ -429,9 +447,8 @@
     into a {@link android.support.v17.leanback.app.RowsFragment}.</li>
 </ul>
 
-<p>This library is located in the
-{@code &lt;sdk&gt;/extras/android/support/v17/leanback} directory after
-you download the Android Support Libraries. For more information
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/v17/leanback} directory. For more information
 on how to set up your project, follow the instructions in <a
 href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries
 with resources</a>. </p>
@@ -444,3 +461,48 @@
 
 
 
+<h2 id="annotations">Annotations Support Library</h2>
+
+<p>The <a href="{@docRoot}reference/android/support/annotation/package-summary.html">Annotation</a>
+package provides APIs to support adding annotation metadata to your apps. </p>
+
+<p></p>
+
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/annotations} directory. For more information
+on how to set up your project, follow the instructions in <a
+href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries
+with resources</a>. </p>
+
+<p>The Gradle build script dependency identifier for this library is as follows:</p>
+
+<pre>
+com.android.support:support-annotations:22.0.0
+</pre>
+
+
+
+<h2 id="design">Design Support Library</h2>
+
+<p>The
+<a href="{@docRoot}reference/android/support/design/package-summary.html">Design</a> package
+provides APIs to support adding material design components and patterns to your apps. </p>
+
+<p>The Design Support library adds support for various material design components and patterns for
+app developers to build upon, such as navigation drawers, floating action buttons (<i>FAB</i>),
+snackbars, and <a href="{@docRoot}design/building-blocks/tabs.html">tabs</a>.  </p>
+
+
+<p>After you download the Android Support Libraries, this library is located in the
+{@code &lt;sdk&gt;/extras/android/support/design} directory. For more information
+on how to set up your project, follow the instructions in <a
+href="{@docRoot}tools/support-library/setup.html#libs-with-res">Adding libraries
+with resources</a>. </p>
+
+<p>The Gradle build script dependency identifier for this library is as follows:</p>
+
+<pre>
+com.android.support:support-design:22.0.0
+</pre>
+
+
diff --git a/docs/html/tools/support-library/index.jd b/docs/html/tools/support-library/index.jd
index 98c9ad5..5688d8a 100644
--- a/docs/html/tools/support-library/index.jd
+++ b/docs/html/tools/support-library/index.jd
@@ -62,10 +62,183 @@
 <div class="toggle-content opened">
   <p id="rev21"><a href="#" onclick="return toggleContent(this)">
     <img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-content-img" alt=""
-/>Android Support Library, revision 22.1.0</a> <em>(April 2015)</em>
+/>Android Support Library, revision 22.2.0</a> <em>(May 2015)</em>
   </p>
   <div class="toggle-content-toggleme">
     <dl>
+      <dt>Added <a href="features.html#design">Design Support library:</a></dt>
+      <dd>
+        <ul>
+          <li>Added {@link android.support.design.widget.TextInputLayout} for showing
+            {@link android.widget.EditText} hint and error text as floating labels.
+          </li>
+          <li>Added {@link android.support.design.widget.FloatingActionButton} for implementing a
+            primary action on your interface as a
+            floating action button, supporting either default or mini sizes.
+          </li>
+          <li>Added {@link android.support.design.widget.Snackbar} for providing lightweight
+            feedback with an optional action in an animated snackbar.
+          </li>
+          <li>Added {@link android.support.design.widget.TabLayout} for implementing fixed and
+            scrollable
+           <a href="{@docRoot}design/building-blocks/tabs.html">tabs</a> as well as easy
+             integration with
+             {@link android.support.v4.view.ViewPager}.
+          </li>
+          <li>Added {@link android.support.design.widget.NavigationView} for implementing
+            <a href="{@docRoot}design/patterns/navigation-drawer.html">navigation drawer</a>
+             contents, including the ability to inflate menu items via a
+             <a href="{@docRoot}guide/topics/resources/menu-resource.html">Menu Resource</a>.
+          </li>
+          <li>Added {@link android.support.design.widget.CoordinatorLayout}, a general purpose
+            layout, used for building dependencies between
+            sibling views and allowing easy scrolling reactions between components via
+            {@link android.support.design.widget.CoordinatorLayout.Behavior}. Many of the Design
+            Library components rely on being a child of a
+            {@link android.support.design.widget.CoordinatorLayout}.
+          </li>
+          <li>Added {@link android.support.design.widget.AppBarLayout}, a container for a
+            {@link android.widget.Toolbar}
+            and other views (such as {@link android.support.design.widget.TabLayout}) for
+            reacting to scrolling events by scrolling off the screen, becoming visible in reaction
+            to a downward scroll, or collapsing/uncollapsing before scrolling off/onto the screen.
+          </li>
+          <li>Added {@link android.support.design.widget.CollapsingToolbarLayout} for controlling
+            how a {@link android.widget.Toolbar} collapses. A toolbar may collapse by:
+            pinning components to the top of the screen while it collapses, introducing
+            parallax scrolling of components such as an {@link android.widget.ImageView},
+            or adding a content scrim color when the view is partially collapsed.
+          </li>
+       </ul>
+      </dt>
+
+
+
+      <dt>Changes for <a href="features.html#v4">v4 support library:</a></dt>
+      <dd>
+         <ul>
+
+          <li>Added the
+{@link android.support.v4.view.accessibility.AccessibilityEventCompat#getContentChangeTypes getContentChangeTypes()}
+            and
+{@link android.support.v4.view.accessibility.AccessibilityEventCompat#setContentChangeTypes setContentChangeTypes()}
+            methods and related change type
+            fields to the
+            {@link android.support.v4.view.accessibility.AccessibilityEventCompat}
+            class for accessibility event handling.
+          </li>
+          <li>Added the
+{@link android.support.v4.media.session.PlaybackStateCompat#getActiveQueueItemId getActiveQueueItemId()},
+{@link android.support.v4.media.session.PlaybackStateCompat#getCustomActions getCustomActions()},
+            and
+            {@link android.support.v4.media.session.PlaybackStateCompat#getExtras getExtras()}
+            methods with related state fields to the
+            {@link android.support.v4.media.session.PlaybackStateCompat} class for
+            getting custom actions from the queue.
+          </li>
+          <li>Added the
+{@link android.support.v4.media.session.PlaybackStateCompat.Builder#addCustomAction addCustomAction()},
+{@link android.support.v4.media.session.PlaybackStateCompat.Builder#setActiveQueueItemId setActiveQueueItemId()},
+            and
+            {@link android.support.v4.media.session.PlaybackStateCompat.Builder#setExtras setExtras()}
+            methods to the
+            {@link android.support.v4.media.session.PlaybackStateCompat.Builder} class for adding
+            adding custom actions to a playback state.
+          </li>
+          <li>Added the
+{@link android.support.v4.media.session.PlaybackStateCompat.CustomAction#fromCustomAction fromCustomAction()} and
+{@link android.support.v4.media.session.PlaybackStateCompat.CustomAction#getCustomAction getCustomAction()} methods
+            to the
+            {@link android.support.v4.media.session.PlaybackStateCompat.CustomAction} class
+            for getting custom actions from the queue.
+          </li>
+          <li>Added the {@link android.support.v4.view.ViewCompat#isAttachedToWindow isAttachedToWindow()},
+            {@link android.support.v4.view.ViewCompat#offsetLeftAndRight offsetLeftAndRight()}, and
+            {@link android.support.v4.view.ViewCompat#offsetTopAndBottom offsetTopAndBottom()}
+            methods to the {@link android.support.v4.view.ViewCompat} class for working with views.
+          </li>
+          <li>Added the {@link android.support.v4.view.ViewPager#addOnPageChangeListener addOnPageChangeListener()},
+            {@link android.support.v4.view.ViewPager#clearOnPageChangeListeners clearOnPageChangeListeners()}, and
+            {@link android.support.v4.view.ViewPager#removeOnPageChangeListener removeOnPageChangeListener()}
+            methods to the {@link android.support.v4.view.ViewPager} class for responding to page
+            changes.
+            <p>Deprecated the
+            {@link android.support.v4.view.ViewPager#setOnPageChangeListener setOnPageChangeListener()} method.</p>
+          </li>
+          <li>Added the
+{@link android.support.v4.view.ViewParentCompat#notifySubtreeAccessibilityStateChanged notifySubtreeAccessibilityStateChanged()} method to
+            the {@link android.support.v4.view.ViewParentCompat} class for notifying a view parent
+            that the accessibility state of one of its descendants has changed.
+          </li>
+          <li>Added the {@link android.support.v4.view.ViewPropertyAnimatorCompat#translationZ translationZ()},
+            {@link android.support.v4.view.ViewPropertyAnimatorCompat#translationZBy translationZBy()},
+            {@link android.support.v4.view.ViewPropertyAnimatorCompat#z z()}, and
+            {@link android.support.v4.view.ViewPropertyAnimatorCompat#zBy zBy()}
+            methods to the {@link android.support.v4.view.ViewPropertyAnimatorCompat} class for
+            adding animation.
+          </li>
+       </ul>
+      </dd>
+
+
+
+<dt>Changes for <a href="features.html#v7-appcompat">v7 appcompat library</a>:</dt>
+      <dd>
+<ul>
+          <li>Added the
+            {@link android.support.v7.app.AppCompatActivity#onWindowStartingSupportActionMode onWindowStartingSupportActionMode()}
+            method to the
+            {@link android.support.v7.app.AppCompatActivity},
+            {@link android.support.v7.app.AppCompatCallback}, and
+            {@link android.support.v7.app.AppCompatDialog} classes for handling action modes
+            started from the current window.
+          </li>
+
+          <li>Added the
+{@link android.support.v7.app.AppCompatDelegate#isHandleNativeActionModesEnabled isHandleNativeActionModesEnabled()} and
+{@link android.support.v7.app.AppCompatDelegate#setHandleNativeActionModesEnabled setHandleNativeActionModesEnabled()}
+           methods to the
+           {@link android.support.v7.app.AppCompatDelegate} class for handling native action modes.
+          </li>
+       </ul>
+      </dd>
+
+
+    </dl>
+
+  </div>
+</div> <!-- end of collapsible section -->
+
+
+
+
+
+<div class="toggle-content closed">
+  <p id="rev21"><a href="#" onclick="return toggleContent(this)">
+    <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-content-img" alt=""
+/>Android Support Library, revision 22.1.0</a> <em>(April 2015)</em>
+  </p>
+
+
+
+  <div class="toggle-content-toggleme">
+    <dl>
+
+
+  <div class="toggle-content-toggleme">
+    <dl>
+      <dt>Changes for <a href="features.html#annotations">annotations library:</a></dt>
+      <dd>
+        <ul>
+          <li>Added the Annotations library to provide support for enhanced code inspections.
+            Annotations are added as metadata tags that you attach to variables, parameters,
+            and return values to inspect method return values, passed parameters, and local
+            variables and fields.
+          </li>
+        </ul>
+      </dd>
+
+
       <dt>Changes for <a href="features.html#v4">v4 support library:</a></dt>
       <dd>
         <ul>
@@ -132,7 +305,7 @@
          <li>Updated the {@link android.support.v4.view.accessibility.AccessibilityNodeInfoCompat}
           class to add methods for errors, content invalidation and labels.
          </li>
-         <li>Added the following interpolation classses for animation:
+         <li>Added the following interpolation classes for animation:
            {@link android.support.v4.view.animation.FastOutLinearInInterpolator},
            {@link android.support.v4.view.animation.FastOutSlowInInterpolator},
            {@link android.support.v4.view.animation.LinearOutSlowInInterpolator},
@@ -245,7 +418,7 @@
       </dd>
 
 
-      <dt>Changes for v8 renderscript library:</dt>
+      <dt>Changes for <a href="features.html#v8-renderscript">v8 renderscript library</a>:</dt>
       <dd>
         <ul>
           <li>Added the {@link android.support.v8.renderscript.ScriptIntrinsicHistogram} class for
@@ -643,7 +816,7 @@
         </ul>
       </dd>
 
-      <dt>Changes for v8 renderscript library:</dt>
+      <dt>Changes for <a href="features.html#v8-renderscript">v8 renderscript library</a></dt>
       <dd>
         <ul>
           <li>Added error propagation for the RenderScript thunking layer.</li>
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index 88a2674..f46dcaa 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -1,12 +1,10 @@
 <ul id="nav">
 
-
-<!-- Downloads menu-->
-
   <li class="nav-section">
-    <div class="nav-section-header"><a href="<?cs var:toroot?>sdk/index.html"><span class="en">Download</span></a></div>
+    <div class="nav-section-header"><a href="<?cs var:toroot
+?>sdk/index.html"><span class="en">Download</span></a></div>
     <ul>
-            <li><a href="<?cs var:toroot ?>sdk/installing/index.html">
+      <li><a href="<?cs var:toroot ?>sdk/installing/index.html">
           <span class="en">Installing the SDK</span></a></li>
 
       <li><a href="<?cs var:toroot ?>sdk/installing/adding-packages.html">
@@ -18,13 +16,15 @@
 <!-- Android Studio menu-->
 
  <li class="nav-section">
-    <div class="nav-section-header"><a href="<?cs var:toroot?>tools/studio/index.html"><span class="en">Android Studio</span></a></div>
-       <ul>
-         <li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html">Tips and Tricks</a> </li>
-       </ul>
+    <div class="nav-section-header">
+      <a href="<?cs var:toroot?>tools/studio/index.html">Android Studio</a>
+    </div>
+    <ul>
+      <li><a href="<?cs var:toroot ?>sdk/installing/studio-tips.html">
+          Tips and Tricks</a></li>
+    </ul>
 
- </li><!-- End of Android Studio Basics -->
-
+ </li><!-- End of Android Studio menu -->
 
 
 <!-- Workflow menu-->
@@ -70,6 +70,7 @@
           <li><a href="<?cs var:toroot ?>tools/building/building-cmdline.html">
             <span class="en">From the Command Line</span></a></li>
         </ul>
+      </li>
 
 
   <li class="nav-section">
@@ -81,8 +82,8 @@
             <a href="<?cs var:toroot?>tools/testing/testing_android.html">
             <span class="en">Fundamentals</span></a>
           </li>
-          <li><a href="<?cs var:toroot ?>tools/testing/testing_studio.html">
-            <span class="en">From Android Studio</span></a>
+          <li><a href="<?cs var:toroot ?>tools/testing/testing_eclipse.html">
+            <span class="en">From Eclipse</span></a>
           </li>
           <li><a href="<?cs var:toroot ?>tools/testing/testing_otheride.html">
             <span class="en">From Other IDEs</span></a>
@@ -143,14 +144,12 @@
         </ul>
       </li>
     </ul>
-  </li><!-- end of debugging -->
+  </li>
 
 
-
-<!-- Tool Help menu-->
-
   <li class="nav-section">
-    <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/index.html"><span class="en">Tools Help</span></a></div>
+    <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/help/index.html"><span
+class="en">Tools Help</span></a></div>
     <ul>
       <li><a href="<?cs var:toroot ?>tools/help/adb.html">adb</a></li>
       <li><a href="<?cs var:toroot ?>tools/help/android.html">android</a></li>
@@ -175,6 +174,7 @@
        <li><a href="<?cs var:toroot ?>tools/help/zipalign.html">zipalign</a></li>
     </ul>
   </li>
+
   </li><!-- end of tools help -->
 
 
@@ -194,10 +194,70 @@
       </ul>
   </li><!-- end of build system -->
 
+<!-- Performance Tools menu-->
+  <li class="nav-section">
+    <div class="nav-section-header">
+      <a href="<?cs var:toroot ?>tools/performance/index.html">Peformance Tools</a>
+    </div>
+    <ul>
+      <li><a href="<?cs var:toroot ?>tools/performance/debug-gpu-overdraw/index.html">
+        Overdraw Debugger</a>
+      </li>
+      <li><a href="<?cs var:toroot ?>tools/performance/profile-gpu-rendering/index.html">
+        Rendering Profiler</a>
+      </li>
+      <li class="nav-section">
+        <div class="nav-section-header">
+          <a href="<?cs var:toroot ?>tools/performance/hierarchy-viewer/index.html">
+          Hierarchy Viewer</a></div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>tools/performance/hierarchy-viewer/setup.html"><span
+            class="en">Setup</span></a>
+          </li>
+          <li><a href="<?cs var:toroot ?>tools/performance/hierarchy-viewer/profiling.html"><span
+            class="en">Profiling</span></a>
+          </li>
+        </ul>
+      </li>
+      <li class="nav-section">
+        <div class="nav-section-header">
+          <a href="<?cs var:toroot ?>tools/performance/comparison.html">
+          Memory Profilers</a></div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>tools/performance/memory-monitor/index.html"><span
+            class="en">Memory Monitor</span></a>
+          </li>
+          <li><a href="<?cs var:toroot ?>tools/performance/heap-viewer/index.html"><span
+            class="en">Heap Viewer</span></a>
+          </li>
+          <li><a href="<?cs var:toroot ?>tools/performance/allocation-tracker/index.html"><span
+            class="en">Allocation Tracker</span></a>
+          </li>
+        </ul>
+      </li>
+      <li><a href="<?cs var:toroot ?>tools/performance/traceview/index.html">
+        Traceview</a>
+      </li>
+      <li><a href="<?cs var:toroot ?>tools/performance/systrace/index.html">
+        Systrace</a>
+      </li>
+      <li class="nav-section">
+        <div class="nav-section-header">
+          <a href="<?cs var:toroot ?>tools/performance/batterystats-battery-historian/index.html">
+          Battery Profilers</a></div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>tools/performance/batterystats-battery-historian/charts.html"><span
+            class="en">Historian Charts</span></a>
+          </li>
+        </ul>
+      </li>
+    </ul>
+  </li><!-- End Performance Tools menu-->
+
   <!-- Testing Tools menu-->
 
   <li class="nav-section">
-    <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/testing/testing-tools.html""><span class="en">Testing Tools</span></a></div>
+    <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/testing/testing-tools.html"><span class="en">Testing Tools</span></a></div>
     <ul>
       <li class="nav-section">
          <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/testing-support-library/index.html"><span
@@ -234,6 +294,13 @@
     </ul>
   </li><!-- end of support library -->
 
+  <li class="nav-section">
+    <div class="nav-section-header"><a href="<?cs var:toroot ?>tools/data-binding/index.html"><span
+class="en">Data Binding Library</span></a></div>
+    <ul>
+      <li><a href="<?cs var:toroot ?>tools/data-binding/guide.html">Guide</a></li>
+    </ul>
+  </li><!-- end of support library -->
 
 
 <!-- Revision menu-->
@@ -245,10 +312,9 @@
       <li><a href="<?cs var:toroot ?>tools/revisions/studio.html">
         <span class="en">Android Studio</span>
       </a></li>
-      <li><a href="<?cs var:toroot ?>tools/revisions/sdk/tools-notes.html">
+      <li><a href="<?cs var:toroot ?>tools/sdk/tools-notes.html">
         <span class="en">SDK Tools</span>
       </a></li>
-      </a></li>
       <li><a href="<?cs var:toroot ?>tools/revisions/build-tools.html">
         <span class="en">SDK Build Tools</span>
       </a></li>
@@ -260,23 +326,15 @@
       <li><a href="<?cs var:toroot ?>tools/sdk/eclipse-adt.html">
         <span class="en">ADT Plugin</span></a></li>
     </ul>
-  </li><!-- end of revision -->
-
-
-
-<!-- NDK menu-->
+  </li>
 
   <li class="nav-section">
     <div class="nav-section-header empty">
-      <a href="<?cs var:toroot ?>tools/ndk/index.html">NDK</a>
+      <a href="<?cs var:toroot ?>tools/sdk/ndk/index.html">NDK</a>
     </div>
-  </li><!-- end of NDK -->
+  </li>
 
-
-
-<!-- ADK menu-->
-
-  <li class="nav-section">
+<!--  <li class="nav-section">
     <div class="nav-section-header">
     <a href="<?cs var:toroot ?>tools/adk/index.html">
       <span class="en">ADK</span></a>
@@ -285,8 +343,7 @@
       <li><a href="<?cs var:toroot ?>tools/adk/adk2.html">ADK 2012 Guide</a></li>
       <li><a href="<?cs var:toroot ?>tools/adk/adk.html">ADK 2011 Guide</a></li>
     </ul>
-  </li><!-- end of ADK -->
-
+  </li> -->
 
 
 <!-- Eclipse ADT menu-->
diff --git a/docs/html/training/auto/audio/index.jd b/docs/html/training/auto/audio/index.jd
index 56ec90a..f5a797c 100644
--- a/docs/html/training/auto/audio/index.jd
+++ b/docs/html/training/auto/audio/index.jd
@@ -21,6 +21,7 @@
       <li><a href="#config_manifest">Configure Your Manifest</a></li>
       <li><a href="#implement_browser">Build a Browser Service</a></li>
       <li><a href="#implement_callback">Implement Play Controls</a></li>
+      <li><a href="#support_voice">Support Voice Actions</a></li>
     </ol>
 
     <h2>Related Samples</h2>
@@ -28,6 +29,8 @@
     <ul>
       <li><a href="{@docRoot}samples/MediaBrowserService/index.html">
         MediaBrowserService</a></li>
+      <li><a href="//github.com/googlesamples/android-UniversalMusicPlayer">Universal Media
+      Player</a></li>
     </ul>
 
     <h2>See Also</h2>
@@ -58,7 +61,7 @@
   Drivers want to access their music and other audio content on the road. Audio books, podcasts,
   sports commentary, and recorded talks can make a long trip educational, inspirational, and
   enjoyable. The Android framework allows you to extend your audio app so users can listen to their
-  favorite tunes and audio content using a simpler, safer user interface.
+  favorite tunes and audio content using a simple, yet customizable user interface.
 </p>
 
 <p>
@@ -280,7 +283,7 @@
 <p class="note"><strong>Note:</strong> You should consider providing different content
 hierarchies depending on what client is making the query. In particular, Auto
 applications have strict limits on how large a menu they can display. This is
-intended to prevent distracting the driver, and to make it easy for the driver
+intended to minimize distracting the driver, and to make it easy for the driver
 to operate the app via voice commands. For more information on the Auto user
 experience restrictions, see the <a href="{@docRoot}shareables/auto/AndroidAuto-audio-apps.pdf">
 Auto Audio Apps</a> guidelines.</p>
@@ -383,7 +386,7 @@
 
 <pre>
 public void onCreate() {
-        super.onCreate();
+    super.onCreate();
 
     ...
     // Start a new MediaSession
@@ -426,6 +429,12 @@
 {@link android.media.session.MediaSession.Callback#onPause onPause()}, your
 app should resume playback.</dd>
 
+<p class="note">
+  <strong>Note:</strong> Google Play requires your app not to play music immediately when it
+  launches. For more information on this and other requirements, see
+<a href="{@docRoot}distribute/essentials/quality/auto.html">Auto App Quality</a>.
+</p>
+
 <dt>{@link android.media.session.MediaSession.Callback#onPlayFromMediaId
 onPlayFromMediaId()}</dt>
 <dd>Invoked when the user chooses to play a specific item. The method is passed
@@ -470,3 +479,196 @@
 <a href="{@docRoot}guide/topics/media/mediaplayer.html">Media Playback</a>,
 <a href="{@docRoot}training/managing-audio/index.html">Managing Audio Playback</a>, and
 <a href="{@docRoot}guide/topics/media/exoplayer.html">ExoPlayer</a>.</p>
+
+
+<h2 id="support_voice">Support Voice Actions</h2>
+
+<p>To reduce driver distractions, you can add voice actions in your audio playback app. With voice
+action support, users can launch your app and play audio by providing voice input on Auto screens.
+If your audio playback app is already active and the user says
+<i>“Play a song”</i>, the system starts playing music without requiring the user to look at or touch
+the screen.</p>
+
+<h3 id="enable_playback">Enable your app to handle audio playback requests</h3>
+
+<p>Enable your audio app to launch with a voice command such as <i>"Play [search query] on
+[your app name]"</i> by adding the following entry in your manifest:</p>
+
+<pre>
+&lt;activity>
+    &lt;intent-filter>
+        &lt;action android:name=
+             "android.media.action.MEDIA_PLAY_FROM_SEARCH" />
+        &lt;category android:name=
+             "android.intent.category.DEFAULT" />
+    &lt;/intent-filter>
+&lt;/activity>
+</pre>
+
+<p>When the user says <i>“Play music on [your app name]”</i> on an Auto screen, Auto
+attempts to launch your app and play audio by calling your app’s
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>MediaSession.Callback.onPlayFromSearch()</code></a>
+method. If the user has not specified criteria such as a track name or music genre, the
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>MediaSession.Callback.onPlayFromSearch()</code></a>
+method receives an empty query parameter. Your app should respond by immediately playing audio, such
+as a song from a random queue or the most recent playlist.
+</p>
+
+<h3 id="parse_voice">Parse the voice query to build the playback queue</h3>
+
+<p>When a user searches for a specific criteria, such as <i>“Play jazz on [your app name]”</i>
+or <i>“Listen to [song title]”</i>, the
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>onPlayFromSearch()</code></a>
+callback method receives the voice search results in the query parameter and an extras bundle. For
+more information on how to handle search queries to play audio content, see
+<a href="https://developer.android.com/guide/components/intents-common.html#PlaySearch">Play music
+based on a search query</a>.
+</p>
+
+<p>To parse the voice search query to play back audio content in your app, follow these steps:</p>
+
+<ol>
+  <li>Use the extras bundle and search query string returned from the voice search to filter
+  results.</li>
+  <li>Build the audio content queue based on these results.</li>
+  <li>Play the audio content.</li>
+</ol>
+
+<p>The
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>onPlayFromSearch()</code></a>
+method takes an extras parameter with more detailed information from the voice search.
+These extras help you find the audio content in your app for playback. If the search results are
+unable to provide this data, you can implement logic to parse the raw search query and play the
+appropriate tracks based on the query.
+</p>
+
+<p>The following extras are supported in Android Auto:</p>
+
+<ul>
+  <li><a href="{@docRoot}reference/android/provider/MediaStore.html#EXTRA_MEDIA_ALBUM"><code>android.intent.extra.album</code></a></li>
+  <li><a href="{@docRoot}reference/android/provider/MediaStore.html#EXTRA_MEDIA_ARTIST"><code>android.intent.extra.artist</code></a></li>
+  <li><a href="{@docRoot}reference/android/provider/MediaStore.html#EXTRA_MEDIA_GENRE"><code>android.intent.extra.genre</code></a></li>
+  <li><a href="{@docRoot}reference/android/provider/MediaStore.html#EXTRA_MEDIA_PLAYLIST"><code>android.intent.extra.playlist</code></a></li>
+  <li><a href="{@docRoot}reference/android/provider/MediaStore.html#EXTRA_MEDIA_TITLE"><code>android.intent.extra.title</code></a></li>
+</ul>
+
+<p>The following snippet shows how to override the
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>onPlayFromSearch()</code></a>
+method in your
+<a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html"><code>MediaSession.Callback</code></a>
+implementation to handle the search query and extras for playing audio content in your app:
+</p>
+
+<pre>
+&#64;Override
+public void onPlayFromSearch(String query, Bundle extras) {
+    if (TextUtils.isEmpty(query)) {
+        // The user provided generic string e.g. 'Play music'
+        // Build appropriate playlist queue
+    } else {
+        // Build a queue based on songs that match "query" or "extras" param
+        String mediaFocus = extras.getString(MediaStore.EXTRA_MEDIA_FOCUS);
+        if (TextUtils.equals(mediaFocus,
+                MediaStore.Audio.Artists.ENTRY_CONTENT_TYPE)) {
+            isArtistFocus = true;
+            artist = extras.getString(MediaStore.EXTRA_MEDIA_ARTIST);
+        } else if (TextUtils.equals(mediaFocus,
+                MediaStore.Audio.Albums.ENTRY_CONTENT_TYPE)) {
+            isAlbumFocus = true;
+            album = extras.getString(MediaStore.EXTRA_MEDIA_ALBUM);
+        }
+
+        // Implement additional "extras" param filtering
+    }
+
+    // Implement your logic to retrieve the queue
+    if (isArtistFocus) {
+        result = searchMusicByArtist(artist);
+    } else if (isAlbumFocus) {
+        result = searchMusicByAlbum(album);
+    }
+
+    if (result == null) {
+        // No focus found, search by query for song title
+        result = searchMusicBySongTitle(query);
+    }
+
+    if (result != null && !result.isEmpty()) {
+        // Immediately start playing from the beginning of the search results
+        // Implement your logic to start playing music
+        playMusic(result);
+    } else {
+        // Handle no queue found. Stop playing if the app
+        // is currently playing a song
+    }
+}
+</pre>
+
+<p class="note">
+  <strong>Note:</strong> To minimize driver distractions, immediately initiate audio content
+  playback in the
+  <a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlayFromSearch(java.lang.String, android.os.Bundle)"><code>onPlayFromSearch()</code></a>
+  method when you have generated the audio content queue based on the user's request.
+</p>
+
+<p>For a more detailed example on how to implement voice search to play audio content in your app,
+see the
+<a href="//github.com/googlesamples/android-UniversalMusicPlayer/">Universal Media Player</a>
+sample.
+</p>
+
+<h3 id="implement_playback_controls">Implement playback control actions</h3>
+
+<p>To provide a hands-free experience while users drive and listen to audio content in Android Auto,
+your app should allow users to control audio content playback with voice actions. When users speak
+commands such as <i>“Next song”</i>, <i>“Pause music”</i>, or <i>“Resume music”</i>, the system
+triggers the corresponding callback method where you implement the playback control action.
+</p>
+
+<p>To provide voice-enabled playback controls, first enable the hardware controls by setting these
+flags in your app’s
+<a href="{@docRoot}reference/android/media/session/MediaSession.html"><code>MediaSession</code></a>
+object:
+</p>
+
+<pre>
+mSession.setFlags(MediaSession.FLAG_HANDLES_MEDIA_BUTTONS |
+    MediaSession.FLAG_HANDLES_TRANSPORT_CONTROLS);
+</pre>
+
+<p>Then, implement the callback methods with the playback controls that you support in your app.
+Here’s a list of voice-enabled playback controls supported by Android Auto:
+</p>
+
+<table>
+  <tr>
+    <th>Example phrase</th>
+    <th>Callback method</th>
+  </tr>
+  <tr>
+    <td><i>"Next song"</i></td>
+    <td><a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onSkipToNext()"><code>onSkipToNext()</code></a></td>
+  </tr>
+  <tr>
+    <td><i>"Previous song"</i></td>
+    <td><a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onSkipToPrevious()"><code>onSkipToPrevious()</code></a></td>
+  </tr>
+  <tr>
+    <td><i>"Pause music"</i></td>
+    <td><a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPause()"><code>onPause()</code></a></td>
+  </tr>
+  <tr>
+    <td><i>"Stop music"</i></td>
+    <td><a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onStop()"><code>onStop()</code></a></td>
+  </tr>
+  <tr>
+    <td><i>"Resume music"</i></td>
+    <td><a href="{@docRoot}reference/android/media/session/MediaSession.Callback.html#onPlay()"><code>onPlay()</code></a></td>
+  </tr>
+</table>
+
+<p>For a more detailed example on how to implement voice-enabled playback actions in your app, see
+the
+<a href="//github.com/googlesamples/android-UniversalMusicPlayer/">Universal Media Player</a>
+sample.
+</p>
\ No newline at end of file
diff --git a/docs/html/training/auto/messaging/index.jd b/docs/html/training/auto/messaging/index.jd
index 7540a3f..0177c84 100644
--- a/docs/html/training/auto/messaging/index.jd
+++ b/docs/html/training/auto/messaging/index.jd
@@ -52,9 +52,8 @@
 
 <p>
   Staying connected through messages is important to many drivers. Chat apps can let users
-  know if a child need to be picked up, or if a dinner location has been changed. Apps that provide
-  sports information might tell the user who just won the big game, and let the user ask questions
-  about other games being played. The Android framework enables messaging apps to extend their
+  know if a child need to be picked up, or if a dinner location has been changed.
+  The Android framework enables messaging apps to extend their
   services into car dashboards using a standard user interface that lets drivers keep their eyes
   on the road.
 </p>
@@ -79,7 +78,7 @@
 
 <p>
   Messaging apps do not run directly on the Android dashboard hardware. They are installed on
-  separate, Android mobile device. When the mobile device is plugged into a dashboard,
+  a separate Android mobile device. When the mobile device is plugged into a dashboard,
   the installed messaging apps can offer services for viewing and responding to messages
   through the Auto user interface.
 </p>
@@ -98,7 +97,7 @@
     has read or replied to a message.
 </ul>
 
-<h3 id="#concepts">Concepts and Objects</h3>
+<h3 id="concepts">Concepts and objects</h3>
 
 <p>Before you start designing your app, it's helpful to understand how Auto
 handles messaging.</p>
@@ -106,23 +105,19 @@
 <p>Each individual chunk of communication is a <em>message</em>. A message is a
 short length of text, suitable for the Auto device to read aloud. In a chat app,
 this might be a single message from one person to another: <code>"Fitzy -- Jane
-can't come to the ball, her youngest has the croup. :-( --Liz"</code> In a
-sports app, a message might be a single bit of news about a game: <code>"Granger
-scores for Harpies at 7 minutes in."</code></p>
+can't come to the ball, her youngest has the croup. :-( --Liz"</code>.</p>
 
 <p>A <em>conversation</em> is a group of messages that are all grouped together
 in some way. Auto uses the conversation information to group the messages
 together when presenting them to the user. In a chat app, a conversation might
 be all the messages between the user and another person (for example, all
-the messages back and forth between Darcy and Elizabeth). In a sports app, a
-conversation might be all the messages about a particular game. Every message
+the messages back and forth between Darcy and Elizabeth). Every message
 belongs to a conversation, even if it's the only message in that conversation.
 Each conversation has a <em>conversation name</em>.
 The conversation name is used by Android Auto to
 present the messages; it's up to your app to choose an appropriate conversation
 name. In a chat app, the conversation name is usually the person your user is
-talking to.
-In a sports app, this might be the name of the teams playing in the game.</p>
+talking to.</p>
 
 <p>The v4 support library defines an {@link
 android.support.v4.app.NotificationCompat.CarExtender.UnreadConversation
@@ -177,9 +172,7 @@
 <li>If the user sends a reply, Auto triggers the app's "message reply" intent and
 attaches a transcript of the user's response.  The app can take appropriate
 action, based on the app's logic. For example, a chat app might interpret the
-reply as a message to go to the other conversation participants, while a sports
-app might try to interpret the "reply" as a request for other information
-("What's the score in the Sharks game?").</li>
+reply as a message to go to the other conversation participants.</li>
 
 </ol>
 
diff --git a/docs/html/training/index.jd b/docs/html/training/index.jd
index 44b6747..3e0d593 100644
--- a/docs/html/training/index.jd
+++ b/docs/html/training/index.jd
@@ -12,18 +12,19 @@
     essentials for Android app development. If you're a new Android app developer, you should
     complete each of these classes in order.</p>
 
-<div>
-<div style="float:left; width:40%; margin-right:30px">
-
-    <p>If you prefer to learn through interactive video training,
-    check out this trailer for a course about the fundamentals of Android development.</p>
-    <p><a href="https://www.udacity.com/course/ud853" class="button">
-    Start the video course</a></p>
-</div>
-
-<div style="float:left; margin-bottom:20px">
-    <iframe width="300" height="169" src="//www.youtube.com/embed/LfVBFFoy9Y0?utm_source=dac&utm_medium=video&utm_content=andfuntrain&utm_campaign=udacint?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe>
-</div>
+<div class="wrap">
+  <div class="cols">
+    <div class="col-1of2">
+      <p>If you prefer to learn through interactive video training,
+      check out this trailer for a course about the fundamentals of Android development.</p>
+      <p><a href="https://www.udacity.com/course/ud853" class="button">
+        Start the video course</a>
+      </p>
+    </div>
+    <div class="col-1of2">
+      <iframe width="300" height="169" src="//www.youtube.com/embed/LfVBFFoy9Y0?utm_source=dac&utm_medium=video&utm_content=andfuntrain&utm_campaign=udacint?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe>
+    </div>
+  </div>
 </div>
 
 <div style="clear:left"></div>
diff --git a/docs/html/training/run-background-service/create-service.jd b/docs/html/training/run-background-service/create-service.jd
index 5f4799c..9b9fcd2 100644
--- a/docs/html/training/run-background-service/create-service.jd
+++ b/docs/html/training/run-background-service/create-service.jd
@@ -55,8 +55,8 @@
     </li>
 </ul>
 <p>
-    However, in most cases an {@link android.app.IntentService} is the preferred way to simple
-    background operations.
+    However, in most cases an {@link android.app.IntentService} is the preferred way to perform
+    simple background operations.
 </p>
 <p>
     This lesson shows you how to create your own subclass of {@link android.app.IntentService}.
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index cefff81..535a87e 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -1654,20 +1654,11 @@
     </ul>
   </li> <!-- end of Background Jobs -->
 
-  <li class="nav-section">
-    <div class="nav-section-header">
-      <a href="<?cs var:toroot ?>training/best-performance.html">
-      <span class="small">Best Practices for</span><br/>
-              Performance
-      </a>
-    </div>
-    <ul>
-
       <li>
         <a href="<?cs var:toroot ?>training/articles/memory.html"
-           description=
-           "How to keep your app's memory footprint small in order to improve performance
-           on a variety of mobile devices."
+          description=
+          "How to keep your app's memory footprint small in order to improve performance
+          on a variety of mobile devices."
           >Managing Your App's Memory</a>
       </li>
 
diff --git a/docs/image_sources/preview/features/app-permissions-screen-orig.png b/docs/image_sources/preview/features/app-permissions-screen-orig.png
new file mode 100644
index 0000000..1868c7a
--- /dev/null
+++ b/docs/image_sources/preview/features/app-permissions-screen-orig.png
Binary files differ
diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
index 28c26ff..b8f64a4 100644
--- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java
@@ -31,6 +31,7 @@
 import android.util.ArrayMap;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.View;
 
 import com.android.internal.R;
 
@@ -200,7 +201,7 @@
     }
 
     @Override
-    public boolean onLayoutDirectionChange(int layoutDirection) {
+    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
         return mAnimatedVectorState.mVectorDrawable.setLayoutDirection(layoutDirection);
     }
 
diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java
index 22ff3e74..e8e4664 100644
--- a/graphics/java/android/graphics/drawable/Drawable.java
+++ b/graphics/java/android/graphics/drawable/Drawable.java
@@ -276,7 +276,7 @@
     public void setDither(boolean dither) {}
 
     /**
-     * @return whether this drawable dither its colors
+     * @return whether this drawable dithers its colors
      * @see #setDither(boolean)
      */
     public boolean getDither() {
@@ -295,7 +295,7 @@
      * @return whether this drawable filters its bitmap
      * @see #setFilterBitmap(boolean)
      */
-    public boolean getFilterBitmap() {
+    public boolean isFilterBitmap() {
         return false;
     }
 
@@ -444,7 +444,7 @@
     public final boolean setLayoutDirection(@View.ResolvedLayoutDir int layoutDirection) {
         if (mLayoutDirection != layoutDirection) {
             mLayoutDirection = layoutDirection;
-            return onLayoutDirectionChange(layoutDirection);
+            return onLayoutDirectionChanged(layoutDirection);
         }
         return false;
     }
@@ -457,7 +457,7 @@
      *         the drawable to change and it needs to be re-drawn
      * @see #setLayoutDirection(int)
      */
-    public boolean onLayoutDirectionChange(@View.ResolvedLayoutDir int layoutDirection) {
+    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
         return false;
     }
 
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 4a06805..8b801c3 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -31,6 +31,7 @@
 import android.os.SystemClock;
 import android.util.LayoutDirection;
 import android.util.SparseArray;
+import android.view.View;
 
 import java.util.Collection;
 
@@ -337,7 +338,7 @@
     }
 
     @Override
-    public boolean onLayoutDirectionChange(int layoutDirection) {
+    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
         // Let the container handle setting its own layout direction. Otherwise,
         // we're accessing potentially unused states.
         return mDrawableContainerState.setLayoutDirection(layoutDirection, getCurrentIndex());
diff --git a/graphics/java/android/graphics/drawable/DrawableWrapper.java b/graphics/java/android/graphics/drawable/DrawableWrapper.java
index bd8eae0..58d43f9 100644
--- a/graphics/java/android/graphics/drawable/DrawableWrapper.java
+++ b/graphics/java/android/graphics/drawable/DrawableWrapper.java
@@ -258,7 +258,7 @@
     }
 
     @Override
-    public boolean onLayoutDirectionChange(@View.ResolvedLayoutDir int layoutDirection) {
+    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
         return mDrawable != null && mDrawable.setLayoutDirection(layoutDirection);
     }
 
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java
index e5b4612..5c00a23 100644
--- a/graphics/java/android/graphics/drawable/LayerDrawable.java
+++ b/graphics/java/android/graphics/drawable/LayerDrawable.java
@@ -1662,7 +1662,7 @@
     }
 
     @Override
-    public boolean onLayoutDirectionChange(int layoutDirection) {
+    public boolean onLayoutDirectionChanged(@View.ResolvedLayoutDir int layoutDirection) {
         boolean changed = false;
 
         final ChildDrawable[] array = mLayerState.mChildren;
diff --git a/keystore/java/android/security/KeyStoreParameter.java b/keystore/java/android/security/KeyStoreParameter.java
index 174e03f..66c87ed 100644
--- a/keystore/java/android/security/KeyStoreParameter.java
+++ b/keystore/java/android/security/KeyStoreParameter.java
@@ -19,7 +19,6 @@
 import android.annotation.NonNull;
 import android.app.KeyguardManager;
 import android.content.Context;
-import android.security.keystore.KeyGenParameterSpec;
 import android.security.keystore.KeyProtection;
 
 import java.security.KeyPairGenerator;
@@ -49,28 +48,14 @@
  */
 @Deprecated
 public final class KeyStoreParameter implements ProtectionParameter {
-    private final Context mContext;
     private final int mFlags;
 
     private KeyStoreParameter(
-            Context context,
             int flags) {
-        if (context == null) {
-            throw new IllegalArgumentException("context == null");
-        }
-
-        mContext = context;
         mFlags = flags;
     }
 
     /**
-     * Gets the Android context used for operations with this instance.
-     */
-    public Context getContext() {
-        return mContext;
-    }
-
-    /**
      * @hide
      */
     public int getFlags() {
@@ -115,7 +100,6 @@
      */
     @Deprecated
     public final static class Builder {
-        private final Context mContext;
         private int mFlags;
 
         /**
@@ -128,7 +112,6 @@
             if (context == null) {
                 throw new NullPointerException("context == null");
             }
-            mContext = context;
         }
 
         /**
@@ -163,7 +146,6 @@
         @NonNull
         public KeyStoreParameter build() {
             return new KeyStoreParameter(
-                    mContext,
                     mFlags);
         }
     }
diff --git a/keystore/java/android/security/keystore/KeyGenParameterSpec.java b/keystore/java/android/security/keystore/KeyGenParameterSpec.java
index 1d4c188..d861302 100644
--- a/keystore/java/android/security/keystore/KeyGenParameterSpec.java
+++ b/keystore/java/android/security/keystore/KeyGenParameterSpec.java
@@ -743,7 +743,7 @@
          * <p>This restriction applies only to private key operations. Public key operations are not
          * restricted.
          *
-         * <p><b>NOTE: This has currently no effect.</b>
+         * <p><b>NOTE: This has currently no effect on asymmetric key pairs.</b>
          *
          * @see #setUserAuthenticationValidityDurationSeconds(int)
          */
@@ -759,7 +759,7 @@
          *
          * <p>By default, the user needs to authenticate for every use of the key.
          *
-         * <p><b>NOTE: This has currently no effect.</b>
+         * <p><b>NOTE: This has currently no effect on asymmetric key pairs.</b>
          *
          * @param seconds duration in seconds or {@code -1} if the user needs to authenticate for
          *        every use of the key.
diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp
index 223bdf0..d9b40ae 100644
--- a/libs/hwui/LayerRenderer.cpp
+++ b/libs/hwui/LayerRenderer.cpp
@@ -439,13 +439,6 @@
             renderer.translate(0.0f, bitmap->height());
             renderer.scale(1.0f, -1.0f);
 
-            mat4 texTransform(layer->getTexTransform());
-
-            mat4 invert;
-            invert.translate(0.0f, 1.0f);
-            invert.scale(1.0f, -1.0f, 1.0f);
-            layer->getTexTransform().multiply(invert);
-
             if ((error = glGetError()) != GL_NO_ERROR) goto error;
 
             {
@@ -459,7 +452,6 @@
                 if ((error = glGetError()) != GL_NO_ERROR) goto error;
             }
 
-            layer->getTexTransform().load(texTransform);
             status = true;
         }
 
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 54bcd7e..b3fb7ef 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -841,7 +841,7 @@
 }
 
 void OpenGLRenderer::drawTextureLayer(Layer* layer, const Rect& rect) {
-    bool snap = !layer->getForceFilter()
+    const bool tryToSnap = !layer->getForceFilter()
             && layer->getWidth() == (uint32_t) rect.getWidth()
             && layer->getHeight() == (uint32_t) rect.getHeight();
     Glop glop;
@@ -849,7 +849,7 @@
             .setMeshTexturedUvQuad(nullptr, Rect(0, 1, 1, 0)) // TODO: simplify with VBO
             .setFillTextureLayer(*layer, getLayerAlpha(layer))
             .setTransform(currentSnapshot()->getOrthoMatrix(), *currentTransform(), false)
-            .setModelViewMapUnitToRectOptionalSnap(snap, rect)
+            .setModelViewMapUnitToRectOptionalSnap(tryToSnap, rect)
             .setRoundRectClipState(currentSnapshot()->roundRectClipState)
             .build();
     renderGlop(glop);
@@ -865,7 +865,7 @@
         Blend::ModeOrderSwap modeUsage = swap ?
                 Blend::ModeOrderSwap::Swap : Blend::ModeOrderSwap::NoSwap;
         const Matrix4& transform = swap ? Matrix4::identity() : *currentTransform();
-        bool snap = !swap
+        const bool tryToSnap = !swap
                 && layer->getWidth() == static_cast<uint32_t>(rect.getWidth())
                 && layer->getHeight() == static_cast<uint32_t>(rect.getHeight());
         Glop glop;
@@ -873,7 +873,7 @@
                 .setMeshTexturedUvQuad(nullptr, layer->texCoords)
                 .setFillLayer(layer->getTexture(), layer->getColorFilter(), getLayerAlpha(layer), layer->getMode(), modeUsage)
                 .setTransform(currentSnapshot()->getOrthoMatrix(), transform, false)
-                .setModelViewMapUnitToRectOptionalSnap(snap, rect)
+                .setModelViewMapUnitToRectOptionalSnap(tryToSnap, rect)
                 .setRoundRectClipState(currentSnapshot()->roundRectClipState)
                 .build();
         renderGlop(glop);
@@ -1654,14 +1654,17 @@
             fmin(1.0f, src.right / texture->width),
             fmin(1.0f, src.bottom / texture->height));
 
-    int textureFillFlags = static_cast<int>((bitmap->colorType() == kAlpha_8_SkColorType)
+    const int textureFillFlags = static_cast<int>((bitmap->colorType() == kAlpha_8_SkColorType)
             ? TextureFillFlags::kIsAlphaMaskTexture : TextureFillFlags::kNone);
+    const bool tryToSnap = MathUtils::areEqual(src.getWidth(), dst.getWidth())
+            && MathUtils::areEqual(src.getHeight(), dst.getHeight());
+
     Glop glop;
     GlopBuilder(mRenderState, mCaches, &glop)
             .setMeshTexturedUvQuad(texture->uvMapper, uv)
             .setFillTexturePaint(*texture, textureFillFlags, paint, currentSnapshot()->alpha)
             .setTransform(currentSnapshot()->getOrthoMatrix(), *currentTransform(), false)
-            .setModelViewMapUnitToRectSnap(dst)
+            .setModelViewMapUnitToRectOptionalSnap(tryToSnap, dst)
             .setRoundRectClipState(currentSnapshot()->roundRectClipState)
             .build();
     renderGlop(glop);
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index 723a177..7dbe3b7 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -29,7 +29,7 @@
 bool Properties::debugOverdraw = false;
 bool Properties::showDirtyRegions = false;
 bool Properties::skipEmptyFrames = true;
-bool Properties::swapBuffersWithDamage = false;
+bool Properties::swapBuffersWithDamage = true;
 
 DebugLevel Properties::debugLevel = kDebugDisabled;
 OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default;
@@ -104,7 +104,7 @@
     }
 
     skipEmptyFrames = property_get_bool(PROPERTY_SKIP_EMPTY_DAMAGE, true);
-    swapBuffersWithDamage = property_get_bool(PROPERTY_SWAP_WITH_DAMAGE, false);
+    swapBuffersWithDamage = property_get_bool(PROPERTY_SWAP_WITH_DAMAGE, true);
 
     return (prevDebugLayersUpdates != debugLayersUpdates)
             || (prevDebugOverdraw != debugOverdraw)
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 9146b68..9e5ec28 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -83,8 +83,9 @@
  * display list. This function should remain in sync with the replay() function.
  */
 void RenderNode::output(uint32_t level) {
-    ALOGD("%*sStart display list (%p, %s%s%s%s)", (level - 1) * 2, "", this,
+    ALOGD("%*sStart display list (%p, %s%s%s%s%s)", (level - 1) * 2, "", this,
             getName(),
+            (MathUtils::isZero(properties().getAlpha()) ? ", zero alpha" : ""),
             (properties().hasShadow() ? ", casting shadow" : ""),
             (isRenderable() ? "" : ", empty"),
             (mLayer != nullptr ? ", on HW Layer" : ""));
diff --git a/libs/hwui/RenderProperties.cpp b/libs/hwui/RenderProperties.cpp
index 7b75690..07b8ce6 100644
--- a/libs/hwui/RenderProperties.cpp
+++ b/libs/hwui/RenderProperties.cpp
@@ -146,12 +146,12 @@
 
     const bool isLayer = effectiveLayerType() != LayerType::None;
     int clipFlags = getClippingFlags();
-    if (mPrimitiveFields.mAlpha < 1) {
+    if (mPrimitiveFields.mAlpha < 1
+            && !MathUtils::isZero(mPrimitiveFields.mAlpha)) {
         if (isLayer) {
             clipFlags &= ~CLIP_TO_BOUNDS; // bounds clipping done by layer
         }
 
-        LOG_ALWAYS_FATAL_IF(!isLayer && mPrimitiveFields.mHasOverlappingRendering);
         ALOGD("%*sScaleAlpha %.2f", level * 2, "", mPrimitiveFields.mAlpha);
     }
     if (clipFlags) {
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp
index d7c8316..df12e63 100644
--- a/libs/hwui/renderstate/RenderState.cpp
+++ b/libs/hwui/renderstate/RenderState.cpp
@@ -266,10 +266,10 @@
         mCaches->textureState().activateTexture(0);
 
         if (texture.clamp != GL_INVALID_ENUM) {
-            texture.texture->setWrap(texture.clamp, true);
+            texture.texture->setWrap(texture.clamp, true, false, texture.target);
         }
         if (texture.filter != GL_INVALID_ENUM) {
-            texture.texture->setFilter(texture.filter, true);
+            texture.texture->setFilter(texture.filter, true, false, texture.target);
         }
 
         mCaches->textureState().bindTexture(texture.target, texture.texture->id);
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index c0e7c73..cb34e00 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -256,7 +256,7 @@
 #endif
 
 #ifdef EGL_KHR_swap_buffers_with_damage
-    if (CC_UNLIKELY(Properties::swapBuffersWithDamage)) {
+    if (CC_LIKELY(Properties::swapBuffersWithDamage)) {
         SkIRect idirty;
         dirty.roundOut(&idirty);
         /*
@@ -273,11 +273,6 @@
         // layout: {x, y, width, height}
         EGLint rects[4] = { idirty.x(), y, idirty.width(), idirty.height() };
         EGLint numrects = dirty.isEmpty() ? 0 : 1;
-        // TODO: Remove prior to enabling this path by default
-        ALOGD("Swap buffers with damage %d: %d, %d, %d, %d (src="
-                RECT_STRING ")",
-                dirty.isEmpty() ? 0 : 1, rects[0], rects[1], rects[2], rects[3],
-                SK_RECT_ARGS(dirty));
         eglSwapBuffersWithDamageKHR(mEglDisplay, surface, rects, numrects);
     } else {
         eglSwapBuffers(mEglDisplay, surface);
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index 0030a39..ee6d661 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -47,10 +47,11 @@
  * at which content is rendered or produced. For instance a sound at a media sample rate of 8000Hz
  * can be played on a device operating at a sample rate of 48000Hz; the sample rate conversion is
  * automatically handled by the platform, it will not play at 6x speed.
- * (more to be added...)
  *
  * <h4 id="encoding">Encoding</h4>
- * <p>To Be Added... stay tuned
+ * <p>For PCM audio, audio encoding is used to describe the bit representation of an audio data
+ * sample; for example, the size as 8 bit, 16 bit, and the representation as integer or float.
+ * <br>For compressed formats, audio encoding is used to describe the compression scheme being used.
  *
  * <h4 id="channelMask">Channel mask</h4>
  * <p>Channel masks are used in <code>AudioTrack</code> and <code>AudioRecord</code> to describe
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index 6f28bf6..eec4960 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -23,6 +23,7 @@
 import android.graphics.Rect;
 import android.media.Image;
 import android.media.MediaCodecInfo;
+import android.media.MediaCodecInfo.CodecCapabilities;
 import android.media.MediaCodecList;
 import android.media.MediaCrypto;
 import android.media.MediaFormat;
@@ -42,204 +43,1307 @@
 import java.util.Map;
 
 /**
- * MediaCodec class can be used to access low-level media codec, i.e.
- * encoder/decoder components.
- *
- * <p>MediaCodec is generally used like this:
- * <pre>
- * MediaCodec codec = MediaCodec.createDecoderByType(type);
- * codec.configure(format, ...);
- * codec.start();
- *
- * // if API level <= 20, get input and output buffer arrays here
- * ByteBuffer[] inputBuffers = codec.getInputBuffers();
- * ByteBuffer[] outputBuffers = codec.getOutputBuffers();
- * for (;;) {
- *   int inputBufferIndex = codec.dequeueInputBuffer(timeoutUs);
- *   if (inputBufferIndex &gt;= 0) {
- *     // if API level >= 21, get input buffer here
- *     ByteBuffer inputBuffer = codec.getInputBuffer(inputBufferIndex);
- *     // fill inputBuffers[inputBufferIndex] with valid data
- *     ...
- *     codec.queueInputBuffer(inputBufferIndex, ...);
- *   }
- *
- *   int outputBufferIndex = codec.dequeueOutputBuffer(timeoutUs);
- *   if (outputBufferIndex &gt;= 0) {
- *     // if API level >= 21, get output buffer here
- *     ByteBuffer outputBuffer = codec.getOutputBuffer(outputBufferIndex);
- *     // outputBuffer is ready to be processed or rendered.
- *     ...
- *     codec.releaseOutputBuffer(outputBufferIndex, ...);
- *   } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
- *     // no needed to handle if API level >= 21 and using getOutputBuffer(int)
- *     outputBuffers = codec.getOutputBuffers();
- *   } else if (outputBufferIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
- *     // Subsequent data will conform to new format.
- *     // can ignore if API level >= 21 and using getOutputFormat(outputBufferIndex)
- *     MediaFormat format = codec.getOutputFormat();
- *     ...
- *   }
- * }
- * codec.stop();
- * codec.release();
- * codec = null;
- * </pre>
- *
- * Each codec maintains a number of input and output buffers that are
- * referred to by index in API calls.
- * <p>
- * For API levels 20 and below:
- * The contents of these buffers are represented by the ByteBuffer[] arrays
- * accessible through {@link #getInputBuffers} and {@link #getOutputBuffers}.
- * <p>
- * After a successful call to {@link #start} the client "owns" neither
- * input nor output buffers, subsequent calls to {@link #dequeueInputBuffer}
- * and {@link #dequeueOutputBuffer} then transfer ownership from the codec
- * to the client.<p>
- * The client is not required to resubmit/release buffers immediately
- * to the codec, the sample code above simply does this for simplicity's sake.
- * Nonetheless, it is possible that a codec may hold off on generating
- * output buffers until all outstanding buffers have been
- * released/resubmitted.
- * <p>
- * Once the client has an input buffer available it can fill it with data
- * and submit it it to the codec via a call to {@link #queueInputBuffer}.
- * Do not submit multiple input buffers with the same timestamp (unless
- * it is codec-specific data marked as such using the flag
- * {@link #BUFFER_FLAG_CODEC_CONFIG}).
- * <p>
- * The codec in turn will return an output buffer to the client in response
- * to {@link #dequeueOutputBuffer}. After the output buffer has been processed
- * a call to {@link #releaseOutputBuffer} will return it to the codec.
- * If a video surface has been provided in the call to {@link #configure},
- * {@link #releaseOutputBuffer} optionally allows rendering of the buffer
- * to the surface.<p>
- *
- * Input buffers (for decoders) and Output buffers (for encoders) contain
- * encoded data according to the format's type. For video types this data
- * is all the encoded data representing a single moment in time, for audio
- * data this is slightly relaxed in that a buffer may contain multiple
- * encoded frames of audio. In either case, buffers do not start and end on
- * arbitrary byte boundaries, this is not a stream of bytes, it's a stream
- * of access units.<p>
- *
- * Most formats also require the actual data to be prefixed by a number
- * of buffers containing setup data, or codec specific data, i.e. the
- * first few buffers submitted to the codec object after starting it must
- * be codec specific data marked as such using the flag {@link #BUFFER_FLAG_CODEC_CONFIG}
- * in a call to {@link #queueInputBuffer}.
- * <p>
- * Codec specific data included in the format passed to {@link #configure}
- * (in ByteBuffer entries with keys "csd-0", "csd-1", ...) is automatically
- * submitted to the codec, this data MUST NOT be submitted explicitly by the
- * client.
- * <p>
- * Once the client reaches the end of the input data it signals the end of
- * the input stream by specifying a flag of {@link #BUFFER_FLAG_END_OF_STREAM} in the call to
- * {@link #queueInputBuffer}. The codec will continue to return output buffers
- * until it eventually signals the end of the output stream by specifying
- * the same flag ({@link #BUFFER_FLAG_END_OF_STREAM}) on the BufferInfo returned in
- * {@link #dequeueOutputBuffer}.  Do not submit additional input buffers after
- * signaling the end of the input stream, unless the codec has been flushed,
- * or stopped and restarted.
- * <p>
- * <h3>Seeking &amp; Adaptive Playback Support</h3>
- *
- * You can check if a decoder supports adaptive playback via {@link
- * MediaCodecInfo.CodecCapabilities#isFeatureSupported}.  Adaptive playback
- * is only supported if you configure the codec to decode onto a {@link
- * android.view.Surface}.
- *
- * <h4>For decoders that do not support adaptive playback (including
- * when not decoding onto a Surface)</h4>
- *
- * In order to start decoding data that's not adjacent to previously submitted
- * data (i.e. after a seek) <em>one must</em> {@link #flush} the decoder.
- * Any input or output buffers the client may own at the point of the flush are
- * immediately revoked, i.e. after a call to {@link #flush} the client does not
- * own any buffers anymore.
- * <p>
- * It is important that the input data after a flush starts at a suitable
- * stream boundary.  The first frame must be able to be decoded completely on
- * its own (for most codecs this means an I-frame), and that no frames should
- * refer to frames before that first new frame.
- * Note that the format of the data submitted after a flush must not change,
- * flush does not support format discontinuities,
- * for this a full {@link #stop}, {@link #configure configure()}, {@link #start}
- * cycle is necessary.
- *
- * <h4>For decoders that support adaptive playback</h4>
- *
- * In order to start decoding data that's not adjacent to previously submitted
- * data (i.e. after a seek) it is <em>not necessary</em> to {@link #flush} the
- * decoder.
- * <p>
- * It is still important that the input data after the discontinuity starts
- * at a suitable stream boundary (e.g. I-frame), and that no new frames refer
- * to frames before the first frame of the new input data segment.
- * <p>
- * For some video formats it is also possible to change the picture size
- * mid-stream.  To do this for H.264, the new Sequence Parameter Set (SPS) and
- * Picture Parameter Set (PPS) values must be packaged together with an
- * Instantaneous Decoder Refresh (IDR) frame in a single buffer, which then
- * can be enqueued as a regular input buffer.
- * The client will receive an {@link #INFO_OUTPUT_FORMAT_CHANGED} return
- * value from {@link #dequeueOutputBuffer dequeueOutputBuffer()} or
- * {@link Callback#onOutputBufferAvailable onOutputBufferAvailable()}
- * just after the picture-size change takes place and before any
- * frames with the new size have been returned.
- * <p>
- * Be careful when calling {@link #flush} shortly after you have changed
- * the picture size.  If you have not received confirmation of the picture
- * size change, you will need to repeat the request for the new picture size.
- * E.g. for H.264 you will need to prepend the PPS/SPS to the new IDR
- * frame to ensure that the codec receives the picture size change request.
- *
- * <h3>States and error handling</h3>
- *
- * <p> During its life, a codec conceptually exists in one of the following states:
- * Initialized, Configured, Executing, Error, Uninitialized, (omitting transitory states
- * between them). When created by one of the factory methods,
- * the codec is in the Initialized state; {@link #configure} brings it to the
- * Configured state; {@link #start} brings it to the Executing state.
- * In the Executing state, decoding or encoding occurs through the buffer queue
- * manipulation described above. The method {@link #stop}
- * returns the codec to the Initialized state, whereupon it may be configured again,
- * and {@link #release} brings the codec to the terminal Uninitialized state.  When
- * a codec error occurs, the codec moves to the Error state.  Use {@link #reset} to
- * bring the codec back to the Initialized state, or {@link #release} to move it
- * to the Uninitialized state.
- *
- * <p> The factory methods
- * {@link #createByCodecName},
- * {@link #createDecoderByType},
- * and {@link #createEncoderByType}
- * throw {@link java.io.IOException} on failure which
- * the caller must catch or declare to pass up.
- * MediaCodec methods throw {@link java.lang.IllegalStateException}
- * when the method is called from a codec state that does not allow it;
- * this is typically due to incorrect application API usage.
- * Methods involving secure buffers may throw
- * {@link MediaCodec.CryptoException#MediaCodec.CryptoException}, which
- * has further error information obtainable from {@link MediaCodec.CryptoException#getErrorCode}.
- *
- * <p> Internal codec errors result in a {@link MediaCodec.CodecException},
- * which may be due to media content corruption, hardware failure, resource exhaustion,
- * and so forth, even when the application is correctly using the API.
- * The recommended action when receiving a {@link MediaCodec.CodecException} can be determined by
- * calling {@link MediaCodec.CodecException#isRecoverable} and
- * {@link MediaCodec.CodecException#isTransient}.
- * If {@link MediaCodec.CodecException#isRecoverable} returns true,
- * then a {@link #stop}, {@link #configure}, and {@link #start} can be performed to recover.
- * If {@link MediaCodec.CodecException#isTransient} returns true,
- * then resources are temporarily unavailable and the method may be retried at a later time.
- * If both {@link MediaCodec.CodecException#isRecoverable}
- * and {@link MediaCodec.CodecException#isTransient} return false,
- * then the {@link MediaCodec.CodecException} is fatal and the codec must be
- * {@link #reset reset} or {@link #release released}.
- * Both {@link MediaCodec.CodecException#isRecoverable} and
- * {@link MediaCodec.CodecException#isTransient} do not return true at the same time.
+ MediaCodec class can be used to access low-level media codecs, i.e. encoder/decoder components.
+ It is part of the Android low-level multimedia support infrastructure (normally used together
+ with {@link MediaExtractor}, {@link MediaSync}, {@link MediaMuxer}, {@link MediaCrypto},
+ {@link MediaDrm}, {@link Image}, {@link Surface}, and {@link AudioTrack}.)
+ <p>
+ <center><object style="width: 540px; height: 205px;" type="image/svg+xml"
+   data="../../../images/media/mediacodec_buffers.svg"><img
+   src="../../../images/media/mediacodec_buffers.png" style="width: 540px; height: 205px"
+   alt="MediaCodec buffer flow diagram"></object></center>
+ <p>
+ In broad terms, a codec processes input data to generate output data. It processes data
+ asynchronously and uses a set of input and output buffers. At a simplistic level, you request
+ (or receive) an empty input buffer, fill it up with data and send it to the codec for
+ processing. The codec uses up the data and transforms it into one of its empty output buffers.
+ Finally, you request (or receive) a filled output buffer, consume its contents and release it
+ back to the codec.
+
+ <h3>Data Types</h3>
+ <p>
+ Codecs operate on three kinds of data: compressed data, raw audio data and raw video data.
+ All three kinds of data can be processed using {@link ByteBuffer ByteBuffers}, but you should use
+ a {@link Surface} for raw video data to improve codec performance. Surface uses native video
+ buffers without mapping or copying them to ByteBuffers; thus, it is much more efficient.
+ You normally cannot access the raw video data when using a Surface, but you can use the
+ {@link ImageReader} class to access unsecured decoded (raw) video frames. This may still be more
+ efficient than using ByteBuffers, as some native buffers may be mapped into {@linkplain
+ ByteBuffer#isDirect direct} ByteBuffers. When using ByteBuffer mode, you can access raw video
+ frames using the {@link Image} class and {@link #getInputImage getInput}/{@link #getOutputImage
+ OutputImage(int)}.
+
+ <h4>Compressed Buffers</h4>
+ <p>
+ Input buffers (for decoders) and output buffers (for encoders) contain compressed data according
+ to the {@linkplain MediaFormat#KEY_MIME format's type}. For video types this is a single
+ compressed video frame. For audio data this is normally a single access unit (an encoded audio
+ segment typically containing a few milliseconds of audio as dictated by the format type), but
+ this requirement is slightly relaxed in that a buffer may contain multiple encoded access units
+ of audio. In either case, buffers do not start or end on arbitrary byte boundaries, but rather on
+ frame/access unit boundaries.
+
+ <h4>Raw Audio Buffers</h4>
+ <p>
+ Raw audio buffers contain entire frames of PCM audio data, which is one sample for each channel
+ in channel order. Each sample is a {@linkplain AudioFormat#ENCODING_PCM_16BIT 16-bit signed
+ integer in native byte order}.
+
+ <pre class=prettyprint>
+ short[] getSamplesForChannel(MediaCodec codec, int bufferId, int channelIx) {
+   ByteBuffer outputBuffer = codec.getOutputBuffer(bufferId);
+   MediaFormat format = codec.getOutputFormat(bufferId);
+   ShortBuffer samples = outputBuffer.order(ByteOrder.nativeOrder()).asShortBuffer();
+   int numChannels = formet.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
+   if (channelIx &lt; 0 || channelIx &gt;= numChannels) {
+     return null;
+   }
+   short[] res = new short[samples.remaining() / numChannels];
+   for (int i = 0; i &lt; res.length; ++i) {
+     res[i] = samples.get(i * numChannels + channelIx);
+   }
+   return res;
+ }</pre>
+
+ <h4>Raw Video Buffers</h4>
+ <p>
+ In ByteBuffer mode video buffers are laid out according to their {@linkplain
+ MediaFormat#KEY_COLOR_FORMAT color format}. You can get the supported color formats as an array
+ from {@link #getCodecInfo}{@code .}{@link MediaCodecInfo#getCapabilitiesForType
+ getCapabilitiesForType(&hellip;)}{@code .}{@link CodecCapabilities#colorFormats colorFormats}.
+ Video codecs may support three kinds of color formats:
+ <ul>
+ <li><strong>native raw video format:</strong> This is marked by {@link
+ CodecCapabilities#COLOR_FormatSurface} and it can be used with an input or output Surface.</li>
+ <li><strong>flexible YUV buffers</strong> (such as {@link
+ CodecCapabilities#COLOR_FormatYUV420Flexible}): These can be used with an input/output Surface,
+ as well as in ByteBuffer mode, by using {@link #getInputImage getInput}/{@link #getOutputImage
+ OutputImage(int)}.</li>
+ <li><strong>other, specific formats:</strong> These are normally only supported in ByteBuffer
+ mode. Some color formats are vendor specific. Others are defined in {@link CodecCapabilities}.
+ For color formats that are equivalent to a flexible format, you can still use {@link
+ #getInputImage getInput}/{@link #getOutputImage OutputImage(int)}.</li>
+ </ul>
+ <p>
+ All video codecs support flexible YUV 4:2:0 buffers since {@link
+ android.os.Build.VERSION_CODES#LOLLIPOP_MR1}.
+
+ <h3>States</h3>
+ <p>
+ During its life a codec conceptually exists in one of three states: Stopped, Executing or
+ Released. The Stopped collective state is actually the conglomeration of three states:
+ Uninitialized, Configured and Error, whereas the Executing state conceptually progresses through
+ three sub-states: Flushed, Running and End-of-Stream.
+ <p>
+ <center><object style="width: 516px; height: 353px;" type="image/svg+xml"
+   data="../../../images/media/mediacodec_states.svg"><img
+   src="../../../images/media/mediacodec_states.png" style="width: 519px; height: 356px"
+   alt="MediaCodec state diagram"></object></center>
+ <p>
+ When you create a codec using one of the factory methods, the codec is in the Uninitialized
+ state. First, you need to configure it via {@link #configure configure(&hellip;)}, which brings
+ it to the Configured state, then call {@link #start} to move it to the Executing state. In this
+ state you can process data through the buffer queue manipulation described above.
+ <p>
+ The Executing state has three sub-states: Flushed, Running and End-of-Stream. Immediately after
+ {@link #start} the codec is in the Flushed sub-state, where it holds all the buffers. As soon
+ as the first input buffer is dequeued, the codec moves to the Running sub-state, where it spends
+ most of its life. When you queue an input buffer with the {@linkplain #BUFFER_FLAG_END_OF_STREAM
+ end-of-stream marker}, the codec transitions to the End-of-Stream sub-state. In this state the
+ codec no longer accepts further input buffers, but still generates output buffers until the
+ end-of-stream is reached on the output. You can move back to the Flushed sub-state at any time
+ while in the Executing state using {@link #flush}.
+ <p>
+ Call {@link #stop} to return the codec to the Uninitialized state, whereupon it may be configured
+ again. When you are done using a codec, you must release it by calling {@link #release}.
+ <p>
+ On rare occasions the codec may encounter an error and move to the Error state. This is
+ communicated using an invalid return value from a queuing operation, or sometimes via an
+ exception. Call {@link #reset} to make the codec usable again. You can call it from any state to
+ move the codec back to the Uninitialized state. Otherwise, call {@link #release} to move to the
+ terminal Released state.
+
+ <h3>Creation</h3>
+ <p>
+ Use {@link MediaCodecList} to create a MediaCodec for a specific {@link MediaFormat}. When
+ decoding a file or a stream, you can get the desired format from {@link
+ MediaExtractor#getTrackFormat MediaExtractor.getTrackFormat}. Inject any specific features that
+ you want to add using {@link MediaFormat#setFeatureEnabled MediaFormat.setFeatureEnabled}, then
+ call {@link MediaCodecList#findDecoderForFormat MediaCodecList.findDecoderForFormat} to get the
+ name of a codec that can handle that specific media format. Finally, create the codec using
+ {@link #createByCodecName}.
+ <p class=note>
+ <strong>Note:</strong> On {@link android.os.Build.VERSION_CODES#LOLLIPOP}, the format to
+ {@code MediaCodecList.findDecoder}/{@code EncoderForFormat} must not contain a {@linkplain
+ MediaFormat#KEY_FRAME_RATE frame rate}. Use
+ <code class=prettyprint>format.setString(MediaFormat.KEY_FRAME_RATE, null)</code>
+ to clear any existing frame rate setting in the format.
+ <p>
+ You can also create the preferred codec for a specific MIME type using {@link
+ #createDecoderByType createDecoder}/{@link #createEncoderByType EncoderByType(String)}.
+ This, however, cannot be used to inject features, and may create a codec that cannot handle the
+ specific desired media format.
+
+ <h4>Creating secure decoders</h4>
+ <p>
+ On versions {@link android.os.Build.VERSION_CODES#KITKAT_WATCH} and earlier, secure codecs might
+ not be listed in {@link MediaCodecList}, but may still be available on the system. Secure codecs
+ that exist can be instantiated by name only, by appending {@code ".secure"} to the name of a
+ regular codec (the name of all secure codecs must end in {@code ".secure"}.) {@link
+ #createByCodecName} will throw an {@code IOException} if the codec is not present on the system.
+ <p>
+ From {@link android.os.Build.VERSION_CODES#LOLLIPOP} onwards, you should use the {@link
+ CodecCapabilities#FEATURE_SecurePlayback} feature in the media format to create a secure decoder.
+
+ <h3>Initialization</h3>
+ <p>
+ After creating the codec, you can set a callback using {@link #setCallback setCallback} if you
+ want to process data asynchronously. Then, {@linkplain #configure configure} the codec using the
+ specific media format. This is when you can specify the output {@link Surface} for video
+ producers &ndash; codecs that generate raw video data (e.g. video decoders). This is also when
+ you can set the decryption parameters for secure codecs (see {@link MediaCrypto}). Finally, since
+ some codecs can operate in multiple modes, you must specify whether you want it to work as a
+ decoder or an encoder.
+ <p>
+ Since {@link android.os.Build.VERSION_CODES#LOLLIPOP}, you can query the resulting input and
+ output format in the Configured state. You can use this to verify the resulting configuration,
+ e.g. color formats, before starting the codec.
+ <p>
+ If you want to process raw input video buffers natively with a video consumer &ndash; a codec
+ that processes raw video input, such as a video encoder &ndash; create a destination Surface for
+ your input data using {@link #createInputSurface} after configuration. Alternately, set up the
+ codec to use a previously created {@linkplain #createPersistentInputSurface persistent input
+ surface} by calling {@link #setInputSurface}.
+
+ <h4 id=CSD><a name="CSD"></a>Codec-specific Data</h4>
+ <p>
+ Some formats, notably AAC audio and MPEG4, H.264 and H.265 video formats require the actual data
+ to be prefixed by a number of buffers containing setup data, or codec specific data. When
+ processing such compressed formats, this data must be submitted to the codec after {@link
+ #start} and before any frame data. Such data must be marked using the flag {@link
+ #BUFFER_FLAG_CODEC_CONFIG} in a call to {@link #queueInputBuffer queueInputBuffer}.
+ <p>
+ Codec-specific data can also be included in the format passed to {@link #configure configure} in
+ ByteBuffer entries with keys "csd-0", "csd-1", etc. These keys are always included in the track
+ {@link MediaFormat} obtained from the {@link MediaExtractor#getTrackFormat MediaExtractor}.
+ Codec-specific data in the format is automatically submitted to the codec upon {@link #start};
+ you <strong>MUST NOT</strong> submit this data explicitly. If the format did not contain codec
+ specific data, you can choose to submit it using the specified number of buffers in the correct
+ order, according to the format requirements. Alternately, you can concatenate all codec-specific
+ data and submit it as a single codec-config buffer.
+ <p>
+ Android uses the following codec-specific data buffers. These are also required to be set in
+ the track format for proper {@link MediaMuxer} track configuration. Each parameter set and
+ codec-specific-data must start with a start code of {@code "\x00\x00\x00\x01"}.
+ <p>
+ <style>td.NA { background: #ccc; } .mid > tr > td { vertical-align: middle; }</style>
+ <table>
+  <thead>
+   <th>Format</th>
+   <th>CSD buffer #0</th>
+   <th>CSD buffer #1</th>
+  </thead>
+  <tbody class=mid>
+   <tr>
+    <td>AAC</td>
+    <td>Decoder-specific information from ESDS</td>
+    <td class=NA>Not Used</td>
+   </tr>
+   <tr>
+    <td>MPEG-4</td>
+    <td>Decoder-specific information from ESDS</td>
+    <td class=NA>Not Used</td>
+   </tr>
+   <tr>
+    <td>H.264 AVC</td>
+    <td>SPS (Sequence Parameter Sets)</td>
+    <td>PPS (Picture Parameter Sets)</td>
+   </tr>
+   <tr>
+    <td>H.265 HEVC</td>
+    <td>VPS (Video Parameter Sets) +<br>
+     SPS (Sequence Parameter Sets) +<br>
+     PPS (Picture Parameter Sets)</td>
+    <td class=NA>Not Used</td>
+   </tr>
+  </tbody>
+ </table>
+
+ <p class=note>
+ <strong>Note:</strong> care must be taken if the codec is flushed immediately or shortly
+ after start, before any output buffer or output format change has been returned, as the codec
+ specific data may be lost during the flush. You must resubmit the data using buffers marked with
+ {@link #BUFFER_FLAG_CODEC_CONFIG} after such flush to ensure proper codec operation.
+ <p>
+ Encoders (or codecs that generate compressed data) will create and return the codec specific data
+ before any valid output buffer in output buffers marked with the {@linkplain
+ #BUFFER_FLAG_CODEC_CONFIG codec-config flag}. Buffers containing codec-specific-data have no
+ meaningful timestamps.
+
+ <h3>Data Processing</h3>
+ <p>
+ Each codec maintains a set of input and output buffers that are referred to by a buffer-ID in
+ API calls. After a successful call to {@link #start} the client "owns" neither input nor output
+ buffers. In synchronous mode, call {@link #dequeueInputBuffer dequeueInput}/{@link
+ #dequeueOutputBuffer OutputBuffer(&hellip;)} to obtain (get ownership of) an input or output
+ buffer from the codec. In asynchronous mode, you will automatically receive available buffers via
+ the {@link Callback#onInputBufferAvailable MediaCodec.Callback.onInput}/{@link
+ Callback#onOutputBufferAvailable OutputBufferAvailable(&hellip;)} callbacks.
+ <p>
+ Upon obtaining an input buffer, fill it with data and submit it to the codec using {@link
+ #queueInputBuffer queueInputBuffer} &ndash; or {@link #queueSecureInputBuffer
+ queueSecureInputBuffer} if using decryption. Do not submit multiple input buffers with the same
+ timestamp (unless it is <a href="#CSD">codec-specific data</a> marked as such).
+ <p>
+ The codec in turn will return a read-only output buffer via the {@link
+ Callback#onOutputBufferAvailable onOutputBufferAvailable} callback in asynchronous mode, or in
+ response to a {@link #dequeueOutputBuffer dequeuOutputBuffer} call in synchronous mode. After the
+ output buffer has been processed, call one of the {@link #releaseOutputBuffer
+ releaseOutputBuffer} methods to return the buffer to the codec.
+ <p>
+ While you are not required to resubmit/release buffers immediately to the codec, holding onto
+ input and/or output buffers may stall the codec, and this behavior is device dependent. E.g. it
+ is possible that a codec may hold off on generating output buffers until all outstanding buffers
+ have been released/resubmitted. Therefore, try to hold onto to available buffers as little as
+ possible.
+ <p>
+ Depending on the API version, you can process data in three ways:
+ <table>
+  <thead>
+   <tr>
+    <th>Processing Mode</th>
+    <th>API version <= 20<br>Jelly Bean/KitKat</th>
+    <th>API version >= 21<br>Lollipop and later</th>
+   </tr>
+  </thead>
+  <tbody>
+   <tr>
+    <td>Synchronous API using buffer arrays</td>
+    <td>Supported</td>
+    <td>Deprecated</td>
+   </tr>
+   <tr>
+    <td>Synchronous API using buffers</td>
+    <td class=NA>Not Available</td>
+    <td>Supported</td>
+   </tr>
+   <tr>
+    <td>Asynchronous API using buffers</td>
+    <td class=NA>Not Available</td>
+    <td>Supported</td>
+   </tr>
+  </tbody>
+ </table>
+
+ <h4>Asynchronous Processing using Buffers</h4>
+ <p>
+ Since {@link android.os.Build.VERSION_CODES#LOLLIPOP}, the preferred method is to process data
+ asynchronously by setting a callback before calling {@link #configure configure}. Asynchronous
+ mode changes the state transitions slightly, because you must call {@link #start} after {@link
+ #flush} to transition the codec to the Running sub-state and start receiving input buffers.
+ Similarly, upon an initial call to {@code start} the codec will move directly to the Running
+ sub-state and start passing available input buffers via the callback.
+ <p>
+ <center><object style="width: 516px; height: 353px;" type="image/svg+xml"
+   data="../../../images/media/mediacodec_async_states.svg"><img
+   src="../../../images/media/mediacodec_async_states.png" style="width: 516px; height: 353px"
+   alt="MediaCodec state diagram for asynchronous operation"></object></center>
+ <p>
+ MediaCodec is typically used like this in asynchronous mode:
+ <pre class=prettyprint>
+ MediaCodec codec = MediaCodec.createCodecByName(name);
+ MediaFormat mOutputFormat; // member variable
+ codec.setCallback(new MediaCodec.Callback() {
+   {@literal @Override}
+   void onInputBufferAvailable(MediaCodec mc, int inputBufferId) {
+     ByteBuffer inputBuffer = codec.getInputBuffer(inputBufferId);
+     // fill inputBuffer with valid data
+     &hellip;
+     codec.queueInputBuffer(inputBufferId, &hellip;);
+   }
+
+   {@literal @Override}
+   void onOutputBufferAvailable(MediaCodec mc, int outputBufferId, &hellip;) {
+     ByteBuffer outputBuffer = codec.getOutputBuffer(outputBufferId);
+     MediaFormat bufferFormat = codec.getOutputFormat(outputBufferId); // option A
+     // bufferFormat is equivalent to mOutputFormat
+     // outputBuffer is ready to be processed or rendered.
+     &hellip;
+     codec.releaseOutputBuffer(outputBufferId, &hellip;);
+   }
+
+   {@literal @Override}
+   void onOutputFormatChanged(MediaCodec mc, MediaFormat format) {
+     // Subsequent data will conform to new format.
+     // Can ignore if using getOutputFormat(outputBufferId)
+     mOutputFormat = format; // option B
+   }
+
+   {@literal @Override}
+   void onError(&hellip;) {
+     &hellip;
+   }
+ });
+ codec.configure(format, &hellip;);
+ mOutputFormat = codec.getOutputFormat(); // option B
+ codec.start();
+ // wait for processing to complete
+ codec.stop();
+ codec.release();</pre>
+
+ <h4>Synchronous Processing using Buffers</h4>
+ <p>
+ Since {@link android.os.Build.VERSION_CODES#LOLLIPOP}, you should retrieve input and output
+ buffers using {@link #getInputBuffer getInput}/{@link #getOutputBuffer OutputBuffer(int)} and/or
+ {@link #getInputImage getInput}/{@link #getOutputImage OutputImage(int)} even when using the
+ codec in synchronous mode. This allows certain optimizations by the framework, e.g. when
+ processing dynamic content. This optimization is disabled if you call {@link #getInputBuffers
+ getInput}/{@link #getOutputBuffers OutputBuffers()}.
+
+ <p class=note>
+ <strong>Note:</strong> do not mix the methods of using buffers and buffer arrays at the same
+ time. Specifically, only call {@code getInput}/{@code OutputBuffers} directly after {@link
+ #start} or after having dequeued an output buffer ID with the value of {@link
+ #INFO_OUTPUT_FORMAT_CHANGED}.
+ <p>
+ MediaCodec is typically used like this in synchronous mode:
+ <pre>
+ MediaCodec codec = MediaCodec.createCodecByName(name);
+ codec.configure(format, &hellip;);
+ MediaFormat outputFormat = codec.getOutputFormat(); // option B
+ codec.start();
+ for (;;) {
+   int inputBufferId = codec.dequeueInputBuffer(timeoutUs);
+   if (inputBufferId &gt;= 0) {
+     ByteBuffer inputBuffer = codec.getInputBuffer(&hellip;);
+     // fill inputBuffer with valid data
+     &hellip;
+     codec.queueInputBuffer(inputBufferId, &hellip;);
+   }
+   int outputBufferId = codec.dequeueOutputBuffer(&hellip;);
+   if (outputBufferId &gt;= 0) {
+     ByteBuffer outputBuffer = codec.getOutputBuffer(outputBufferId);
+     MediaFormat bufferFormat = codec.getOutputFormat(outputBufferId); // option A
+     // bufferFormat is identical to outputFormat
+     // outputBuffer is ready to be processed or rendered.
+     &hellip;
+     codec.releaseOutputBuffer(outputBufferId, &hellip;);
+   } else if (outputBufferId == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+     // Subsequent data will conform to new format.
+     // Can ignore if using getOutputFormat(outputBufferId)
+     outputFormat = codec.getOutputFormat(); // option B
+   }
+ }
+ codec.stop();
+ codec.release();</pre>
+
+ <h4>Synchronous Processing using Buffer Arrays (deprecated)</h4>
+ <p>
+ In versions {@link android.os.Build.VERSION_CODES#KITKAT_WATCH} and before, the set of input and
+ output buffers are represented by the {@code ByteBuffer[]} arrays. After a successful call to
+ {@link #start}, retrieve the buffer arrays using {@link #getInputBuffers getInput}/{@link
+ #getOutputBuffers OutputBuffers()}. Use the buffer ID-s as indices into these arrays (when
+ non-negative), as demonstrated in the sample below. Note that there is no inherent correlation
+ between the size of the arrays and the number of input and output buffers used by the system,
+ although the array size provides an upper bound.
+ <pre>
+ MediaCodec codec = MediaCodec.createCodecByName(name);
+ codec.configure(format, &hellip;);
+ codec.start();
+ ByteBuffer[] inputBuffers = codec.getInputBuffers();
+ ByteBuffer[] outputBuffers = codec.getOutputBuffers();
+ for (;;) {
+   int inputBufferId = codec.dequeueInputBuffer(&hellip;);
+   if (inputBufferId &gt;= 0) {
+     // fill inputBuffers[inputBufferId] with valid data
+     &hellip;
+     codec.queueInputBuffer(inputBufferId, &hellip;);
+   }
+   int outputBufferId = codec.dequeueOutputBuffer(&hellip;);
+   if (outputBufferId &gt;= 0) {
+     // outputBuffers[outputBufferId] is ready to be processed or rendered.
+     &hellip;
+     codec.releaseOutputBuffer(outputBufferId, &hellip;);
+   } else if (outputBufferId == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) {
+     outputBuffers = codec.getOutputBuffers();
+   } else if (outputBufferId == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) {
+     // Subsequent data will conform to new format.
+     MediaFormat format = codec.getOutputFormat();
+   }
+ }
+ codec.stop();
+ codec.release();</pre>
+
+ <h4>End-of-stream Handling</h4>
+ <p>
+ When you reach the end of the input data, you must signal it to the codec by specifying the
+ {@link #BUFFER_FLAG_END_OF_STREAM} flag in the call to {@link #queueInputBuffer
+ queueInputBuffer}. You can do this on the last valid input buffer, or by submitting an additional
+ empty input buffer with the end-of-stream flag set. If using an empty buffer, the timestamp will
+ be ignored.
+ <p>
+ The codec will continue to return output buffers until it eventually signals the end of the
+ output stream by specifying the same end-of-stream flag in the {@link BufferInfo} set in {@link
+ #dequeueOutputBuffer dequeueOutputBuffer} or returned via {@link Callback#onOutputBufferAvailable
+ onOutputBufferAvailable}. This can be set on the last valid output buffer, or on an empty buffer
+ after the last valid output buffer. The timestamp of such empty buffer should be ignored.
+ <p>
+ Do not submit additional input buffers after signaling the end of the input stream, unless the
+ codec has been flushed, or stopped and restarted.
+
+ <h4>Using an Output Surface</h4>
+ <p>
+ The data processing is nearly identical to the ByteBuffer mode when using an output {@link
+ Surface}; however, the output buffers will not be accessible, and are represented as {@code null}
+ values. E.g. {@link #getOutputBuffer getOutputBuffer}/{@link #getOutputImage Image(int)} will
+ return {@code null} and {@link #getOutputBuffers} will return an array containing only {@code
+ null}-s.
+ <p>
+ When using an output Surface, you can select whether or not to render each output buffer on the
+ surface. You have three choices:
+ <ul>
+ <li><strong>Do not render the buffer:</strong> Call {@link #releaseOutputBuffer(int, boolean)
+ releaseOutputBuffer(bufferId, false)}.</li>
+ <li><strong>Render the buffer with the default timestamp:</strong> Call {@link
+ #releaseOutputBuffer(int, boolean) releaseOutputBuffer(bufferId, true)}.</li>
+ <li><strong>Render the buffer with a specific timestamp:</strong> Call {@link
+ #releaseOutputBuffer(int, long) releaseOutputBuffer(bufferId, timestamp)}.</li>
+ </ul>
+ <p>
+ Since {@link android.os.Build.VERSION_CODES#MNC}, the default timestamp is the {@linkplain
+ BufferInfo#presentationTimeUs presentation timestamp} of the buffer (converted to nanoseconds).
+ It was not defined prior to that.
+ <p>
+ Also since {@link android.os.Build.VERSION_CODES#MNC}, you can change the output Surface
+ dynamically using {@link #setOutputSurface setOutputSurface}.
+
+ <h4>Using an Input Surface</h4>
+ <p>
+ When using an input Surface, there are no accessible input buffers, as buffers are automatically
+ passed from the input surface to the codec. Calling {@link #dequeueInputBuffer
+ dequeueInputBuffer} will throw an {@code IllegalStateException}, and {@link #getInputBuffers}
+ returns a bogus {@code ByteBuffer[]} array that <strong>MUST NOT</strong> be written into.
+ <p>
+ Call {@link #signalEndOfInputStream} to signal end-of-stream. The input surface will stop
+ submitting data to the codec immediately after this call.
+ <p>
+
+ <h3>Seeking &amp; Adaptive Playback Support</h3>
+ <p>
+ Video decoders (and in general codecs that consume compressed video data) behave differently
+ regarding seek and format change whether or not they support and are configured for adaptive
+ playback. You can check if a decoder supports {@linkplain
+ CodecCapabilities#FEATURE_AdaptivePlayback adaptive playback} via {@link
+ CodecCapabilities#isFeatureSupported CodecCapabilities.isFeatureSupported(String)}. Adaptive
+ playback support for video decoders is only activated if you configure the codec to decode onto a
+ {@link Surface}.
+
+ <h4 id=KeyFrames><a name="KeyFrames"></a>Stream Boundary and Key Frames</h4>
+ <p>
+ It is important that the input data after {@link #start} or {@link #flush} starts at a suitable
+ stream boundary: the first frame must a key frame. A <em>key frame</em> can be decoded
+ completely on its own (for most codecs this means an I-frame), and no frames that are to be
+ displayed after a key frame refer to frames before the key frame.
+ <p>
+ The following table summarizes suitable key frames for various video formats.
+ <table>
+  <thead>
+   <tr>
+    <th>Format</th>
+    <th>Suitable key frame</th>
+   </tr>
+  </thead>
+  <tbody class=mid>
+   <tr>
+    <td>VP9/VP8</td>
+    <td>a suitable intraframe where no subsequent frames refer to frames prior to this frame.<br>
+      <i>(There is no specific name for such key frame.)</i></td>
+   </tr>
+   <tr>
+    <td>H.265 HEVC</td>
+    <td>IDR or CRA</td>
+   </tr>
+   <tr>
+    <td>H.264 AVC</td>
+    <td>IDR</td>
+   </tr>
+   <tr>
+    <td>MPEG-4<br>H.263<br>MPEG-2</td>
+    <td>a suitable I-frame where no subsequent frames refer to frames prior to this frame.<br>
+      <i>(There is no specific name for such key frame.)</td>
+   </tr>
+  </tbody>
+ </table>
+
+ <h4>For decoders that do not support adaptive playback (including when not decoding onto a
+ Surface)</h4>
+ <p>
+ In order to start decoding data that is not adjacent to previously submitted data (i.e. after a
+ seek) you <strong>MUST</strong> flush the decoder. Since all output buffers are immediately
+ revoked at the point of the flush, you may want to first signal then wait for the end-of-stream
+ before you call {@code flush}. It is important that the input data after a flush starts at a
+ suitable stream boundary/key frame.
+ <p class=note>
+ <strong>Note:</strong> the format of the data submitted after a flush must not change; {@link
+ #flush} does not support format discontinuities; for that, a full {@link #stop} - {@link
+ #configure configure(&hellip;)} - {@link #start} cycle is necessary.
+
+ <p class=note>
+ <strong>Also note:</strong> if you flush the codec too soon after {@link #start} &ndash;
+ generally, before the first output buffer or output format change is received &ndash; you
+ will need to resubmit the codec-specific-data to the codec. See the <a
+ href="#CSD">codec-specific-data section</a> for more info.
+
+ <h4>For decoders that support and are configured for adaptive playback</h4>
+ <p>
+ In order to start decoding data that is not adjacent to previously submitted data (i.e. after a
+ seek) it is <em>not necessary</em> to flush the decoder; however, input data after the
+ discontinuity must start at a suitable stream boundary/key frame.
+ <p>
+ For some video formats - namely H.264, H.265, VP8 and VP9 - it is also possible to change the
+ picture size or configuration mid-stream. To do this you must package the entire new
+ codec-specific configuration data together with the key frame into a single buffer (including
+ any start codes), and submit it as a <strong>regular</strong> input buffer.
+ <p>
+ You will receive an {@link #INFO_OUTPUT_FORMAT_CHANGED} return value from {@link
+ #dequeueOutputBuffer dequeueOutputBuffer} or a {@link Callback#onOutputBufferAvailable
+ onOutputFormatChanged} callback just after the picture-size change takes place and before any
+ frames with the new size have been returned.
+ <p class=note>
+ <strong>Note:</strong> just as the case for codec-specific data, be careful when calling
+ {@link #flush} shortly after you have changed the picture size. If you have not received
+ confirmation of the picture size change, you will need to repeat the request for the new picture
+ size.
+
+ <h3>Error handling</h3>
+ <p>
+ The factory methods {@link #createByCodecName createByCodecName} and {@link #createDecoderByType
+ createDecoder}/{@link #createEncoderByType EncoderByType} throw {@code IOException} on failure
+ which you must catch or declare to pass up. MediaCodec methods throw {@code
+ IllegalStateException} when the method is called from a codec state that does not allow it; this
+ is typically due to incorrect application API usage. Methods involving secure buffers may throw
+ {@link CryptoException}, which has further error information obtainable from {@link
+ CryptoException#getErrorCode}.
+ <p>
+ Internal codec errors result in a {@link CodecException}, which may be due to media content
+ corruption, hardware failure, resource exhaustion, and so forth, even when the application is
+ correctly using the API. The recommended action when receiving a {@code CodecException}
+ can be determined by calling {@link CodecException#isRecoverable} and {@link
+ CodecException#isTransient}:
+ <ul>
+ <li><strong>recoverable errors:</strong> If {@code isRecoverable()} returns true, then call
+ {@link #stop}, {@link #configure configure(&hellip;)}, and {@link #start} to recover.</li>
+ <li><strong>transient errors:</strong> If {@code isTransient()} returns true, then resources are
+ temporarily unavailable and the method may be retried at a later time.</li>
+ <li><strong>fatal errors:</strong> If both {@code isRecoverable()} and {@code isTransient()}
+ return false, then the {@code CodecException} is fatal and the codec must be {@linkplain #reset
+ reset} or {@linkplain #release released}.</li>
+ </ul>
+ <p>
+ Both {@code isRecoverable()} and {@code isTransient()} do not return true at the same time.
+
+ <h2 id=History><a name="History"></a>Valid API Calls and API History</h2>
+ <p>
+ This sections summarizes the valid API calls in each state and the API history of the MediaCodec
+ class. For API version numbers, see {@link android.os.Build.VERSION_CODES}.
+
+ <style>
+ .api > tr > th, td { text-align: center; padding: 4px 4px; }
+ .api > tr > th     { vertical-align: bottom; }
+ .api > tr > td     { vertical-align: middle; }
+ .sml > tr > th, td { text-align: center; padding: 2px 4px; }
+ .fn { text-align: left; }
+ .fn > code > a { font: 14px/19px Roboto Condensed, sans-serif; }
+ .deg45 {
+   white-space: nowrap; background: none; border: none; vertical-align: bottom;
+   width: 30px; height: 83px;
+ }
+ .deg45 > div {
+   transform: skew(-45deg, 0deg) translate(1px, -67px);
+   transform-origin: bottom left 0;
+   width: 30px; height: 20px;
+ }
+ .deg45 > div > div { border: 1px solid #ddd; background: #999; height: 90px; width: 42px; }
+ .deg45 > div > div > div { transform: skew(45deg, 0deg) translate(-55px, 55px) rotate(-45deg); }
+ </style>
+
+ <table align="right" style="width: 0%">
+  <thead>
+   <tr><th>Symbol</th><th>Meaning</th></tr>
+  </thead>
+  <tbody class=sml>
+   <tr><td>&#9679;</td><td>Supported</td></tr>
+   <tr><td>&#8277;</td><td>Semantics changed</td></tr>
+   <tr><td>&#9675;</td><td>Experimental support</td></tr>
+   <tr><td>[ ]</td><td>Deprecated</td></tr>
+   <tr><td>&#9099;</td><td>Restricted to surface input mode</td></tr>
+   <tr><td>&#9094;</td><td>Restricted to surface output mode</td></tr>
+   <tr><td>&#9639;</td><td>Restricted to ByteBuffer input mode</td></tr>
+   <tr><td>&#8617;</td><td>Restricted to synchronous mode</td></tr>
+   <tr><td>&#8644;</td><td>Restricted to asynchronous mode</td></tr>
+   <tr><td>( )</td><td>Can be called, but shouldn't</td></tr>
+  </tbody>
+ </table>
+
+ <table style="width: 100%;">
+  <thead class=api>
+   <tr>
+    <th class=deg45><div><div style="background:#4285f4"><div>Uninitialized</div></div></div></th>
+    <th class=deg45><div><div style="background:#f4b400"><div>Configured</div></div></div></th>
+    <th class=deg45><div><div style="background:#e67c73"><div>Flushed</div></div></div></th>
+    <th class=deg45><div><div style="background:#0f9d58"><div>Running</div></div></div></th>
+    <th class=deg45><div><div style="background:#f7cb4d"><div>End of Stream</div></div></div></th>
+    <th class=deg45><div><div style="background:#db4437"><div>Error</div></div></div></th>
+    <th class=deg45><div><div style="background:#666"><div>Released</div></div></div></th>
+    <th></th>
+    <th colspan="8">SDK Version</th>
+   </tr>
+   <tr>
+    <th colspan="7">State</th>
+    <th>Method</th>
+    <th>16</th>
+    <th>17</th>
+    <th>18</th>
+    <th>19</th>
+    <th>20</th>
+    <th>21</th>
+    <th>22</th>
+    <th>23</th>
+   </tr>
+  </thead>
+  <tbody class=api>
+   <tr>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td class=fn>{@link #createByCodecName createByCodecName}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td class=fn>{@link #createDecoderByType createDecoderByType}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td class=fn>{@link #createEncoderByType createEncoderByType}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td class=fn>{@link #createPersistentInputSurface createPersistentInputSurface}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #configure configure}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>18+</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #createInputSurface createInputSurface}</td>
+    <td></td>
+    <td></td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>(16+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #dequeueInputBuffer dequeueInputBuffer}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9639;</td>
+    <td>&#9639;</td>
+    <td>&#9639;</td>
+    <td>&#8277;&#9639;&#8617;</td>
+    <td>&#9639;&#8617;</td>
+    <td>&#9639;&#8617;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #dequeueOutputBuffer dequeueOutputBuffer}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;&#8617;</td>
+    <td>&#8617;</td>
+    <td>&#8617;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #flush flush}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>-</td>
+    <td class=fn>{@link #getCodecInfo getCodecInfo}</td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>(21+)</td>
+    <td>21+</td>
+    <td>(21+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getInputBuffer getInputBuffer}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>(16+)</td>
+    <td>(16+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getInputBuffers getInputBuffers}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>[&#8277;&#8617;]</td>
+    <td>[&#8617;]</td>
+    <td>[&#8617;]</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>21+</td>
+    <td>(21+)</td>
+    <td>(21+)</td>
+    <td>(21+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getInputFormat getInputFormat}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>(21+)</td>
+    <td>21+</td>
+    <td>(21+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getInputImage getInputImage}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9675;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>-</td>
+    <td class=fn>{@link #getName getName}</td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>(21+)</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getOutputBuffer getOutputBuffer}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getOutputBuffers getOutputBuffers}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>[&#8277;&#8617;]</td>
+    <td>[&#8617;]</td>
+    <td>[&#8617;]</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>21+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getOutputFormat()}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>(21+)</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getOutputFormat(int)}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>(21+)</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #getOutputImage getOutputImage}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9675;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>(16+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #queueInputBuffer queueInputBuffer}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>(16+)</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #queueSecureInputBuffer queueSecureInputBuffer}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td class=fn>{@link #release release}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #releaseOutputBuffer(int, boolean)}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #releaseOutputBuffer(int, long)}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+   </tr>
+   <tr>
+    <td>21+</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>21+</td>
+    <td>-</td>
+    <td class=fn>{@link #reset reset}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>21+</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #setCallback(Callback) setCallback}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>{@link #setCallback(Callback, Handler) &#8277;}</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>23+</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #setInputSurface setInputSurface}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9099;</td>
+   </tr>
+   <tr>
+    <td>23+</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>(23+)</td>
+    <td>(23+)</td>
+    <td class=fn>{@link #setOnFrameRenderedListener setOnFrameRenderedListener}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9675; &#9094;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>23+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #setOutputSurface setOutputSurface}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9094;</td>
+   </tr>
+   <tr>
+    <td>19+</td>
+    <td>19+</td>
+    <td>19+</td>
+    <td>19+</td>
+    <td>19+</td>
+    <td>(19+)</td>
+    <td>-</td>
+    <td class=fn>{@link #setParameters setParameters}</td>
+    <td></td>
+    <td></td>
+    <td></td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>(16+)</td>
+    <td>-</td>
+    <td class=fn>{@link #setVideoScalingMode setVideoScalingMode}</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+    <td>&#9094;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>18+</td>
+    <td>18+</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #signalEndOfInputStream signalEndOfInputStream}</td>
+    <td></td>
+    <td></td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+    <td>&#9099;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>16+</td>
+    <td>21+(&#8644;)</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #start start}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#8277;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+   <tr>
+    <td>-</td>
+    <td>-</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>16+</td>
+    <td>-</td>
+    <td>-</td>
+    <td class=fn>{@link #stop stop}</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+    <td>&#9679;</td>
+   </tr>
+  </tbody>
+ </table>
  */
 final public class MediaCodec {
     /**
@@ -548,14 +1652,14 @@
     }
 
     /**
-     * Returns the codec to its initial (Initialized) state.
+     * Returns the codec to its initial (Uninitialized) state.
      *
      * Call this if an {@link MediaCodec.CodecException#isRecoverable unrecoverable}
      * error has occured to reset the codec to its initial state after creation.
      *
      * @throws CodecException if an unrecoverable error has occured and the codec
      * could not be reset.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     public final void reset() {
         freeAllTrackedBuffers(); // free buffers first
@@ -607,7 +1711,7 @@
      * or the format is unacceptable (e.g. missing a mandatory key),
      * or the flags are not set properly
      * (e.g. missing {@link #CONFIGURE_FLAG_ENCODE} for an encoder).
-     * @throws IllegalStateException if not in the Initialized state.
+     * @throws IllegalStateException if not in the Uninitialized state.
      * @throws CryptoException upon DRM error.
      * @throws CodecException upon codec error.
      */
@@ -765,7 +1869,7 @@
      * remains active and ready to be {@link #start}ed again.
      * To ensure that it is available to other client call {@link #release}
      * and don't just rely on garbage collection to eventually do this for you.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     public final void stop() {
         native_stop();
@@ -1771,14 +2875,14 @@
      * If a surface has been specified in a previous call to {@link #configure}
      * specifies the scaling mode to use. The default is "scale to fit".
      * @throws IllegalArgumentException if mode is not recognized.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     public native final void setVideoScalingMode(@VideoScalingMode int mode);
 
     /**
      * Get the component name. If the codec was created by createDecoderByType
      * or createEncoderByType, what component is chosen is not known beforehand.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     @NonNull
     public native final String getName();
@@ -1811,7 +2915,7 @@
      * <b>Note:</b> Some of these parameter changes may silently fail to apply.
      *
      * @param params The bundle of parameters to set.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     public final void setParameters(@Nullable Bundle params) {
         if (params == null) {
@@ -2025,7 +3129,7 @@
      * Get the codec info. If the codec was created by createDecoderByType
      * or createEncoderByType, what component is chosen is not known beforehand,
      * and thus the caller does not have the MediaCodecInfo.
-     * @throws IllegalStateException if in the Uninitialized state.
+     * @throws IllegalStateException if in the Released state.
      */
     @NonNull
     public MediaCodecInfo getCodecInfo() {
diff --git a/media/java/android/media/MediaFormat.java b/media/java/android/media/MediaFormat.java
index 0e67daa..b2fa0ac 100644
--- a/media/java/android/media/MediaFormat.java
+++ b/media/java/android/media/MediaFormat.java
@@ -106,9 +106,6 @@
     public static final String MIMETYPE_AUDIO_FLAC = "audio/flac";
     public static final String MIMETYPE_AUDIO_MSGSM = "audio/gsm";
     public static final String MIMETYPE_AUDIO_AC3 = "audio/ac3";
-    /**
-     * @hide
-     */
     public static final String MIMETYPE_AUDIO_EAC3 = "audio/eac3";
 
     /**
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
index 6295de4..4edc1c9 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -114,35 +114,40 @@
         if (mPendingLockCheck != null) {
             mPendingLockCheck.cancel(false);
         }
+
+        if (entry.length() < MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) {
+            // to avoid accidental lockout, only count attempts that are long enough to be a
+            // real password. This may require some tweaking.
+            setPasswordEntryInputEnabled(true);
+            onPasswordChecked(entry, false, 0);
+            return;
+        }
+
         mPendingLockCheck = LockPatternChecker.checkPassword(
                 mLockPatternUtils,
                 entry,
                 KeyguardUpdateMonitor.getCurrentUser(),
                 new LockPatternChecker.OnCheckCallback() {
                     @Override
-                    public void onChecked(boolean matched) {
+                    public void onChecked(boolean matched, int timeoutMs) {
                         setPasswordEntryInputEnabled(true);
                         mPendingLockCheck = null;
-                        onPasswordChecked(entry, matched);
+                        onPasswordChecked(entry, matched, timeoutMs);
                     }
                 });
     }
 
-    private void onPasswordChecked(String entry, boolean matched) {
+    private void onPasswordChecked(String entry, boolean matched, int timeoutMs) {
         if (matched) {
-            mCallback.reportUnlockAttempt(true);
+            mCallback.reportUnlockAttempt(true, 0);
             mCallback.dismiss(true);
         } else {
-            if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
-                // to avoid accidental lockout, only count attempts that are long enough to be a
-                // real password. This may require some tweaking.
-                mCallback.reportUnlockAttempt(false);
-                int attempts = KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
-                if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
-                    long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
-                            KeyguardUpdateMonitor.getCurrentUser());
-                    handleAttemptLockout(deadline);
-                }
+            mCallback.reportUnlockAttempt(false, timeoutMs);
+            int attempts = KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
+            if (timeoutMs > 0) {
+                long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
+                        KeyguardUpdateMonitor.getCurrentUser(), timeoutMs);
+                handleAttemptLockout(deadline);
             }
             mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(), true);
         }
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
index 35c6873..ed595c0 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java
@@ -224,23 +224,30 @@
                 mPendingLockCheck.cancel(false);
             }
 
+            if (pattern.size() < LockPatternUtils.MIN_PATTERN_REGISTER_FAIL) {
+                mLockPatternView.enableInput();
+                onPatternChecked(pattern, false, 0);
+                return;
+            }
+
             mPendingLockCheck = LockPatternChecker.checkPattern(
                     mLockPatternUtils,
                     pattern,
                     KeyguardUpdateMonitor.getCurrentUser(),
                     new LockPatternChecker.OnCheckCallback() {
                         @Override
-                        public void onChecked(boolean matched) {
+                        public void onChecked(boolean matched, int timeoutMs) {
                             mLockPatternView.enableInput();
                             mPendingLockCheck = null;
-                            onPatternChecked(pattern, matched);
+                            onPatternChecked(pattern, matched, timeoutMs);
                         }
                     });
         }
 
-        private void onPatternChecked(List<LockPatternView.Cell> pattern, boolean matched) {
+        private void onPatternChecked(List<LockPatternView.Cell> pattern, boolean matched,
+                int timeoutMs) {
             if (matched) {
-                mCallback.reportUnlockAttempt(true);
+                mCallback.reportUnlockAttempt(true, 0);
                 mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Correct);
                 mCallback.dismiss(true);
             } else {
@@ -248,16 +255,11 @@
                     mCallback.userActivity();
                 }
                 mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
-                boolean registeredAttempt =
-                        pattern.size() >= LockPatternUtils.MIN_PATTERN_REGISTER_FAIL;
-                if (registeredAttempt) {
-                    mCallback.reportUnlockAttempt(false);
-                }
+                mCallback.reportUnlockAttempt(false, timeoutMs);
                 int attempts = mKeyguardUpdateMonitor.getFailedUnlockAttempts();
-                if (registeredAttempt &&
-                        0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
+                if (timeoutMs > 0) {
                     long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
-                            KeyguardUpdateMonitor.getCurrentUser());
+                            KeyguardUpdateMonitor.getCurrentUser(), timeoutMs);
                     handleAttemptLockout(deadline);
                 } else {
                     mSecurityMessageDisplay.setMessage(R.string.kg_wrong_pattern, true);
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
index 5877bc8..836c195 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityCallback.java
@@ -37,8 +37,10 @@
     /**
      * Call to report an unlock attempt.
      * @param success set to 'true' if user correctly entered security credentials.
+     * @param timeoutMs timeout in milliseconds to wait before reattempting an unlock.
+     *                  Only nonzero if 'success' is false
      */
-    void reportUnlockAttempt(boolean success);
+    void reportUnlockAttempt(boolean success, int timeoutMs);
 
     /**
      * Resets the keyguard view.
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
index 4d89a8d..d17b25a 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -176,8 +176,8 @@
         dialog.show();
     }
 
-    private void showTimeoutDialog() {
-        int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
+    private void showTimeoutDialog(int timeoutMs) {
+        int timeoutInSeconds = (int) timeoutMs / 1000;
         int messageId = 0;
 
         switch (mSecurityModel.getSecurityMode()) {
@@ -244,16 +244,7 @@
         showDialog(null, message);
     }
 
-    private void showAlmostAtAccountLoginDialog() {
-        final int timeoutInSeconds = (int) LockPatternUtils.FAILED_ATTEMPT_TIMEOUT_MS / 1000;
-        final int count = LockPatternUtils.FAILED_ATTEMPTS_BEFORE_RESET
-                - LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT;
-        String message = mContext.getString(R.string.kg_failed_attempts_almost_at_login,
-                count, LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT, timeoutInSeconds);
-        showDialog(null, message);
-    }
-
-    private void reportFailedUnlockAttempt() {
+    private void reportFailedUnlockAttempt(int timeoutMs) {
         final KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
         final int failedAttempts = monitor.getFailedUnlockAttempts() + 1; // +1 for this time
 
@@ -290,14 +281,11 @@
                 Slog.i(TAG, "Too many unlock attempts; user " + expiringUser + " will be wiped!");
                 showWipeDialog(failedAttempts, userType);
             }
-        } else {
-            showTimeout =
-                (failedAttempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) == 0;
         }
         monitor.reportFailedUnlockAttempt();
         mLockPatternUtils.reportFailedPasswordAttempt(KeyguardUpdateMonitor.getCurrentUser());
-        if (showTimeout) {
-            showTimeoutDialog();
+        if (timeoutMs > 0) {
+            showTimeoutDialog(timeoutMs);
         }
     }
 
@@ -425,14 +413,14 @@
             return mIsVerifyUnlockOnly;
         }
 
-        public void reportUnlockAttempt(boolean success) {
+        public void reportUnlockAttempt(boolean success, int timeoutMs) {
             KeyguardUpdateMonitor monitor = KeyguardUpdateMonitor.getInstance(mContext);
             if (success) {
                 monitor.clearFailedUnlockAttempts();
                 mLockPatternUtils.reportSuccessfulPasswordAttempt(
                         KeyguardUpdateMonitor.getCurrentUser());
             } else {
-                KeyguardSecurityContainer.this.reportFailedUnlockAttempt();
+                KeyguardSecurityContainer.this.reportFailedUnlockAttempt(timeoutMs);
             }
         }
 
@@ -448,7 +436,7 @@
         @Override
         public void userActivity() { }
         @Override
-        public void reportUnlockAttempt(boolean success) { }
+        public void reportUnlockAttempt(boolean success, int timeoutMs) { }
         @Override
         public boolean isVerifyUnlockOnly() { return false; }
         @Override
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 5360645..3c30d8c 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -659,6 +659,7 @@
     }
 
     protected void handleScreenTurnedOn() {
+        updateFingerprintListeningState();
         final int count = mCallbacks.size();
         for (int i = 0; i < count; i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
@@ -666,7 +667,6 @@
                 cb.onScreenTurnedOn();
             }
         }
-        updateFingerprintListeningState();
     }
 
     protected void handleScreenTurnedOff(int arg1) {
diff --git a/packages/PrintSpooler/res/values/themes.xml b/packages/PrintSpooler/res/values/themes.xml
index db319e9..05de5b7 100644
--- a/packages/PrintSpooler/res/values/themes.xml
+++ b/packages/PrintSpooler/res/values/themes.xml
@@ -16,7 +16,7 @@
 
 <resources>
 
-    <style name="PrintActivity" parent="@android:style/Theme.Material.Settings">
+    <style name="PrintActivity" parent="@android:style/Theme.DeviceDefault">
         <item name="android:windowIsTranslucent">true</item>
         <item name="android:windowBackground">@android:color/transparent</item>
         <item name="android:windowContentOverlay">@null</item>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_1_path_animation.xml
similarity index 89%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_1_path_animation.xml
index ada7c10..18bc8a2 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_1_path_animation.xml
@@ -14,12 +14,13 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
+
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="16"
+            android:duration="60"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="0.0"
@@ -31,6 +32,6 @@
             android:valueFrom="0.0"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_2_path_animation.xml
similarity index 76%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_2_path_animation.xml
index a1cf8df..531fac0 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_2_path_animation.xml
@@ -17,10 +17,10 @@
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
+        android:duration="140"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="1.0"
+        android:valueTo="0.0"
         android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
+        android:interpolator="@interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_0" />
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_5_path_animation.xml
similarity index 87%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_5_path_animation.xml
index 3bacf03..87c7f21 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_5_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="16"
+            android:duration="20"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="0.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="66"
+            android:duration="180"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_6_path_animation.xml
similarity index 76%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_6_path_animation.xml
index a1cf8df..e0a66d9 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_6_path_animation.xml
@@ -17,10 +17,10 @@
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
+        android:duration="190"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="1.0"
+        android:valueTo="0.0"
         android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
+        android:interpolator="@interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1" />
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_7_path_animation.xml
similarity index 87%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_7_path_animation.xml
index 3bacf03..9b0e17b 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_off_ridge_7_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="16"
+            android:duration="10"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="0.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="66"
+            android:duration="160"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_1_path_animation.xml
similarity index 82%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_1_path_animation.xml
index 3a18296..eb323f5 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_1_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="16"
+            android:duration="316"
             android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="133"
-            android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
+            android:valueFrom="0.0"
             android:valueTo="0.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="383"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_2_path_animation.xml
similarity index 87%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_2_path_animation.xml
index 454be24..cae4a70 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_2_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="233"
+            android:duration="216"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="1.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="466"
+            android:duration="400"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="0.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/fast_out_slow_in" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_5_path_animation.xml
similarity index 83%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_5_path_animation.xml
index 8c6e71d..0be6c9e 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_5_path_animation.xml
@@ -20,17 +20,17 @@
         android:ordering="sequentially" >
         <objectAnimator
             android:duration="33"
-            android:propertyName="trimPathStart"
+            android:propertyName="trimPathEnd"
             android:valueFrom="0.0"
             android:valueTo="0.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="150"
-            android:propertyName="trimPathStart"
+            android:duration="383"
+            android:propertyName="trimPathEnd"
             android:valueFrom="0.0"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_0" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_6_path_animation.xml
similarity index 87%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_6_path_animation.xml
index 454be24..5d2cdb6 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_6_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="233"
+            android:duration="50"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="1.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="466"
+            android:duration="549"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="0.0"
             android:valueType="floatType"
-            android:interpolator="@android:interpolator/fast_out_slow_in" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_7_path_animation.xml
similarity index 82%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_7_path_animation.xml
index 3a18296..6f8b559 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_draw_on_ridge_7_path_animation.xml
@@ -19,18 +19,18 @@
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="16"
+            android:duration="83"
             android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="133"
-            android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
+            android:valueFrom="0.0"
             android:valueTo="0.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="483"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_fingerprint_ridges_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_fingerprint_ridges_animation.xml
deleted file mode 100644
index c6a4622..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_fingerprint_ridges_animation.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="100"
-            android:propertyName="rotation"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="566"
-            android:propertyName="rotation"
-            android:valueFrom="0.0"
-            android:valueTo="-305.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3" />
-        <objectAnimator
-            android:duration="1066"
-            android:propertyName="rotation"
-            android:valueFrom="-305.0"
-            android:valueTo="-305.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-        <objectAnimator
-            android:duration="800"
-            android:propertyName="rotation"
-            android:valueFrom="-305.0"
-            android:valueTo="-720.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_1_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_1_animation.xml
deleted file mode 100644
index 0e2c2f0..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_1_animation.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="183"
-            android:propertyName="rotation"
-            android:valueFrom="285.0"
-            android:valueTo="285.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="516"
-            android:propertyName="rotation"
-            android:valueFrom="285.0"
-            android:valueTo="90.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_0_animation.xml
deleted file mode 100644
index faeecf4..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_0_animation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="133"
-        android:propertyName="trimPathEnd"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/fast_out_slow_in" />
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="100"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="100"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_2" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_0_animation.xml
deleted file mode 100644
index 80a0faa..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_2_path_0_animation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="116"
-            android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="116"
-            android:propertyName="trimPathEnd"
-            android:valueFrom="1.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3" />
-    </set>
-    <objectAnimator
-        android:duration="166"
-        android:propertyName="trimPathStart"
-        android:valueFrom="1.0"
-        android:valueTo="0.0"
-        android:valueType="floatType"
-        android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3" />
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_0_animation.xml
deleted file mode 100644
index 1e16df7..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_0_animation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="166"
-        android:propertyName="trimPathEnd"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/fast_out_slow_in" />
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="150"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="166"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_2" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_0_animation.xml
deleted file mode 100644
index f88c070..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_6_path_0_animation.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="250"
-        android:propertyName="trimPathEnd"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="133"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="216"
-            android:propertyName="trimPathStart"
-            android:valueFrom="0.0"
-            android:valueTo="1.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_1_animation.xml
similarity index 78%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_1_animation.xml
index a1cf8df..0c87c4b 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_1_animation.xml
@@ -14,13 +14,14 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
+
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
+        android:duration="416"
+        android:propertyName="rotation"
+        android:valueFrom="430.0"
+        android:valueTo="206.0"
         android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
+        android:interpolator="@android:interpolator/fast_out_linear_in" />
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_2_animation.xml
similarity index 79%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_2_animation.xml
index a1cf8df..0ff1c8c 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_group_2_animation.xml
@@ -14,13 +14,14 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
+
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
+        android:duration="233"
+        android:propertyName="rotation"
         android:valueFrom="0.0"
-        android:valueTo="1.0"
+        android:valueTo="-289.0"
         android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
+        android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_1" />
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_1_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_1_animation.xml
new file mode 100644
index 0000000..a1cadf8
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_1_animation.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="16"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+            android:valueTo="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="83"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+            android:valueTo="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 -0.0213623046875,0.0250244140625 -0.0213623046875,0.0250244140625 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0213623046875,-0.0250244140625 0.0213623046875,-0.0250244140625 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_2_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_2_animation.xml
new file mode 100644
index 0000000..1ca49ba
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_2_animation.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
+            android:valueTo="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="83"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
+            android:valueTo="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0340270996094,0.050048828125 0.0340270996094,0.050048828125 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 -0.0340270996094,-0.050048828125 -0.0340270996094,-0.050048828125 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_3_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_3_animation.xml
new file mode 100644
index 0000000..8491747
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_path_3_animation.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <objectAnimator
+        android:duration="383"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="1.0"
+        android:valueTo="0.0"
+        android:valueType="floatType"
+        android:interpolator="@android:interpolator/fast_out_linear_in" />
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_1_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_1_path_animation.xml
new file mode 100644
index 0000000..b9636ae
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_1_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="400"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="199"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_2" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_2_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_2_path_animation.xml
new file mode 100644
index 0000000..c1a3ecf
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_2_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="333"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="200"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_3" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_5_path_animation.xml
new file mode 100644
index 0000000..e285edc
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_5_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="216"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="316"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_0" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_6_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_6_path_animation.xml
new file mode 100644
index 0000000..2ea1021
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_6_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="183"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="350"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_5" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_7_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_7_path_animation.xml
new file mode 100644
index 0000000..1481cfa
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_ridge_7_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="233"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="200"
+            android:propertyName="trimPathStart"
+            android:valueFrom="1.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_2" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_white_fingerprint_ridges_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_white_fingerprint_ridges_animation.xml
new file mode 100644
index 0000000..9dc587c
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_to_fp_white_fingerprint_ridges_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="183"
+            android:propertyName="rotation"
+            android:valueFrom="200.66753"
+            android:valueTo="200.66753"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="266"
+            android:propertyName="rotation"
+            android:valueFrom="200.66753"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_4" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_white_fingerprint_ridges_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_white_fingerprint_ridges_animation.xml
deleted file mode 100644
index c6a4622..0000000
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_white_fingerprint_ridges_animation.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <set
-        android:ordering="sequentially" >
-        <objectAnimator
-            android:duration="100"
-            android:propertyName="rotation"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
-            android:valueType="floatType"
-            android:interpolator="@android:interpolator/linear" />
-        <objectAnimator
-            android:duration="566"
-            android:propertyName="rotation"
-            android:valueFrom="0.0"
-            android:valueTo="-305.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3" />
-        <objectAnimator
-            android:duration="1066"
-            android:propertyName="rotation"
-            android:valueFrom="-305.0"
-            android:valueTo="-305.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-        <objectAnimator
-            android:duration="800"
-            android:propertyName="rotation"
-            android:valueFrom="-305.0"
-            android:valueTo="-720.0"
-            android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0" />
-    </set>
-</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_fingerprint_ridges_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_fingerprint_ridges_animation.xml
new file mode 100644
index 0000000..ada4213
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_fingerprint_ridges_animation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="rotation"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="516"
+            android:propertyName="rotation"
+            android:valueFrom="0.0"
+            android:valueTo="-305.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3" />
+        <objectAnimator
+            android:duration="1116"
+            android:propertyName="rotation"
+            android:valueFrom="-305.0"
+            android:valueTo="-305.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+        <objectAnimator
+            android:duration="800"
+            android:propertyName="rotation"
+            android:valueFrom="-305.0"
+            android:valueTo="-720.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_1_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_1_animation.xml
new file mode 100644
index 0000000..2cdd02c
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_1_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="183"
+            android:propertyName="rotation"
+            android:valueFrom="231.0"
+            android:valueTo="231.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="400"
+            android:propertyName="rotation"
+            android:valueFrom="231.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_4" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_2_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_2_animation.xml
similarity index 60%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_2_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_2_animation.xml
index c01010d..7b62f20 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_group_2_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_group_2_animation.xml
@@ -1,59 +1,44 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="283"
+            android:duration="266"
             android:propertyName="scaleX"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
+            android:valueFrom="0.63838"
+            android:valueTo="0.63838"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
             android:duration="316"
             android:propertyName="scaleX"
-            android:valueFrom="0.0"
+            android:valueFrom="0.63838"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_1" />
     </set>
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="283"
+            android:duration="266"
             android:propertyName="scaleY"
-            android:valueFrom="0.0"
-            android:valueTo="0.0"
+            android:valueFrom="0.63838"
+            android:valueTo="0.63838"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
             android:duration="316"
             android:propertyName="scaleY"
-            android:valueFrom="0.0"
+            android:valueFrom="0.63838"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_1" />
     </set>
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="283"
+            android:duration="266"
             android:propertyName="rotation"
             android:valueFrom="184.0"
             android:valueTo="184.0"
@@ -65,6 +50,6 @@
             android:valueFrom="184.0"
             android:valueTo="0.0"
             android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_4" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_1_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_1_animation.xml
new file mode 100644
index 0000000..bdd24b7
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_1_animation.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="316"
+            android:propertyName="pathData"
+            android:valueFrom="M -1.3737487793,-6.77532958984 c 0.0,0.0 0.00604248046875,0.0166625976562 0.00604248046876,0.0166625976562 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 -0.00604248046875,-0.0166625976562 -0.00604248046876,-0.0166625976562 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
+            android:valueTo="M -1.3737487793,-6.77532958984 c 0.0,0.0 0.00604248046875,0.0166625976562 0.00604248046876,0.0166625976562 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 -0.00604248046875,-0.0166625976562 -0.00604248046876,-0.0166625976562 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="16"
+            android:propertyName="pathData"
+            android:valueFrom="M -1.3737487793,-6.77532958984 c 0.0,0.0 0.00604248046875,0.0166625976562 0.00604248046876,0.0166625976562 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 -0.00604248046875,-0.0166625976562 -0.00604248046876,-0.0166625976562 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
+            android:valueTo="M 1.33227539062,-6.75866699219 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="133"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.33227539062,-6.75866699219 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
+            android:valueTo="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+            android:valueType="pathType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_5" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_2_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_2_animation.xml
new file mode 100644
index 0000000..8ec7c30
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_2_animation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="316"
+            android:propertyName="pathData"
+            android:valueFrom="M -1.3705291748,4.06730651855 c 0.0,0.0 0.036376953125,-0.0102386474609 0.036376953125,-0.0102386474609 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 -0.0161437988281,0.00479125976562 -0.0161437988281,0.00479125976563 c 0.0,0.0 -0.0134124755859,0.00141906738281 -0.0134124755859,0.00141906738281 Z"
+            android:valueTo="M -1.3705291748,4.06730651855 c 0.0,0.0 0.036376953125,-0.0102386474609 0.036376953125,-0.0102386474609 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 -0.0161437988281,0.00479125976562 -0.0161437988281,0.00479125976563 c 0.0,0.0 -0.0134124755859,0.00141906738281 -0.0134124755859,0.00141906738281 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="16"
+            android:propertyName="pathData"
+            android:valueFrom="M -1.3705291748,4.06730651855 c 0.0,0.0 0.036376953125,-0.0102386474609 0.036376953125,-0.0102386474609 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 -0.0161437988281,0.00479125976562 -0.0161437988281,0.00479125976563 c 0.0,0.0 -0.0134124755859,0.00141906738281 -0.0134124755859,0.00141906738281 Z"
+            android:valueTo="M 1.36582946777,4.05706787109 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 2.72023010254,-0.00544738769531 2.72023010254,-0.00544738769531 c 0.0,0.0 -0.013427734375,0.00141906738281 -0.013427734375,0.00141906738281 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.36582946777,4.05706787109 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 2.72023010254,-0.00544738769531 2.72023010254,-0.00544738769531 c 0.0,0.0 -0.013427734375,0.00141906738281 -0.013427734375,0.00141906738281 Z"
+            android:valueTo="M 1.36582946777,4.05706787109 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.00682067871094,-0.0040283203125 0.00682067871094,-0.0040283203125 Z"
+            android:valueType="pathType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="99"
+            android:propertyName="pathData"
+            android:valueFrom="M 1.36582946777,4.05706787109 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.00682067871094,-0.0040283203125 0.00682067871094,-0.0040283203125 Z"
+            android:valueTo="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
+            android:valueType="pathType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_5" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_3_animation.xml
similarity index 94%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_3_animation.xml
index 454be24..ec65805 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_path_3_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_path_3_animation.xml
@@ -14,19 +14,20 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
+
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <set
         android:ordering="sequentially" >
         <objectAnimator
-            android:duration="233"
+            android:duration="183"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="1.0"
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="466"
+            android:duration="400"
             android:propertyName="trimPathStart"
             android:valueFrom="1.0"
             android:valueTo="0.0"
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_0_animation.xml
new file mode 100644
index 0000000..26622dd
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_0_animation.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <objectAnimator
+        android:duration="133"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="0.0"
+        android:valueTo="1.0"
+        android:valueType="floatType"
+        android:interpolator="@android:interpolator/fast_out_slow_in" />
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_2" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_animation.xml
similarity index 99%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_animation.xml
index 3bacf03..443e6fb 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_1_path_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_animation.xml
@@ -14,6 +14,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
+
 <set
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <set
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_0_animation.xml
new file mode 100644
index 0000000..f383c0a
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_0_animation.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="116"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="1.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="116"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="1.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3" />
+    </set>
+    <objectAnimator
+        android:duration="166"
+        android:propertyName="trimPathStart"
+        android:valueFrom="1.0"
+        android:valueTo="0.0"
+        android:valueType="floatType"
+        android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3" />
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_animation.xml
new file mode 100644
index 0000000..f8140d5
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="16"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="1.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="133"
+            android:propertyName="trimPathEnd"
+            android:valueFrom="1.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_0_animation.xml
new file mode 100644
index 0000000..870c44d
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_0_animation.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <objectAnimator
+        android:duration="166"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="0.0"
+        android:valueTo="1.0"
+        android:valueType="floatType"
+        android:interpolator="@android:interpolator/fast_out_slow_in" />
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="150"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="166"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_2" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_animation.xml
new file mode 100644
index 0000000..eef1efd
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_animation.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <objectAnimator
+        android:duration="150"
+        android:propertyName="trimPathStart"
+        android:valueFrom="0.0"
+        android:valueTo="1.0"
+        android:valueType="floatType"
+        android:interpolator="@android:interpolator/linear" />
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_0_animation.xml
new file mode 100644
index 0000000..1b8a77f
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_0_animation.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <objectAnimator
+        android:duration="250"
+        android:propertyName="trimPathEnd"
+        android:valueFrom="0.0"
+        android:valueTo="1.0"
+        android:valueType="floatType"
+        android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="133"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="216"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_animation.xml
new file mode 100644
index 0000000..ad37bc1
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="16"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="216"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_0_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_0_animation.xml
similarity index 65%
rename from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_0_animation.xml
rename to packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_0_animation.xml
index e6b12da..cd04aba 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_7_path_0_animation.xml
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_0_animation.xml
@@ -1,19 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
     xmlns:android="http://schemas.android.com/apk/res/android" >
     <set
@@ -43,11 +28,11 @@
             android:valueType="floatType"
             android:interpolator="@android:interpolator/linear" />
         <objectAnimator
-            android:duration="266"
+            android:duration="199"
             android:propertyName="trimPathStart"
             android:valueFrom="0.0"
             android:valueTo="1.0"
             android:valueType="floatType"
-            android:interpolator="@interpolator/lockscreen_fingerprint_error_state_animation_interpolator_2" />
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_2" />
     </set>
 </set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_animation.xml
new file mode 100644
index 0000000..a09bdea
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_animation.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="33"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="150"
+            android:propertyName="trimPathStart"
+            android:valueFrom="0.0"
+            android:valueTo="1.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_white_fingerprint_ridges_animation.xml b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_white_fingerprint_ridges_animation.xml
new file mode 100644
index 0000000..ada4213
--- /dev/null
+++ b/packages/SystemUI/res/anim/lockscreen_fingerprint_fp_to_error_state_white_fingerprint_ridges_animation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set
+    xmlns:android="http://schemas.android.com/apk/res/android" >
+    <set
+        android:ordering="sequentially" >
+        <objectAnimator
+            android:duration="100"
+            android:propertyName="rotation"
+            android:valueFrom="0.0"
+            android:valueTo="0.0"
+            android:valueType="floatType"
+            android:interpolator="@android:interpolator/linear" />
+        <objectAnimator
+            android:duration="516"
+            android:propertyName="rotation"
+            android:valueFrom="0.0"
+            android:valueTo="-305.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3" />
+        <objectAnimator
+            android:duration="1116"
+            android:propertyName="rotation"
+            android:valueFrom="-305.0"
+            android:valueTo="-305.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+        <objectAnimator
+            android:duration="800"
+            android:propertyName="rotation"
+            android:valueFrom="-305.0"
+            android:valueTo="-720.0"
+            android:valueType="floatType"
+            android:interpolator="@interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0" />
+    </set>
+</set>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off.xml
new file mode 100644
index 0000000..81da26d
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="lockscreen_fingerprint_draw_off"
+    android:width="32dp"
+    android:viewportWidth="32"
+    android:height="32dp"
+    android:viewportHeight="32" >
+    <group
+        android:name="white_fingerprint_ridges"
+        android:translateX="16.125"
+        android:translateY="19.75" >
+        <group
+            android:name="white_fingerprint_ridges_pivot"
+            android:translateX="33.2085"
+            android:translateY="30.91685" >
+            <group
+                android:name="ridge_5" >
+                <path
+                    android:name="ridge_5_path"
+                    android:pathData="M -25.3591003418,-24.4138946533 c -0.569000244141,0.106399536133 -1.12660217285,0.140594482422 -1.45460510254,0.140594482422 c -1.29689025879,0.0 -2.53239440918,-0.343307495117 -3.62019348145,-1.12400817871 c -1.67700195312,-1.20349121094 -2.76950073242,-3.17008972168 -2.76950073242,-5.39189147949"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round" />
+            </group>
+            <group
+                android:name="ridge_4" >
+                <path
+                    android:name="ridge_7_path"
+                    android:pathData="M -36.1409912109,-21.7843475342 c -1.00540161133,-1.19300842285 -1.57499694824,-1.9181060791 -2.36520385742,-3.50170898438 c -0.827560424805,-1.65869140625 -1.31352233887,-3.49159240723 -1.31352233887,-5.48489379883 c 0.0,-3.66279602051 2.96932983398,-6.63220214844 6.63221740723,-6.63220214844 c 3.6628112793,0.0 6.63220214844,2.96940612793 6.63220214844,6.63220214844"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round" />
+            </group>
+            <group
+                android:name="ridge_3" >
+                <path
+                    android:name="ridge_6_path"
+                    android:pathData="M -42.1907958984,-25.6756896973 c -0.758117675781,-2.14370727539 -0.896545410156,-3.86891174316 -0.896545410156,-5.12921142578 c 0.0,-1.46069335938 0.249176025391,-2.84799194336 0.814682006836,-4.09748840332 c 1.56153869629,-3.45030212402 5.03434753418,-5.85076904297 9.0679473877,-5.85076904297 c 5.49430847168,0.0 9.94830322266,4.4539642334 9.94830322266,9.94825744629 c 0.0,1.83151245117 -1.48460388184,3.31610107422 -3.31610107422,3.31610107422 c -1.83149719238,0.0 -3.31610107422,-1.48469543457 -3.31610107422,-3.31610107422 c 0.0,-1.83139038086 -1.48458862305,-3.31610107422 -3.31610107422,-3.31610107422 c -1.83149719238,0.0 -3.31610107422,1.48471069336 -3.31610107422,3.31610107422 c 0.0,2.57020568848 0.989517211914,4.88710021973 2.60510253906,6.5865020752 c 1.22210693359,1.28550720215 2.43139648438,2.09950256348 4.47590637207,2.69030761719"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round" />
+            </group>
+            <group
+                android:name="ridge_2" >
+                <path
+                    android:name="ridge_2_path"
+                    android:pathData="M -44.0646514893,-38.1672973633 c 1.19026184082,-1.77430725098 2.67503356934,-3.24531555176 4.55902099609,-4.27278137207 c 1.88395690918,-1.0274810791 4.04466247559,-1.61137390137 6.34175109863,-1.61137390137 c 2.28761291504,0.0 4.43991088867,0.579071044922 6.31831359863,1.59861755371 c 1.8784942627,1.01954650879 3.36059570312,2.4796295166 4.55279541016,4.24153137207"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round" />
+            </group>
+            <group
+                android:name="ridge_1"
+                android:translateX="-97.5"
+                android:translateY="-142.5" >
+                <path
+                    android:name="ridge_1_path"
+                    android:pathData="M 71.7812347412,97.0507202148 c -2.27149963379,-1.31344604492 -4.71360778809,-2.07006835938 -7.56221008301,-2.07006835938 c -2.84869384766,0.0 -5.23320007324,0.779556274414 -7.34411621094,2.07006835938"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round" />
+            </group>
+        </group>
+    </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off_animation.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off_animation.xml
new file mode 100644
index 0000000..1599577
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_off_animation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<animated-vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/lockscreen_fingerprint_draw_off" >
+    <target
+        android:name="ridge_5_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_off_ridge_5_path_animation" />
+    <target
+        android:name="ridge_7_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_off_ridge_7_path_animation" />
+    <target
+        android:name="ridge_6_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_off_ridge_6_path_animation" />
+    <target
+        android:name="ridge_2_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_off_ridge_2_path_animation" />
+    <target
+        android:name="ridge_1_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_off_ridge_1_path_animation" />
+</animated-vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on.xml
new file mode 100644
index 0000000..8b517b6
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="lockscreen_fingerprint_draw_on"
+    android:width="32dp"
+    android:viewportWidth="32"
+    android:height="32dp"
+    android:viewportHeight="32" >
+    <group
+        android:name="white_fingerprint_ridges"
+        android:translateX="16.125"
+        android:translateY="19.75" >
+        <group
+            android:name="white_fingerprint_ridges_pivot"
+            android:translateX="33.2085"
+            android:translateY="30.91685" >
+            <group
+                android:name="ridge_5" >
+                <path
+                    android:name="ridge_5_path"
+                    android:pathData="M -25.3591003418,-24.4138946533 c -0.569000244141,0.106399536133 -1.12660217285,0.140594482422 -1.45460510254,0.140594482422 c -1.29689025879,0.0 -2.53239440918,-0.343307495117 -3.62019348145,-1.12400817871 c -1.67700195312,-1.20349121094 -2.76950073242,-3.17008972168 -2.76950073242,-5.39189147949"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathEnd="0" />
+            </group>
+            <group
+                android:name="ridge_4" >
+                <path
+                    android:name="ridge_7_path"
+                    android:pathData="M -36.1409912109,-21.7843475342 c -1.00540161133,-1.19300842285 -1.57499694824,-1.9181060791 -2.36520385742,-3.50170898438 c -0.827560424805,-1.65869140625 -1.31352233887,-3.49159240723 -1.31352233887,-5.48489379883 c 0.0,-3.66279602051 2.96932983398,-6.63220214844 6.63221740723,-6.63220214844 c 3.6628112793,0.0 6.63220214844,2.96940612793 6.63220214844,6.63220214844"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathEnd="0" />
+            </group>
+            <group
+                android:name="ridge_3" >
+                <path
+                    android:name="ridge_6_path"
+                    android:pathData="M -42.1907958984,-25.6756896973 c -0.758117675781,-2.14370727539 -0.896545410156,-3.86891174316 -0.896545410156,-5.12921142578 c 0.0,-1.46069335938 0.249176025391,-2.84799194336 0.814682006836,-4.09748840332 c 1.56153869629,-3.45030212402 5.03434753418,-5.85076904297 9.0679473877,-5.85076904297 c 5.49430847168,0.0 9.94830322266,4.4539642334 9.94830322266,9.94825744629 c 0.0,1.83151245117 -1.48460388184,3.31610107422 -3.31610107422,3.31610107422 c -1.83149719238,0.0 -3.31610107422,-1.48469543457 -3.31610107422,-3.31610107422 c 0.0,-1.83139038086 -1.48458862305,-3.31610107422 -3.31610107422,-3.31610107422 c -1.83149719238,0.0 -3.31610107422,1.48471069336 -3.31610107422,3.31610107422 c 0.0,2.57020568848 0.989517211914,4.88710021973 2.60510253906,6.5865020752 c 1.22210693359,1.28550720215 2.43139648438,2.09950256348 4.47590637207,2.69030761719"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathStart="1" />
+            </group>
+            <group
+                android:name="ridge_2" >
+                <path
+                    android:name="ridge_2_path"
+                    android:pathData="M -44.0646514893,-38.1672973633 c 1.19026184082,-1.77430725098 2.67503356934,-3.24531555176 4.55902099609,-4.27278137207 c 1.88395690918,-1.0274810791 4.04466247559,-1.61137390137 6.34175109863,-1.61137390137 c 2.28761291504,0.0 4.43991088867,0.579071044922 6.31831359863,1.59861755371 c 1.8784942627,1.01954650879 3.36059570312,2.4796295166 4.55279541016,4.24153137207"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathStart="1" />
+            </group>
+            <group
+                android:name="ridge_1"
+                android:translateX="-97.5"
+                android:translateY="-142.5" >
+                <path
+                    android:name="ridge_1_path"
+                    android:pathData="M 71.7812347412,97.0507202148 c -2.27149963379,-1.31344604492 -4.71360778809,-2.07006835938 -7.56221008301,-2.07006835938 c -2.84869384766,0.0 -5.23320007324,0.779556274414 -7.34411621094,2.07006835938"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathEnd="0" />
+            </group>
+        </group>
+    </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on_animation.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on_animation.xml
new file mode 100644
index 0000000..d1aac02
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_draw_on_animation.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<animated-vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/lockscreen_fingerprint_draw_on" >
+    <target
+        android:name="ridge_5_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_on_ridge_5_path_animation" />
+    <target
+        android:name="ridge_7_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_on_ridge_7_path_animation" />
+    <target
+        android:name="ridge_6_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_on_ridge_6_path_animation" />
+    <target
+        android:name="ridge_2_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_on_ridge_2_path_animation" />
+    <target
+        android:name="ridge_1_path"
+        android:animation="@anim/lockscreen_fingerprint_draw_on_ridge_1_path_animation" />
+</animated-vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml
new file mode 100644
index 0000000..67e6a01
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:name="lockscreen_fingerprint_error_state_to_fp"
+    android:width="32dp"
+    android:viewportWidth="32"
+    android:height="32dp"
+    android:viewportHeight="32" >
+    <group
+        android:name="white_fingerprint_ridges"
+        android:translateX="16.125"
+        android:translateY="19.75"
+        android:rotation="200.66753" >
+        <group
+            android:name="white_fingerprint_ridges_pivot"
+            android:translateX="33.2085"
+            android:translateY="30.91685" >
+            <group
+                android:name="ridge_5" >
+                <path
+                    android:name="ridge_5_path"
+                    android:pathData="M -25.3591003418,-24.4138946533 c -0.569000244141,0.106399536133 -1.12660217285,0.140594482422 -1.45460510254,0.140594482422 c -1.29689025879,0.0 -2.53239440918,-0.343307495117 -3.62019348145,-1.12400817871 c -1.67700195312,-1.20349121094 -2.76950073242,-3.17008972168 -2.76950073242,-5.39189147949"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathEnd="0" />
+            </group>
+            <group
+                android:name="ridge_4" >
+                <path
+                    android:name="ridge_7_path"
+                    android:pathData="M -36.1409912109,-21.7843475342 c -1.00540161133,-1.19300842285 -1.57499694824,-1.9181060791 -2.36520385742,-3.50170898438 c -0.827560424805,-1.65869140625 -1.31352233887,-3.49159240723 -1.31352233887,-5.48489379883 c 0.0,-3.66279602051 2.96932983398,-6.63220214844 6.63221740723,-6.63220214844 c 3.6628112793,0.0 6.63220214844,2.96940612793 6.63220214844,6.63220214844"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathStart="1" />
+            </group>
+            <group
+                android:name="ridge_3" >
+                <path
+                    android:name="ridge_6_path"
+                    android:pathData="M -42.1907958984,-25.6756896973 c -0.758117675781,-2.14370727539 -0.896545410156,-3.86891174316 -0.896545410156,-5.12921142578 c 0.0,-1.46069335938 0.249176025391,-2.84799194336 0.814682006836,-4.09748840332 c 1.56153869629,-3.45030212402 5.03434753418,-5.85076904297 9.0679473877,-5.85076904297 c 5.49430847168,0.0 9.94830322266,4.4539642334 9.94830322266,9.94825744629 c 0.0,1.83151245117 -1.48460388184,3.31610107422 -3.31610107422,3.31610107422 c -1.83149719238,0.0 -3.31610107422,-1.48469543457 -3.31610107422,-3.31610107422 c 0.0,-1.83139038086 -1.48458862305,-3.31610107422 -3.31610107422,-3.31610107422 c -1.83149719238,0.0 -3.31610107422,1.48471069336 -3.31610107422,3.31610107422 c 0.0,2.57020568848 0.989517211914,4.88710021973 2.60510253906,6.5865020752 c 1.22210693359,1.28550720215 2.43139648438,2.09950256348 4.47590637207,2.69030761719"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathStart="1" />
+            </group>
+            <group
+                android:name="ridge_2" >
+                <path
+                    android:name="ridge_2_path"
+                    android:pathData="M -44.0646514893,-38.1672973633 c 1.19026184082,-1.77430725098 2.67503356934,-3.24531555176 4.55902099609,-4.27278137207 c 1.88395690918,-1.0274810791 4.04466247559,-1.61137390137 6.34175109863,-1.61137390137 c 2.28761291504,0.0 4.43991088867,0.579071044922 6.31831359863,1.59861755371 c 1.8784942627,1.01954650879 3.36059570312,2.4796295166 4.55279541016,4.24153137207"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathStart="1" />
+            </group>
+            <group
+                android:name="ridge_1"
+                android:translateX="-97.5"
+                android:translateY="-142.5" >
+                <path
+                    android:name="ridge_1_path"
+                    android:pathData="M 71.7812347412,97.0507202148 c -2.27149963379,-1.31344604492 -4.71360778809,-2.07006835938 -7.56221008301,-2.07006835938 c -2.84869384766,0.0 -5.23320007324,0.779556274414 -7.34411621094,2.07006835938"
+                    android:strokeColor="#FFFFFFFF"
+                    android:strokeAlpha="0.5"
+                    android:strokeWidth="1.45"
+                    android:strokeLineCap="round"
+                    android:trimPathEnd="0" />
+            </group>
+        </group>
+    </group>
+    <group
+        android:name="exclamation"
+        android:translateX="16"
+        android:translateY="16" >
+        <group
+            android:name="group_2" >
+            <path
+                android:name="path_2"
+                android:pathData="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z"
+                android:fillColor="#FFF2501D" />
+            <path
+                android:name="path_1"
+                android:pathData="M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+                android:fillColor="#FFF2501D" />
+        </group>
+    </group>
+    <group
+        android:name="circle_outline"
+        android:translateX="16"
+        android:translateY="16" >
+        <group
+            android:name="group_1"
+            android:scaleX="1.12734"
+            android:scaleY="1.12734"
+            android:rotation="430" >
+            <path
+                android:name="path_3"
+                android:pathData="M 0.0101470947266,10.8087768555 c -5.96701049805,0.0 -10.8000183105,-4.8330078125 -10.8000183105,-10.8000488281 c 0.0,-5.96691894531 4.8330078125,-10.7999267578 10.8000183105,-10.7999267578 c 5.96697998047,0.0 10.799987793,4.8330078125 10.799987793,10.7999267578 c 0.0,5.96704101562 -4.8330078125,10.8000488281 -10.799987793,10.8000488281 Z"
+                android:strokeColor="#FFF2501D"
+                android:strokeWidth="2"
+                android:trimPathStart="0"
+                android:trimPathEnd="1" />
+        </group>
+    </group>
+</vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_animation.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp_animation.xml
similarity index 66%
rename from packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_animation.xml
rename to packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp_animation.xml
index 8cc8ac2..0351524 100644
--- a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_animation.xml
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state_to_fp_animation.xml
@@ -16,50 +16,38 @@
   -->
 <animated-vector
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:drawable="@drawable/lockscreen_fingerprint_error_state" >
+    android:drawable="@drawable/lockscreen_fingerprint_error_state_to_fp" >
     <target
         android:name="white_fingerprint_ridges"
-        android:animation="@anim/lockscreen_fingerprint_error_state_white_fingerprint_ridges_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_white_fingerprint_ridges_animation" />
     <target
         android:name="ridge_5_path"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_5_path_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_ridge_5_path_animation" />
     <target
         android:name="ridge_7_path"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_7_path_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_ridge_7_path_animation" />
     <target
         android:name="ridge_6_path"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_6_path_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_ridge_6_path_animation" />
     <target
         android:name="ridge_2_path"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_2_path_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_ridge_2_path_animation" />
     <target
         android:name="ridge_1_path"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_1_path_animation" />
-    <target
-        android:name="fingerprint_ridges"
-        android:animation="@anim/lockscreen_fingerprint_error_state_fingerprint_ridges_animation" />
-    <target
-        android:name="ridge_5_path_0"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_5_path_0_animation" />
-    <target
-        android:name="ridge_7_path_0"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_7_path_0_animation" />
-    <target
-        android:name="ridge_6_path_0"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_6_path_0_animation" />
-    <target
-        android:name="ridge_2_path_0"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_2_path_0_animation" />
-    <target
-        android:name="ridge_1_path_0"
-        android:animation="@anim/lockscreen_fingerprint_error_state_ridge_1_path_0_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_ridge_1_path_animation" />
     <target
         android:name="group_2"
-        android:animation="@anim/lockscreen_fingerprint_error_state_group_2_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_group_2_animation" />
+    <target
+        android:name="path_2"
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_path_2_animation" />
+    <target
+        android:name="path_1"
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_path_1_animation" />
     <target
         android:name="group_1"
-        android:animation="@anim/lockscreen_fingerprint_error_state_group_1_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_group_1_animation" />
     <target
         android:name="path_3"
-        android:animation="@anim/lockscreen_fingerprint_error_state_path_3_animation" />
+        android:animation="@anim/lockscreen_fingerprint_error_state_to_fp_path_3_animation" />
 </animated-vector>
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
similarity index 90%
rename from packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state.xml
rename to packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
index cc8aba9..bbadec1 100644
--- a/packages/SystemUI/res/drawable/lockscreen_fingerprint_error_state.xml
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state.xml
@@ -16,7 +16,7 @@
   -->
 <vector
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:name="lockscreen_fingerprint_error_state"
+    android:name="lockscreen_fingerprint_fp_to_error_state"
     android:width="32dp"
     android:viewportWidth="32"
     android:height="32dp"
@@ -151,12 +151,16 @@
         android:translateY="16" >
         <group
             android:name="group_2"
-            android:scaleX="0"
-            android:scaleY="0"
+            android:scaleX="0.63838"
+            android:scaleY="0.63838"
             android:rotation="184" >
             <path
-                android:name="path_2_merged"
-                android:pathData="M 1.35900878906,6.76104736328 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-2.69995117188 0.0,-2.69995117188 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,2.69995117188 0.0,2.69995117188 Z M 1.35363769531,1.36633300781 c 0.0,0.0 -2.69998168945,0.0 -2.69998168945,0.0 c 0.0,0.0 0.0,-8.09997558594 0.0,-8.09997558594 c 0.0,0.0 2.69998168945,0.0 2.69998168945,0.0 c 0.0,0.0 0.0,8.09997558594 0.0,8.09997558594 Z"
+                android:name="path_2"
+                android:pathData="M -1.3705291748,4.06730651855 c 0.0,0.0 0.036376953125,-0.0102386474609 0.036376953125,-0.0102386474609 c 0.0,0.0 -0.00682067871094,0.0040283203125 -0.00682067871093,0.0040283203125 c 0.0,0.0 -0.0161437988281,0.00479125976562 -0.0161437988281,0.00479125976563 c 0.0,0.0 -0.0134124755859,0.00141906738281 -0.0134124755859,0.00141906738281 Z"
+                android:fillColor="#FFF2501D" />
+            <path
+                android:name="path_1"
+                android:pathData="M -1.3737487793,-6.77532958984 c 0.0,0.0 0.00604248046875,0.0166625976562 0.00604248046876,0.0166625976562 c 0.0,0.0 0.0213623046875,0.0250244140625 0.0213623046875,0.0250244140625 c 0.0,0.0 -0.00604248046875,-0.0166625976562 -0.00604248046876,-0.0166625976562 c 0.0,0.0 -0.0213623046875,-0.0250244140625 -0.0213623046875,-0.0250244140625 Z"
                 android:fillColor="#FFF2501D" />
         </group>
     </group>
@@ -168,7 +172,7 @@
             android:name="group_1"
             android:scaleX="1.12734"
             android:scaleY="1.12734"
-            android:rotation="285" >
+            android:rotation="231" >
             <path
                 android:name="path_3"
                 android:pathData="M 0.0101470947266,10.8087768555 c -5.96701049805,0.0 -10.8000183105,-4.8330078125 -10.8000183105,-10.8000488281 c 0.0,-5.96691894531 4.8330078125,-10.7999267578 10.8000183105,-10.7999267578 c 5.96697998047,0.0 10.799987793,4.8330078125 10.799987793,10.7999267578 c 0.0,5.96704101562 -4.8330078125,10.8000488281 -10.799987793,10.8000488281 Z"
diff --git a/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state_animation.xml b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state_animation.xml
new file mode 100644
index 0000000..f7b710f
--- /dev/null
+++ b/packages/SystemUI/res/drawable/lockscreen_fingerprint_fp_to_error_state_animation.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2015 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
+  -->
+<animated-vector
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/lockscreen_fingerprint_fp_to_error_state" >
+    <target
+        android:name="white_fingerprint_ridges"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_white_fingerprint_ridges_animation" />
+    <target
+        android:name="ridge_5_path"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_animation" />
+    <target
+        android:name="ridge_7_path"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_animation" />
+    <target
+        android:name="ridge_6_path"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_animation" />
+    <target
+        android:name="ridge_2_path"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_animation" />
+    <target
+        android:name="ridge_1_path"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_animation" />
+    <target
+        android:name="fingerprint_ridges"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_fingerprint_ridges_animation" />
+    <target
+        android:name="ridge_5_path_0"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_5_path_0_animation" />
+    <target
+        android:name="ridge_7_path_0"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_7_path_0_animation" />
+    <target
+        android:name="ridge_6_path_0"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_6_path_0_animation" />
+    <target
+        android:name="ridge_2_path_0"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_2_path_0_animation" />
+    <target
+        android:name="ridge_1_path_0"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_ridge_1_path_0_animation" />
+    <target
+        android:name="group_2"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_group_2_animation" />
+    <target
+        android:name="path_2"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_path_2_animation" />
+    <target
+        android:name="path_1"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_path_1_animation" />
+    <target
+        android:name="group_1"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_group_1_animation" />
+    <target
+        android:name="path_3"
+        android:animation="@anim/lockscreen_fingerprint_fp_to_error_state_path_3_animation" />
+</animated-vector>
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_0.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_0.xml
index a1cf8df..e8c1f90 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_0.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.5,0.0 1.0,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1.xml
index a1cf8df..cb59de9 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_off_animation_interpolator_1.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.5,0.0 0.5,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_0.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_0.xml
index a1cf8df..708de2a 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_0.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.29,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1.xml
index a1cf8df..a5ffc40 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_draw_on_animation_interpolator_1.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.5,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_0.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_0.xml
index a1cf8df..708de2a 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_0.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.29,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_1.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_1.xml
index a1cf8df..07cae89 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_1.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.4,0.0 0.83333333333,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_2.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_2.xml
index a1cf8df..a5ffc40 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_2.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.5,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_3.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_3.xml
index a1cf8df..34156c3 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_3.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.9999,0.999933333333 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_4.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_4.xml
index a1cf8df..24a3d43 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_4.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.612659627466,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_5.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_5.xml
index a1cf8df..c0a68e2 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_to_fp_animation_interpolator_5.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.9999,0.999883333333 1.0,1.0" />
diff --git a/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0.xml
similarity index 100%
rename from packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_0.xml
rename to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_0.xml
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_1.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_1.xml
index a1cf8df..9769a83 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_1.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.312548622571,1.03663900165 0.662518487347,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_2.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_2.xml
similarity index 100%
rename from packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_2.xml
rename to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_2.xml
diff --git a/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3.xml
similarity index 100%
rename from packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_3.xml
rename to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_3.xml
diff --git a/packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_4.xml
similarity index 100%
rename from packages/SystemUI/res/interpolator/lockscreen_fingerprint_error_state_animation_interpolator_1.xml
rename to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_4.xml
diff --git a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_5.xml
similarity index 66%
copy from packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
copy to packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_5.xml
index a1cf8df..a5ffc40 100644
--- a/packages/SystemUI/res/anim/lockscreen_fingerprint_error_state_ridge_5_path_animation.xml
+++ b/packages/SystemUI/res/interpolator/lockscreen_fingerprint_fp_to_error_state_animation_interpolator_5.xml
@@ -14,13 +14,6 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License
   -->
-<set
-    xmlns:android="http://schemas.android.com/apk/res/android" >
-    <objectAnimator
-        android:duration="150"
-        android:propertyName="trimPathStart"
-        android:valueFrom="0.0"
-        android:valueTo="1.0"
-        android:valueType="floatType"
-        android:interpolator="@android:interpolator/linear" />
-</set>
+<pathInterpolator
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:pathData="M 0.0,0.0 c 0.0,0.0 0.5,1.0 1.0,1.0" />
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 354e99d..139462d 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -42,6 +42,10 @@
     <!-- Whether to use cheap, less good looking shadows for recents -->
     <bool name="config_recents_fake_shadows">false</bool>
 
+    <!-- Whether to clip notification contents with a rounded rectangle. Might be expensive on
+         certain GPU's and thus can be turned off with only minimal visual impact. -->
+    <bool name="config_notifications_round_rect_clipping">true</bool>
+
     <!-- The theme to use for RecentsActivity. -->
     <item type="style" name="config_recents_activity_theme">@style/RecentsTheme.Wallpaper</item>
 
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index 9504ea3..9bc5b75 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -326,7 +326,7 @@
                     item.tag = ap;
                     item.icon = mWifiController.getIcon(ap);
                     item.line1 = ap.getSsid();
-                    item.line2 = ap.getSummary();
+                    item.line2 = ap.isActive() ? ap.getSummary() : null;
                     item.overlay = ap.getSecurity() != AccessPoint.SECURITY_NONE
                             ? mContext.getDrawable(R.drawable.qs_ic_wifi_lock)
                             : null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigMediaNarrowViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigMediaNarrowViewWrapper.java
new file mode 100644
index 0000000..91e5404
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigMediaNarrowViewWrapper.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2015 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.systemui.statusbar;
+
+import android.content.Context;
+import android.view.View;
+
+/**
+ * Wraps a big media narrow notification template layout.
+ */
+public class NotificationBigMediaNarrowViewWrapper extends NotificationMediaViewWrapper {
+
+    protected NotificationBigMediaNarrowViewWrapper(Context ctx,
+            View view) {
+        super(ctx, view);
+    }
+
+    @Override
+    public boolean needsRoundRectClipping() {
+        return true;
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigPictureViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigPictureViewWrapper.java
new file mode 100644
index 0000000..ffe0cd1
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBigPictureViewWrapper.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 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.systemui.statusbar;
+
+import android.content.Context;
+import android.view.View;
+
+/**
+ * Wraps a notification view inflated from a big picture style template.
+ */
+public class NotificationBigPictureViewWrapper extends NotificationTemplateViewWrapper {
+
+    protected NotificationBigPictureViewWrapper(Context ctx, View view) {
+        super(ctx, view);
+    }
+
+    @Override
+    public boolean needsRoundRectClipping() {
+        return true;
+    }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
index 110b14c..dec2fc7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
@@ -17,6 +17,7 @@
 package com.android.systemui.statusbar;
 
 import android.content.Context;
+import android.graphics.Outline;
 import android.graphics.Paint;
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffXfermode;
@@ -24,6 +25,7 @@
 import android.util.AttributeSet;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.ViewTreeObserver;
 import android.view.animation.Interpolator;
 import android.view.animation.LinearInterpolator;
@@ -46,21 +48,26 @@
     private final Rect mClipBounds = new Rect();
     private final int mSmallHeight;
     private final int mHeadsUpHeight;
+    private final int mRoundRectRadius;
     private final Interpolator mLinearInterpolator = new LinearInterpolator();
+    private final boolean mRoundRectClippingEnabled;
 
     private View mContractedChild;
     private View mExpandedChild;
     private View mHeadsUpChild;
 
     private NotificationViewWrapper mContractedWrapper;
+    private NotificationViewWrapper mExpandedWrapper;
+    private NotificationViewWrapper mHeadsUpWrapper;
     private int mClipTopAmount;
     private int mContentHeight;
+    private int mUnrestrictedContentHeight;
     private int mVisibleType = VISIBLE_TYPE_CONTRACTED;
     private boolean mDark;
     private final Paint mFadePaint = new Paint();
     private boolean mAnimate;
     private boolean mIsHeadsUp;
-    private ViewTreeObserver.OnPreDrawListener mEnableAnimationPredrawListener
+    private final ViewTreeObserver.OnPreDrawListener mEnableAnimationPredrawListener
             = new ViewTreeObserver.OnPreDrawListener() {
         @Override
         public boolean onPreDraw() {
@@ -70,12 +77,25 @@
         }
     };
 
+    private final ViewOutlineProvider mOutlineProvider = new ViewOutlineProvider() {
+        @Override
+        public void getOutline(View view, Outline outline) {
+            outline.setRoundRect(0, 0, view.getWidth(), mUnrestrictedContentHeight,
+                    mRoundRectRadius);
+        }
+    };
+
     public NotificationContentView(Context context, AttributeSet attrs) {
         super(context, attrs);
         mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
         mSmallHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height);
         mHeadsUpHeight = getResources().getDimensionPixelSize(R.dimen.notification_mid_height);
+        mRoundRectRadius = getResources().getDimensionPixelSize(
+                R.dimen.notification_material_rounded_rect_radius);
+        mRoundRectClippingEnabled = getResources().getBoolean(
+                R.bool.config_notifications_round_rect_clipping);
         reset(true);
+        setOutlineProvider(mOutlineProvider);
     }
 
     @Override
@@ -127,6 +147,7 @@
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         super.onLayout(changed, left, top, right, bottom);
         updateClipping();
+        invalidateOutline();
     }
 
     @Override
@@ -177,6 +198,7 @@
         mContractedWrapper = NotificationViewWrapper.wrap(getContext(), child);
         selectLayout(false /* animate */, true /* force */);
         mContractedWrapper.setDark(mDark, false /* animate */, 0 /* delay */);
+        updateRoundRectClipping();
     }
 
     public void setExpandedChild(View child) {
@@ -186,7 +208,9 @@
         }
         addView(child);
         mExpandedChild = child;
+        mExpandedWrapper = NotificationViewWrapper.wrap(getContext(), child);
         selectLayout(false /* animate */, true /* force */);
+        updateRoundRectClipping();
     }
 
     public void setHeadsUpChild(View child) {
@@ -196,7 +220,9 @@
         }
         addView(child);
         mHeadsUpChild = child;
+        mHeadsUpWrapper = NotificationViewWrapper.wrap(getContext(), child);
         selectLayout(false /* animate */, true /* force */);
+        updateRoundRectClipping();
     }
 
     @Override
@@ -222,10 +248,11 @@
     }
 
     public void setContentHeight(int contentHeight) {
-        contentHeight = Math.max(Math.min(contentHeight, getHeight()), getMinHeight());
-        mContentHeight = contentHeight;
+        mContentHeight = Math.max(Math.min(contentHeight, getHeight()), getMinHeight());;
+        mUnrestrictedContentHeight = Math.max(contentHeight, getMinHeight());
         selectLayout(mAnimate /* animate */, false /* force */);
         updateClipping();
+        invalidateOutline();
     }
 
     public int getContentHeight() {
@@ -250,6 +277,27 @@
         updateClipping();
     }
 
+    private void updateRoundRectClipping() {
+        boolean enabled = needsRoundRectClipping();
+        setClipToOutline(enabled);
+    }
+
+    private boolean needsRoundRectClipping() {
+        if (!mRoundRectClippingEnabled) {
+            return false;
+        }
+        boolean needsForContracted = mContractedChild != null
+                && mContractedChild.getVisibility() == View.VISIBLE
+                && mContractedWrapper.needsRoundRectClipping();
+        boolean needsForExpanded = mExpandedChild != null
+                && mExpandedChild.getVisibility() == View.VISIBLE
+                && mExpandedWrapper.needsRoundRectClipping();
+        boolean needsForHeadsUp = mExpandedChild != null
+                && mExpandedChild.getVisibility() == View.VISIBLE
+                && mExpandedWrapper.needsRoundRectClipping();
+        return needsForContracted || needsForExpanded || needsForHeadsUp;
+    }
+
     private void updateClipping() {
         mClipBounds.set(0, mClipTopAmount, getWidth(), mContentHeight);
         setClipBounds(mClipBounds);
@@ -290,6 +338,7 @@
             mHeadsUpChild.setLayerType(LAYER_TYPE_NONE, null);
         }
         setLayerType(LAYER_TYPE_NONE, null);
+        updateRoundRectClipping();
     }
 
     private void runSwitchAnimation(int visibleType) {
@@ -315,6 +364,7 @@
                         updateViewVisibilities(mVisibleType);
                     }
                 });
+        updateRoundRectClipping();
     }
 
     /**
@@ -358,6 +408,10 @@
             mContractedWrapper.notifyContentUpdated();
             mContractedWrapper.setDark(mDark, false /* animate */, 0 /* delay */);
         }
+        if (mExpandedChild != null) {
+            mExpandedWrapper.notifyContentUpdated();
+        }
+        updateRoundRectClipping();
     }
 
     public boolean isContentExpandable() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationCustomViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationCustomViewWrapper.java
index 0702d7e..6fd341b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationCustomViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationCustomViewWrapper.java
@@ -41,4 +41,9 @@
             mInvertHelper.update(dark);
         }
     }
+
+    @Override
+    public boolean needsRoundRectClipping() {
+        return true;
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewWrapper.java
index 44e8b85..b362a29 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewWrapper.java
@@ -25,15 +25,23 @@
  */
 public abstract class NotificationViewWrapper {
 
+    private static final String TAG_BIG_MEDIA_NARROW = "bigMediaNarrow";
+    private static final String TAG_MEDIA = "media";
+    private static final String TAG_BIG_PICTURE = "bigPicture";
+
     protected final View mView;
 
     public static NotificationViewWrapper wrap(Context ctx, View v) {
-
-        // TODO: Figure out a better way to find out which template the view is.
-        if (v.findViewById(com.android.internal.R.id.media_actions) != null) {
-            return new NotificationMediaViewWrapper(ctx, v);
-        } else if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
-            return new NotificationTemplateViewWrapper(ctx, v);
+        if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
+            if (TAG_BIG_MEDIA_NARROW.equals(v.getTag())) {
+                return new NotificationBigMediaNarrowViewWrapper(ctx, v);
+            } else if (TAG_MEDIA.equals(v.getTag())) {
+                return new NotificationMediaViewWrapper(ctx, v);
+            } else if (TAG_BIG_PICTURE.equals(v.getTag())) {
+                return new NotificationBigMediaNarrowViewWrapper(ctx, v);
+            } else {
+                return new NotificationTemplateViewWrapper(ctx, v);
+            }
         } else {
             return new NotificationCustomViewWrapper(v);
         }
@@ -56,4 +64,12 @@
      * Notifies this wrapper that the content of the view might have changed.
      */
     public void notifyContentUpdated() {}
+
+    /**
+     * @return true if this template might need to be clipped with a round rect to make it look
+     *         nice, false otherwise
+     */
+    public boolean needsRoundRectClipping() {
+        return false;
+    }
 }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 14e491b..991bde5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -56,10 +56,13 @@
     private boolean mVpnVisible = false;
     private boolean mEthernetVisible = false;
     private int mEthernetIconId = 0;
+    private int mLastEthernetIconId = -1;
     private boolean mWifiVisible = false;
     private int mWifiStrengthId = 0;
+    private int mLastWifiStrengthId = -1;
     private boolean mIsAirplaneMode = false;
     private int mAirplaneIconId = 0;
+    private int mLastAirplaneIconId = -1;
     private String mAirplaneContentDescription;
     private String mWifiDescription;
     private String mEthernetDescription;
@@ -275,10 +278,14 @@
 
         if (mEthernet != null) {
             mEthernet.setImageDrawable(null);
+            mEthernetDark.setImageDrawable(null);
+            mLastEthernetIconId = -1;
         }
 
         if (mWifi != null) {
             mWifi.setImageDrawable(null);
+            mWifiDark.setImageDrawable(null);
+            mLastWifiStrengthId = -1;
         }
 
         for (PhoneState state : mPhoneStates) {
@@ -290,8 +297,9 @@
             }
         }
 
-        if(mAirplane != null) {
+        if (mAirplane != null) {
             mAirplane.setImageDrawable(null);
+            mLastAirplaneIconId = -1;
         }
 
         apply();
@@ -310,8 +318,11 @@
         if (DEBUG) Log.d(TAG, String.format("vpn: %s", mVpnVisible ? "VISIBLE" : "GONE"));
 
         if (mEthernetVisible) {
-            mEthernet.setImageResource(mEthernetIconId);
-            mEthernetDark.setImageResource(mEthernetIconId);
+            if (mLastEthernetIconId != mEthernetIconId) {
+                mEthernet.setImageResource(mEthernetIconId);
+                mEthernetDark.setImageResource(mEthernetIconId);
+                mLastEthernetIconId = mEthernetIconId;
+            }
             mEthernetGroup.setContentDescription(mEthernetDescription);
             mEthernetGroup.setVisibility(View.VISIBLE);
         } else {
@@ -324,8 +335,11 @@
 
 
         if (mWifiVisible) {
-            mWifi.setImageResource(mWifiStrengthId);
-            mWifiDark.setImageResource(mWifiStrengthId);
+            if (mWifiStrengthId != mLastWifiStrengthId) {
+                mWifi.setImageResource(mWifiStrengthId);
+                mWifiDark.setImageResource(mWifiStrengthId);
+                mLastWifiStrengthId = mWifiStrengthId;
+            }
             mWifiGroup.setContentDescription(mWifiDescription);
             mWifiGroup.setVisibility(View.VISIBLE);
         } else {
@@ -349,7 +363,10 @@
         }
 
         if (mIsAirplaneMode) {
-            mAirplane.setImageResource(mAirplaneIconId);
+            if (mLastAirplaneIconId != mAirplaneIconId) {
+                mAirplane.setImageResource(mAirplaneIconId);
+                mLastAirplaneIconId = mAirplaneIconId;
+            }
             mAirplane.setContentDescription(mAirplaneContentDescription);
             mAirplane.setVisibility(View.VISIBLE);
         } else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index efc3ea0..adee5a8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -562,12 +562,12 @@
 
         @Override
         public void onScreenTurnedOn() {
-            mLockIcon.update();
+            mLockIcon.setScreenOn(true);
         }
 
         @Override
         public void onScreenTurnedOff(int why) {
-            mLockIcon.update();
+            mLockIcon.setScreenOn(false);
         }
 
         @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
index 66f3232..2063b26 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java
@@ -35,6 +35,11 @@
  */
 public class LockIcon extends KeyguardAffordanceView {
 
+    /**
+     * Delay animations a bit when the screen just turned on as a heuristic to start them after
+     * the screen has actually turned on.
+     */
+    private static final long ANIM_DELAY_AFTER_SCREEN_ON = 250;
 
     private static final int STATE_LOCKED = 0;
     private static final int STATE_LOCK_OPEN = 1;
@@ -43,7 +48,9 @@
     private static final int STATE_FINGERPRINT_ERROR = 4;
 
     private int mLastState = 0;
+    private boolean mLastScreenOn;
     private boolean mTransientFpError;
+    private boolean mScreenOn;
     private final TrustDrawable mTrustDrawable;
     private final UnlockMethodCache mUnlockMethodCache;
     private AccessibilityController mAccessibilityController;
@@ -76,6 +83,11 @@
         update();
     }
 
+    public void setScreenOn(boolean screenOn) {
+        mScreenOn = screenOn;
+        update();
+    }
+
     public void update() {
         boolean visible = isShown() && KeyguardUpdateMonitor.getInstance(mContext).isScreenOn();
         if (visible) {
@@ -89,16 +101,18 @@
         // TODO: Real icon for facelock.
         int state = getState();
         boolean anyFingerprintIcon = state == STATE_FINGERPRINT || state == STATE_FINGERPRINT_ERROR;
-        if (state != mLastState) {
-            int iconRes = getAnimationResForTransition(mLastState, state);
+        if (state != mLastState || mScreenOn != mLastScreenOn) {
+            int iconRes = getAnimationResForTransition(mLastState, state, mLastScreenOn, mScreenOn);
+            if (iconRes == R.drawable.lockscreen_fingerprint_draw_off_animation) {
+                anyFingerprintIcon = true;
+            }
             if (iconRes == -1) {
                 iconRes = getIconForState(state);
             }
             Drawable icon = mContext.getDrawable(iconRes);
-            AnimatedVectorDrawable animation = null;
-            if (icon instanceof AnimatedVectorDrawable) {
-                animation = (AnimatedVectorDrawable) icon;
-            }
+            final AnimatedVectorDrawable animation = icon instanceof AnimatedVectorDrawable
+                    ? (AnimatedVectorDrawable) icon
+                    : null;
             int iconHeight = getResources().getDimensionPixelSize(
                     R.dimen.keyguard_affordance_icon_height);
             int iconWidth = getResources().getDimensionPixelSize(
@@ -115,14 +129,27 @@
                     anyFingerprintIcon ? 1f : KeyguardAffordanceHelper.SWIPE_RESTING_ALPHA_AMOUNT);
             setImageDrawable(icon);
             if (animation != null) {
-                animation.start();
+
+                // If we play the draw on animation, delay it by one frame when the screen is
+                // actually turned on.
+                if (iconRes == R.drawable.lockscreen_fingerprint_draw_on_animation) {
+                    postOnAnimationDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            animation.start();
+                        }
+                    }, ANIM_DELAY_AFTER_SCREEN_ON);
+                } else {
+                    animation.start();
+                }
             }
+            mLastState = state;
+            mLastScreenOn = mScreenOn;
         }
 
         // Hide trust circle when fingerprint is running.
         boolean trustManaged = mUnlockMethodCache.isTrustManaged() && !anyFingerprintIcon;
         mTrustDrawable.setTrustManaged(trustManaged);
-        mLastState = state;
         updateClickability();
     }
 
@@ -161,9 +188,16 @@
         }
     }
 
-    private int getAnimationResForTransition(int oldState, int newState) {
+    private int getAnimationResForTransition(int oldState, int newState, boolean oldScreenOn,
+            boolean screenOn) {
         if (oldState == STATE_FINGERPRINT && newState == STATE_FINGERPRINT_ERROR) {
-            return R.drawable.lockscreen_fingerprint_error_state_animation;
+            return R.drawable.lockscreen_fingerprint_fp_to_error_state_animation;
+        } else if (oldState == STATE_FINGERPRINT_ERROR && newState == STATE_FINGERPRINT) {
+            return R.drawable.lockscreen_fingerprint_error_state_to_fp_animation;
+        } else if (oldState == STATE_FINGERPRINT && newState == STATE_LOCK_OPEN) {
+            return R.drawable.lockscreen_fingerprint_draw_off_animation;
+        } else if (newState == STATE_FINGERPRINT && !oldScreenOn && screenOn) {
+            return R.drawable.lockscreen_fingerprint_draw_on_animation;
         } else {
             return -1;
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 50cdbb6..1e4aa61 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -745,7 +745,8 @@
         mHandlerThread.start();
 
         // Other icons
-        mLocationController = new LocationControllerImpl(mContext); // will post a notification
+        mLocationController = new LocationControllerImpl(mContext,
+                mHandlerThread.getLooper()); // will post a notification
         mBatteryController = new BatteryController(mContext);
         mBatteryController.addStateChangedCallback(new BatteryStateChangeCallback() {
             @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
index d8d7042..93a8fd8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
@@ -26,6 +26,8 @@
 import android.content.IntentFilter;
 import android.location.LocationManager;
 import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings;
@@ -56,31 +58,21 @@
 
     private ArrayList<LocationSettingsChangeCallback> mSettingsChangeCallbacks =
             new ArrayList<LocationSettingsChangeCallback>();
+    private final H mHandler = new H();
 
-    public LocationControllerImpl(Context context) {
+    public LocationControllerImpl(Context context, Looper bgLooper) {
         mContext = context;
 
+        // Register to listen for changes in location settings.
         IntentFilter filter = new IntentFilter();
         filter.addAction(LocationManager.HIGH_POWER_REQUEST_CHANGE_ACTION);
-        context.registerReceiverAsUser(this, UserHandle.ALL, filter, null, null);
+        filter.addAction(LocationManager.MODE_CHANGED_ACTION);
+        context.registerReceiverAsUser(this, UserHandle.ALL, filter, null, new Handler(bgLooper));
 
         mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
         mStatusBarManager
                 = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
 
-        // Register to listen for changes in location settings.
-        IntentFilter intentFilter = new IntentFilter();
-        intentFilter.addAction(LocationManager.MODE_CHANGED_ACTION);
-        context.registerReceiverAsUser(new BroadcastReceiver() {
-            @Override
-            public void onReceive(Context context, Intent intent) {
-                String action = intent.getAction();
-                if (LocationManager.MODE_CHANGED_ACTION.equals(action)) {
-                    locationSettingsChanged();
-                }
-            }
-        }, UserHandle.ALL, intentFilter, null, new Handler());
-
         // Examine the current location state and initialize the status view.
         updateActiveLocationRequests();
         refreshViews();
@@ -91,7 +83,7 @@
      */
     public void addSettingsChangedCallback(LocationSettingsChangeCallback cb) {
         mSettingsChangeCallbacks.add(cb);
-        locationSettingsChanged(cb);
+        mHandler.sendEmptyMessage(H.MSG_LOCATION_SETTINGS_CHANGED);
     }
 
     public void removeSettingsChangedCallback(LocationSettingsChangeCallback cb) {
@@ -181,8 +173,8 @@
     // Updates the status view based on the current state of location requests.
     private void refreshViews() {
         if (mAreActiveLocationRequests) {
-            mStatusBarManager.setIcon(LOCATION_STATUS_ICON_PLACEHOLDER, LOCATION_STATUS_ICON_ID, 0,
-                    mContext.getString(R.string.accessibility_location_active));
+            mStatusBarManager.setIcon(LOCATION_STATUS_ICON_PLACEHOLDER, LOCATION_STATUS_ICON_ID,
+                    0, mContext.getString(R.string.accessibility_location_active));
         } else {
             mStatusBarManager.removeIcon(LOCATION_STATUS_ICON_PLACEHOLDER);
         }
@@ -197,22 +189,33 @@
         }
     }
 
-    private void locationSettingsChanged() {
-        boolean isEnabled = isLocationEnabled();
-        for (LocationSettingsChangeCallback cb : mSettingsChangeCallbacks) {
-            cb.onLocationSettingsChanged(isEnabled);
-        }
-    }
-
-    private void locationSettingsChanged(LocationSettingsChangeCallback cb) {
-        cb.onLocationSettingsChanged(isLocationEnabled());
-    }
-
     @Override
     public void onReceive(Context context, Intent intent) {
         final String action = intent.getAction();
         if (LocationManager.HIGH_POWER_REQUEST_CHANGE_ACTION.equals(action)) {
             updateActiveLocationRequests();
+        } else if (LocationManager.MODE_CHANGED_ACTION.equals(action)) {
+            mHandler.sendEmptyMessage(H.MSG_LOCATION_SETTINGS_CHANGED);
+        }
+    }
+
+    private final class H extends Handler {
+        private static final int MSG_LOCATION_SETTINGS_CHANGED = 1;
+
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case MSG_LOCATION_SETTINGS_CHANGED:
+                    locationSettingsChanged();
+                    break;
+            }
+        }
+
+        private void locationSettingsChanged() {
+            boolean isEnabled = isLocationEnabled();
+            for (LocationSettingsChangeCallback cb : mSettingsChangeCallbacks) {
+                cb.onLocationSettingsChanged(isEnabled);
+            }
         }
     }
 }
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 7ac2655..edca4b8 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -3640,6 +3640,7 @@
 
     @Override
     public void releasePendingNetworkRequest(PendingIntent operation) {
+        checkNotNull(operation, "PendingIntent cannot be null.");
         mHandler.sendMessage(mHandler.obtainMessage(EVENT_RELEASE_NETWORK_REQUEST_WITH_INTENT,
                 getCallingUid(), 0, operation));
     }
diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags
index 4b65dec..c01d816 100644
--- a/services/core/java/com/android/server/EventLogTags.logtags
+++ b/services/core/java/com/android/server/EventLogTags.logtags
@@ -66,13 +66,13 @@
 # when notifications are newly displayed on screen, or disappear from screen
 27510 notification_visibility_changed (newlyVisibleKeys|3),(noLongerVisibleKeys|3)
 # when notifications are expanded, or contracted
-27511 notification_expansion (key|3),(user_action|1),(expanded|1)
+27511 notification_expansion (key|3),(user_action|1),(expanded|1),(lifespan|1),(freshness|1),(exposure|1)
 # when a notification has been clicked
-27520 notification_clicked (key|3)
+27520 notification_clicked (key|3),(lifespan|1),(freshness|1),(exposure|1)
 # when a notification action button has been clicked
-27521 notification_action_clicked (key|3),(action_index|1)
+27521 notification_action_clicked (key|3),(action_index|1),(lifespan|1),(freshness|1),(exposure|1)
 # when a notification has been canceled
-27530 notification_canceled (key|3),(reason|1),(lifespan|1),(exposure|1)
+27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1)
 # replaces 27510 with a row per notification
 27531 notification_visibility (key|3),(visibile|1),(lifespan|1),(freshness|1)
 
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index 2df7f79..f6ca0d7 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -25,11 +25,9 @@
 import android.content.IntentFilter;
 import android.content.pm.PackageManager;
 import android.content.pm.UserInfo;
-
 import static android.Manifest.permission.ACCESS_KEYGUARD_SECURE_STORAGE;
 import static android.content.Context.USER_SERVICE;
 import static android.Manifest.permission.READ_PROFILE;
-
 import android.database.sqlite.SQLiteDatabase;
 import android.os.Binder;
 import android.os.IBinder;
@@ -44,6 +42,7 @@
 import android.provider.Settings.Secure;
 import android.provider.Settings.SettingNotFoundException;
 import android.security.KeyStore;
+import android.service.gatekeeper.GateKeeperResponse;
 import android.service.gatekeeper.IGateKeeperService;
 import android.text.TextUtils;
 import android.util.Slog;
@@ -51,6 +50,7 @@
 import com.android.internal.util.ArrayUtils;
 import com.android.internal.widget.ILockSettings;
 import com.android.internal.widget.LockPatternUtils;
+import com.android.internal.widget.VerifyCredentialResponse;
 import com.android.server.LockSettingsStorage.CredentialHash;
 
 import java.util.Arrays;
@@ -76,6 +76,12 @@
     private boolean mFirstCallToVold;
     private IGateKeeperService mGateKeeperService;
 
+    private interface CredentialUtil {
+        void setCredential(String credential, String savedCredential, int userId)
+                throws RemoteException;
+        byte[] toHash(String credential, int userId);
+    }
+
     public LockSettingsService(Context context) {
         mContext = context;
         // Open the database
@@ -468,155 +474,163 @@
         byte[] toEnrollBytes = toEnroll == null
                 ? null
                 : toEnroll.getBytes();
-        byte[] hash = getGateKeeperService().enroll(userId, enrolledHandle, enrolledCredentialBytes,
-                toEnrollBytes);
+        GateKeeperResponse response = getGateKeeperService().enroll(userId, enrolledHandle,
+                enrolledCredentialBytes, toEnrollBytes);
 
-        if (hash != null) {
-            setKeystorePassword(toEnroll, userId);
+        if (response == null) {
+            return null;
         }
 
+        byte[] hash = response.getPayload();
+        if (hash != null) {
+            setKeystorePassword(toEnroll, userId);
+        } else {
+            // Should not happen
+            Slog.e(TAG, "Throttled while enrolling a password");
+        }
         return hash;
     }
 
     @Override
-    public boolean checkPattern(String pattern, int userId) throws RemoteException {
-        try {
-            doVerifyPattern(pattern, false, 0, userId);
-        } catch (VerificationFailedException ex) {
-            return false;
-        }
-
-        return true;
+    public VerifyCredentialResponse checkPattern(String pattern, int userId) throws RemoteException {
+        return doVerifyPattern(pattern, false, 0, userId);
     }
 
     @Override
-    public byte[] verifyPattern(String pattern, long challenge, int userId)
+    public VerifyCredentialResponse verifyPattern(String pattern, long challenge, int userId)
             throws RemoteException {
-        try {
-            return doVerifyPattern(pattern, true, challenge, userId);
-        } catch (VerificationFailedException ex) {
-            return null;
-        }
+        return doVerifyPattern(pattern, true, challenge, userId);
     }
 
-    private byte[] doVerifyPattern(String pattern, boolean hasChallenge, long challenge,
-            int userId) throws VerificationFailedException, RemoteException {
+    private VerifyCredentialResponse doVerifyPattern(String pattern, boolean hasChallenge, long challenge,
+            int userId) throws RemoteException {
        checkPasswordReadPermission(userId);
-
        CredentialHash storedHash = mStorage.readPatternHash(userId);
+       return verifyCredential(userId, storedHash, pattern, hasChallenge,
+               challenge,
+               new CredentialUtil() {
+                   @Override
+                   public void setCredential(String pattern, String oldPattern, int userId)
+                           throws RemoteException {
+                       setLockPattern(pattern, oldPattern, userId);
+                   }
 
-        if ((storedHash == null || storedHash.hash.length == 0) && TextUtils.isEmpty(pattern)) {
-            // don't need to pass empty passwords to GateKeeper
-            return null;
-        }
-
-        if (TextUtils.isEmpty(pattern)) {
-            throw new VerificationFailedException();
-        }
-
-        if (storedHash.version == CredentialHash.VERSION_LEGACY) {
-            byte[] hash = mLockPatternUtils.patternToHash(
-                    mLockPatternUtils.stringToPattern(pattern));
-            if (Arrays.equals(hash, storedHash.hash)) {
-                unlockKeystore(pattern, userId);
-                // migrate password to GateKeeper
-                setLockPattern(pattern, null, userId);
-                if (!hasChallenge) {
-                    return null;
-                }
-                // Fall through to get the auth token. Technically this should never happen,
-                // as a user that had a legacy pattern would have to unlock their device
-                // before getting to a flow with a challenge, but supporting for consistency.
-            } else {
-                throw new VerificationFailedException();
-            }
-        }
-
-        byte[] token = null;
-        if (hasChallenge) {
-            token = getGateKeeperService()
-                    .verifyChallenge(userId, challenge, storedHash.hash, pattern.getBytes());
-            if (token == null) {
-                throw new VerificationFailedException();
-            }
-        } else if (!getGateKeeperService().verify(userId, storedHash.hash, pattern.getBytes())) {
-            throw new VerificationFailedException();
-        }
-
-        // pattern has matched
-        unlockKeystore(pattern, userId);
-        return token;
-
+                   @Override
+                   public byte[] toHash(String pattern, int userId) {
+                       return mLockPatternUtils.patternToHash(
+                               mLockPatternUtils.stringToPattern(pattern));
+                   }
+               }
+       );
     }
 
     @Override
-    public boolean checkPassword(String password, int userId) throws RemoteException {
-        try {
-            doVerifyPassword(password, false, 0, userId);
-        } catch (VerificationFailedException ex) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public byte[] verifyPassword(String password, long challenge, int userId)
+    public VerifyCredentialResponse checkPassword(String password, int userId)
             throws RemoteException {
-        try {
-            return doVerifyPassword(password, true, challenge, userId);
-        } catch (VerificationFailedException ex) {
-            return null;
-        }
+        return doVerifyPassword(password, false, 0, userId);
     }
 
-    private byte[] doVerifyPassword(String password, boolean hasChallenge, long challenge,
-            int userId) throws VerificationFailedException, RemoteException {
+    @Override
+    public VerifyCredentialResponse verifyPassword(String password, long challenge, int userId)
+            throws RemoteException {
+        return doVerifyPassword(password, true, challenge, userId);
+    }
+
+    private VerifyCredentialResponse doVerifyPassword(String password, boolean hasChallenge,
+            long challenge, int userId) throws RemoteException {
        checkPasswordReadPermission(userId);
-
        CredentialHash storedHash = mStorage.readPasswordHash(userId);
+       return verifyCredential(userId, storedHash, password, hasChallenge, challenge,
+               new CredentialUtil() {
+                   @Override
+                   public void setCredential(String password, String oldPassword, int userId)
+                           throws RemoteException {
+                       setLockPassword(password, oldPassword, userId);
+                   }
 
-        if ((storedHash == null || storedHash.hash.length == 0) && TextUtils.isEmpty(password)) {
-            // don't need to pass empty passwords to GateKeeper
-            return null;
+                   @Override
+                   public byte[] toHash(String password, int userId) {
+                       return mLockPatternUtils.passwordToHash(password, userId);
+                   }
+               }
+       );
+    }
+
+    private VerifyCredentialResponse verifyCredential(int userId, CredentialHash storedHash,
+            String credential, boolean hasChallenge, long challenge, CredentialUtil credentialUtil)
+                throws RemoteException {
+        if ((storedHash == null || storedHash.hash.length == 0) && TextUtils.isEmpty(credential)) {
+            // don't need to pass empty credentials to GateKeeper
+            return VerifyCredentialResponse.OK;
         }
 
-        if (TextUtils.isEmpty(password)) {
-            throw new VerificationFailedException();
+        if (TextUtils.isEmpty(credential)) {
+            return VerifyCredentialResponse.ERROR;
         }
 
         if (storedHash.version == CredentialHash.VERSION_LEGACY) {
-            byte[] hash = mLockPatternUtils.passwordToHash(password, userId);
+            byte[] hash = credentialUtil.toHash(credential, userId);
             if (Arrays.equals(hash, storedHash.hash)) {
-                unlockKeystore(password, userId);
-                // migrate password to GateKeeper
-                setLockPassword(password, null, userId);
+                unlockKeystore(credential, userId);
+                // migrate credential to GateKeeper
+                credentialUtil.setCredential(credential, null, userId);
                 if (!hasChallenge) {
-                    return null;
+                    return VerifyCredentialResponse.OK;
                 }
                 // Fall through to get the auth token. Technically this should never happen,
-                // as a user that had a legacy password would have to unlock their device
+                // as a user that had a legacy credential would have to unlock their device
                 // before getting to a flow with a challenge, but supporting for consistency.
             } else {
-                throw new VerificationFailedException();
+                return VerifyCredentialResponse.ERROR;
             }
         }
 
-        byte[] token = null;
+        VerifyCredentialResponse response;
+        boolean shouldReEnroll = false;;
         if (hasChallenge) {
-            token = getGateKeeperService()
-                    .verifyChallenge(userId, challenge, storedHash.hash, password.getBytes());
-            if (token == null) {
-                throw new VerificationFailedException();
+            byte[] token = null;
+            GateKeeperResponse gateKeeperResponse = getGateKeeperService()
+                    .verifyChallenge(userId, challenge, storedHash.hash, credential.getBytes());
+            int responseCode = gateKeeperResponse.getResponseCode();
+            if (responseCode == GateKeeperResponse.RESPONSE_RETRY) {
+                 response = new VerifyCredentialResponse(gateKeeperResponse.getTimeout());
+            } else if (responseCode == GateKeeperResponse.RESPONSE_OK) {
+                token = gateKeeperResponse.getPayload();
+                if (token == null) {
+                    // something's wrong if there's no payload with a challenge
+                    Slog.e(TAG, "verifyChallenge response had no associated payload");
+                    response = VerifyCredentialResponse.ERROR;
+                } else {
+                    shouldReEnroll = gateKeeperResponse.getShouldReEnroll();
+                    response = new VerifyCredentialResponse(token);
+                }
+            } else {
+                response = VerifyCredentialResponse.ERROR;
             }
-        } else if (!getGateKeeperService().verify(userId, storedHash.hash, password.getBytes())) {
-            throw new VerificationFailedException();
+        } else {
+            GateKeeperResponse gateKeeperResponse = getGateKeeperService().verify(
+                    userId, storedHash.hash, credential.getBytes());
+            int responseCode = gateKeeperResponse.getResponseCode();
+            if (responseCode == GateKeeperResponse.RESPONSE_RETRY) {
+                response = new VerifyCredentialResponse(gateKeeperResponse.getTimeout());
+            } else if (responseCode == GateKeeperResponse.RESPONSE_OK) {
+                shouldReEnroll = gateKeeperResponse.getShouldReEnroll();
+                response = VerifyCredentialResponse.OK;
+            } else {
+                response = VerifyCredentialResponse.ERROR;
+            }
         }
 
-        // password has matched
-        unlockKeystore(password, userId);
-        return token;
-    }
+        if (response.getResponseCode() == VerifyCredentialResponse.RESPONSE_OK) {
+            // credential has matched
+            unlockKeystore(credential, userId);
+            if (shouldReEnroll) {
+                credentialUtil.setCredential(credential, credential, userId);
+            }
+        }
 
+        return response;
+    }
 
     @Override
     public boolean checkVoldPassword(int userId) throws RemoteException {
@@ -644,7 +658,8 @@
 
         try {
             if (mLockPatternUtils.isLockPatternEnabled(userId)) {
-                if (checkPattern(password, userId)) {
+                if (checkPattern(password, userId).getResponseCode()
+                        == GateKeeperResponse.RESPONSE_OK) {
                     return true;
                 }
             }
@@ -653,7 +668,8 @@
 
         try {
             if (mLockPatternUtils.isLockPasswordEnabled(userId)) {
-                if (checkPassword(password, userId)) {
+                if (checkPassword(password, userId).getResponseCode()
+                        == GateKeeperResponse.RESPONSE_OK) {
                     return true;
                 }
             }
@@ -741,6 +757,4 @@
         return null;
     }
 
-    private class VerificationFailedException extends Exception {}
-
 }
diff --git a/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java b/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java
index ec2bd67..16c959f 100644
--- a/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java
+++ b/services/core/java/com/android/server/am/ActivityManagerDebugConfig.java
@@ -41,14 +41,21 @@
     // Enable all debug log categories.
     static final boolean DEBUG_ALL = false;
 
+    // Enable all debug log categories for activities.
+    static final boolean DEBUG_ALL_ACTIVITIES = DEBUG_ALL || false;
+
     // Available log categories in the activity manager package.
+    static final boolean DEBUG_ADD_REMOVE = DEBUG_ALL_ACTIVITIES || false;
+    static final boolean DEBUG_APP = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_BACKUP = DEBUG_ALL || false;
     static final boolean DEBUG_BROADCAST = DEBUG_ALL || false;
     static final boolean DEBUG_BROADCAST_BACKGROUND = DEBUG_BROADCAST || false;
     static final boolean DEBUG_BROADCAST_LIGHT = DEBUG_BROADCAST || false;
     static final boolean DEBUG_CLEANUP = DEBUG_ALL || false;
     static final boolean DEBUG_CONFIGURATION = DEBUG_ALL || false;
+    static final boolean DEBUG_CONTAINERS = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_FOCUS = false;
+    static final boolean DEBUG_IDLE = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_IMMERSIVE = DEBUG_ALL || false;
     static final boolean DEBUG_LOCKSCREEN = DEBUG_ALL || false;
     static final boolean DEBUG_LOCKTASK = DEBUG_ALL || false;
@@ -63,10 +70,14 @@
     static final boolean DEBUG_PROVIDER = DEBUG_ALL || false;
     static final boolean DEBUG_PSS = DEBUG_ALL || false;
     static final boolean DEBUG_RECENTS = DEBUG_ALL || false;
+    static final boolean DEBUG_RELEASE = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_RESULTS = DEBUG_ALL || false;
+    static final boolean DEBUG_SAVED_STATE = DEBUG_ALL_ACTIVITIES || false;
+    static final boolean DEBUG_SCREENSHOTS = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_SERVICE = DEBUG_ALL || false;
     static final boolean DEBUG_SERVICE_EXECUTING = DEBUG_ALL || false;
     static final boolean DEBUG_STACK = DEBUG_ALL || false;
+    static final boolean DEBUG_STATES = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_SWITCH = DEBUG_ALL || false;
     static final boolean DEBUG_TASKS = DEBUG_ALL || false;
     static final boolean DEBUG_THUMBNAILS = DEBUG_ALL || false;
@@ -75,16 +86,21 @@
     static final boolean DEBUG_URI_PERMISSION = DEBUG_ALL || false;
     static final boolean DEBUG_USER_LEAVING = DEBUG_ALL || false;
     static final boolean DEBUG_VISIBILITY = DEBUG_ALL || false;
+    static final boolean DEBUG_VISIBLE_BEHIND = DEBUG_ALL_ACTIVITIES || false;
     static final boolean DEBUG_USAGE_STATS = DEBUG_ALL || false;
 
+    static final String POSTFIX_ADD_REMOVE = (APPEND_CATEGORY_NAME) ? "_AddRemove" : "";
+    static final String POSTFIX_APP = (APPEND_CATEGORY_NAME) ? "_App" : "";
     static final String POSTFIX_BACKUP = (APPEND_CATEGORY_NAME) ? "_Backup" : "";
     static final String POSTFIX_BROADCAST = (APPEND_CATEGORY_NAME) ? "_Broadcast" : "";
     static final String POSTFIX_CLEANUP = (APPEND_CATEGORY_NAME) ? "_Cleanup" : "";
     static final String POSTFIX_CONFIGURATION = (APPEND_CATEGORY_NAME) ? "_Configuration" : "";
+    static final String POSTFIX_CONTAINERS = (APPEND_CATEGORY_NAME) ? "_Containers" : "";
     static final String POSTFIX_FOCUS = (APPEND_CATEGORY_NAME) ? "_Focus" : "";
+    static final String POSTFIX_IDLE = (APPEND_CATEGORY_NAME) ? "_Idle" : "";
     static final String POSTFIX_IMMERSIVE = (APPEND_CATEGORY_NAME) ? "_Immersive" : "";
-    static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LOCKSCREEN" : "";
-    static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LOCKTASK" : "";
+    static final String POSTFIX_LOCKSCREEN = (APPEND_CATEGORY_NAME) ? "_LockScreen" : "";
+    static final String POSTFIX_LOCKTASK = (APPEND_CATEGORY_NAME) ? "_LockTask" : "";
     static final String POSTFIX_LRU = (APPEND_CATEGORY_NAME) ? "_LRU" : "";
     static final String POSTFIX_MU = "_MU";
     static final String POSTFIX_OOM_ADJ = (APPEND_CATEGORY_NAME) ? "_OomAdj" : "";
@@ -95,12 +111,16 @@
     static final String POSTFIX_PROCESSES = (APPEND_CATEGORY_NAME) ? "_Processes" : "";
     static final String POSTFIX_PROVIDER = (APPEND_CATEGORY_NAME) ? "_Provider" : "";
     static final String POSTFIX_PSS = (APPEND_CATEGORY_NAME) ? "_Pss" : "";
-    static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : "";
     static final String POSTFIX_RECENTS = (APPEND_CATEGORY_NAME) ? "_Recents" : "";
+    static final String POSTFIX_RELEASE = (APPEND_CATEGORY_NAME) ? "_Release" : "";
+    static final String POSTFIX_RESULTS = (APPEND_CATEGORY_NAME) ? "_Results" : "";
+    static final String POSTFIX_SAVED_STATE = (APPEND_CATEGORY_NAME) ? "_SavedState" : "";
+    static final String POSTFIX_SCREENSHOTS = (APPEND_CATEGORY_NAME) ? "_Screenshots" : "";
     static final String POSTFIX_SERVICE = (APPEND_CATEGORY_NAME) ? "_Service" : "";
     static final String POSTFIX_SERVICE_EXECUTING =
             (APPEND_CATEGORY_NAME) ? "_ServiceExecuting" : "";
     static final String POSTFIX_STACK = (APPEND_CATEGORY_NAME) ? "_Stack" : "";
+    static final String POSTFIX_STATES = (APPEND_CATEGORY_NAME) ? "_States" : "";
     static final String POSTFIX_SWITCH = (APPEND_CATEGORY_NAME) ? "_Switch" : "";
     static final String POSTFIX_TASKS = (APPEND_CATEGORY_NAME) ? "_Tasks" : "";
     static final String POSTFIX_THUMBNAILS = (APPEND_CATEGORY_NAME) ? "_Thumbnails" : "";
@@ -110,5 +130,6 @@
     static final String POSTFIX_URI_PERMISSION = (APPEND_CATEGORY_NAME) ? "_UriPermission" : "";
     static final String POSTFIX_USER_LEAVING = (APPEND_CATEGORY_NAME) ? "_UserLeaving" : "";
     static final String POSTFIX_VISIBILITY = (APPEND_CATEGORY_NAME) ? "_Visibility" : "";
+    static final String POSTFIX_VISIBLE_BEHIND = (APPEND_CATEGORY_NAME) ? "_VisibleBehind" : "";
 
 }
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index b111b36..2b6f8e1 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -281,6 +281,7 @@
     private static final String TAG_UID_OBSERVERS = TAG + POSTFIX_UID_OBSERVERS;
     private static final String TAG_URI_PERMISSION = TAG + POSTFIX_URI_PERMISSION;
     private static final String TAG_VISIBILITY = TAG + POSTFIX_VISIBILITY;
+    private static final String TAG_VISIBLE_BEHIND = TAG + POSTFIX_VISIBLE_BEHIND;
 
     /** Control over CPU and battery monitoring */
     // write battery stats every 30 minutes.
@@ -3426,7 +3427,8 @@
                 if (preferredComponent != null) {
                     ai = AppGlobals.getPackageManager().getActivityInfo(
                             preferredComponent, flags, userId);
-                } else {
+                }
+                if (ai == null) {
                     ResolveInfo info = AppGlobals.getPackageManager().resolveIntent(
                             intent,
                             intent.resolveTypeIfNeeded(mContext.getContentResolver()),
@@ -5501,8 +5503,10 @@
                     // Entire package setting changed
                     enabled = pm.getApplicationEnabledSetting(packageName,
                             (userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_OWNER);
-                } catch (RemoteException e) {
-                    // Can't happen...
+                } catch (Exception e) {
+                    // No such package/component; probably racing with uninstall.  In any
+                    // event it means we have nothing further to do here.
+                    return;
                 }
                 packageDisabled = enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                         && enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
@@ -5517,8 +5521,9 @@
                     enabled = pm.getComponentEnabledSetting(
                             new ComponentName(packageName, changedClass),
                             (userId != UserHandle.USER_ALL) ? userId : UserHandle.USER_OWNER);
-                } catch (RemoteException e) {
-                    // Can't happen...
+                } catch (Exception e) {
+                    // As above, probably racing with uninstall.
+                    return;
                 }
                 if (enabled != PackageManager.COMPONENT_ENABLED_STATE_ENABLED
                         && enabled != PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
@@ -10837,7 +10842,7 @@
             synchronized (this) {
                 final ActivityStack stack = ActivityRecord.getStackLocked(token);
                 final boolean visible = stack == null ? false : stack.hasVisibleBehindActivity();
-                if (ActivityStackSupervisor.DEBUG_VISIBLE_BEHIND) Slog.d(TAG,
+                if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND,
                         "isBackgroundVisibleBehind: stack=" + stack + " visible=" + visible);
                 return visible;
             }
@@ -11045,9 +11050,15 @@
     public void killUid(int uid, String reason) {
         enforceCallingPermission(Manifest.permission.KILL_UID, "killUid");
         synchronized (this) {
-            killPackageProcessesLocked(null, UserHandle.getAppId(uid), UserHandle.getUserId(uid),
-                    ProcessList.FOREGROUND_APP_ADJ-1, false, true, true, false,
-                    reason != null ? reason : "kill uid");
+            final long identity = Binder.clearCallingIdentity();
+            try {
+                killPackageProcessesLocked(null, UserHandle.getAppId(uid),
+                        UserHandle.getUserId(uid),
+                        ProcessList.PERSISTENT_PROC_ADJ, false, true, true, true,
+                        reason != null ? reason : "kill uid");
+            } finally {
+                Binder.restoreCallingIdentity(identity);
+            }
         }
     }
 
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index 54dd491..3765a3c 100755
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -72,11 +72,11 @@
  */
 final class ActivityRecord {
     private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityRecord" : TAG_AM;
+    private static final String TAG_STATES = TAG + POSTFIX_STATES;
     private static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
     private static final String TAG_THUMBNAILS = TAG + POSTFIX_THUMBNAILS;
 
     private static final boolean SHOW_ACTIVITY_START_TIME = true;
-    static final boolean DEBUG_SAVED_STATE = ActivityStackSupervisor.DEBUG_SAVED_STATE;
     final public static String RECENTS_PACKAGE_NAME = "com.android.systemui.recents";
 
     private static final String ATTR_ID = "id";
@@ -1093,7 +1093,7 @@
 
     static void activityResumedLocked(IBinder token) {
         final ActivityRecord r = ActivityRecord.forTokenLocked(token);
-        if (DEBUG_SAVED_STATE) Slog.i(TAG, "Resumed activity; dropping state of: " + r);
+        if (DEBUG_SAVED_STATE) Slog.i(TAG_STATES, "Resumed activity; dropping state of: " + r);
         r.icicle = null;
         r.haveState = false;
     }
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index a4c557f..30ee214 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -23,13 +23,6 @@
 import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
 import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;
 
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_ADD_REMOVE;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_APP;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_CONTAINERS;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_RELEASE;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_SAVED_STATE;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_SCREENSHOTS;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_STATES;
 import static com.android.server.am.ActivityStackSupervisor.HOME_STACK_ID;
 
 import android.util.ArraySet;
@@ -89,11 +82,18 @@
 final class ActivityStack {
 
     private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityStack" : TAG_AM;
+    private static final String TAG_ADD_REMOVE = TAG + POSTFIX_ADD_REMOVE;
+    private static final String TAG_APP = TAG + POSTFIX_APP;
     private static final String TAG_CLEANUP = TAG + POSTFIX_CLEANUP;
     private static final String TAG_CONFIGURATION = TAG + POSTFIX_CONFIGURATION;
+    private static final String TAG_CONTAINERS = TAG + POSTFIX_CONTAINERS;
     private static final String TAG_PAUSE = TAG + POSTFIX_PAUSE;
+    private static final String TAG_RELEASE = TAG + POSTFIX_RELEASE;
     private static final String TAG_RESULTS = TAG + POSTFIX_RESULTS;
+    private static final String TAG_SAVED_STATE = TAG + POSTFIX_SAVED_STATE;
+    private static final String TAG_SCREENSHOTS = TAG + POSTFIX_SCREENSHOTS;
     private static final String TAG_STACK = TAG + POSTFIX_STACK;
+    private static final String TAG_STATES = TAG + POSTFIX_STATES;
     private static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
     private static final String TAG_TASKS = TAG + POSTFIX_TASKS;
     private static final String TAG_TRANSITION = TAG + POSTFIX_TRANSITION;
@@ -666,8 +666,8 @@
 
     void minimalResumeActivityLocked(ActivityRecord r) {
         r.state = ActivityState.RESUMED;
-        if (DEBUG_STATES) Slog.v(TAG, "Moving to RESUMED: " + r
-                + " (starting new instance)");
+        if (DEBUG_STATES) Slog.v(TAG_STATES,
+                "Moving to RESUMED: " + r + " (starting new instance)");
         r.stopped = false;
         mResumedActivity = r;
         r.task.touchActiveTime();
@@ -675,7 +675,8 @@
         completeResumeLocked(r);
         mStackSupervisor.checkReadyForSleepLocked();
         setLaunchTime(r);
-        if (DEBUG_SAVED_STATE) Slog.i(TAG, "Launch completed; removing icicle of " + r.icicle);
+        if (DEBUG_SAVED_STATE) Slog.i(TAG_SAVED_STATE,
+                "Launch completed; removing icicle of " + r.icicle);
     }
 
     private void startLaunchTraces() {
@@ -752,7 +753,8 @@
             // Stop visible behind activity before going to sleep.
             final ActivityRecord r = mActivityContainer.mActivityDisplay.mVisibleBehindActivity;
             mStackSupervisor.mStoppingActivities.add(r);
-            if (DEBUG_STATES) Slog.v(TAG, "Sleep still waiting to stop visible behind " + r);
+            if (DEBUG_STATES) Slog.v(TAG_STATES,
+                    "Sleep still waiting to stop visible behind " + r);
             return true;
         }
 
@@ -776,23 +778,23 @@
     }
 
     public final Bitmap screenshotActivities(ActivityRecord who) {
-        if (DEBUG_SCREENSHOTS) Slog.d(TAG, "screenshotActivities: " + who);
+        if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "screenshotActivities: " + who);
         if (who.noDisplay) {
-            if (DEBUG_SCREENSHOTS) Slog.d(TAG, "\tNo display");
+            if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "\tNo display");
             return null;
         }
 
         if (isHomeStack()) {
             // This is an optimization -- since we never show Home or Recents within Recents itself,
             // we can just go ahead and skip taking the screenshot if this is the home stack.
-            if (DEBUG_SCREENSHOTS) Slog.d(TAG, "\tHome stack");
+            if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "\tHome stack");
             return null;
         }
 
         int w = mService.mThumbnailWidth;
         int h = mService.mThumbnailHeight;
         if (w > 0) {
-            if (DEBUG_SCREENSHOTS) Slog.d(TAG, "\tTaking screenshot");
+            if (DEBUG_SCREENSHOTS) Slog.d(TAG_SCREENSHOTS, "\tTaking screenshot");
             return mWindowManager.screenshotApplications(who.appToken, Display.DEFAULT_DISPLAY,
                     w, h);
         }
@@ -840,7 +842,7 @@
             mStackSupervisor.pauseChildStacks(prev, userLeaving, uiSleeping, resuming, dontWait);
         }
 
-        if (DEBUG_STATES) Slog.v(TAG, "Moving to PAUSING: " + prev);
+        if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to PAUSING: " + prev);
         else if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Start pausing: " + prev);
         mResumedActivity = null;
         mPausingActivity = prev;
@@ -934,7 +936,7 @@
         if (r != null) {
             mHandler.removeMessages(PAUSE_TIMEOUT_MSG, r);
             if (mPausingActivity == r) {
-                if (DEBUG_STATES) Slog.v(TAG, "Moving to PAUSED: " + r
+                if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to PAUSED: " + r
                         + (timeout ? " (due to timeout)" : " (pause complete)"));
                 completePauseLocked(true);
             } else {
@@ -962,7 +964,7 @@
             r.persistentState = persistentState;
             mService.notifyTaskPersisterLocked(r.task, false);
         }
-        if (DEBUG_SAVED_STATE) Slog.i(TAG, "Saving icicle of " + r + ": " + icicle);
+        if (DEBUG_SAVED_STATE) Slog.i(TAG_SAVED_STATE, "Saving icicle of " + r + ": " + icicle);
         if (icicle != null) {
             // If icicle is null, this is happening due to a timeout, so we
             // haven't really saved the state.
@@ -972,7 +974,7 @@
             r.updateThumbnailLocked(null, description);
         }
         if (!r.stopped) {
-            if (DEBUG_STATES) Slog.v(TAG, "Moving to STOPPED: " + r + " (stop complete)");
+            if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to STOPPED: " + r + " (stop complete)");
             mHandler.removeMessages(STOP_TIMEOUT_MSG, r);
             r.stopped = true;
             r.state = ActivityState.STOPPED;
@@ -1594,7 +1596,8 @@
             }
             // Let's just start up the Launcher...
             ActivityOptions.abort(options);
-            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: No more activities go home");
+            if (DEBUG_STATES) Slog.d(TAG_STATES,
+                    "resumeTopActivityLocked: No more activities go home");
             if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
             // Only resume home if on home display
             final int returnTaskType = prevTask == null || !prevTask.isOverHomeStack() ?
@@ -1613,7 +1616,8 @@
             mWindowManager.executeAppTransition();
             mNoAnimActivities.clear();
             ActivityOptions.abort(options);
-            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Top activity resumed " + next);
+            if (DEBUG_STATES) Slog.d(TAG_STATES,
+                    "resumeTopActivityLocked: Top activity resumed " + next);
             if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
             return false;
         }
@@ -1632,7 +1636,7 @@
             } else if (!isOnHomeDisplay()) {
                 return false;
             } else if (!isHomeStack()){
-                if (DEBUG_STATES) Slog.d(TAG,
+                if (DEBUG_STATES) Slog.d(TAG_STATES,
                         "resumeTopActivityLocked: Launching home next");
                 final int returnTaskType = prevTask == null || !prevTask.isOverHomeStack() ?
                         HOME_ACTIVITY_TYPE : prevTask.getTaskToReturnTo();
@@ -1651,7 +1655,8 @@
             mWindowManager.executeAppTransition();
             mNoAnimActivities.clear();
             ActivityOptions.abort(options);
-            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Going to sleep and all paused");
+            if (DEBUG_STATES) Slog.d(TAG_STATES,
+                    "resumeTopActivityLocked: Going to sleep and all paused");
             if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
             return false;
         }
@@ -1720,11 +1725,12 @@
         boolean dontWaitForPause = (next.info.flags&ActivityInfo.FLAG_RESUME_WHILE_PAUSING) != 0;
         boolean pausing = mStackSupervisor.pauseBackStacks(userLeaving, true, dontWaitForPause);
         if (mResumedActivity != null) {
-            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Pausing " + mResumedActivity);
+            if (DEBUG_STATES) Slog.d(TAG_STATES,
+                    "resumeTopActivityLocked: Pausing " + mResumedActivity);
             pausing |= startPausingLocked(userLeaving, false, true, dontWaitForPause);
         }
         if (pausing) {
-            if (DEBUG_SWITCH || DEBUG_STATES) Slog.v(TAG,
+            if (DEBUG_SWITCH || DEBUG_STATES) Slog.v(TAG_STATES,
                     "resumeTopActivityLocked: Skip resume: need to start pausing");
             // At this point we want to put the upcoming activity's process
             // at the top of the LRU list, since we know we will be needing it
@@ -1742,8 +1748,8 @@
         // sure to finish it as we're making a new activity topmost.
         if (mService.isSleeping() && mLastNoHistoryActivity != null &&
                 !mLastNoHistoryActivity.finishing) {
-            if (DEBUG_STATES) Slog.d(TAG, "no-history finish of " + mLastNoHistoryActivity +
-                    " on new resume");
+            if (DEBUG_STATES) Slog.d(TAG_STATES,
+                    "no-history finish of " + mLastNoHistoryActivity + " on new resume");
             requestFinishActivityLocked(mLastNoHistoryActivity.appToken, Activity.RESULT_CANCELED,
                     null, "resume-no-history", false);
             mLastNoHistoryActivity = null;
@@ -1864,7 +1870,7 @@
 
             mService.updateCpuStats();
 
-            if (DEBUG_STATES) Slog.v(TAG, "Moving to RESUMED: " + next + " (in existing)");
+            if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to RESUMED: " + next + " (in existing)");
             next.state = ActivityState.RESUMED;
             mResumedActivity = next;
             next.task.touchActiveTime();
@@ -1893,7 +1899,7 @@
                 // is still at the top and schedule another run if something
                 // weird happened.
                 ActivityRecord nextNext = topRunningActivityLocked(null);
-                if (DEBUG_SWITCH || DEBUG_STATES) Slog.i(TAG,
+                if (DEBUG_SWITCH || DEBUG_STATES) Slog.i(TAG_STATES,
                         "Activity config changed during resume: " + next
                         + ", new next: " + nextNext);
                 if (nextNext != next) {
@@ -1938,10 +1944,10 @@
 
                 mStackSupervisor.checkReadyForSleepLocked();
 
-                if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Resumed " + next);
+                if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Resumed " + next);
             } catch (Exception e) {
                 // Whoops, need to restart this activity!
-                if (DEBUG_STATES) Slog.v(TAG, "Resume failed; resetting state to "
+                if (DEBUG_STATES) Slog.v(TAG_STATES, "Resume failed; resetting state to "
                         + lastState + ": " + next);
                 next.state = lastState;
                 if (lastStack != null) {
@@ -1995,7 +2001,7 @@
                 }
                 if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Restarting: " + next);
             }
-            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Restarting " + next);
+            if (DEBUG_STATES) Slog.d(TAG_STATES, "resumeTopActivityLocked: Restarting " + next);
             mStackSupervisor.startSpecificActivityLocked(next, true, true);
         }
 
@@ -2345,9 +2351,9 @@
                             noOptions = false;
                         }
                     }
-                    if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing activity " + p + " from task="
-                            + task + " adding to task=" + targetTask
-                            + " Callers=" + Debug.getCallers(4));
+                    if (DEBUG_ADD_REMOVE) Slog.i(TAG_ADD_REMOVE,
+                            "Removing activity " + p + " from task=" + task + " adding to task="
+                            + targetTask + " Callers=" + Debug.getCallers(4));
                     if (DEBUG_TASKS) Slog.v(TAG_TASKS,
                             "Pushing next activity " + p + " out to target's task " + target.task);
                     p.setTask(targetTask, null);
@@ -2490,9 +2496,9 @@
                         p.setTask(task, null);
                         task.addActivityAtIndex(taskInsertionPoint, p);
 
-                        if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing and adding activity " + p
-                                + " to stack at " + task,
-                                new RuntimeException("here").fillInStackTrace());
+                        if (DEBUG_ADD_REMOVE) Slog.i(TAG_ADD_REMOVE,
+                                "Removing and adding activity " + p + " to stack at " + task
+                                + " callers=" + Debug.getCallers(3));
                         if (DEBUG_TASKS) Slog.v(TAG_TASKS, "Pulling activity " + p
                                 + " from " + srcPos + " in to resetting task " + task);
                         mWindowManager.setAppTask(p.appToken, taskId);
@@ -2657,13 +2663,11 @@
                 || (r.info.flags&ActivityInfo.FLAG_NO_HISTORY) != 0) {
             if (!r.finishing) {
                 if (!mService.isSleeping()) {
-                    if (DEBUG_STATES) {
-                        Slog.d(TAG, "no-history finish of " + r);
-                    }
+                    if (DEBUG_STATES) Slog.d(TAG_STATES, "no-history finish of " + r);
                     requestFinishActivityLocked(r.appToken, Activity.RESULT_CANCELED, null,
                             "stop-no-history", false);
                 } else {
-                    if (DEBUG_STATES) Slog.d(TAG, "Not finishing noHistory " + r
+                    if (DEBUG_STATES) Slog.d(TAG_STATES, "Not finishing noHistory " + r
                             + " on stop because we're just sleeping");
                 }
             }
@@ -2674,8 +2678,8 @@
             r.resumeKeyDispatchingLocked();
             try {
                 r.stopped = false;
-                if (DEBUG_STATES) Slog.v(TAG, "Moving to STOPPING: " + r
-                        + " (stop requested)");
+                if (DEBUG_STATES) Slog.v(TAG_STATES,
+                        "Moving to STOPPING: " + r + " (stop requested)");
                 r.state = ActivityState.STOPPING;
                 if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY,
                         "Stopping visible=" + r.visible + " for " + r);
@@ -2695,7 +2699,7 @@
                 Slog.w(TAG, "Exception thrown during pause", e);
                 // Just in case, assume it to be stopped.
                 r.stopped = true;
-                if (DEBUG_STATES) Slog.v(TAG, "Stop failed; moving to STOPPED: " + r);
+                if (DEBUG_STATES) Slog.v(TAG_STATES, "Stop failed; moving to STOPPED: " + r);
                 r.state = ActivityState.STOPPED;
                 if (r.configDestroy) {
                     destroyActivityLocked(r, true, "stop-except");
@@ -2711,8 +2715,8 @@
     final boolean requestFinishActivityLocked(IBinder token, int resultCode,
             Intent resultData, String reason, boolean oomAdj) {
         ActivityRecord r = isInStackLocked(token);
-        if (DEBUG_RESULTS || DEBUG_STATES) Slog.v(
-                TAG, "Finishing activity token=" + token + " r="
+        if (DEBUG_RESULTS || DEBUG_STATES) Slog.v(TAG_STATES,
+                "Finishing activity token=" + token + " r="
                 + ", result=" + resultCode + ", data=" + resultData
                 + ", reason=" + reason);
         if (r == null) {
@@ -2933,8 +2937,8 @@
                     mStackSupervisor.checkReadyForSleepLocked();
                 }
             }
-            if (DEBUG_STATES) Slog.v(TAG, "Moving to STOPPING: " + r
-                    + " (finish requested)");
+            if (DEBUG_STATES) Slog.v(TAG_STATES,
+                    "Moving to STOPPING: "+ r + " (finish requested)");
             r.state = ActivityState.STOPPING;
             if (oomAdj) {
                 mService.updateOomAdjLocked();
@@ -2950,7 +2954,7 @@
             mResumedActivity = null;
         }
         final ActivityState prevState = r.state;
-        if (DEBUG_STATES) Slog.v(TAG, "Moving to FINISHING: " + r);
+        if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to FINISHING: " + r);
         r.state = ActivityState.FINISHING;
 
         if (mode == FINISH_IMMEDIATELY
@@ -2963,7 +2967,7 @@
             if (activityRemoved) {
                 mStackSupervisor.resumeTopActivitiesLocked();
             }
-            if (DEBUG_CONTAINERS) Slog.d(TAG,
+            if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS,
                     "destroyActivityLocked: finishCurrentActivityLocked r=" + r +
                     " destroy returned removed=" + activityRemoved);
             return activityRemoved ? null : r;
@@ -3137,9 +3141,9 @@
         r.frozenBeforeDestroy = false;
 
         if (setState) {
-            if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r + " (cleaning up)");
+            if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to DESTROYED: " + r + " (cleaning up)");
             r.state = ActivityState.DESTROYED;
-            if (DEBUG_APP) Slog.v(TAG, "Clearing app during cleanUp for activity " + r);
+            if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during cleanUp for activity " + r);
             r.app = null;
         }
 
@@ -3183,16 +3187,15 @@
         mStackSupervisor.removeChildActivityContainers(r);
         finishActivityResultsLocked(r, Activity.RESULT_CANCELED, null);
         r.makeFinishingLocked();
-        if (DEBUG_ADD_REMOVE) {
-            RuntimeException here = new RuntimeException("here");
-            here.fillInStackTrace();
-            Slog.i(TAG, "Removing activity " + r + " from stack");
-        }
+        if (DEBUG_ADD_REMOVE) Slog.i(TAG_ADD_REMOVE,
+                "Removing activity " + r + " from stack callers=" + Debug.getCallers(5));
+
         r.takeFromHistory();
         removeTimeoutsForActivityLocked(r);
-        if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r + " (removed from history)");
+        if (DEBUG_STATES) Slog.v(TAG_STATES,
+                "Moving to DESTROYED: " + r + " (removed from history)");
         r.state = ActivityState.DESTROYED;
-        if (DEBUG_APP) Slog.v(TAG, "Clearing app during remove for activity " + r);
+        if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during remove for activity " + r);
         r.app = null;
         mWindowManager.removeAppToken(r.appToken);
         if (VALIDATE_TOKENS) {
@@ -3280,7 +3283,7 @@
     final int releaseSomeActivitiesLocked(ProcessRecord app, ArraySet<TaskRecord> tasks,
             String reason) {
         // Iterate over tasks starting at the back (oldest) first.
-        if (DEBUG_RELEASE) Slog.d(TAG, "Trying to release some activities in " + app);
+        if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Trying to release some activities in " + app);
         int maxTasks = tasks.size() / 4;
         if (maxTasks < 1) {
             maxTasks = 1;
@@ -3291,13 +3294,13 @@
             if (!tasks.contains(task)) {
                 continue;
             }
-            if (DEBUG_RELEASE) Slog.d(TAG, "Looking for activities to release in " + task);
+            if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Looking for activities to release in " + task);
             int curNum = 0;
             final ArrayList<ActivityRecord> activities = task.mActivities;
             for (int actNdx = 0; actNdx < activities.size(); actNdx++) {
                 final ActivityRecord activity = activities.get(actNdx);
                 if (activity.app == app && activity.isDestroyable()) {
-                    if (DEBUG_RELEASE) Slog.v(TAG, "Destroying " + activity
+                    if (DEBUG_RELEASE) Slog.v(TAG_RELEASE, "Destroying " + activity
                             + " in state " + activity.state + " resumed=" + mResumedActivity
                             + " pausing=" + mPausingActivity + " for reason " + reason);
                     destroyActivityLocked(activity, true, reason);
@@ -3317,7 +3320,8 @@
                 }
             }
         }
-        if (DEBUG_RELEASE) Slog.d(TAG, "Done releasing: did " + numReleased + " activities");
+        if (DEBUG_RELEASE) Slog.d(TAG_RELEASE,
+                "Done releasing: did " + numReleased + " activities");
         return numReleased;
     }
 
@@ -3387,15 +3391,16 @@
             // it in the destroyed state since we are not removing it from the
             // list.
             if (r.finishing && !skipDestroy) {
-                if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYING: " + r
+                if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to DESTROYING: " + r
                         + " (destroy requested)");
                 r.state = ActivityState.DESTROYING;
                 Message msg = mHandler.obtainMessage(DESTROY_TIMEOUT_MSG, r);
                 mHandler.sendMessageDelayed(msg, DESTROY_TIMEOUT);
             } else {
-                if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r + " (destroy skipped)");
+                if (DEBUG_STATES) Slog.v(TAG_STATES,
+                        "Moving to DESTROYED: " + r + " (destroy skipped)");
                 r.state = ActivityState.DESTROYED;
-                if (DEBUG_APP) Slog.v(TAG, "Clearing app during destroy for activity " + r);
+                if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during destroy for activity " + r);
                 r.app = null;
             }
         } else {
@@ -3404,9 +3409,9 @@
                 removeActivityFromHistoryLocked(r, reason + " hadNoApp");
                 removedFromHistory = true;
             } else {
-                if (DEBUG_STATES) Slog.v(TAG, "Moving to DESTROYED: " + r + " (no app)");
+                if (DEBUG_STATES) Slog.v(TAG_STATES, "Moving to DESTROYED: " + r + " (no app)");
                 r.state = ActivityState.DESTROYED;
-                if (DEBUG_APP) Slog.v(TAG, "Clearing app during destroy for activity " + r);
+                if (DEBUG_APP) Slog.v(TAG_APP, "Clearing app during destroy for activity " + r);
                 r.app = null;
             }
         }
@@ -3427,7 +3432,7 @@
             if (r != null) {
                 mHandler.removeMessages(DESTROY_TIMEOUT_MSG, r);
             }
-            if (DEBUG_CONTAINERS) Slog.d(TAG, "activityDestroyedLocked: r=" + r);
+            if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS, "activityDestroyedLocked: r=" + r);
 
             if (isInStackLocked(r) != null) {
                 if (r.state == ActivityState.DESTROYING) {
@@ -3449,7 +3454,7 @@
                 // activity.
                 return;
             }
-            if (DEBUG_STATES) Slog.d(TAG, "releaseBackgroundResources activtyDisplay=" +
+            if (DEBUG_STATES) Slog.d(TAG_STATES, "releaseBackgroundResources activtyDisplay=" +
                     mActivityContainer.mActivityDisplay + " visibleBehind=" + r + " app=" + r.app +
                     " thread=" + r.app.thread);
             if (r != null && r.app != null && r.app.thread != null) {
@@ -3550,15 +3555,12 @@
                         remove = false;
                     }
                     if (remove) {
-                        if (DEBUG_ADD_REMOVE || DEBUG_CLEANUP) {
-                            RuntimeException here = new RuntimeException("here");
-                            here.fillInStackTrace();
-                            Slog.i(TAG, "Removing activity " + r + " from stack at " + i
-                                    + ": haveState=" + r.haveState
-                                    + " stateNotNeeded=" + r.stateNotNeeded
-                                    + " finishing=" + r.finishing
-                                    + " state=" + r.state, here);
-                        }
+                        if (DEBUG_ADD_REMOVE || DEBUG_CLEANUP) Slog.i(TAG_ADD_REMOVE,
+                                "Removing activity " + r + " from stack at " + i
+                                + ": haveState=" + r.haveState
+                                + " stateNotNeeded=" + r.stateNotNeeded
+                                + " finishing=" + r.finishing
+                                + " state=" + r.state + " callers=" + Debug.getCallers(5));
                         if (!r.finishing) {
                             Slog.w(TAG, "Force removing " + r + ": app died, no saved state");
                             EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY,
@@ -3572,14 +3574,13 @@
                     } else {
                         // We have the current state for this activity, so
                         // it can be restarted later when needed.
-                        if (DEBUG_ALL) Slog.v(
-                            TAG, "Keeping entry, setting app to null");
-                        if (DEBUG_APP) Slog.v(TAG, "Clearing app during removeHistory for activity "
-                                + r);
+                        if (DEBUG_ALL) Slog.v(TAG, "Keeping entry, setting app to null");
+                        if (DEBUG_APP) Slog.v(TAG_APP,
+                                "Clearing app during removeHistory for activity " + r);
                         r.app = null;
                         r.nowVisible = false;
                         if (!r.haveState) {
-                            if (DEBUG_SAVED_STATE) Slog.i(TAG,
+                            if (DEBUG_SAVED_STATE) Slog.i(TAG_SAVED_STATE,
                                     "App died, clearing saved state of " + r);
                             r.icicle = null;
                         }
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 01a3fe3..23e62e2 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -124,37 +124,31 @@
 public final class ActivityStackSupervisor implements DisplayListener {
     private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityStackSupervisor" : TAG_AM;
     private static final String TAG_CONFIGURATION = TAG + POSTFIX_CONFIGURATION;
+    private static final String TAG_CONTAINERS = TAG + POSTFIX_CONTAINERS;
     private static final String TAG_FOCUS = TAG + POSTFIX_FOCUS;
+    private static final String TAG_IDLE = TAG + POSTFIX_IDLE;
     private static final String TAG_LOCKTASK = TAG + POSTFIX_LOCKTASK;
     private static final String TAG_PAUSE = TAG + POSTFIX_PAUSE;
-    private static final String TAG_RESULTS = TAG + POSTFIX_RESULTS;
     private static final String TAG_RECENTS = TAG + POSTFIX_RECENTS;
+    private static final String TAG_RELEASE = TAG + POSTFIX_RELEASE;
+    private static final String TAG_RESULTS = TAG + POSTFIX_RESULTS;
     private static final String TAG_STACK = TAG + POSTFIX_STACK;
+    private static final String TAG_STATES = TAG + POSTFIX_STATES;
     private static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;
     private static final String TAG_TASKS = TAG + POSTFIX_TASKS;
+    private static final String TAG_VISIBLE_BEHIND = TAG + POSTFIX_VISIBLE_BEHIND;
     private static final String TAG_USER_LEAVING = TAG + POSTFIX_USER_LEAVING;
 
-    static final boolean DEBUG = DEBUG_ALL || false;
-    static final boolean DEBUG_ADD_REMOVE = DEBUG || false;
-    static final boolean DEBUG_APP = DEBUG || false;
-    static final boolean DEBUG_CONTAINERS = DEBUG || false;
-    static final boolean DEBUG_IDLE = DEBUG || false;
-    static final boolean DEBUG_RELEASE = DEBUG || false;
-    static final boolean DEBUG_SAVED_STATE = DEBUG || false;
-    static final boolean DEBUG_SCREENSHOTS = DEBUG || false;
-    static final boolean DEBUG_STATES = DEBUG || false;
-    static final boolean DEBUG_VISIBLE_BEHIND = DEBUG || false;
-
     public static final int HOME_STACK_ID = 0;
 
     /** How long we wait until giving up on the last activity telling us it is idle. */
-    static final int IDLE_TIMEOUT = 10*1000;
+    static final int IDLE_TIMEOUT = 10 * 1000;
 
     /** How long we can hold the sleep wake lock before giving up. */
-    static final int SLEEP_TIMEOUT = 5*1000;
+    static final int SLEEP_TIMEOUT = 5 * 1000;
 
     // How long we can hold the launch wake lock before giving up.
-    static final int LAUNCH_TIMEOUT = 10*1000;
+    static final int LAUNCH_TIMEOUT = 10 * 1000;
 
     static final int IDLE_TIMEOUT_MSG = FIRST_SUPERVISOR_STACK_MSG;
     static final int IDLE_NOW_MSG = FIRST_SUPERVISOR_STACK_MSG + 1;
@@ -631,7 +625,7 @@
                 }
                 final ActivityRecord resumedActivity = stack.mResumedActivity;
                 if (resumedActivity == null || !resumedActivity.idle) {
-                    if (DEBUG_STATES) Slog.d(TAG, "allResumedActivitiesIdle: stack="
+                    if (DEBUG_STATES) Slog.d(TAG_STATES, "allResumedActivitiesIdle: stack="
                              + stack.mStackId + " " + resumedActivity + " not idle");
                     return false;
                 }
@@ -691,7 +685,7 @@
             for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
                 final ActivityStack stack = stacks.get(stackNdx);
                 if (!isFrontStack(stack) && stack.mResumedActivity != null) {
-                    if (DEBUG_STATES) Slog.d(TAG, "pauseBackStacks: stack=" + stack +
+                    if (DEBUG_STATES) Slog.d(TAG_STATES, "pauseBackStacks: stack=" + stack +
                             " mResumedActivity=" + stack.mResumedActivity);
                     someActivityPaused |= stack.startPausingLocked(userLeaving, false, resuming,
                             dontWait);
@@ -710,7 +704,8 @@
                 final ActivityRecord r = stack.mPausingActivity;
                 if (r != null && r.state != PAUSED && r.state != STOPPED && r.state != STOPPING) {
                     if (DEBUG_STATES) {
-                        Slog.d(TAG, "allPausedActivitiesComplete: r=" + r + " state=" + r.state);
+                        Slog.d(TAG_STATES,
+                                "allPausedActivitiesComplete: r=" + r + " state=" + r.state);
                         pausing = false;
                     } else {
                         return false;
@@ -1308,8 +1303,8 @@
             // should look like we asked it to pause+stop (but remain visible),
             // and it has done so and reported back the current icicle and
             // other state.
-            if (DEBUG_STATES) Slog.v(TAG, "Moving to STOPPED: " + r
-                    + " (starting in stopped state)");
+            if (DEBUG_STATES) Slog.v(TAG_STATES,
+                    "Moving to STOPPED: " + r + " (starting in stopped state)");
             r.state = STOPPED;
             r.stopped = true;
         }
@@ -2382,8 +2377,8 @@
 
         ActivityRecord r = ActivityRecord.forTokenLocked(token);
         if (r != null) {
-            if (DEBUG_IDLE) Slog.d(TAG, "activityIdleInternalLocked: Callers=" +
-                    Debug.getCallers(4));
+            if (DEBUG_IDLE) Slog.d(TAG_IDLE, "activityIdleInternalLocked: Callers="
+                    + Debug.getCallers(4));
             mHandler.removeMessages(IDLE_TIMEOUT_MSG, r);
             r.finishLaunchTickingLocked();
             if (fromTimeout) {
@@ -2693,7 +2688,8 @@
         ActivityContainer activityContainer =
                 new VirtualActivityContainer(parentActivity, callback);
         mActivityContainers.put(activityContainer.mStackId, activityContainer);
-        if (DEBUG_CONTAINERS) Slog.d(TAG, "createActivityContainer: " + activityContainer);
+        if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS,
+                "createActivityContainer: " + activityContainer);
         parentActivity.mChildContainers.add(activityContainer);
         return activityContainer;
     }
@@ -2702,8 +2698,8 @@
         final ArrayList<ActivityContainer> childStacks = parentActivity.mChildContainers;
         for (int containerNdx = childStacks.size() - 1; containerNdx >= 0; --containerNdx) {
             ActivityContainer container = childStacks.remove(containerNdx);
-            if (DEBUG_CONTAINERS) Slog.d(TAG, "removeChildActivityContainers: removing " +
-                    container);
+            if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS, "removeChildActivityContainers: removing "
+                    + container);
             container.release();
         }
     }
@@ -2711,8 +2707,8 @@
     void deleteActivityContainer(IActivityContainer container) {
         ActivityContainer activityContainer = (ActivityContainer)container;
         if (activityContainer != null) {
-            if (DEBUG_CONTAINERS) Slog.d(TAG, "deleteActivityContainer: ",
-                    new RuntimeException("here").fillInStackTrace());
+            if (DEBUG_CONTAINERS) Slog.d(TAG_CONTAINERS,
+                    "deleteActivityContainer: callers=" + Debug.getCallers(4));
             final int stackId = activityContainer.mStackId;
             mActivityContainers.remove(stackId);
             mWindowManager.removeStack(stackId);
@@ -3077,17 +3073,17 @@
     boolean requestVisibleBehindLocked(ActivityRecord r, boolean visible) {
         final ActivityStack stack = r.task.stack;
         if (stack == null) {
-            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind: r=" + r + " visible=" +
-                    visible + " stack is null");
+            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND,
+                    "requestVisibleBehind: r=" + r + " visible=" + visible + " stack is null");
             return false;
         }
         final boolean isVisible = stack.hasVisibleBehindActivity();
-        if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind r=" + r + " visible=" +
-                visible + " isVisible=" + isVisible);
+        if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND,
+                "requestVisibleBehind r=" + r + " visible=" + visible + " isVisible=" + isVisible);
 
         final ActivityRecord top = topRunningActivityLocked();
         if (top == null || top == r || (visible == isVisible)) {
-            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind: quick return");
+            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND, "requestVisibleBehind: quick return");
             stack.setVisibleBehindActivity(visible ? r : null);
             return true;
         }
@@ -3095,16 +3091,18 @@
         // A non-top activity is reporting a visibility change.
         if (visible && top.fullscreen) {
             // Let the caller know that it can't be seen.
-            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind: returning top.fullscreen="
-                    + top.fullscreen + " top.state=" + top.state + " top.app=" + top.app +
-                    " top.app.thread=" + top.app.thread);
+            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND,
+                    "requestVisibleBehind: returning top.fullscreen=" + top.fullscreen
+                    + " top.state=" + top.state + " top.app=" + top.app + " top.app.thread="
+                    + top.app.thread);
             return false;
         } else if (!visible && stack.getVisibleBehindActivity() != r) {
             // Only the activity set as currently visible behind should actively reset its
             // visible behind state.
-            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG, "requestVisibleBehind: returning visible="
-                    + visible + " stack.getVisibleBehindActivity()=" +
-                    stack.getVisibleBehindActivity() + " r=" + r);
+            if (DEBUG_VISIBLE_BEHIND) Slog.d(TAG_VISIBLE_BEHIND,
+                    "requestVisibleBehind: returning visible=" + visible
+                    + " stack.getVisibleBehindActivity()=" + stack.getVisibleBehindActivity()
+                    + " r=" + r);
             return false;
         }
 
@@ -3179,25 +3177,25 @@
         TaskRecord firstTask = null;
         // Tasks is non-null only if two or more tasks are found.
         ArraySet<TaskRecord> tasks = null;
-        if (DEBUG_RELEASE) Slog.d(TAG, "Trying to release some activities in " + app);
-        for (int i=0; i<app.activities.size(); i++) {
+        if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Trying to release some activities in " + app);
+        for (int i = 0; i < app.activities.size(); i++) {
             ActivityRecord r = app.activities.get(i);
             // First, if we find an activity that is in the process of being destroyed,
             // then we just aren't going to do anything for now; we want things to settle
             // down before we try to prune more activities.
             if (r.finishing || r.state == DESTROYING || r.state == DESTROYED) {
-                if (DEBUG_RELEASE) Slog.d(TAG, "Abort release; already destroying: " + r);
+                if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Abort release; already destroying: " + r);
                 return;
             }
             // Don't consider any activies that are currently not in a state where they
             // can be destroyed.
             if (r.visible || !r.stopped || !r.haveState || r.state == RESUMED || r.state == PAUSING
                     || r.state == PAUSED || r.state == STOPPING) {
-                if (DEBUG_RELEASE) Slog.d(TAG, "Not releasing in-use activity: " + r);
+                if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Not releasing in-use activity: " + r);
                 continue;
             }
             if (r.task != null) {
-                if (DEBUG_RELEASE) Slog.d(TAG, "Collecting release task " + r.task
+                if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Collecting release task " + r.task
                         + " from " + r);
                 if (firstTask == null) {
                     firstTask = r.task;
@@ -3211,7 +3209,7 @@
             }
         }
         if (tasks == null) {
-            if (DEBUG_RELEASE) Slog.d(TAG, "Didn't find two or more tasks to release");
+            if (DEBUG_RELEASE) Slog.d(TAG_RELEASE, "Didn't find two or more tasks to release");
             return;
         }
         // If we have activities in multiple tasks that are in a position to be destroyed,
@@ -3546,7 +3544,8 @@
     }
 
     void scheduleIdleTimeoutLocked(ActivityRecord next) {
-        if (DEBUG_IDLE) Slog.d(TAG, "scheduleIdleTimeoutLocked: Callers=" + Debug.getCallers(4));
+        if (DEBUG_IDLE) Slog.d(TAG_IDLE,
+                "scheduleIdleTimeoutLocked: Callers=" + Debug.getCallers(4));
         Message msg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG, next);
         mHandler.sendMessageDelayed(msg, IDLE_TIMEOUT);
     }
@@ -3556,7 +3555,8 @@
     }
 
     void removeTimeoutsForActivityLocked(ActivityRecord r) {
-        if (DEBUG_IDLE) Slog.d(TAG, "removeTimeoutsForActivity: Callers=" + Debug.getCallers(4));
+        if (DEBUG_IDLE) Slog.d(TAG_IDLE, "removeTimeoutsForActivity: Callers="
+                + Debug.getCallers(4));
         mHandler.removeMessages(IDLE_TIMEOUT_MSG, r);
     }
 
@@ -3858,7 +3858,8 @@
         public void handleMessage(Message msg) {
             switch (msg.what) {
                 case IDLE_TIMEOUT_MSG: {
-                    if (DEBUG_IDLE) Slog.d(TAG, "handleMessage: IDLE_TIMEOUT_MSG: r=" + msg.obj);
+                    if (DEBUG_IDLE) Slog.d(TAG_IDLE,
+                            "handleMessage: IDLE_TIMEOUT_MSG: r=" + msg.obj);
                     if (mService.mDidDexOpt) {
                         mService.mDidDexOpt = false;
                         Message nmsg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG);
@@ -3871,7 +3872,7 @@
                     activityIdleInternal((ActivityRecord)msg.obj);
                 } break;
                 case IDLE_NOW_MSG: {
-                    if (DEBUG_IDLE) Slog.d(TAG, "handleMessage: IDLE_NOW_MSG: r=" + msg.obj);
+                    if (DEBUG_IDLE) Slog.d(TAG_IDLE, "handleMessage: IDLE_NOW_MSG: r=" + msg.obj);
                     activityIdleInternal((ActivityRecord)msg.obj);
                 } break;
                 case RESUME_TOP_ACTIVITY_MSG: {
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index d56a024..f966bcf 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -27,7 +27,6 @@
 import static com.android.server.am.ActivityRecord.HOME_ACTIVITY_TYPE;
 import static com.android.server.am.ActivityRecord.APPLICATION_ACTIVITY_TYPE;
 import static com.android.server.am.ActivityRecord.RECENTS_ACTIVITY_TYPE;
-import static com.android.server.am.ActivityStackSupervisor.DEBUG_ADD_REMOVE;
 
 import android.app.Activity;
 import android.app.ActivityManager;
@@ -42,6 +41,7 @@
 import android.content.pm.IPackageManager;
 import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
+import android.os.Debug;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
 import android.os.UserHandle;
@@ -60,6 +60,7 @@
 
 final class TaskRecord {
     private static final String TAG = TAG_WITH_CLASS_NAME ? "TaskRecord" : TAG_AM;
+    private static final String TAG_ADD_REMOVE = TAG + POSTFIX_ADD_REMOVE;
     private static final String TAG_RECENTS = TAG + POSTFIX_RECENTS;
     private static final String TAG_LOCKTASK = TAG + POSTFIX_LOCKTASK;
     private static final String TAG_TASKS = TAG + POSTFIX_TASKS;
@@ -561,8 +562,9 @@
      * Reorder the history stack so that the passed activity is brought to the front.
      */
     final void moveActivityToFrontLocked(ActivityRecord newTop) {
-        if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Removing and adding activity " + newTop
-            + " to stack at top", new RuntimeException("here").fillInStackTrace());
+        if (DEBUG_ADD_REMOVE) Slog.i(TAG_ADD_REMOVE,
+                "Removing and adding activity " + newTop
+                + " to stack at top callers=" + Debug.getCallers(4));
 
         mActivities.remove(newTop);
         mActivities.add(newTop);
diff --git a/services/core/java/com/android/server/notification/CalendarTracker.java b/services/core/java/com/android/server/notification/CalendarTracker.java
index 71d7f19..de321fe 100644
--- a/services/core/java/com/android/server/notification/CalendarTracker.java
+++ b/services/core/java/com/android/server/notification/CalendarTracker.java
@@ -26,8 +26,11 @@
 import android.net.Uri;
 import android.provider.BaseColumns;
 import android.provider.CalendarContract.Attendees;
+import android.provider.CalendarContract.Calendars;
+import android.provider.CalendarContract.Events;
 import android.provider.CalendarContract.Instances;
 import android.service.notification.ZenModeConfig.EventInfo;
+import android.util.ArraySet;
 import android.util.Log;
 
 import java.io.PrintWriter;
@@ -63,13 +66,15 @@
     private static final String ATTENDEE_SELECTION = Attendees.EVENT_ID + " = ? AND "
             + Attendees.ATTENDEE_EMAIL + " = ?";
 
-    private final Context mContext;
+    private final Context mSystemContext;
+    private final Context mUserContext;
 
     private Callback mCallback;
     private boolean mRegistered;
 
-    public CalendarTracker(Context context) {
-        mContext = context;
+    public CalendarTracker(Context systemContext, Context userContext) {
+        mSystemContext = systemContext;
+        mUserContext = userContext;
     }
 
     public void setCallback(Callback callback) {
@@ -81,11 +86,12 @@
     public void dump(String prefix, PrintWriter pw) {
         pw.print(prefix); pw.print("mCallback="); pw.println(mCallback);
         pw.print(prefix); pw.print("mRegistered="); pw.println(mRegistered);
+        pw.print(prefix); pw.print("u="); pw.println(mUserContext.getUserId());
     }
 
     public void dumpContent(Uri uri) {
         Log.d(TAG, "dumpContent: " + uri);
-        final Cursor cursor = mContext.getContentResolver().query(uri, null, null, null, null);
+        final Cursor cursor = mUserContext.getContentResolver().query(uri, null, null, null, null);
         try {
             int r = 0;
             while (cursor.moveToNext()) {
@@ -126,36 +132,61 @@
         }
     }
 
-
+    private ArraySet<Long> getPrimaryCalendars() {
+        final long start = System.currentTimeMillis();
+        final ArraySet<Long> rt = new ArraySet<>();
+        final String primary = "\"primary\"";
+        final String[] projection = { Calendars._ID,
+                "(" + Calendars.ACCOUNT_NAME + "=" + Calendars.OWNER_ACCOUNT + ") AS " + primary };
+        final String selection = primary + " = 1";
+        Cursor cursor = null;
+        try {
+            cursor = mUserContext.getContentResolver().query(Calendars.CONTENT_URI, projection,
+                    selection, null, null);
+            while (cursor != null && cursor.moveToNext()) {
+                rt.add(cursor.getLong(0));
+            }
+        } finally {
+            if (cursor != null) {
+                cursor.close();
+            }
+        }
+        if (DEBUG) Log.d(TAG, "getPrimaryCalendars took " + (System.currentTimeMillis() - start));
+        return rt;
+    }
 
     public CheckEventResult checkEvent(EventInfo filter, long time) {
         final Uri.Builder uriBuilder = Instances.CONTENT_URI.buildUpon();
         ContentUris.appendId(uriBuilder, time);
         ContentUris.appendId(uriBuilder, time + EVENT_CHECK_LOOKAHEAD);
         final Uri uri = uriBuilder.build();
-        final Cursor cursor = mContext.getContentResolver().query(uri, INSTANCE_PROJECTION, null,
-                null, INSTANCE_ORDER_BY);
+        final Cursor cursor = mUserContext.getContentResolver().query(uri, INSTANCE_PROJECTION,
+                null, null, INSTANCE_ORDER_BY);
         final CheckEventResult result = new CheckEventResult();
         result.recheckAt = time + EVENT_CHECK_LOOKAHEAD;
         try {
-            while (cursor.moveToNext()) {
+            final ArraySet<Long> primaryCalendars = getPrimaryCalendars();
+            while (cursor != null && cursor.moveToNext()) {
                 final long begin = cursor.getLong(0);
                 final long end = cursor.getLong(1);
                 final String title = cursor.getString(2);
-                final boolean visible = cursor.getInt(3) == 1;
+                final boolean calendarVisible = cursor.getInt(3) == 1;
                 final int eventId = cursor.getInt(4);
                 final String owner = cursor.getString(5);
                 final long calendarId = cursor.getLong(6);
                 final int availability = cursor.getInt(7);
-                if (DEBUG) Log.d(TAG, String.format("%s %s-%s v=%s a=%s eid=%s o=%s cid=%s", title,
-                        new Date(begin), new Date(end), visible, availabilityToString(availability),
-                        eventId, owner, calendarId));
+                final boolean calendarPrimary = primaryCalendars.contains(calendarId);
+                if (DEBUG) Log.d(TAG, String.format("%s %s-%s v=%s a=%s eid=%s o=%s cid=%s p=%s",
+                        title,
+                        new Date(begin), new Date(end), calendarVisible,
+                        availabilityToString(availability), eventId, owner, calendarId,
+                        calendarPrimary));
                 final boolean meetsTime = time >= begin && time < end;
-                final boolean meetsCalendar = visible
-                        && (filter.calendar == ANY_CALENDAR || filter.calendar == calendarId)
-                        && availability != Instances.AVAILABILITY_FREE;
-                if (meetsCalendar) {
-                    if (DEBUG) Log.d(TAG, "  MEETS CALENDAR");
+                final boolean meetsCalendar = calendarVisible && calendarPrimary
+                        && (filter.calendar == ANY_CALENDAR || filter.calendar == calendarId);
+                final boolean meetsAvailability = availability != Instances.AVAILABILITY_FREE;
+                if (meetsCalendar && meetsAvailability) {
+                    if (DEBUG) Log.d(TAG, "  MEETS CALENDAR & AVAILABILITY");
                     final boolean meetsAttendee = meetsAttendee(filter, eventId, owner);
                     if (meetsAttendee) {
                         if (DEBUG) Log.d(TAG, "    MEETS ATTENDEE");
@@ -172,19 +203,22 @@
                 }
             }
         } finally {
-            cursor.close();
+            if (cursor != null) {
+                cursor.close();
+            }
         }
         return result;
     }
 
     private boolean meetsAttendee(EventInfo filter, int eventId, String email) {
+        final long start = System.currentTimeMillis();
         String selection = ATTENDEE_SELECTION;
         String[] selectionArgs = { Integer.toString(eventId), email };
         if (DEBUG_ATTENDEES) {
             selection = null;
             selectionArgs = null;
         }
-        final Cursor cursor = mContext.getContentResolver().query(Attendees.CONTENT_URI,
+        final Cursor cursor = mUserContext.getContentResolver().query(Attendees.CONTENT_URI,
                 ATTENDEE_PROJECTION, selection, selectionArgs, null);
         try {
             if (cursor.getCount() == 0) {
@@ -208,18 +242,25 @@
             return rt;
         } finally {
             cursor.close();
+            if (DEBUG) Log.d(TAG, "meetsAttendee took " + (System.currentTimeMillis() - start));
         }
     }
 
     private void setRegistered(boolean registered) {
         if (mRegistered == registered) return;
-        final ContentResolver cr = mContext.getContentResolver();
+        final ContentResolver cr = mSystemContext.getContentResolver();
+        final int userId = mUserContext.getUserId();
         if (mRegistered) {
+            if (DEBUG) Log.d(TAG, "unregister content observer u=" + userId);
             cr.unregisterContentObserver(mObserver);
         }
         mRegistered = registered;
+        if (DEBUG) Log.d(TAG, "mRegistered = " + registered + " u=" + userId);
         if (mRegistered) {
-            cr.registerContentObserver(Instances.CONTENT_URI, false, mObserver);
+            if (DEBUG) Log.d(TAG, "register content observer u=" + userId);
+            cr.registerContentObserver(Instances.CONTENT_URI, true, mObserver, userId);
+            cr.registerContentObserver(Events.CONTENT_URI, true, mObserver, userId);
+            cr.registerContentObserver(Calendars.CONTENT_URI, true, mObserver, userId);
         }
     }
 
@@ -260,7 +301,8 @@
     private final ContentObserver mObserver = new ContentObserver(null) {
         @Override
         public void onChange(boolean selfChange, Uri u) {
-            if (DEBUG) Log.d(TAG, "onChange selfChange=" + selfChange + " uri=" + u);
+            if (DEBUG) Log.d(TAG, "onChange selfChange=" + selfChange + " uri=" + u
+                    + " u=" + mUserContext.getUserId());
             mCallback.onChanged();
         }
 
diff --git a/services/core/java/com/android/server/notification/ConditionProviders.java b/services/core/java/com/android/server/notification/ConditionProviders.java
index 8c6afaf..33c666a 100644
--- a/services/core/java/com/android/server/notification/ConditionProviders.java
+++ b/services/core/java/com/android/server/notification/ConditionProviders.java
@@ -130,8 +130,8 @@
     }
 
     @Override
-    public void onUserSwitched() {
-        super.onUserSwitched();
+    public void onUserSwitched(int user) {
+        super.onUserSwitched(user);
         if (mCallback != null) {
             mCallback.onUserSwitched();
         }
diff --git a/services/core/java/com/android/server/notification/EventConditionProvider.java b/services/core/java/com/android/server/notification/EventConditionProvider.java
index dea6325..46cc47b 100644
--- a/services/core/java/com/android/server/notification/EventConditionProvider.java
+++ b/services/core/java/com/android/server/notification/EventConditionProvider.java
@@ -23,7 +23,12 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.pm.PackageManager.NameNotFoundException;
 import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.UserHandle;
+import android.os.UserManager;
 import android.service.notification.Condition;
 import android.service.notification.IConditionProvider;
 import android.service.notification.ZenModeConfig;
@@ -31,6 +36,7 @@
 import android.util.ArraySet;
 import android.util.Log;
 import android.util.Slog;
+import android.util.SparseArray;
 
 import com.android.server.notification.CalendarTracker.CheckEventResult;
 import com.android.server.notification.NotificationManagerService.DumpFilter;
@@ -51,17 +57,21 @@
     private static final String ACTION_EVALUATE = SIMPLE_NAME + ".EVALUATE";
     private static final int REQUEST_CODE_EVALUATE = 1;
     private static final String EXTRA_TIME = "time";
+    private static final long CHANGE_DELAY = 2 * 1000;  // coalesce chatty calendar changes
 
     private final Context mContext = this;
     private final ArraySet<Uri> mSubscriptions = new ArraySet<Uri>();
-    private final CalendarTracker mTracker = new CalendarTracker(mContext);
+    private final SparseArray<CalendarTracker> mTrackers = new SparseArray<>();
+    private final Handler mWorker;
 
     private boolean mConnected;
     private boolean mRegistered;
     private boolean mBootComplete;  // don't hammer the calendar provider until boot completes.
+    private long mNextAlarmTime;
 
-    public EventConditionProvider() {
+    public EventConditionProvider(Looper worker) {
         if (DEBUG) Slog.d(TAG, "new " + SIMPLE_NAME + "()");
+        mWorker = new Handler(worker);
     }
 
     @Override
@@ -80,13 +90,17 @@
         pw.print("      mConnected="); pw.println(mConnected);
         pw.print("      mRegistered="); pw.println(mRegistered);
         pw.print("      mBootComplete="); pw.println(mBootComplete);
+        dumpUpcomingTime(pw, "mNextAlarmTime", mNextAlarmTime, System.currentTimeMillis());
         pw.println("      mSubscriptions=");
         for (Uri conditionId : mSubscriptions) {
             pw.print("        ");
             pw.println(conditionId);
         }
-        pw.println("      mTracker=");
-        mTracker.dump("        ", pw);
+        pw.println("      mTrackers=");
+        for (int i = 0; i < mTrackers.size(); i++) {
+            pw.print("        user="); pw.println(mTrackers.keyAt(i));
+            mTrackers.valueAt(i).dump("          ", pw);
+        }
     }
 
     @Override
@@ -94,7 +108,16 @@
         if (DEBUG) Slog.d(TAG, "onBootComplete");
         if (mBootComplete) return;
         mBootComplete = true;
-        evaluateSubscriptions();
+        final IntentFilter filter = new IntentFilter();
+        filter.addAction(Intent.ACTION_MANAGED_PROFILE_ADDED);
+        filter.addAction(Intent.ACTION_MANAGED_PROFILE_REMOVED);
+        mContext.registerReceiver(new BroadcastReceiver() {
+            @Override
+            public void onReceive(Context context, Intent intent) {
+                reloadTrackers();
+            }
+        }, filter);
+        reloadTrackers();
     }
 
     @Override
@@ -146,14 +169,39 @@
         return (IConditionProvider) onBind(null);
     }
 
+    private void reloadTrackers() {
+        if (DEBUG) Slog.d(TAG, "reloadTrackers");
+        for (int i = 0; i < mTrackers.size(); i++) {
+            mTrackers.valueAt(i).setCallback(null);
+        }
+        mTrackers.clear();
+        for (UserHandle user : UserManager.get(mContext).getUserProfiles()) {
+            final Context context = user.isOwner() ? mContext : getContextForUser(mContext, user);
+            if (context == null) {
+                Slog.w(TAG, "Unable to create context for user " + user.getIdentifier());
+                continue;
+            }
+            mTrackers.put(user.getIdentifier(), new CalendarTracker(mContext, context));
+        }
+        evaluateSubscriptions();
+    }
+
     private void evaluateSubscriptions() {
-        if (DEBUG) Log.d(TAG, "evaluateSubscriptions");
+        if (!mWorker.hasCallbacks(mEvaluateSubscriptionsW)) {
+            mWorker.post(mEvaluateSubscriptionsW);
+        }
+    }
+
+    private void evaluateSubscriptionsW() {
+        if (DEBUG) Slog.d(TAG, "evaluateSubscriptions");
         if (!mBootComplete) {
-            if (DEBUG) Log.d(TAG, "Skipping evaluate before boot complete");
+            if (DEBUG) Slog.d(TAG, "Skipping evaluate before boot complete");
             return;
         }
         final long now = System.currentTimeMillis();
-        mTracker.setCallback(mSubscriptions.isEmpty() ? null : mTrackerCallback);
+        for (int i = 0; i < mTrackers.size(); i++) {
+            mTrackers.valueAt(i).setCallback(mSubscriptions.isEmpty() ? null : mTrackerCallback);
+        }
         setRegistered(!mSubscriptions.isEmpty());
         long reevaluateAt = 0;
         for (Uri conditionId : mSubscriptions) {
@@ -162,7 +210,30 @@
                 notifyCondition(conditionId, Condition.STATE_FALSE, "badConditionId");
                 continue;
             }
-            final CheckEventResult result = mTracker.checkEvent(event, now);
+            CheckEventResult result = null;
+            if (event.calendar == EventInfo.ANY_CALENDAR) {
+                // event could exist on any tracker
+                for (int i = 0; i < mTrackers.size(); i++) {
+                    final CalendarTracker tracker = mTrackers.valueAt(i);
+                    final CheckEventResult r = tracker.checkEvent(event, now);
+                    if (result == null) {
+                        result = r;
+                    } else {
+                        result.inEvent |= r.inEvent;
+                        result.recheckAt = Math.min(result.recheckAt, r.recheckAt);
+                    }
+                }
+            } else {
+                // event should exist on one tracker
+                final int userId = EventInfo.resolveUserId(event.userId);
+                final CalendarTracker tracker = mTrackers.get(userId);
+                if (tracker == null) {
+                    Slog.w(TAG, "No calendar tracker found for user " + userId);
+                    notifyCondition(conditionId, Condition.STATE_FALSE, "badUserId");
+                    continue;
+                }
+                result = tracker.checkEvent(event, now);
+            }
             if (result.recheckAt != 0 && (reevaluateAt == 0 || result.recheckAt < reevaluateAt)) {
                 reevaluateAt = result.recheckAt;
             }
@@ -172,11 +243,12 @@
             }
             notifyCondition(conditionId, Condition.STATE_TRUE, "inEventNow");
         }
-        updateAlarm(now, reevaluateAt);
-        if (DEBUG) Log.d(TAG, "evaluateSubscriptions took " + (System.currentTimeMillis() - now));
+        rescheduleAlarm(now, reevaluateAt);
+        if (DEBUG) Slog.d(TAG, "evaluateSubscriptions took " + (System.currentTimeMillis() - now));
     }
 
-    private void updateAlarm(long now, long time) {
+    private void rescheduleAlarm(long now, long time) {
+        mNextAlarmTime = time;
         final AlarmManager alarms = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
         final PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext,
                 REQUEST_CODE_EVALUATE,
@@ -196,8 +268,8 @@
     }
 
     private void notifyCondition(Uri conditionId, int state, String reason) {
-        if (DEBUG) Slog.d(TAG, "notifyCondition " + Condition.stateToString(state)
-                + " reason=" + reason);
+        if (DEBUG) Slog.d(TAG, "notifyCondition " + conditionId + " "
+                + Condition.stateToString(state) + " reason=" + reason);
         notifyCondition(createCondition(conditionId, state));
     }
 
@@ -223,19 +295,35 @@
         }
     }
 
+    private static Context getContextForUser(Context context, UserHandle user) {
+        try {
+            return context.createPackageContextAsUser(context.getPackageName(), 0, user);
+        } catch (NameNotFoundException e) {
+            return null;
+        }
+    }
+
     private final CalendarTracker.Callback mTrackerCallback = new CalendarTracker.Callback() {
         @Override
         public void onChanged() {
-            if (DEBUG) Log.d(TAG, "mTrackerCallback.onChanged");
-            evaluateSubscriptions();
+            if (DEBUG) Slog.d(TAG, "mTrackerCallback.onChanged");
+            mWorker.removeCallbacks(mEvaluateSubscriptionsW);
+            mWorker.postDelayed(mEvaluateSubscriptionsW, CHANGE_DELAY);
         }
     };
 
-    private BroadcastReceiver mReceiver = new BroadcastReceiver() {
+    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
             if (DEBUG) Slog.d(TAG, "onReceive " + intent.getAction());
             evaluateSubscriptions();
         }
     };
+
+    private final Runnable mEvaluateSubscriptionsW = new Runnable() {
+        @Override
+        public void run() {
+            evaluateSubscriptionsW();
+        }
+    };
 }
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index 6f8e3ca..8f24b46 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -216,8 +216,8 @@
         }
     }
 
-    public void onUserSwitched() {
-        if (DEBUG) Slog.d(TAG, "onUserSwitched");
+    public void onUserSwitched(int user) {
+        if (DEBUG) Slog.d(TAG, "onUserSwitched u=" + user);
         if (Arrays.equals(mLastSeenProfileIds, mUserProfiles.getCurrentProfileIds())) {
             if (DEBUG) Slog.d(TAG, "Current profile IDs didn't change, skipping rebindServices().");
             return;
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index ef4da02..c8ab10a 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -555,12 +555,15 @@
         @Override
         public void onNotificationClick(int callingUid, int callingPid, String key) {
             synchronized (mNotificationList) {
-                EventLogTags.writeNotificationClicked(key);
                 NotificationRecord r = mNotificationsByKey.get(key);
                 if (r == null) {
                     Log.w(TAG, "No notification with key: " + key);
                     return;
                 }
+                final long now = System.currentTimeMillis();
+                EventLogTags.writeNotificationClicked(key,
+                        r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now));
+
                 StatusBarNotification sbn = r.sbn;
                 cancelNotification(callingUid, callingPid, sbn.getPackageName(), sbn.getTag(),
                         sbn.getId(), Notification.FLAG_AUTO_CANCEL,
@@ -573,12 +576,14 @@
         public void onNotificationActionClick(int callingUid, int callingPid, String key,
                 int actionIndex) {
             synchronized (mNotificationList) {
-                EventLogTags.writeNotificationActionClicked(key, actionIndex);
                 NotificationRecord r = mNotificationsByKey.get(key);
                 if (r == null) {
                     Log.w(TAG, "No notification with key: " + key);
                     return;
                 }
+                final long now = System.currentTimeMillis();
+                EventLogTags.writeNotificationActionClicked(key, actionIndex,
+                        r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now));
                 // TODO: Log action click via UsageStats.
             }
         }
@@ -685,11 +690,14 @@
         @Override
         public void onNotificationExpansionChanged(String key,
                 boolean userAction, boolean expanded) {
-            EventLogTags.writeNotificationExpansion(key, userAction ? 1 : 0, expanded ? 1 : 0);
             synchronized (mNotificationList) {
                 NotificationRecord r = mNotificationsByKey.get(key);
                 if (r != null) {
                     r.stats.onExpansionChanged(userAction, expanded);
+                    final long now = System.currentTimeMillis();
+                    EventLogTags.writeNotificationExpansion(key,
+                            userAction ? 1 : 0, expanded ? 1 : 0,
+                            r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now));
                 }
             }
         }
@@ -799,12 +807,13 @@
                 mNotificationLight.turnOff();
                 mStatusBar.notificationLightOff();
             } else if (action.equals(Intent.ACTION_USER_SWITCHED)) {
+                final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
                 // reload per-user settings
                 mSettingsObserver.update(null);
                 mUserProfiles.updateCache(context);
                 // Refresh managed services
-                mConditionProviders.onUserSwitched();
-                mListeners.onUserSwitched();
+                mConditionProviders.onUserSwitched(user);
+                mListeners.onUserSwitched(user);
             } else if (action.equals(Intent.ACTION_USER_ADDED)) {
                 mUserProfiles.updateCache(context);
             }
@@ -2786,10 +2795,8 @@
         mArchive.record(r.sbn);
 
         final long now = System.currentTimeMillis();
-        final int lifespan = (int) (now - r.getCreationTimeMs());
-        final long visibleSinceMs = r.getVisibleSinceMs();
-        final int exposure = visibleSinceMs == 0L ? 0 : (int) (now - visibleSinceMs);
-        EventLogTags.writeNotificationCanceled(canceledKey, reason, lifespan, exposure);
+        EventLogTags.writeNotificationCanceled(canceledKey, reason,
+                r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now));
     }
 
     /**
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index b8478c1..c4773ca 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -288,24 +288,27 @@
     }
 
     /**
-     * Returns the timestamp of the most recent updates, or the post time if none.
+     * @param now this current time in milliseconds.
+     * @returns the number of milliseconds since the most recent update, or the post time if none.
      */
-    public long getUpdateTimeMs() {
-        return mUpdateTimeMs;
+    public int getFreshnessMs(long now) {
+        return (int) (now - mUpdateTimeMs);
     }
 
     /**
-     * Returns the timestamp of the first post, ignoring updates.
+     * @param now this current time in milliseconds.
+     * @returns the number of milliseconds since the the first post, ignoring updates.
      */
-    public long getCreationTimeMs() {
-        return mCreationTimeMs;
+    public int getLifespanMs(long now) {
+        return (int) (now - mCreationTimeMs);
     }
 
     /**
-     * Returns the timestamp of the most recent visibility event, or 0L if hidden.
+     * @param now this current time in milliseconds.
+     * @returns the number of milliseconds since the most recent visibility event, or 0 if never.
      */
-    public long getVisibleSinceMs() {
-        return mVisibleSinceMs;
+    public int getExposureMs(long now) {
+        return mVisibleSinceMs == 0 ? 0 : (int) (now - mVisibleSinceMs);
     }
 
     /**
@@ -313,7 +316,7 @@
      */
     public void setVisibility(boolean visible) {
         final long now = System.currentTimeMillis();
-        mVisibleSinceMs = visible ? now : 0L;
+        mVisibleSinceMs = visible ? now : mVisibleSinceMs;
         stats.onVisibilityChanged(visible);
         EventLogTags.writeNotificationVisibility(getKey(), visible ? 1 : 0,
                 (int) (now - mCreationTimeMs),
diff --git a/services/core/java/com/android/server/notification/ScheduleConditionProvider.java b/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
index f06f54c..44448cc 100644
--- a/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
+++ b/services/core/java/com/android/server/notification/ScheduleConditionProvider.java
@@ -85,12 +85,7 @@
             pw.print(meetsSchedule(conditionId, now) ? "* " : "  ");
             pw.println(conditionId);
         }
-        pw.print("      mNextAlarmTime="); pw.print(mNextAlarmTime);
-        if (mNextAlarmTime > 0) {
-            pw.printf(" (%s, in %s, now=%s)", ts(mNextAlarmTime),
-                    formatDuration(mNextAlarmTime - now), ts(now));
-        }
-        pw.println();
+        dumpUpcomingTime(pw, "mNextAlarmTime", mNextAlarmTime, now);
     }
 
     @Override
diff --git a/services/core/java/com/android/server/notification/SystemConditionProviderService.java b/services/core/java/com/android/server/notification/SystemConditionProviderService.java
index 8a8e063..574f04c 100644
--- a/services/core/java/com/android/server/notification/SystemConditionProviderService.java
+++ b/services/core/java/com/android/server/notification/SystemConditionProviderService.java
@@ -46,4 +46,14 @@
         TimeUtils.formatDuration(millis, sb);
         return sb.toString();
     }
+
+    protected static void dumpUpcomingTime(PrintWriter pw, String var, long time, long now) {
+        pw.print("      "); pw.print(var); pw.print('=');
+        if (time > 0) {
+            pw.printf("%s, in %s, now=%s", ts(time), formatDuration(time - now), ts(now));
+        } else {
+            pw.print(time);
+        }
+        pw.println();
+    }
 }
diff --git a/services/core/java/com/android/server/notification/ZenModeConditions.java b/services/core/java/com/android/server/notification/ZenModeConditions.java
index f1c58bd..d6b7f2f 100644
--- a/services/core/java/com/android/server/notification/ZenModeConditions.java
+++ b/services/core/java/com/android/server/notification/ZenModeConditions.java
@@ -50,7 +50,7 @@
             mConditionProviders.addSystemProvider(new ScheduleConditionProvider());
         }
         if (mConditionProviders.isSystemProviderEnabled(ZenModeConfig.EVENT_PATH)) {
-            mConditionProviders.addSystemProvider(new EventConditionProvider());
+            mConditionProviders.addSystemProvider(new EventConditionProvider(helper.getLooper()));
         }
         mConditionProviders.setCallback(this);
     }
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index a3c36ed..1860673 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -98,6 +98,10 @@
         mConditions = new ZenModeConditions(this, conditionProviders);
     }
 
+    public Looper getLooper() {
+        return mHandler.getLooper();
+    }
+
     @Override
     public String toString() {
         return TAG;
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index cebb909..5d8979f 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -2672,7 +2672,8 @@
     }
 
     void removeWindowLocked(WindowState win) {
-        if (win.mAttrs.type == TYPE_APPLICATION_STARTING) {
+        final boolean startingWindow = win.mAttrs.type == TYPE_APPLICATION_STARTING;
+        if (startingWindow) {
             if (DEBUG_STARTING_WINDOW) Slog.d(TAG, "Starting window removed " + win);
         }
 
@@ -2721,7 +2722,13 @@
                     mAccessibilityController.onWindowTransitionLocked(win, transit);
                 }
             }
-            if (win.mExiting || win.mWinAnimator.isAnimating()) {
+            final AppWindowToken appToken = win.mAppToken;
+            // The starting window is the last window in this app token and it isn't animating.
+            // Allow it to be removed now as there is no additional window or animation that will
+            // trigger its removal.
+            final boolean lastWinStartingNotAnimating = startingWindow && appToken!= null
+                    && appToken.allAppWindows.size() == 1 && !win.mWinAnimator.isWindowAnimating();
+            if (!lastWinStartingNotAnimating && (win.mExiting || win.mWinAnimator.isAnimating())) {
                 // The exit animation is running... wait for it!
                 //Slog.i(TAG, "*** Running exit animation...");
                 win.mExiting = true;
@@ -2733,8 +2740,8 @@
                 final boolean focusChanged = updateFocusedWindowLocked(
                         UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/);
                 performLayoutAndPlaceSurfacesLocked();
-                if (win.mAppToken != null) {
-                    win.mAppToken.updateReportedVisibilityLocked();
+                if (appToken != null) {
+                    appToken.updateReportedVisibilityLocked();
                 }
                 if (focusChanged) {
                     mInputMonitor.updateInputWindowsLw(false /*force*/);
@@ -4648,12 +4655,7 @@
 
             mOpeningApps.remove(wtoken);
             mClosingApps.remove(wtoken);
-            wtoken.waitingToShow = wtoken.waitingToHide = false;
-            wtoken.hiddenRequested = !visible;
-
-            mOpeningApps.remove(wtoken);
-            mClosingApps.remove(wtoken);
-            wtoken.waitingToShow = wtoken.waitingToHide = false;
+            wtoken.waitingToShow = false;
             wtoken.hiddenRequested = !visible;
 
             // If we are preparing an app transition, then delay changing
@@ -4692,12 +4694,6 @@
                 } else {
                     mClosingApps.add(wtoken);
                     wtoken.mEnteringAnimation = false;
-
-                    // If the token is currently visible (should be the
-                    // common case), then set up to wait for it to be hidden.
-                    if (!wtoken.hidden) {
-                        wtoken.waitingToHide = true;
-                    }
                 }
                 if (mAppTransition.getAppTransition() == AppTransition.TRANSIT_TASK_OPEN_BEHIND) {
                     // We're launchingBehind, add the launching activity to mOpeningApps.
@@ -4867,7 +4863,6 @@
                     delayed = true;
                 } else if (mAppTransition.isTransitionSet()) {
                     mClosingApps.add(wtoken);
-                    wtoken.waitingToHide = true;
                     delayed = true;
                 }
                 if (DEBUG_APP_TRANSITIONS) Slog.v(
@@ -9416,7 +9411,6 @@
                 wtoken.inPendingTransaction = false;
                 setTokenVisibilityLocked(wtoken, animLp, false, transit, false, voiceInteraction);
                 wtoken.updateReportedVisibilityLocked();
-                wtoken.waitingToHide = false;
                 // Force the allDrawn flag, because we want to start
                 // this guy's animations regardless of whether it's
                 // gotten drawn.
diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java
index b303505..4ac9135 100644
--- a/services/core/java/com/android/server/wm/WindowToken.java
+++ b/services/core/java/com/android/server/wm/WindowToken.java
@@ -63,10 +63,6 @@
     // will be shown.
     boolean waitingToShow;
 
-    // Set to true when this token is in a pending transaction where it
-    // will be hidden.
-    boolean waitingToHide;
-
     // Set to true when this token is in a pending transaction where its
     // windows will be put to the bottom of the list.
     boolean sendingToBottom;
@@ -93,9 +89,8 @@
         pw.print(prefix); pw.print("windowType="); pw.print(windowType);
                 pw.print(" hidden="); pw.print(hidden);
                 pw.print(" hasVisible="); pw.println(hasVisible);
-        if (waitingToShow || waitingToHide || sendingToBottom) {
+        if (waitingToShow || sendingToBottom) {
             pw.print(prefix); pw.print("waitingToShow="); pw.print(waitingToShow);
-                    pw.print(" waitingToHide="); pw.print(waitingToHide);
                     pw.print(" sendingToBottom="); pw.print(sendingToBottom);
         }
     }
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index fc09db3..d807b0b 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -5381,20 +5381,14 @@
                         ServiceManager.getService(Context.AUDIO_SERVICE));
             }
 
-            if (enabled && !alreadyRestricted) {
-                try {
-                    if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) {
-                        iAudioService.setMicrophoneMute(true, who.getPackageName());
-                    } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) {
-                        iAudioService.setMasterMute(true, 0, who.getPackageName());
-                    }
-                } catch (RemoteException re) {
-                    Slog.e(LOG_TAG, "Failed to talk to AudioService.", re);
-                }
-            }
             long id = Binder.clearCallingIdentity();
             try {
                 if (enabled && !alreadyRestricted) {
+                    if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) {
+                        iAudioService.setMicrophoneMute(true, mContext.getPackageName());
+                    } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) {
+                        iAudioService.setMasterMute(true, 0, mContext.getPackageName());
+                    }
                     if (UserManager.DISALLOW_CONFIG_WIFI.equals(key)) {
                         Settings.Secure.putIntForUser(mContext.getContentResolver(),
                                 Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0,
@@ -5443,20 +5437,18 @@
                         mContext.getContentResolver().notifyChange(url, null, true, userHandle);
                     }
                 }
+                if (!enabled && alreadyRestricted) {
+                    if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) {
+                        iAudioService.setMicrophoneMute(false, mContext.getPackageName());
+                    } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) {
+                        iAudioService.setMasterMute(false, 0, mContext.getPackageName());
+                    }
+                }
+            } catch (RemoteException re) {
+                Slog.e(LOG_TAG, "Failed to talk to AudioService.", re);
             } finally {
                 restoreCallingIdentity(id);
             }
-            if (!enabled && alreadyRestricted) {
-                try {
-                    if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) {
-                        iAudioService.setMicrophoneMute(false, who.getPackageName());
-                    } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) {
-                        iAudioService.setMasterMute(false, 0, who.getPackageName());
-                    }
-                } catch (RemoteException re) {
-                    Slog.e(LOG_TAG, "Failed to talk to AudioService.", re);
-                }
-            }
             sendChangedNotification(userHandle);
         }
     }
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index b3beaf9..7d39efc 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -222,15 +222,6 @@
      */
     public static final String STRING_VVM_TYPE = "string_vvm_type";
 
-    /* Visual voicemail protocols */
-
-    /**
-     * The OMTP protocol.
-     *
-     * @hide
-     */
-    public static final String VVM_TYPE_OMTP = "vvm_type_omtp";
-
     private final static String TAG = "CarrierConfigManager";
 
     /** The default value for every variable. */
@@ -333,7 +324,7 @@
      * Depending on simState, the config may be cleared or loaded from config app. This is only used
      * by SubscriptionInfoUpdater.
      * </p>
-     * 
+     *
      * @hide
      */
     @SystemApi
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index d674b31..fbc70de 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -605,6 +605,22 @@
     @SystemApi
     public static final int SIM_ACTIVATION_RESULT_CANCELED = 4;
 
+    /* Visual voicemail protocols */
+
+    /**
+     * The OMTP protocol.
+     *
+     * @hide
+     */
+    public static final String VVM_TYPE_OMTP = "vvm_type_omtp";
+
+    /**
+     * A flavor of OMTP protocol for Comverse.
+     *
+     * @hide
+     */
+    public static final String VVM_TYPE_CVVM = "vvm_type_cvvm";
+
     //
     //
     // Device Info
diff --git a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
index f703903..eaff6c7 100644
--- a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
+++ b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
@@ -17,6 +17,7 @@
 package com.android.compatibilitytest;
 
 import android.app.ActivityManager;
+import android.app.UiModeManager;
 import android.app.ActivityManager.ProcessErrorStateInfo;
 import android.app.ActivityManager.RunningTaskInfo;
 import android.content.Context;
@@ -24,6 +25,7 @@
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Configuration;
 import android.os.Bundle;
 import android.test.InstrumentationTestCase;
 import android.util.Log;
@@ -97,7 +99,12 @@
         String packageName = mArgs.getString(PACKAGE_TO_LAUNCH);
         if (packageName != null) {
             Log.d(TAG, "Launching app " + packageName);
-            ProcessErrorStateInfo err = launchActivity(packageName);
+            Intent intent = getLaunchIntentForPackage(packageName);
+            if (intent == null) {
+                Log.w(TAG, String.format("Skipping %s; no launch intent", packageName));
+                return;
+            }
+            ProcessErrorStateInfo err = launchActivity(packageName, intent);
             // Make sure there are no errors when launching the application,
             // otherwise raise an
             // exception with the first error encountered.
@@ -155,6 +162,19 @@
         }
     }
 
+    private Intent getLaunchIntentForPackage(String packageName) {
+        UiModeManager umm = (UiModeManager)
+                getInstrumentation().getContext().getSystemService(Context.UI_MODE_SERVICE);
+        boolean isLeanback = umm.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
+        Intent intent = null;
+        if (isLeanback) {
+            intent = mPackageManager.getLeanbackLaunchIntentForPackage(packageName);
+        } else {
+            intent = mPackageManager.getLaunchIntentForPackage(packageName);
+        }
+        return intent;
+    }
+
     /**
      * Launches and activity and queries for errors.
      *
@@ -163,18 +183,9 @@
      * @return {@link Collection} of {@link ProcessErrorStateInfo} detected
      *         during the app launch.
      */
-    private ProcessErrorStateInfo launchActivity(String packageName) {
-        // the recommended way to see if this is a tv or not.
-        boolean isleanback = !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)
-            && !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
-        Intent intent;
-        if (isleanback) {
-            Log.d(TAG, "Leanback and relax! " + packageName);
-            intent = mPackageManager.getLeanbackLaunchIntentForPackage(packageName);
-        } else {
-            intent = mPackageManager.getLaunchIntentForPackage(packageName);
-        }
-        assertNotNull("Skipping " + packageName + "; missing launch intent", intent);
+    private ProcessErrorStateInfo launchActivity(String packageName, Intent intent) {
+        Log.d(TAG, String.format("launching package \"%s\" with intent: %s",
+                packageName, intent.toString()));
 
         String processName = getProcessName(packageName);
 
diff --git a/tests/VectorDrawableTest/AndroidManifest.xml b/tests/VectorDrawableTest/AndroidManifest.xml
index 991ec57..e648897 100644
--- a/tests/VectorDrawableTest/AndroidManifest.xml
+++ b/tests/VectorDrawableTest/AndroidManifest.xml
@@ -144,6 +144,15 @@
             </intent-filter>
         </activity>
         <activity
+            android:name="AnimatedVectorDrawableAttr"
+            android:label="AnimatedVectorDrawable Attr Test" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="com.android.test.dynamic.TEST" />
+            </intent-filter>
+        </activity>
+        <activity
             android:name="BoundsCheckTest"
             android:label="SetBound check" >
             <intent-filter>
@@ -154,4 +163,4 @@
         </activity>
     </application>
 
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/tests/VectorDrawableTest/res/anim/blink.xml b/tests/VectorDrawableTest/res/anim/blink.xml
new file mode 100644
index 0000000..2af0b48
--- /dev/null
+++ b/tests/VectorDrawableTest/res/anim/blink.xml
@@ -0,0 +1,28 @@
+<!--
+    Copyright (C) 2015 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.
+-->
+<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
+    android:interpolator="@android:anim/linear_interpolator"
+    android:duration="@android:integer/config_longAnimTime"
+    android:repeatCount="-1"
+    android:repeatMode="reverse" >
+
+    <propertyValuesHolder
+        android:propertyName="fillColor"
+        android:valueType="colorType"
+        android:valueFrom="#ff3838"
+        android:valueTo="?attr/color1" />
+
+</objectAnimator>
diff --git a/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml b/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml
new file mode 100644
index 0000000..10a0970
--- /dev/null
+++ b/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon.xml
@@ -0,0 +1,93 @@
+<!--
+Copyright (C) 2015 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="250dp"
+        android:height="250dp"
+        android:viewportWidth="200"
+        android:viewportHeight="200">
+
+    <path
+        android:pathData="M-3.476563,-21.275826l34.441406,18.748753 0.000000,37.497501 -34.441406,18.748756 -34.441406,-18.718758 0.000000,-37.527500z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M65.5,-21.497507l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748756 -34.441406,-18.718754 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M202.75,-21.497507l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748760 -34.441406,-18.718758 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M134.125,-21.497505l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748756 -34.441406,-18.718758 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:name="hex"
+        android:pathData="M99.8125,34.752495l34.441406,18.748753 0.000000,37.497501 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527500z"
+        android:strokeWidth="2.5"
+        android:fillColor="?attr/color1"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M30.6875,34.689995l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M168.3125,35.002495l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M203.0,91.002495l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M133.8125,91.314995l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color3"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M65.0625,91.127495l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color2"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M-3.25,91.189995l34.441406,18.748756 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M31.0625,147.81499l34.441406,18.748764 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M99.625,147.37749l34.441406,18.748764 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+    <path
+        android:pathData="M168.8125,147.50249l34.441406,18.748764 0.000000,37.497498 -34.441406,18.748749 -34.441406,-18.718750 0.000000,-37.527496z"
+        android:strokeWidth="2.5"
+        android:fillColor="@color/color0"
+        android:strokeColor="@android:color/white"/>
+</vector>
diff --git a/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml b/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml
new file mode 100644
index 0000000..7e65229
--- /dev/null
+++ b/tests/VectorDrawableTest/res/drawable/animated_vector_drawable_attr_icon_animated.xml
@@ -0,0 +1,21 @@
+<!--
+Copyright (C) 2015 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.
+-->
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:drawable="@drawable/animated_vector_drawable_attr_icon" >
+    <target
+        android:name="hex"
+        android:animation="@anim/blink" />
+</animated-vector>
diff --git a/tests/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml b/tests/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml
new file mode 100644
index 0000000..92680d5
--- /dev/null
+++ b/tests/VectorDrawableTest/res/layout/activity_animated_vector_drawable_attr.xml
@@ -0,0 +1,37 @@
+<?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" >
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="50dp"
+        android:src="@drawable/animated_vector_drawable_attr_icon"
+        android:theme="@style/ColorTheme" />
+
+    <ImageView
+        android:id="@+id/avd"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:src="@drawable/animated_vector_drawable_attr_icon_animated"
+        android:theme="@style/ColorTheme" />
+
+</LinearLayout>
+
diff --git a/core/res/res/drawable/dialog_background_shadow_material.xml b/tests/VectorDrawableTest/res/values/attrs.xml
similarity index 65%
rename from core/res/res/drawable/dialog_background_shadow_material.xml
rename to tests/VectorDrawableTest/res/values/attrs.xml
index 0554920..98bf992 100644
--- a/core/res/res/drawable/dialog_background_shadow_material.xml
+++ b/tests/VectorDrawableTest/res/values/attrs.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
+<!-- Copyright (C) 2015 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.
@@ -13,8 +12,6 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/dialog_background_mtrl_mult"
-    android:tint="?attr/colorBackground"
-    android:tintMode="multiply" />
+<resources>
+    <attr name="color1" format="color" />
+</resources>
diff --git a/core/res/res/drawable/dialog_background_shadow_material.xml b/tests/VectorDrawableTest/res/values/colors.xml
similarity index 65%
copy from core/res/res/drawable/dialog_background_shadow_material.xml
copy to tests/VectorDrawableTest/res/values/colors.xml
index 0554920..6eb3036 100644
--- a/core/res/res/drawable/dialog_background_shadow_material.xml
+++ b/tests/VectorDrawableTest/res/values/colors.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
+<!-- Copyright (C) 2015 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.
@@ -13,8 +12,9 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
-<nine-patch xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/dialog_background_mtrl_mult"
-    android:tint="?attr/colorBackground"
-    android:tintMode="multiply" />
+<resources>
+    <color name="color0">#a6e4ea</color>
+    <color name="color1">#ff3838</color>
+    <color name="color2">#ffff51</color>
+    <color name="color3">#0ed300</color>
+</resources>
diff --git a/tests/VectorDrawableTest/res/values/styles.xml b/tests/VectorDrawableTest/res/values/styles.xml
index 460c0db..8adc034 100644
--- a/tests/VectorDrawableTest/res/values/styles.xml
+++ b/tests/VectorDrawableTest/res/values/styles.xml
@@ -13,4 +13,7 @@
      limitations under the License.
 -->
 <resources>
+    <style name="ColorTheme">
+        <item name="color1">@color/color1</item>
+    </style>
 </resources>
diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
new file mode 100644
index 0000000..8de2f6b
--- /dev/null
+++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2015 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.test.dynamic;
+
+import android.app.Activity;
+import android.graphics.drawable.AnimatedVectorDrawable;
+import android.os.Bundle;
+import android.widget.ImageView;
+
+public class AnimatedVectorDrawableAttr extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_animated_vector_drawable_attr);
+
+        ImageView avdIv = (ImageView) findViewById(R.id.avd);
+        AnimatedVectorDrawable avd = (AnimatedVectorDrawable) avdIv.getDrawable();
+        avd.start();
+    }
+}
diff --git a/tools/layoutlib/.idea/misc.xml b/tools/layoutlib/.idea/misc.xml
index 94bcd36..b474bdc 100644
--- a/tools/layoutlib/.idea/misc.xml
+++ b/tools/layoutlib/.idea/misc.xml
@@ -10,27 +10,29 @@
     <type id="android" />
   </component>
   <component name="NullableNotNullManager">
-    <option name="myDefaultNullable" value="com.android.annotations.Nullable" />
-    <option name="myDefaultNotNull" value="com.android.annotations.NonNull" />
+    <option name="myDefaultNullable" value="android.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.annotation.NonNull" />
     <option name="myNullables">
       <value>
-        <list size="5">
+        <list size="6">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
           <item index="4" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
+          <item index="5" class="java.lang.String" itemvalue="android.annotation.Nullable" />
         </list>
       </value>
     </option>
     <option name="myNotNulls">
       <value>
-        <list size="5">
+        <list size="6">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
           <item index="4" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
+          <item index="5" class="java.lang.String" itemvalue="android.annotation.NonNull" />
         </list>
       </value>
     </option>
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java
index fdb6e75..163fbcb 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeResources.java
@@ -16,6 +16,8 @@
 
 package android.content.res;
 
+import com.android.SdkConstants;
+import com.android.ide.common.rendering.api.ArrayResourceValue;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.LayoutlibCallback;
 import com.android.ide.common.rendering.api.ResourceValue;
@@ -32,6 +34,8 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 import android.util.DisplayMetrics;
@@ -42,6 +46,7 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
+import java.util.Iterator;
 
 /**
  *
@@ -241,6 +246,145 @@
     }
 
     @Override
+    public CharSequence[] getTextArray(int id) throws NotFoundException {
+        ResourceValue resValue = getArrayResourceValue(id);
+        if (resValue == null) {
+            // Error already logged by getArrayResourceValue.
+            return new CharSequence[0];
+        } else if (!(resValue instanceof ArrayResourceValue)) {
+            return new CharSequence[]{
+                    resolveReference(resValue.getValue(), resValue.isFramework())};
+        }
+        ArrayResourceValue arv = ((ArrayResourceValue) resValue);
+        return fillValues(arv, new CharSequence[arv.getElementCount()]);
+    }
+
+    @Override
+    public String[] getStringArray(int id) throws NotFoundException {
+        ResourceValue resValue = getArrayResourceValue(id);
+        if (resValue == null) {
+            // Error already logged by getArrayResourceValue.
+            return new String[0];
+        } else if (!(resValue instanceof ArrayResourceValue)) {
+            return new String[]{
+                    resolveReference(resValue.getValue(), resValue.isFramework())};
+        }
+        ArrayResourceValue arv = ((ArrayResourceValue) resValue);
+        return fillValues(arv, new String[arv.getElementCount()]);
+    }
+
+    /**
+     * Resolve each element in resValue and copy them to {@code values}. The values copied are
+     * always Strings. The ideal signature for the method should be &lt;T super String&gt;, but java
+     * generics don't support it.
+     */
+    private <T extends CharSequence> T[] fillValues(ArrayResourceValue resValue, T[] values) {
+        int i = 0;
+        for (Iterator<String> iterator = resValue.iterator(); iterator.hasNext(); i++) {
+            @SuppressWarnings("unchecked")
+            T s = (T) resolveReference(iterator.next(), resValue.isFramework());
+            values[i] = s;
+        }
+        return values;
+    }
+
+    @Override
+    public int[] getIntArray(int id) throws NotFoundException {
+        ResourceValue rv = getArrayResourceValue(id);
+        if (rv == null) {
+            // Error already logged by getArrayResourceValue.
+            return new int[0];
+        } else if (!(rv instanceof ArrayResourceValue)) {
+            // This is an older IDE that can only give us the first element of the array.
+            String firstValue = resolveReference(rv.getValue(), rv.isFramework());
+            try {
+                return new int[]{getInt(firstValue)};
+            } catch (NumberFormatException e) {
+                Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT,
+                        "Integer resource array contains non-integer value: " +
+                                firstValue, null);
+                return new int[1];
+            }
+        }
+        ArrayResourceValue resValue = ((ArrayResourceValue) rv);
+        int[] values = new int[resValue.getElementCount()];
+        int i = 0;
+        for (Iterator<String> iterator = resValue.iterator(); iterator.hasNext(); i++) {
+            String element = resolveReference(iterator.next(), resValue.isFramework());
+            try {
+                values[i] = getInt(element);
+            } catch (NumberFormatException e) {
+                Bridge.getLog().error(LayoutLog.TAG_RESOURCES_FORMAT,
+                        "Integer resource array contains non-integer value: " + element, null);
+            }
+        }
+        return values;
+    }
+
+    /**
+     * Try to find the ArrayResourceValue for the given id.
+     * <p/>
+     * If the ResourceValue found is not of type {@link ResourceType#ARRAY}, the method logs an
+     * error and return null. However, if the ResourceValue found has type {@code
+     * ResourceType.ARRAY}, but the value is not an instance of {@link ArrayResourceValue}, the
+     * method returns the ResourceValue. This happens on older versions of the IDE, which did not
+     * parse the array resources properly.
+     * <p/>
+     * @throws NotFoundException if no resource if found
+     */
+    @Nullable
+    private ResourceValue getArrayResourceValue(int id) throws NotFoundException {
+        Pair<String, ResourceValue> v = getResourceValue(id, mPlatformResourceFlag);
+
+        if (v != null) {
+            ResourceValue resValue = v.getSecond();
+
+            assert resValue != null;
+            if (resValue != null) {
+                final ResourceType type = resValue.getResourceType();
+                if (type != ResourceType.ARRAY) {
+                    Bridge.getLog().error(LayoutLog.TAG_RESOURCES_RESOLVE,
+                            String.format(
+                                    "Resource with id 0x%1$X is not an array resource, but %2$s",
+                                    id, type == null ? "null" : type.getDisplayName()),
+                            null);
+                    return null;
+                }
+                if (!(resValue instanceof ArrayResourceValue)) {
+                    Bridge.getLog().warning(LayoutLog.TAG_UNSUPPORTED,
+                            "Obtaining resource arrays via getTextArray, getStringArray or getIntArray is not fully supported in this version of the IDE.",
+                            null);
+                }
+                return resValue;
+            }
+        }
+
+        // id was not found or not resolved. Throw a NotFoundException.
+        throwException(id);
+
+        // this is not used since the method above always throws
+        return null;
+    }
+
+    @NonNull
+    private String resolveReference(@NonNull String ref, boolean forceFrameworkOnly) {
+        if (ref.startsWith(SdkConstants.PREFIX_RESOURCE_REF) || ref.startsWith
+                (SdkConstants.PREFIX_THEME_REF)) {
+            ResourceValue rv =
+                    mContext.getRenderResources().findResValue(ref, forceFrameworkOnly);
+            rv = mContext.getRenderResources().resolveResValue(rv);
+            if (rv != null) {
+                return rv.getValue();
+            } else {
+                Bridge.getLog().error(LayoutLog.TAG_RESOURCES_RESOLVE,
+                        "Unable to resolve resource " + ref, null);
+            }
+        }
+        // Not a reference.
+        return ref;
+    }
+
+    @Override
     public XmlResourceParser getLayout(int id) throws NotFoundException {
         Pair<String, ResourceValue> v = getResourceValue(id, mPlatformResourceFlag);
 
@@ -430,13 +574,8 @@
             if (resValue != null) {
                 String v = resValue.getValue();
                 if (v != null) {
-                    int radix = 10;
-                    if (v.startsWith("0x")) {
-                        v = v.substring(2);
-                        radix = 16;
-                    }
                     try {
-                        return Integer.parseInt(v, radix);
+                        return getInt(v);
                     } catch (NumberFormatException e) {
                         // return exception below
                     }
@@ -609,7 +748,6 @@
         }
     }
 
-
     @Override
     public InputStream openRawResource(int id) throws NotFoundException {
         Pair<String, ResourceValue> value = getResourceValue(id, mPlatformResourceFlag);
@@ -690,7 +828,7 @@
             resourceInfo = mLayoutlibCallback.resolveResourceId(id);
         }
 
-        String message = null;
+        String message;
         if (resourceInfo != null) {
             message = String.format(
                     "Could not find %1$s resource matching value 0x%2$X (resolved name: %3$s) in current configuration.",
@@ -702,4 +840,15 @@
 
         throw new NotFoundException(message);
     }
+
+    private int getInt(String v) throws NumberFormatException {
+        int radix = 10;
+        if (v.startsWith("0x")) {
+            v = v.substring(2);
+            radix = 16;
+        } else if (v.startsWith("0")) {
+            radix = 8;
+        }
+        return Integer.parseInt(v, radix);
+    }
 }
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
index 54a508a..76019bf 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java
@@ -16,7 +16,6 @@
 
 package android.content.res;
 
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.AttrResourceValue;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.RenderResources;
@@ -33,6 +32,7 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.Nullable;
 import android.content.res.Resources.Theme;
 import android.graphics.drawable.Drawable;
 import android.util.DisplayMetrics;
diff --git a/tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java b/tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java
index 41d94b7..f1e8fc21 100644
--- a/tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java
@@ -16,7 +16,6 @@
 
 package android.content.res;
 
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.ResourceReference;
 import com.android.ide.common.rendering.api.StyleResourceValue;
 import com.android.layoutlib.bridge.android.BridgeContext;
@@ -25,6 +24,7 @@
 import com.android.resources.ResourceType;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.Nullable;
 import android.content.res.Resources.NotFoundException;
 import android.content.res.Resources.Theme;
 import android.content.res.Resources.ThemeKey;
diff --git a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
index 9cf777d..d858953 100644
--- a/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java
@@ -16,13 +16,13 @@
 
 package android.graphics;
 
-import com.android.annotations.Nullable;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.ninepatch.NinePatchChunk;
 import com.android.resources.Density;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.Nullable;
 import android.content.res.BridgeResources.NinePatchInputStream;
 import android.graphics.BitmapFactory.Options;
 import android.graphics.Bitmap_Delegate.BitmapCreateFlags;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
index 9dc1af0..0737682 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap_Delegate.java
@@ -16,13 +16,13 @@
 
 package android.graphics;
 
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.resources.Density;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.Nullable;
 import android.graphics.Bitmap.Config;
 import android.os.Parcel;
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 47acc42..f8b3739 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -16,7 +16,6 @@
 
 package android.graphics;
 
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
@@ -24,6 +23,7 @@
 import com.android.layoutlib.bridge.impl.PorterDuffUtility;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.Nullable;
 import android.graphics.Bitmap.Config;
 import android.text.TextUtils;
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
index 42de4ec..857e6d0 100644
--- a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
@@ -16,14 +16,14 @@
 
 package android.graphics;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.AssetRepository;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.content.res.AssetManager;
 import android.content.res.BridgeAssetManager;
 
diff --git a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
index 3b1e3f9..57dd429 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Paint_Delegate.java
@@ -16,13 +16,13 @@
 
 package android.graphics;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.layoutlib.bridge.Bridge;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.graphics.FontFamily_Delegate.FontVariant;
 import android.graphics.Paint.FontMetrics;
 import android.graphics.Paint.FontMetricsInt;
diff --git a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
index b9460b4..85e65e6 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Typeface_Delegate.java
@@ -16,10 +16,10 @@
 
 package android.graphics;
 
-import com.android.annotations.NonNull;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.NonNull;
 import android.graphics.FontFamily_Delegate.FontVariant;
 
 import java.awt.Font;
diff --git a/tools/layoutlib/bridge/src/android/text/GreedyLineBreaker.java b/tools/layoutlib/bridge/src/android/text/GreedyLineBreaker.java
index b95cda6..50289e9 100644
--- a/tools/layoutlib/bridge/src/android/text/GreedyLineBreaker.java
+++ b/tools/layoutlib/bridge/src/android/text/GreedyLineBreaker.java
@@ -16,8 +16,7 @@
 
 package android.text;
 
-import com.android.annotations.NonNull;
-
+import android.annotation.NonNull;
 import android.text.Primitive.PrimitiveType;
 import android.text.StaticLayout.LineBreaks;
 
diff --git a/tools/layoutlib/bridge/src/android/text/LineBreaker.java b/tools/layoutlib/bridge/src/android/text/LineBreaker.java
index edeef78..06e9c84 100644
--- a/tools/layoutlib/bridge/src/android/text/LineBreaker.java
+++ b/tools/layoutlib/bridge/src/android/text/LineBreaker.java
@@ -16,8 +16,8 @@
 
 package android.text;
 
+import android.annotation.NonNull;
 import android.text.StaticLayout.LineBreaks;
-import com.android.annotations.NonNull;
 
 import java.util.Collections;
 import java.util.List;
diff --git a/tools/layoutlib/bridge/src/android/text/OptimizingLineBreaker.java b/tools/layoutlib/bridge/src/android/text/OptimizingLineBreaker.java
index cd92581..ed8e33a 100644
--- a/tools/layoutlib/bridge/src/android/text/OptimizingLineBreaker.java
+++ b/tools/layoutlib/bridge/src/android/text/OptimizingLineBreaker.java
@@ -16,8 +16,7 @@
 
 package android.text;
 
-import com.android.annotations.NonNull;
-
+import android.annotation.NonNull;
 import android.text.Primitive.PrimitiveType;
 import android.text.StaticLayout.LineBreaks;
 
diff --git a/tools/layoutlib/bridge/src/android/text/Primitive.java b/tools/layoutlib/bridge/src/android/text/Primitive.java
index ce77601..37ed072 100644
--- a/tools/layoutlib/bridge/src/android/text/Primitive.java
+++ b/tools/layoutlib/bridge/src/android/text/Primitive.java
@@ -16,7 +16,7 @@
 
 package android.text;
 
-import com.android.annotations.NonNull;
+import android.annotation.NonNull;
 
 // Based on the native implementation of Primitive in
 // frameworks/base/core/jni/android_text_StaticLayout.cpp revision b808260
diff --git a/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java b/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
index 4226526..1b0ba51 100644
--- a/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/text/StaticLayout_Delegate.java
@@ -1,9 +1,9 @@
 package android.text;
 
-import com.android.annotations.NonNull;
 import com.android.layoutlib.bridge.impl.DelegateManager;
 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
 
+import android.annotation.NonNull;
 import android.graphics.BidiRenderer;
 import android.graphics.Paint;
 import android.graphics.Paint_Delegate;
diff --git a/tools/layoutlib/bridge/src/android/text/TabStops.java b/tools/layoutlib/bridge/src/android/text/TabStops.java
index cff6b93..6c2f1e1 100644
--- a/tools/layoutlib/bridge/src/android/text/TabStops.java
+++ b/tools/layoutlib/bridge/src/android/text/TabStops.java
@@ -16,7 +16,7 @@
 
 package android.text;
 
-import com.android.annotations.Nullable;
+import android.annotation.Nullable;
 
 // Based on the native implementation of TabStops in
 // frameworks/base/core/jni/android_text_StaticLayout.cpp revision b808260
diff --git a/tools/layoutlib/bridge/src/android/view/ShadowPainter.java b/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
index a0db7bf..c734ea1 100644
--- a/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
+++ b/tools/layoutlib/bridge/src/android/view/ShadowPainter.java
@@ -16,7 +16,7 @@
 
 package android.view;
 
-import com.android.annotations.NonNull;
+import android.annotation.NonNull;
 
 import java.awt.Graphics2D;
 import java.awt.Image;
diff --git a/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java
index d5170aa..edb5eff 100644
--- a/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java
+++ b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java
@@ -16,9 +16,8 @@
 
 package android.view.accessibility;
 
-import com.android.annotations.NonNull;
-
 import android.accessibilityservice.AccessibilityServiceInfo;
+import android.annotation.NonNull;
 import android.content.Context;
 import android.content.pm.ServiceInfo;
 import android.view.IWindow;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index af67a43..3ae10f2 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -16,7 +16,6 @@
 
 package com.android.layoutlib.bridge;
 
-import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.Capability;
 import com.android.ide.common.rendering.api.DrawableParams;
 import com.android.ide.common.rendering.api.Features;
@@ -34,6 +33,7 @@
 import com.android.tools.layoutlib.create.OverrideMethod;
 import com.android.util.Pair;
 
+import android.annotation.NonNull;
 import android.content.res.BridgeAssetManager;
 import android.graphics.Bitmap;
 import android.graphics.FontFamily_Delegate;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index 22bcbda..9d2b884 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -16,7 +16,6 @@
 
 package com.android.layoutlib.bridge.android;
 
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.AssetRepository;
 import com.android.ide.common.rendering.api.ILayoutPullParser;
 import com.android.ide.common.rendering.api.LayoutLog;
@@ -36,6 +35,7 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.Nullable;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.ContentResolver;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
index e4c7288..5e5b3c9 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/support/RecyclerViewUtil.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.android.support;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.LayoutlibCallback;
 import com.android.ide.common.rendering.api.SessionParams;
@@ -25,6 +23,8 @@
 import com.android.layoutlib.bridge.android.BridgeContext;
 import com.android.layoutlib.bridge.android.RenderParamsFlags;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.content.Context;
 import android.view.View;
 
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java
index dd1f661..8b8cc38 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/AppCompatActionBar.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.bars;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.RenderResources;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.SessionParams;
@@ -26,6 +24,8 @@
 import com.android.layoutlib.bridge.impl.ResourceHelper;
 import com.android.resources.ResourceType;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.view.ContextThemeWrapper;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java
index 3d1a9b9..a19b689 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/BridgeActionBar.java
@@ -16,7 +16,6 @@
 
 package com.android.layoutlib.bridge.bars;
 
-import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.ActionBarCallback;
 import com.android.ide.common.rendering.api.ActionBarCallback.HomeButtonStyle;
 import com.android.ide.common.rendering.api.RenderResources;
@@ -24,6 +23,7 @@
 import com.android.ide.common.rendering.api.SessionParams;
 import com.android.layoutlib.bridge.android.BridgeContext;
 
+import android.annotation.NonNull;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
index bc1a41d..90a1c75 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/CustomBar.java
@@ -16,7 +16,6 @@
 
 package com.android.layoutlib.bridge.bars;
 
-import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.RenderResources;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.StyleResourceValue;
@@ -32,6 +31,7 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.graphics.Bitmap;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBar.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBar.java
index a1c9065..bb3d13f 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBar.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBar.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.bars;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.RenderResources;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.SessionParams;
@@ -27,6 +25,8 @@
 import com.android.layoutlib.bridge.android.BridgeContext;
 import com.android.layoutlib.bridge.impl.ResourceHelper;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.DisplayMetrics;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBarWrapper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBarWrapper.java
index 44c2cd8..daad602 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBarWrapper.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/bars/FrameworkActionBarWrapper.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.bars;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.ActionBarCallback;
 import com.android.ide.common.rendering.api.RenderResources;
 import com.android.ide.common.rendering.api.ResourceValue;
@@ -31,6 +29,8 @@
 import com.android.layoutlib.bridge.android.BridgeContext;
 import com.android.layoutlib.bridge.impl.ResourceHelper;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.app.ActionBar;
 import android.app.ActionBar.Tab;
 import android.app.ActionBar.TabListener;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
index dbee9ea..47258b6 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/DelegateManager.java
@@ -16,10 +16,10 @@
 
 package com.android.layoutlib.bridge.impl;
 
-import com.android.annotations.Nullable;
 import com.android.layoutlib.bridge.util.Debug;
 import com.android.layoutlib.bridge.util.SparseWeakArray;
 
+import android.annotation.Nullable;
 import android.util.SparseArray;
 
 import java.lang.ref.WeakReference;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
index 646f960..6e67f59 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ParserFactory.java
@@ -17,12 +17,12 @@
 package com.android.layoutlib.bridge.impl;
 
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
 import java.io.File;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index f6e5ef1..ff77b58 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.impl;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.AdapterBinding;
 import com.android.ide.common.rendering.api.HardwareConfig;
 import com.android.ide.common.rendering.api.IAnimationListener;
@@ -68,6 +66,8 @@
 import android.animation.AnimatorInflater;
 import android.animation.LayoutTransition;
 import android.animation.LayoutTransition.TransitionListener;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 import android.app.Fragment_Delegate;
 import android.graphics.Bitmap;
 import android.graphics.Bitmap_Delegate;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
index a3fde866..ca77193 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java
@@ -17,7 +17,6 @@
 package com.android.layoutlib.bridge.impl;
 
 import com.android.SdkConstants;
-import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.DensityBasedResourceValue;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.RenderResources;
@@ -32,6 +31,7 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
 import android.content.res.ColorStateList;
 import android.content.res.Resources.Theme;
 import android.graphics.Bitmap;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/DynamicIdMap.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/DynamicIdMap.java
index 979aa33..08a8faf 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/DynamicIdMap.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/DynamicIdMap.java
@@ -16,10 +16,10 @@
 
 package com.android.layoutlib.bridge.util;
 
-import com.android.annotations.NonNull;
 import com.android.resources.ResourceType;
 import com.android.util.Pair;
 
+import android.annotation.NonNull;
 import android.util.SparseArray;
 
 import java.util.HashMap;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/ReflectionUtils.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/ReflectionUtils.java
index 8e61edf..b324451 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/ReflectionUtils.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/util/ReflectionUtils.java
@@ -16,8 +16,8 @@
 
 package com.android.layoutlib.bridge.util;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build.gradle b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build.gradle
index 0f37fce..4561e1b 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build.gradle
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build.gradle
@@ -3,7 +3,7 @@
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.1.3'
+        classpath 'com.android.tools.build:gradle:1.2.3'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
@@ -19,12 +19,12 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 21
+    compileSdkVersion 22
     buildToolsVersion '21.1.2'
     defaultConfig {
         applicationId 'com.android.layoutlib.test.myapplication'
-        minSdkVersion 19
-        targetSdkVersion 21
+        minSdkVersion 21
+        targetSdkVersion 22
         versionCode 1
         versionName '1.0'
     }
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/ArraysCheckWidget.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/ArraysCheckWidget.class
new file mode 100644
index 0000000..e0373cb
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/ArraysCheckWidget.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/MyActivity.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/MyActivity.class
index 8af93eb..ec42017 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/MyActivity.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/MyActivity.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$array.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$array.class
new file mode 100644
index 0000000..b87f193
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$array.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$attr.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$attr.class
index 9bab801..e2968d40 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$attr.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$attr.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$dimen.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$dimen.class
index 7ad8605..0e208f2 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$dimen.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$dimen.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$drawable.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$drawable.class
index e9e0a33..2b77af3 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$drawable.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$drawable.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$id.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$id.class
index 069f9f7..fd01b44 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$id.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$id.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$integer.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$integer.class
new file mode 100644
index 0000000..91cf5b6
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$integer.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$layout.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$layout.class
index 36e2688..e172b2d 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$layout.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$layout.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$menu.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$menu.class
index ca438ad..aecbff6 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$menu.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$menu.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$string.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$string.class
index a98abf5..fc3f236 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$string.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$string.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$style.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$style.class
index 7d8cc84..83ad35b 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$style.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R$style.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R.class b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R.class
index 7e6113b..d5b81c4 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R.class
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/build/intermediates/classes/debug/com/android/layoutlib/test/myapplication/R.class
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png
new file mode 100644
index 0000000..9a13568
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/golden/array_check.png
Binary files differ
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/java/com/android/layoutlib/test/myapplication/ArraysCheckWidget.java b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/java/com/android/layoutlib/test/myapplication/ArraysCheckWidget.java
new file mode 100644
index 0000000..41d75de
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/java/com/android/layoutlib/test/myapplication/ArraysCheckWidget.java
@@ -0,0 +1,41 @@
+package com.android.layoutlib.test.myapplication;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.util.AttributeSet;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+/**
+ * A widget to test obtaining arrays from resources.
+ */
+public class ArraysCheckWidget extends LinearLayout {
+    public ArraysCheckWidget(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public ArraysCheckWidget(Context context, AttributeSet attrs, int defStyleAttr) {
+        this(context, attrs, defStyleAttr, 0);
+    }
+
+    public ArraysCheckWidget(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        Resources resources = context.getResources();
+        for (CharSequence chars : resources.getTextArray(R.array.array)) {
+            addTextView(context, chars);
+        }
+        for (int i : resources.getIntArray(R.array.int_array)) {
+            addTextView(context, String.valueOf(i));
+        }
+        for (String string : resources.getStringArray(R.array.string_array)) {
+            addTextView(context, string);
+        }
+    }
+
+    private void addTextView(Context context, CharSequence string) {
+        TextView textView = new TextView(context);
+        textView.setText(string);
+        textView.setTextSize(30);
+        addView(textView);
+    }
+}
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/array_check.xml b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/array_check.xml
new file mode 100644
index 0000000..50646ab
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/layout/array_check.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.layoutlib.test.myapplication.ArraysCheckWidget xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+</com.android.layoutlib.test.myapplication.ArraysCheckWidget>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/arrays.xml b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/arrays.xml
new file mode 100644
index 0000000..f6e14d2
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/arrays.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <array name="array">
+        <item>first</item>
+        <item>second</item>
+    </array>
+    <integer-array name="int_array">
+        <item>1</item>
+        <item>0xaB</item>  <!-- hex entry (decimal 171) -->
+        <item>010</item>   <!-- octal entry -->
+        <item>@integer/ten</item>  <!-- value reference -->
+        <item>?attr/myattr</item>  <!-- theme attr reference -->
+    </integer-array>
+    <string-array name="string_array">
+        <item>mystring</item>
+        <item>@string/hello_world</item>   <!-- string ref in appNs -->
+        <!-- theme ref in android NS. value = @string/candidates_style = <u>candidates</u> -->
+        <item>?android:attr/candidatesTextStyleSpans</item>
+        <item>@android:string/unknownName</item>  <!-- value = Unknown -->
+    </string-array>
+
+    <!-- resources that the above array can refer to -->
+    <integer name="ten">10</integer>
+    <integer name="twelve">12</integer>
+</resources>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/attrs.xml b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..894e18c
--- /dev/null
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/attrs.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <attr name="myattr" format="integer" />
+</resources>
\ No newline at end of file
diff --git a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
index ff6c9d2..88c9cbc 100644
--- a/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
+++ b/tools/layoutlib/bridge/tests/res/testApp/MyApplication/src/main/res/values/styles.xml
@@ -1,7 +1,8 @@
 <resources>
 
     <!-- Base application theme. -->
-    <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
+    <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
+        <item name="myattr">@integer/ten</item>
         <!-- Customize your theme here. -->
     </style>
 
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
index 4623f69..77c997b 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/android/BridgeXmlBlockParserTest.java
@@ -16,7 +16,6 @@
 
 package com.android.layoutlib.bridge.android;
 
-import com.android.annotations.NonNull;
 import com.android.layoutlib.bridge.impl.ParserFactory;
 
 import org.junit.AfterClass;
@@ -27,6 +26,8 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
+
 import static org.junit.Assert.assertEquals;
 
 public class BridgeXmlBlockParserTest {
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java
index d7e5486..16911bd 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/ImageUtils.java
@@ -16,7 +16,7 @@
 
 package com.android.layoutlib.bridge.intensive;
 
-import com.android.annotations.NonNull;
+import android.annotation.NonNull;
 
 import java.awt.AlphaComposite;
 import java.awt.Color;
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
index 63115e4..272a2b8 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java
@@ -16,8 +16,6 @@
 
 package com.android.layoutlib.bridge.intensive;
 
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.LayoutLog;
 import com.android.ide.common.rendering.api.RenderSession;
 import com.android.ide.common.rendering.api.Result;
@@ -39,6 +37,9 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
@@ -295,6 +296,11 @@
         renderAndVerify("allwidgets.xml", "allwidgets.png");
     }
 
+    @Test
+    public void testArrayCheck() throws ClassNotFoundException {
+        renderAndVerify("array_check.xml", "array_check.png");
+    }
+
     @AfterClass
     public static void tearDown() {
         sLayoutLibLog = null;
@@ -346,7 +352,7 @@
         ResourceResolver resourceResolver =
                 ResourceResolver.create(sProjectResources.getConfiguredResources(config),
                         sFrameworkRepo.getConfiguredResources(config),
-                        "Theme.Material.Light.DarkActionBar", false);
+                        "AppTheme", true);
 
         return new SessionParams(
                 layoutParser,
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
index ab682fd..6c16ed0 100644
--- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
+++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/setup/LayoutLibTestCallback.java
@@ -17,8 +17,6 @@
 package com.android.layoutlib.bridge.intensive.setup;
 
 import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.ActionBarCallback;
 import com.android.ide.common.rendering.api.AdapterBinding;
 import com.android.ide.common.rendering.api.ILayoutPullParser;
@@ -35,6 +33,9 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+
 import java.io.File;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
index 7872fee..2951edb 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
@@ -18,8 +18,6 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -105,7 +103,7 @@
                         "com.android.internal.widget.*",
                         "android.text.**",
                         "android.graphics.*",
-                        "android.graphics.drawable.*",
+                        "android.graphics.drawable.**",
                         "android.content.*",
                         "android.content.res.*",
                         "android.preference.*",
@@ -119,6 +117,8 @@
                         "android.app.TimePickerDialog",     // b.android.com/61515
                         "com.android.internal.view.menu.ActionMenu",
                         "android.icu.**",                   // needed by LayoutLib
+                        "android.annotation.NonNull",       // annotations
+                        "android.annotation.Nullable",      // annotations
                     },
                     excludeClasses,
                     new String[] {