Merge "docs: Enhanced description of "direct reply" workflow." into mnc-mr-docs
diff --git a/docs/html/guide/practices/screens-distribution.jd b/docs/html/guide/practices/screens-distribution.jd
index 99eb04e..19fb3d3 100644
--- a/docs/html/guide/practices/screens-distribution.jd
+++ b/docs/html/guide/practices/screens-distribution.jd
@@ -25,8 +25,6 @@
   <ol>
     <li><a
 href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a></li>
-    <li><a
-href="{@docRoot}guide/practices/optimizing-for-3.0.html">Optimizing Apps for Android 3.0</a></li>
   </ol>
 
 </div>
diff --git a/docs/html/guide/topics/graphics/opengl.jd b/docs/html/guide/topics/graphics/opengl.jd
index 3e3d569..38d0d91 100644
--- a/docs/html/guide/topics/graphics/opengl.jd
+++ b/docs/html/guide/topics/graphics/opengl.jd
@@ -545,14 +545,15 @@
   </li>
   <li><strong>S3TC (DXT<em>n</em>/DXTC)</strong> - S3 texture compression (S3TC) has several
 format variations (DXT1 to DXT5) and is less widely available. The format supports RGB textures with
-4-bit alpha or 8-bit alpha channels. This format may be represented by several OpenGL extension
-names, for example:
+4-bit alpha or 8-bit alpha channels. These formats are represented by the following OpenGL extension
+name:
     <ul>
-      <li>{@code GL_OES_texture_compression_S3TC}</li>
       <li>{@code GL_EXT_texture_compression_s3tc}</li>
+    </ul>
+    Some devices only support the DXT1 format variation; this limited support is represented by the
+following OpenGL extension name:
+    <ul>
       <li>{@code GL_EXT_texture_compression_dxt1}</li>
-      <li>{@code GL_EXT_texture_compression_dxt3}</li>
-      <li>{@code GL_EXT_texture_compression_dxt5}</li>
     </ul>
   </li>
   <li><strong>3DC</strong> - 3DC texture compression (3DC) is a less widely available format that
diff --git a/docs/html/guide/topics/graphics/overview.jd b/docs/html/guide/topics/graphics/overview.jd
index a53cd3f..66a675d 100644
--- a/docs/html/guide/topics/graphics/overview.jd
+++ b/docs/html/guide/topics/graphics/overview.jd
@@ -8,7 +8,7 @@
   <h3 id="animation">Animation</h3>
   
   <p>The Android framework provides two animation systems: property animation
-  (introduced in Android 3.0) and view animation. Both animation systems are viable options,
+  and view animation. Both animation systems are viable options,
   but the property animation system, in general, is the preferred method to use, because it
   is more flexible and offers more features. In addition to these two systems, you can utilize Drawable
   animation, which allows you to load drawable resources and display them one frame after
diff --git a/docs/html/guide/topics/media/mediarouter.jd b/docs/html/guide/topics/media/mediarouter.jd
index e0bf889..f5e4f14 100644
--- a/docs/html/guide/topics/media/mediarouter.jd
+++ b/docs/html/guide/topics/media/mediarouter.jd
@@ -458,8 +458,8 @@
 <p class="note">
   <strong>Note:</strong> In order for Wireless Display routes to show up in the media route
   selection dialog, users must enable this option in the Settings app. The option is under
-  the <em>Display</em> category and is called <em>Cast screen</em> on Android 4.4 (KitKat) and higher
-  devices and <em>Wireless Display</em> on Android 4.2.x (Jelly Bean) devices. For more information
+  the <em>Display</em> category and is called <em>Cast screen</em> on Android 4.4 (KitKat)
+  and higher devices. For more information
   on enabling this feature see this
   <a href="https://support.google.com/nexus/answer/2865484">Wireless display</a> support page.
 </p>
diff --git a/docs/html/guide/topics/resources/menu-resource.jd b/docs/html/guide/topics/resources/menu-resource.jd
index 53ff276..3c4c8b8 100644
--- a/docs/html/guide/topics/resources/menu-resource.jd
+++ b/docs/html/guide/topics/resources/menu-resource.jd
@@ -300,8 +300,7 @@
     // All other menu item clicks are handled by {@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()}
 }
 </pre>
-<p class="note"><strong>Note:</strong> The {@code android:showAsAction} attribute is
-available only on Android 3.0 (API Level 11) and greater.</p>
+
 </dd> <!-- end example -->
 
 
diff --git a/docs/html/guide/topics/search/search-dialog.jd b/docs/html/guide/topics/search/search-dialog.jd
index 1cf8249..cde1920 100644
--- a/docs/html/guide/topics/search/search-dialog.jd
+++ b/docs/html/guide/topics/search/search-dialog.jd
@@ -102,8 +102,7 @@
 you can place anywhere in your layout. By default, the search widget behaves like a standard {@link
 android.widget.EditText} widget and doesn't do anything, but you can configure it so that the
 Android system handles all input events, delivers queries to the appropriate activity, and provides
-search suggestions (just like the search dialog). However, the search widget is available only in
-Android 3.0 (API Level 11) and higher.
+search suggestions (just like the search dialog).
 
 <p class="note"><strong>Note:</strong> If you want, you can handle all user input into the
 search widget yourself, using various callback methods and listeners. This document, however,
@@ -376,30 +375,13 @@
 
 <h2 id="SearchDialog">Using the Search Dialog</h2>
 
-<div class="sidebox-wrapper">
-<div class="sidebox">
-  <h2>Should I use the search dialog or the widget?</h2>
-  <p>The answer depends mostly on whether you are developing for Android 3.0 (API Level 11 or
-higher), because the {@link android.widget.SearchView} widget was introduced in Android 3.0. So,
-if you are developing your application for a version of Android lower than 3.0, the search widget is
-not an option and you should use the search dialog to implement your search interface.</p>
-  <p>If you <em>are</em> developing for Android 3.0 or higher, then the decision depends more on
-your needs. In most cases, we recommend that you use the search widget as an "action view" in the
-Action Bar. However, it might not be an option for you to put the search
-widget in the Action Bar for some reason (perhaps there's not enough space or you don't use the
-Action Bar). So, you might instead want to put the search widget somewhere in your activity layout.
-And if all else fails, you can still use the search dialog if you prefer to keep the search box
-hidden. In fact, you might want to offer both the dialog and the widget in some cases. For more
-information about the widget, skip to <a href="#UsingSearchWidget">Using the Search Widget</a>.</p>
-</div>
-</div>
 
 <p>The search dialog provides a floating search box at the top of the screen, with the application
 icon on the left. The search dialog can provide search suggestions as the user types and, when
 the user executes a search, the system sends the search query to a
 searchable activity that performs the search. However, if you are developing
 your application for devices running Android 3.0, you should consider using the search widget
-instead (see the side box).</p>
+instead (see <a href="#UsingSearchWidget">Using the Search Widget</a> section).</p>
 
 <p>The search dialog is always hidden by default, until the user activates it. Your application
 can activate the search dialog by calling {@link
@@ -685,14 +667,14 @@
 
 <p>The search widget provides the same functionality as the search dialog. It starts the appropriate
 activity when the user executes a search, and it can provide search suggestions and perform voice
-search.</p>
+search. If it's not an option for you to put the search widget in the Action Bar, you can instead
+put the search widget somewhere in your activity layout.</p>
 
 <p class="note"><strong>Note:</strong> When you use the search widget as an action view, you
 still might need to support using the search dialog, for cases in which the search widget does
 not fit in the Action Bar. See the following section about <a href="#UsingBoth">Using both
 the widget and the dialog</a>.</p>
 
-
 <h3 id="ConfiguringWidget">Configuring the search widget</h3>
 
 <p>After you've created a  <a href="#SearchableConfiguration">searchable configuration</a> and a <a
diff --git a/docs/html/guide/topics/ui/accessibility/apps.jd b/docs/html/guide/topics/ui/accessibility/apps.jd
index da24d03..47e2eff 100644
--- a/docs/html/guide/topics/ui/accessibility/apps.jd
+++ b/docs/html/guide/topics/ui/accessibility/apps.jd
@@ -532,21 +532,12 @@
 }
 </pre>
 
-<p>In applications targeting Android 4.0 (API Level 14) and higher, you can implement these methods
+<p>You can implement these methods
 directly in your custom view class. For another example of this approach, see the Android
 <a href="{@docRoot}tools/support-library/index.html">Support Library</a> (revision 5 or higher)
 sample {@code AccessibilityDelegateSupportActivity} in
 ({@code &lt;sdk&gt;/extras/android/support/v4/samples/Support4Demos/}).</p>
 
-<p class="note"><strong>Note:</strong> You may find information on implementing accessibility for
-custom views written prior to Android 4.0 that describes the use of the
-{@link android.view.View#dispatchPopulateAccessibilityEvent dispatchPopulateAccessibilityEvent()}
-method for populating AccessibilityEvents. As of the Android 4.0 release, however, the recommended
-approach is to use the
-{@link android.view.View#onPopulateAccessibilityEvent onPopulateAccessibilityEvent()} and
-{@link android.view.View#onInitializeAccessibilityEvent onInitializeAccessibilityEvent()}
-methods.</p>
-
 
 <h3 id="virtual-hierarchy">Providing a customized accessibility context</h3>
 
diff --git a/docs/html/guide/topics/ui/accessibility/services.jd b/docs/html/guide/topics/ui/accessibility/services.jd
index d69af9f..8620f15 100644
--- a/docs/html/guide/topics/ui/accessibility/services.jd
+++ b/docs/html/guide/topics/ui/accessibility/services.jd
@@ -409,7 +409,7 @@
 <h3 id="focus-types">Using focus types</h3>
 
 <p>Android 4.1 (API Level 16) introduces a new type of user interface focus called <em>Accessibility
-  Focus</em>. This type of focus can be used by accessibility services to select any visible user
+  Focus</em>. Accessibility services can used this type of focus to select any visible user
   interface element and act on it. This focus type is different from the more well known <em>Input
   Focus</em>, which determines what on-screen user interface element receives input when a user
   types characters, presses <strong>Enter</strong> on a keyboard or pushes the center button of a
diff --git a/docs/html/guide/topics/ui/controls/pickers.jd b/docs/html/guide/topics/ui/controls/pickers.jd
index 31e4d3f5..c0667ad 100644
--- a/docs/html/guide/topics/ui/controls/pickers.jd
+++ b/docs/html/guide/topics/ui/controls/pickers.jd
@@ -170,10 +170,6 @@
 android.support.v4.app.DialogFragment} and return a {@link android.app.DatePickerDialog} from the
 fragment's {@link android.support.v4.app.DialogFragment#onCreateDialog onCreateDialog()} method.</p>
 
-<p class="note"><strong>Note:</strong> If your app supports versions of Android older than 3.0,
-be sure you've set up your Android project with the support library as described in <a
-href="{@docRoot}tools/support-library/setup.html">Setting Up a Project to Use a
-Library</a>.</p>
 
 <h3 id="DatePickerFragment">Extending DialogFragment for a date picker</h3>
 
@@ -250,9 +246,4 @@
 android.support.v4.app.DialogFragment#show show()} method requires an instance of {@link
 android.support.v4.app.FragmentManager} and a unique tag name for the fragment.</p>
 
-<p class="caution"><strong>Caution:</strong> If your app supports versions of Android lower than
-3.0, be sure that you call {@link
-android.support.v4.app.FragmentActivity#getSupportFragmentManager()} to acquire an instance of
-{@link android.support.v4.app.FragmentManager}. Also make sure that your activity that displays the
-time picker extends {@link android.support.v4.app.FragmentActivity} instead of the standard {@link
-android.app.Activity} class.</p>
+
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index 2d4134d..bf0db57 100755
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -211,7 +211,7 @@
 <ul>
   <li><var>wrap_content</var> tells your view to size itself to the dimensions
 required by its content.</li>
-  <li><var>match_parent</var> (named <var>fill_parent</var> before API Level 8)
+  <li><var>match_parent</var>
 tells your view to become as big as its parent view group will allow.</li>
 </ul>
 
diff --git a/docs/html/guide/topics/ui/menus.jd b/docs/html/guide/topics/ui/menus.jd
index 11e84f1..ad2aa9b 100644
--- a/docs/html/guide/topics/ui/menus.jd
+++ b/docs/html/guide/topics/ui/menus.jd
@@ -75,14 +75,6 @@
     <dd>The <a href="#options-menu">options menu</a> is the primary collection of menu items for an
 activity. It's where you should place actions that have a global impact on the app, such as
 "Search," "Compose email," and "Settings."
-  <p>If you're developing for Android 2.3 or lower, users can
-reveal the options menu panel by pressing the <em>Menu</em> button.</p>
-  <p>On Android 3.0 and higher, items from the options menu are presented by the
-  app bar as a combination of on-screen action
-items and overflow options. Beginning with Android 3.0, the <em>Menu</em> button is deprecated (some
-devices
-don't have one), so you should migrate toward using the action bar to provide access to actions and
-other options.</p>
   <p>See the section about <a href="#options-menu">Creating an Options Menu</a>.</p>
     </dd>
     
@@ -91,8 +83,7 @@
    <dd>A context menu is a <a href="#FloatingContextMenu">floating menu</a> that appears when the
 user performs a long-click on an element. It provides actions that affect the selected content or
 context frame.
-  <p>When developing for Android 3.0 and higher, you should instead use the <a
-href="#CAB">contextual action mode</a> to enable actions on selected content. This mode displays
+  <p>The <a href="#CAB">contextual action mode</a> displays
 action items that affect the selected content in a bar at the top of the screen and allows the user
 to select multiple items.</p>
   <p>See the section about <a href="#context-menu">Creating Contextual Menus</a>.</p>
@@ -278,8 +269,8 @@
 
 <p>If you've developed your application for Android 2.3.x and lower, the system calls {@link
 android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} to create the options menu
-when the user opens the menu for the first time. If you've developed for Android 3.0 and higher, the
-system calls {@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} when
+when the user opens the menu for the first time. If you've developed for Android 3.0 and higher,
+the system calls {@link android.app.Activity#onCreateOptionsMenu(Menu) onCreateOptionsMenu()} when
 starting the activity, in order to show items to the app bar.</p>
 
 
@@ -504,10 +495,6 @@
 independently, even though the contextual action bar visually overtakes the app bar
 position.</p>
 
-<p>If you're developing for Android 3.0 (API level 11) or higher, you
-should usually use the contextual action mode to present contextual actions, instead of the <a
-href="#FloatingContextMenu">floating context menu</a>.</p>
-
 <p>For views that provide contextual actions, you should usually invoke the contextual action mode
 upon one of two events (or both):</p>
 <ul>
@@ -737,13 +724,12 @@
 
 <p>If you <a href="#xml">define your menu in XML</a>, here's how you can show the popup menu:</p>
 <ol>
-  <li>Instantate a {@link android.widget.PopupMenu} with its constructor, which takes the
+  <li>Instantiate a {@link android.widget.PopupMenu} with its constructor, which takes the
 current application {@link android.content.Context} and the {@link android.view.View} to which the
 menu should be anchored.</li>
   <li>Use {@link android.view.MenuInflater} to inflate your menu resource into the {@link
 android.view.Menu} object returned by {@link
-android.widget.PopupMenu#getMenu() PopupMenu.getMenu()}. On API level 14 and above, you can use
-{@link android.widget.PopupMenu#inflate PopupMenu.inflate()} instead.</li>
+android.widget.PopupMenu#getMenu() PopupMenu.getMenu()}.</li>
   <li>Call {@link android.widget.PopupMenu#show() PopupMenu.show()}.</li>
 </ol>
 
diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd
index da10dbc..6cd63f3 100644
--- a/docs/html/guide/topics/ui/notifiers/notifications.jd
+++ b/docs/html/guide/topics/ui/notifiers/notifications.jd
@@ -95,9 +95,9 @@
 
 <p>Notifications, as an important part of the Android user interface, have their own design guidelines.
 The material design changes introduced in Android 5.0 (API level 21) are of particular
-importance, and you should review the <a href="{@docRoot}training/material/index.html">Material Design</a>
-training for more information. To learn how to design notifications and their interactions, read the
-<a href="{@docRoot}design/patterns/notifications.html">Notifications</a> design guide.</p>
+importance, and you should review the <a href="{@docRoot}training/material/index.html">Material
+Design</a> training for more information. To learn how to design notifications and their interactions,
+read the <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> design guide.</p>
 
 <h2 id="CreateNotification">Creating a Notification</h2>
 
@@ -326,8 +326,8 @@
     <a href="{@docRoot}design/patterns/notifications.html">Notifications</a> Design guide.
 </p>
 <p class="note">
-    <strong>Note:</strong> This Gmail feature requires the "inbox" expanded layout, which is
-    part of the expanded notification feature available starting in Android 4.1.
+    <strong>Note:</strong> This Gmail feature requires the "inbox" expanded layout, which is part
+    of the expanded notification feature.
 </p>
 <p>
     The following section describes how to update notifications and also how to remove them.
@@ -892,7 +892,8 @@
 {@link android.app.Notification.Builder#addAction(android.app.Notification.Action) addAction()}
 method, which converts actions into clickable icons.</p>
 
-<p class="note"><strong>Note:</strong> The template and the {@link android.app.Notification.Builder#addAction(android.app.Notification.Action) addAction()}
+<p class="note"><strong>Note:</strong> The template and the
+{@link android.app.Notification.Builder#addAction(android.app.Notification.Action) addAction()}
 method are not included in the support library, so these features run in Android 5.0 and higher
 only.</p>
 
diff --git a/docs/html/guide/topics/ui/settings.jd b/docs/html/guide/topics/ui/settings.jd
index 02f1255..3e45c5c 100644
--- a/docs/html/guide/topics/ui/settings.jd
+++ b/docs/html/guide/topics/ui/settings.jd
@@ -549,7 +549,7 @@
 <p>In rare cases, you might want to design your settings such that the first screen
 displays only a list of <a href="#Subscreens">subscreens</a> (such as in the system Settings app,
 as shown in figures 4 and 5). When you're developing such a design for Android 3.0 and higher, you
-should use a new "headers" feature in Android 3.0, instead of building subscreens with nested
+should use the "headers" feature instead of building subscreens with nested
 {@link android.preference.PreferenceScreen} elements.</p>
 
 <p>To build your settings with headers, you need to:</p>
@@ -719,7 +719,7 @@
 
 <p>Because support for {@code &lt;preference-headers>} was added in Android 3.0, the system calls
 {@link android.preference.PreferenceActivity#onBuildHeaders onBuildHeaders()} in your {@link
-android.preference.PreferenceActivity} only when running on Androd 3.0 or higher. In order to load
+android.preference.PreferenceActivity} only when running on Android 3.0 or higher. In order to load
 the "legacy" headers file ({@code preference_headers_legacy.xml}), you must check the Android
 version and, if the version is older than Android 3.0 ({@link
 android.os.Build.VERSION_CODES#HONEYCOMB}), call {@link
diff --git a/docs/html/images/training/ctl-config.png b/docs/html/images/training/ctl-config.png
index 611f9d7..82f63c8 100644
--- a/docs/html/images/training/ctl-config.png
+++ b/docs/html/images/training/ctl-config.png
Binary files differ
diff --git a/docs/html/images/training/testartifactcombined.png b/docs/html/images/training/testartifactcombined.png
new file mode 100644
index 0000000..a3b5e81
--- /dev/null
+++ b/docs/html/images/training/testartifactcombined.png
Binary files differ
diff --git a/docs/html/images/training/testartifactseparate.png b/docs/html/images/training/testartifactseparate.png
new file mode 100644
index 0000000..b12b70c
--- /dev/null
+++ b/docs/html/images/training/testartifactseparate.png
Binary files differ
diff --git a/docs/html/jd_collections.js b/docs/html/jd_collections.js
index 863d235..a8411cd 100644
--- a/docs/html/jd_collections.js
+++ b/docs/html/jd_collections.js
@@ -1469,6 +1469,7 @@
       "https://support.google.com/admob/topic/2784623",
       "https://admob.blogspot.com/",
       "https://analyticsacademy.withgoogle.com/mobile-app",
+      "https://www.udacity.com/courses/ud876-3"
     ]
   },
   "distribute/monetize/paymentmethods": {
@@ -1782,7 +1783,7 @@
     "title": "",
     "resources": [
     "https://medium.com/google-developers/how-often-should-you-update-android-studio-db25785c488e#.8blbql35x",
-    "http://android-developers.blogspot.com/2016/02/android-studio-20-beta.html",
+    "http://android-developers.blogspot.com/2016/04/android-studio-2-0.html",
     "https://medium.com/google-developers/writing-more-code-by-writing-less-code-with-android-studio-live-templates-244f648d17c7#.hczcm02du",
     ]
   },
diff --git a/docs/html/jd_extras.js b/docs/html/jd_extras.js
index eb21dd9..9663fd0b 100644
--- a/docs/html/jd_extras.js
+++ b/docs/html/jd_extras.js
@@ -2783,6 +2783,19 @@
     "lang": "en",
     "group": "",
     "tags": [],
+    "url": "https://www.udacity.com/courses/ud876-3",
+    "timestamp": null,
+    "image": "distribute/images/advertising.jpg",
+    "title": "Learn how to show ads in your Android app",
+    "summary": "Take this online course to learn how to use AdMob to display ads in your Android app.",
+    "keywords": ["marketing", "analytics"],
+    "type": "distribute",
+    "titleFriendly": ""
+  },
+  {
+    "lang": "en",
+    "group": "",
+    "tags": [],
     "url": "https://developers.google.com/mobile-ads-sdk/download",
     "timestamp": null,
     "image": "distribute/images/advertising.jpg",
diff --git a/docs/html/jd_extras_en.js b/docs/html/jd_extras_en.js
index 54b77b0..53f0703 100644
--- a/docs/html/jd_extras_en.js
+++ b/docs/html/jd_extras_en.js
@@ -4447,6 +4447,7 @@
       "https://support.google.com/admob/topic/2784623",
       "https://admob.blogspot.com/",
       "https://analyticsacademy.withgoogle.com/mobile-app",
+      "https://www.udacity.com/courses/ud876-3"
     ]
   },
   "distribute/monetize/paymentmethods": {
diff --git a/docs/html/ndk/guides/cpp-support.jd b/docs/html/ndk/guides/cpp-support.jd
index 0074b80..f9d5171 100644
--- a/docs/html/ndk/guides/cpp-support.jd
+++ b/docs/html/ndk/guides/cpp-support.jd
@@ -170,23 +170,23 @@
 named {@code libgnustl_shared.so}.</p>
 
 
-<h3 id="cs">libC++ runtime:</h3>
+<h3 id="cs">libc++ runtime:</h3>
 <p>This runtime is an Android port of <a href="http://libcxx.llvm.org/">LLVM libc++</a>. Its
 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 turn 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,
-but you can force the NDK to rebuild {@code libc++} from sources by adding the following line to
-your {@code Application.mk} file, or setting it in your environment prior to building: </p>
+<p>The NDK provides prebuilt static and shared libraries for {@code libc++}, but you can force the
+NDK to rebuild {@code libc++} from sources by adding the following line to your
+{@code Application.mk} file, or setting it in your environment prior to building: </p>
 
 <pre>
 LIBCXX_FORCE_REBUILD := true
 </pre>
 
-<h4>atomic support</h4>
+<h4>Atomic support</h4>
 
 <p>If you include {@code &lt;atomic&gt;}, it's likely that you also need {@code libatomic}.
 If you are using {@code ndk-build}, add the following line:</p>
@@ -201,30 +201,28 @@
 -latomic
 </pre>
 
-<p class="note"><strong>Note: </strong>{@code -latomic} is only available for GCC 4.8.
-Because Clang 3.5 and Clang 3.6 use GCC 4.8's headers and libraries, as well as its
-{@code as} and {@code ld} options, those versions of Clang also get {@code -latomic}.</p>
-
 
 <h4>Compatibility</h4>
 
-<p>Around 99% of tests pass when compiling {@code libc++} with Clang 3.4 for all supported ABIs.
-The failures are mostly in the areas of {@code wchar_t} and locales that Android bionic
-doesn't support. Switching locale from the default produces the following warning in
-{@code logcat}:</p>
+<p>The NDK's libc++ is not stable. Not all the tests pass, and the test suite is not comprehensive.
+Some known issues are:</p>
+
+<ul>
+    <li>Using {@code c++_shared} on ARM can crash when an exception is thrown.</li>
+    <li>Support for {@code wchar_t} and the locale APIs is limited.</li>
+</ul>
+
+<p>You should also make sure to check the "Known Issues" section of the changelog for the NDK
+release you are using.</p>
+
+<p class="note"><strong>Warning: </strong>Attempting to change to an unsupported locale will
+<strong>not</strong> fail. The operation will succeed, but the locale will not change and the
+following message will appear in {@code logcat}.</p>
 
 <pre>
 newlocale() WARNING: Trying to set locale to en_US.UTF-8 other than "", "C" or "POSIX"
 </pre>
 
-<p>We do not recommend using {@code libc++} with GCC 4.6 because of GCC 4.6's limited c++11
-support.</p>
-
-<p>For information on {@code libc++} tests that fail to compile, {@code black_list*} in
-{@code $NDK/tests/device/test-libc++-shared-full/jni/Android.mk}. For information about tests
-that fail to run correctly, see {@code $NDK/tests/device/test-libc++-shared-full/BROKEN_RUN}.
-{@code $NDK}, here, is the your NDK installation's root directory.</p>
-
 
 <h2 id="ic">Important Considerations</h2>
 
diff --git a/docs/html/preview/_book.yaml b/docs/html/preview/_book.yaml
index e4f1aba..9f53866 100644
--- a/docs/html/preview/_book.yaml
+++ b/docs/html/preview/_book.yaml
@@ -70,6 +70,8 @@
     path: /preview/j8-jack.html
   - title: Android for Work Updates
     path: /preview/features/afw.html
+  - title: Scoped Directory Access
+    path: /preview/features/scoped-folder-access.html
 
 - title: Samples
   path: /preview/samples.html
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index 478f068..b81ea69 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -19,6 +19,7 @@
         <li><a href="#doze_on_the_go">Doze on the go</a></li>
         <li><a href="#background_optimizations">Background optimizations</a></li>
         <li><a href="#data_saver">Data Saver</a></li>
+        <li><a href="#vulkan">Vulkan API</a></li>
         <li><a href="#tile_api">Quick Settings Tile API</a></li>
         <li><a href="#number-blocking">Number-blocking</a></li>
         <li><a href="#call_screening">Call screening</a></li>
@@ -32,8 +33,10 @@
         <li><a href="#key_attestation">Key Attestation</a></li>
         <li><a href="#network_security_config">Network Security Config</a></li>
         <li><a href="#default_trusted_ca">Default Trusted CA</a></li>
-        <li><a href="apk_signature_v2">APK signature scheme v2</a></li>
+        <li><a href="#apk_signature_v2">APK signature scheme v2</a></li>
         <li><a href="#scoped_directory_access">Scoped directory access</a></li>
+        <li><a href="#launcher_shortcuts">Launcher shortcuts</a></li>
+        <li><a href="#print_svc">Print service enhancements</a></li>
       </ol>
 </div>
 </div>
@@ -305,6 +308,54 @@
 Saver and make an effort to limit foreground and background data usage.</p>
 
 
+<h2 id="vulkan">Vulkan API</h2>
+
+<p>
+  Android N integrates <a href="http://www.khronos.org/vulkan" class=
+  "external-link">Vulkan™</a>, a new 3D rendering API, into the platform. Like
+  <a href="https://www.khronos.org/opengles/" class="external-link">OpenGL™
+  ES</a>, Vulkan is an open standard for 3D graphics and rendering maintained
+  by the Khronos Group.
+</p>
+
+<p>
+  Vulkan is designed from the ground up to minimize CPU overhead in the driver,
+  and allow your application to control GPU operation more directly. Vulkan
+  also enables better parallelization by allowing multiple threads to perform
+  work such as command buffer construction at once.
+</p>
+
+<p>
+  Vulkan development tools and libraries are rolled into the Android NDK. They
+  include:
+</p>
+
+<ul>
+  <li>Headers
+  </li>
+
+  <li>Validation layers (debug libraries)
+  </li>
+
+  <li>SPIR-V shader compiler
+  </li>
+
+  <li>SPIR-V runtime shader compilation library
+  </li>
+</ul>
+
+<p>
+  Vulkan is only available to apps on devices with Vulkan-capable hardware,
+  such as Nexus 5X, Nexus 6P, and Nexus Player. We're working closely with our
+  partners to bring Vulkan to more devices as soon as possible.
+</p>
+
+<p>
+  For more information, see the <!-- TODO: Insert link to blog post -->Vulkan
+  Developer Tools blog post or the <a href=
+  "{@docRoot}ndk/guides/graphics/index.html">API documentation</a> itself.
+</p>
+
 <h2 id="tile_api">Quick Settings Tile API</h2>
 
 
@@ -482,7 +533,8 @@
 <h3 id="work_profile_security_challenge">Work profile security challenge </h3>
 
 <p>
-  Profile owners can specify a separate security challenge for apps running in
+  Profile owners targeting the N SDK
+  can specify a separate security challenge for apps running in
   the work profile. The work challenge is shown when a user attempts to open
   any work apps. Successful completion of the security challenge unlocks the
   work profile and decrypts it if necessary. For profile owners,
@@ -492,7 +544,7 @@
 </p>
 
 <p>
-  Profile owners can set distinct password policies for the work challenge
+  Profile owners can set distinct passcode policies for the work challenge
   (such as how long the PIN needs to be, or whether a fingerprint can be used
   to unlock the profile) using the <code>setPasswordQuality()</code>,
   <code>setPasswordMinimumLength()</code> and related methods. The profile
@@ -534,6 +586,16 @@
   <strong>Settings&gt;More&gt;Vpn</strong>.
 </p>
 
+<h3 id="custom_provisioning">Customized provisioning</h3>
+
+<p>
+  An application can customize the profile owner and device owner provisioning
+  flows with corporate colors and logos.
+  <code>DevicePolicyManager.EXTRA_PROVISIONING_MAIN_COLOR</code> customizes
+  flow color. <code>DevicePolicyManager.EXTRA_PROVISIONING_LOGO_URI</code>
+  customizes the flow with a corporate logo.
+</p>
+
 <h2 id="accessibility_enhancements">Accessibility enhancements</h2>
 
 <p>Android N now offers Vision Settings directly on the Welcome screen for new
@@ -696,8 +758,99 @@
 <a href="{@docRoot}preview/features/scoped-folder-access.html">Scoped
 Directory Access</a> developer documentation.</p>
 
+<h2 id="launcher_shortcuts">
+  Launcher shortcuts
+</h2>
 
+<p>
+  Android N allows apps to define action-specific shortcuts which can be
+  displayed in the launcher. These <em>launcher shortcuts</em> let your users
+  quickly start common or recommended tasks within your app. Each shortcut
+  contains an <a href=
+  "{@docRoot}guide/components/intents-filters.html">intent</a>, which links the
+  shortcut to a specific action in your app. Examples of these actions include:
+</p>
 
+<ul>
+  <li>Navigating users to a particular location in a mapping app.
+  </li>
 
+  <li>Sending messages to a friend in a communication app.
+  </li>
 
+  <li>Playing the next episode of a TV show in a media app.
+  </li>
 
+  <li>Loading the last save point in a gaming app.
+  </li>
+</ul>
+
+<p>
+  Your app can create up to five <em>dynamic shortcuts</em>. When users perform
+  a gesture over your app's launcher icon, these shortcuts appear. By dragging
+  the shortcuts onto the launcher, users can make persistent copies of the
+  shortcuts, called <em>pinned shortcuts</em>. Users can create an unlimited
+  number of pinned shortcuts for each app.
+</p>
+
+<p class="note">
+  <strong>Note:</strong> Although other apps can't access your shortcut data,
+  the launcher <strong>does</strong> have access to this data. Therefore, the
+  shortcuts you create should conceal sensitive user information.
+</p>
+
+<p>
+  You can use this command to view your app's shortcuts:
+</p>
+
+<pre class="no-pretty-print">
+$ adb shell dumpsys shortcut
+</pre>
+
+<p>
+  To update all shortcuts and to delete dynamic shortcuts, use the appropriate
+  methods that the Launcher Shortcut API provides. For more details about this
+  API, see <code>android.content.pm.ShortcutManager</code> in the downloadable
+  <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
+</p>
+
+<h2 id="print_svc">Print Service Enhancements</h2>
+
+<p>
+  In Android N, print service developers can now surface additional information
+  about individual printers and print jobs.
+</p>
+
+<p>
+  When listing individual printers, a print service can now set per-printer
+  icons in two ways:
+</p>
+
+<ul>
+  <li>You can set an icon from a resource ID by calling
+  <code>PrinterInfo.Builder.setResourceIconId()</code>
+  </li>
+
+  <li>You can show an icon from the network by calling
+  <code>PrinterInfo.Builder.setHasCustomPrinterIcon()</code>, and setting a
+  callback for when the icon is requested using
+  <code>android.printservice.PrinterDiscoverySession.onRequestCustomPrinterIcon()</code>
+  </li>
+</ul>
+
+<p>
+  In addition, you can provide a per-printer activity to display additional
+  information by calling <code>PrinterInfo.Builder.setInfoIntent()</code>.
+</p>
+
+<p>
+  You can indicate the progress and status of print jobs in the print job
+  notification by calling
+  <code>android.printservice.PrintJob.setProgress()</code> and
+  <code>android.printservice.PrintJob.setStatus()</code>, respectively.
+</p>
+
+<p>
+  For more information about these methods, see the downloadable <a href=
+  "{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
+</p>
diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd
index 245fa88..ee17c45 100644
--- a/docs/html/preview/behavior-changes.jd
+++ b/docs/html/preview/behavior-changes.jd
@@ -31,6 +31,8 @@
   </li>
   <li><a href="#ndk">NDK Apps Linking to Platform Libraries</a></li>
   <li><a href="#afw">Android for Work</a></li>
+  <li><a href="#annotations">Annotations Retention</a></li>
+  <li><a href="#other">Other Important Points</a></li>
 </ol>
 
 <h2>See Also</h2>
@@ -184,7 +186,6 @@
   Optimizations</a>.
 </p>
 
-
 <h2 id="perm">Permissions Changes</h2>
 
 <p>
@@ -467,7 +468,7 @@
 
   <li>Reset password restrictions for device admins now apply to profile
   owners. Device admins can no longer use
-  <code>DevicePolicyManager.resetPassword()</code> to clear passwords or change
+  {@code DevicePolicyManager.resetPassword()} to clear passwords or change
   ones that are already set. Device admins can still set a password, but only
   when the device has no password, PIN, or pattern.
   </li>
@@ -497,7 +498,26 @@
   <a href="{@docRoot}preview/features/afw.html">Android for Work Updates</a>.
 </p>
 
-<h2 id="other">Other important points</h2>
+<h2 id="annotations">Annotations Retention</h2>
+
+<p>
+Android N fixes a bug where the visibility of annotations was being ignored.
+This issue enabled the runtime to access annotations that it should not have been
+able to. These annotations included:
+</p>
+
+<ul>
+   <li>{@code VISIBILITY_BUILD}: Intended to be visible only at build time.</li>
+   <li>{@code VISIBILITY_SYSTEM}: Intended to be visible at runtime, but only to the
+   underlying system.</li>
+</ul>
+
+<p>
+If your app has relied on this behavior, please add a retention policy to annotations that must
+be available at runtime. You do so by using {@code @Retention(RetentionPolicy.RUNTIME)}.
+</p>
+
+<h2 id="other">Other Important Points</h2>
 
 <ul>
 <li>When an app is running on Android N, but targets a lower API level,
@@ -525,5 +545,31 @@
 <strong>Display</strong> > <strong>Font size</strong>), and then restoring
 the app from Recents.
 </li>
+
+<li>
+Due to a bug in previous versions of Android, the system did not flag writing
+to a TCP socket on the main thread as a strict-mode violation. Android N fixes this bug.
+Apps that exhibit this behavior now throw an {@code android.os.NetworkOnMainThreadException}.
+Generally, performing network operations on the main thread is a bad idea because these operations
+usually have a high tail latency that causes ANRs and jank.
+</li>
+
+<li>
+The {@code Debug.startMethodTracing()} family of methods now defaults to
+storing output in your package-specific directory on shared storage,
+instead of at the top level
+of the SD card.  This means apps no longer need to request the {@code WRITE_EXTERNAL_STORAGE} permission to use these APIs.
+</li>
+
+<li>
+Many platform APIs have now started checking for large payloads being sent
+across {@link android.os.Binder} transactions, and the
+system now rethrows {@code TransactionTooLargeExceptions}
+as {@code RuntimeExceptions}, instead of silently logging or suppressing them.  One
+common example is storing too much data in
+{@link android.app.Activity#onSaveInstanceState Activity.onSaveInstanceState()},
+which causes {@code ActivityThread.StopInfo} to throw a
+{@code RuntimeException} when your app targets Android N.
+</li>
 </ul>
 
diff --git a/docs/html/preview/features/afw.jd b/docs/html/preview/features/afw.jd
index 24f67ef..dc53bd9 100644
--- a/docs/html/preview/features/afw.jd
+++ b/docs/html/preview/features/afw.jd
@@ -142,13 +142,15 @@
 
 <p>
   Device owners and profile owners can temporarily suspend access to packages
-  by calling the new <code>DevicePolicyManager.getPackagesSuspended()</code>
-  method.Owners can use the same method to re-enable those packages.
+  by calling the new <code>DevicePolicyManager.setPackagesSuspended()</code>
+  method. Owners can use the same method to re-enable those packages.
 </p>
 
 <p>
-  While a package is suspended, it cannot start activities, and notifications
-  to the package are suppressed. Suspended packages do not show in the <a href=
+  While a package is suspended, it cannot start activities, notifications to
+  the package are suppressed, and the app's entry in the <a
+  href="{@docRoot}guide/components/recents.html">overview screen</a> is hidden.
+  Suspended packages do not show in the <a href=
   "{@docRoot}guide/components/recents.html">overview screen</a>, and they
   cannot show dialogs (including toasts and snackbars). They also cannot play
   audio or vibrate the device.
@@ -157,19 +159,22 @@
 <p>
   Launchers should apply a distinctive UI to suspended apps to show that the
   apps aren't currently available; for example, they might render the app icon
-  in gray. Launchers can find out which apps are suspended by calling the new
-  <code>DevicePolicyManager.getPackagesSuspended()</code> method.
+  in gray. Launchers can find out if an app is suspended by calling the new
+  <code>DevicePolicyManager.getPackageSuspended()</code> method.
 </p>
 
 <h2 id="toggle-work">Toggle Work Mode</h2>
 
-<p>On dual-profile devices, users can toggle work mode on and off. While work
-  mode is turned off, the managed profile is temporarily shut down. Work profile apps, background sync, and notifications are all disabled, including the profile
-  owner app. While the work profile is disabled, the system  displays a persistent status icon to remind users that they can't launch work apps. The system launcher
-  indicates that work apps and widgets are not accessible.
+<p>
+  On dual-profile devices, users can toggle work mode on and off. While work
+  mode is turned off, the managed profile is temporarily shut down. Work
+  profile apps, background sync, and notifications are all disabled, including
+  the profile owner app. While the work profile is disabled, the system
+  displays a persistent status icon to remind users that they can't launch work
+  apps. The system launcher indicates that work apps and widgets are not
+  accessible.
 </p>
 
-
 <h2 id="always-on-vpn">Always-On VPN</h2>
 
 <p>
@@ -270,29 +275,36 @@
   Device owners can identify suspicious activity by remotely tracking device
   activity, including app launches, adb activity, and screen unlocks. Process
   logs don’t require user consent. To retrieve logs, device owners enable
-  device logging using <code>setDeviceLoggingEnabled()</code>.
+  device logging using <code>DevicePolicyManager.setSecurityLoggingEnabled()</code>.
 </p>
 
 <p>
-  The new <code>android.auditing.SecurityLog</code> class includes these
-  methods:
+  API changes include:
 </p>
 
 <ul>
+
   <li>
-    <code>void DevicePolicyManager.setDeviceLoggingEnabled()</code>
+    The new class <code>android.app.admin.SecurityLog</code> and its
+    methods
   </li>
 
   <li>
-    <code>boolean DevicePolicyManager.getDeviceLoggingEnabled()</code>
+    <code>void DevicePolicyManager.setSecurityLoggingEnabled()</code>
   </li>
 
   <li>
-    <code>List DevicePolicyManager.retrieveDeviceLogs()</code>
+    <code>boolean DevicePolicyManager.isSecurityLoggingEnabled()</code>
   </li>
 
   <li>
-    <code>List DevicePolicyManager.retrievePreviousDeviceLogs()</code>
+    <code>List&lt;SecurityEvent&gt;
+      DevicePolicyManager.retrieveSecurityLogs()</code>
+  </li>
+
+  <li>
+    <code>List&lt;SecurityEvent&gt;
+      DevicePolicyManager.retrievePreRebootSecurityLogs()</code>
   </li>
 
   <li>
@@ -475,7 +487,7 @@
 
 <p>
   Device owners can provide owner information to be shownon the lockscreen.
-  This information takes precedence the user lock screen message (if one is
+  This information takes precedence over the user lock screen message (if one is
   set). New {@link android.app.admin.DevicePolicyManager} methods are:
 </p>
 
diff --git a/docs/html/preview/features/background-optimization.jd b/docs/html/preview/features/background-optimization.jd
index e415bd3..79ba5c8 100644
--- a/docs/html/preview/features/background-optimization.jd
+++ b/docs/html/preview/features/background-optimization.jd
@@ -112,7 +112,7 @@
 <p class="note">
   <strong>Note:</strong> A {@link android.content.BroadcastReceiver} registered with
   {@link android.content.Context#registerReceiver Context.registerReceiver()}
-  continues to receive these broadcasts while the app is in the foreground.
+  continues to receive these broadcasts while the app is running.
 </p>
 
 <h3 id="sched-jobs">
@@ -269,7 +269,7 @@
           MY_BACKGROUND_JOB,
           new ComponentName(context, MediaContentJob.class));
   builder.addTriggerContentUri(
-          new JobInfo.TriggerContentUri(MEDIA_URI,
+          new JobInfo.TriggerContentUri(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
           JobInfo.TriggerContentUri.FLAG_NOTIFY_FOR_DESCENDANTS));
   js.schedule(builder.build());
 }
diff --git a/docs/html/preview/features/direct-boot.jd b/docs/html/preview/features/direct-boot.jd
index aefa4dc..d1530d7 100644
--- a/docs/html/preview/features/direct-boot.jd
+++ b/docs/html/preview/features/direct-boot.jd
@@ -58,7 +58,7 @@
 can run during Direct Boot mode or access device encrypted
 storage. Apps register with the system by marking components as
 <i>encryption aware</i>. To mark your component as encryption aware, set the
-<code>android:encryptionAware</code> attribute to true in your manifest.<p>
+<code>android:directBootAware</code> attribute to true in your manifest.<p>
 
 <p>Encryption aware components can register to receive a
 <code>LOCKED_BOOT_COMPLETED</code> broadcast message from the
@@ -72,7 +72,7 @@
 
 <pre>
 &lt;receiever
-  android:encryptionAware="true" &gt;
+  android:directBootAware="true" &gt;
   ...
   &lt;intent-filter&gt;
     &lt;action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" /&gt;
@@ -87,13 +87,13 @@
 
 <p>To access device encrypted storage, create a second
 {@link android.content.Context} instance by calling
-<code>Context.createDeviceEncryptedStorageContext()</code>. All storage API
+<code>Context.createDeviceProtectedStorageContext()</code>. All storage API
 calls made using this context access the device encrypted storage. The
 following example accesses the device encrypted storage and opens an existing
 app data file:</p>
 
 <pre>
-Context directBootContext = Context.createDeviceEncryptedStorageContext();
+Context directBootContext = appContext.createDeviceProtectedStorageContext();
 // Access appDataFilename that lives in device encrypted storage
 FileInputStream inStream = directBootContext.openFileInput(appDataFilename);
 // Use inStream to read content...
@@ -125,8 +125,8 @@
 
 <p>If a user updates their device to use Direct Boot mode, you might have
 existing data that needs to get migrated to device encrypted storage. Use
-<code>Context.migrateSharedPreferencesFrom()</code> and
-<code>Context.migrateDatabaseFrom()</code> to migrate preference and database
+<code>Context.moveSharedPreferencesFrom()</code> and
+<code>Context.moveDatabaseFrom()</code> to migrate preference and database
 data between credential encrypted storage and device encrypted storage.</p>
 
 <p>Use your best judgment when deciding what data to migrate from credential
diff --git a/docs/html/preview/features/multi-window.jd b/docs/html/preview/features/multi-window.jd
index 0fe5ecf..0773b32 100644
--- a/docs/html/preview/features/multi-window.jd
+++ b/docs/html/preview/features/multi-window.jd
@@ -251,7 +251,7 @@
   </dd>
 
   <dt>
-    <code>android:minimalSize</code>
+    <code>android:minimalHeight</code>, <code>android:minimalWidth</code>
   </dt>
 
   <dd>
@@ -273,7 +273,8 @@
     &lt;layout android:defaultHeight="500dp"
           android:defaultWidth="600dp"
           android:gravity="top|end"
-          android:minimalSize="450dp" /&gt;
+          android:minimalHeight="450dp"
+          android:minimalWidth="300dp" /&gt;
 &lt;/activity&gt;
 </pre>
 
@@ -308,12 +309,13 @@
 <p>
   The following new methods have been added to the {@link android.app.Activity}
   class to support multi-window display. For details on each method, see the
-  <a href="{@docRoot}preview/setup-sdk.html#docs-dl">N Preview SDK Reference</a>.
+  <a href="{@docRoot}preview/setup-sdk.html#docs-dl">N Preview SDK
+  Reference</a>.
 </p>
 
 <dl>
   <dt>
-    <code>Activity.inMultiWindow()</code>
+    <code>Activity.isInMultiWindowMode()</code>
   </dt>
 
   <dd>
@@ -321,7 +323,7 @@
   </dd>
 
   <dt>
-    <code>Activity.inPictureInPicture()</code>
+    <code>Activity.isInPictureInPictureMode()</code>
   </dt>
 
   <dd>
@@ -329,14 +331,14 @@
 
     <p class="note">
       <strong>Note:</strong> Picture-in-picture mode is a special case of
-      multi-window mode. If <code>myActivity.inPictureInPicture()</code>
-      returns true, then <code>myActivity.inMultiWindow()</code> also returns
-      true.
+      multi-window mode. If <code>myActivity.isInPictureInPictureMode()</code>
+      returns true, then <code>myActivity.isInMultiWindowMode()</code> also
+      returns true.
     </p>
   </dd>
 
   <dt>
-    <code>Activity.onMultiWindowChanged()</code>
+    <code>Activity.onMultiWindowModeChanged()</code>
   </dt>
 
   <dd>
@@ -347,7 +349,7 @@
   </dd>
 
   <dt>
-    <code>Activity.onPictureInPictureChanged()</code>
+    <code>Activity.onPictureInPictureModeChanged()</code>
   </dt>
 
   <dd>
@@ -360,14 +362,14 @@
 
 <p>
   There are also {@link android.app.Fragment} versions of each of these
-  methods, for example <code>Fragment.inMultiWindow()</code>.
+  methods, for example <code>Fragment.isInMultiWindowMode()</code>.
 </p>
 
 <h3 id="entering-pip">Entering picture-in-picture mode</h3>
 
 <p>
   To put an activity in picture-in-picture mode, call the new method
-  <code>Activity.enterPictureInPicture()</code>. This method has no effect if
+  <code>Activity.enterPictureInPictureMode()</code>. This method has no effect if
   the device does not support picture-in-picture mode. For more information,
   see the <a href="picture-in-picture.html">Picture-in-Picture</a> documentation.
 </p>
diff --git a/docs/html/preview/features/multilingual-support.jd b/docs/html/preview/features/multilingual-support.jd
index ac96452..89ecd5d 100644
--- a/docs/html/preview/features/multilingual-support.jd
+++ b/docs/html/preview/features/multilingual-support.jd
@@ -188,7 +188,7 @@
 <h2 id="design">Designing your App to Support Additional Locales</h2>
 <h3>LocaleList API</h3>
 
-<p>Android N adds a new API {@code LocaleList.GetDefault()}
+<p>Android N adds a new API {@code LocaleList.getDefault()}
 that lets apps directly query the list of languages a user has specified. This API
 allows you to create more sophisticated
  app behavior and better-optimized display of content. For example, Search
diff --git a/docs/html/preview/features/picture-in-picture.jd b/docs/html/preview/features/picture-in-picture.jd
index 106ad8b..893f8c1 100644
--- a/docs/html/preview/features/picture-in-picture.jd
+++ b/docs/html/preview/features/picture-in-picture.jd
@@ -99,15 +99,15 @@
 <h2 id="pip_button">Switching Your Activity to Picture-in-picture</h2>
 
 When you need to switch your activity into PIP mode, call
-<code>Activity.enterPictureInPicture()</code>. The following example switches
-to PIP mode when the user selects a dedicated PIP button on a media control
-bar:</p>
+<code>Activity.enterPictureInPictureMode()</code>. The following example
+switches to PIP mode when the user selects a dedicated PIP button on a media
+control bar:</p>
 
 <pre>
 &#64;Override
 public void onActionClicked(Action action) {
     if (action.getId() == R.id.lb_control_picture_in_picture) {
-        getActivity().enterPictureInPicture();
+        getActivity().enterPictureInPictureMode();
         return;
     }
     ...
@@ -129,14 +129,14 @@
 <p>When your activity enters PIP mode, your activity should only show video
 playback. Remove UI elements before your activity enters PIP,
 and restore these elements when your activity becomes full-screen again.
-Override <code>Activity.onPictureInPictureChanged()</code> or
-<code>Fragment.onPictureInPictureChanged()</code> and enable or
+Override <code>Activity.onPictureInPictureModeChanged()</code> or
+<code>Fragment.onPictureInPictureModeChanged()</code> and enable or
 disable your UI elements as needed, for example:</p>
 
 <pre>
 &#64;Override
-public void onPictureInPictureChanged(boolean inPictureInPicture) {
-    if (inPictureInPicture) {
+public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
+    if (isInPictureInPictureMode) {
         // Hide the controls in picture-in-picture mode.
         ...
     } else {
@@ -159,8 +159,8 @@
 <pre>
 &#64;Override
 public void onPause() {
-    // If called due to PIP, do not pause playback
-    if (inPictureInPicture()) {
+    // If called while in PIP mode, do not pause playback
+    if (isInPictureInPictureMode()) {
         // Continue playback
         ...
     }
diff --git a/docs/html/preview/features/scoped-folder-access.jd b/docs/html/preview/features/scoped-folder-access.jd
index 932d8a9..814692d 100644
--- a/docs/html/preview/features/scoped-folder-access.jd
+++ b/docs/html/preview/features/scoped-folder-access.jd
@@ -44,6 +44,14 @@
 all available volumes, including removable media volumes, use
 <code>StorageManager.getVolumesList()</code>.</p>
 
+<p>
+On secondary volumes, such as external SD cards, pass in null when calling
+<code>StorageVolume.createAccessIntent()</code> to request access to the entire
+volume, instead of a specific directory.
+<code>StorageVolume.createAccessIntent()</code> returns null if you pass in
+null to the primary volume, or if you pass in an invalid directory name.
+</p>
+
 <p>The following code snippet is an example of how to open the
 <code>Pictures</code> directory in the primary shared storage:</p>
 
@@ -122,4 +130,15 @@
 
 <p>If the user denies access to an external directory, do not immediately
 request access again. Repeatedly insisting on access results in a poor user
-experience.</p>
+experience. If a request is denied by the user, and the app requests access
+again, the UI displays a <b>Don't ask again</b> checkbox:</p>
+
+<img src="{@docRoot}preview/images/scoped-folder-access-dont-ask.png"
+srcset="{@docRoot}preview/images/scoped-folder-access-dont-ask.png 1x,
+{@docRoot}preview/images/scoped-folder-access-dont-ask_2x.png 2x" />
+<p class="img-caption"><strong>Figure 1.</strong> An application making a
+second request for access to removable media.</p>
+
+<p>If the user selects <b>Don't ask again</b> and denies the request, all
+future requests for the given directory from your app will be automatically
+denied, and no request UI will be presented to the user.</p>
\ No newline at end of file
diff --git a/docs/html/preview/features/security-config.jd b/docs/html/preview/features/security-config.jd
index 607e8f3..42c4ff5 100644
--- a/docs/html/preview/features/security-config.jd
+++ b/docs/html/preview/features/security-config.jd
@@ -70,12 +70,13 @@
 
 <pre>
 &lt;?xml version="1.0" encoding="utf-8"?&gt;
-...
-&lt;application ...&gt;
+&lt;manifest ... &gt;
+  &lt;application ... &gt;
     &lt;meta-data android:name="android.security.net.config"
                android:resource="@xml/network_security_config" /&gt;
     ...
-&lt;/application&gt;
+  &lt;/application&gt;
+&lt;/manifest&gt;
 </pre>
 
 <h2 id="CustomTrust">Customizing Trusted CAs</h2>
diff --git a/docs/html/preview/images/scoped-folder-access-dont-ask.png b/docs/html/preview/images/scoped-folder-access-dont-ask.png
new file mode 100644
index 0000000..5c505d9
--- /dev/null
+++ b/docs/html/preview/images/scoped-folder-access-dont-ask.png
Binary files differ
diff --git a/docs/html/preview/images/scoped-folder-access-dont-ask_2x.png b/docs/html/preview/images/scoped-folder-access-dont-ask_2x.png
new file mode 100644
index 0000000..612b69f
--- /dev/null
+++ b/docs/html/preview/images/scoped-folder-access-dont-ask_2x.png
Binary files differ
diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd
index 935eb1a..15dae75 100644
--- a/docs/html/preview/overview.jd
+++ b/docs/html/preview/overview.jd
@@ -362,7 +362,7 @@
   <li> <a href="https://code.google.com/p/android-developer-preview/">N 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
-<a href="{@docRoot}preview/bug">known issues</a> and
+<a href="{@docRoot}preview/bugs">known issues</a> and
     find workaround steps. We’ll keep you updated on your issue as it’s triaged and sent to
     the Android engineering team for review. </li>
   <li> The <a href="{@docRoot}preview/dev-community">Android N Developer Community</a> is
diff --git a/docs/html/preview/preview_toc.cs b/docs/html/preview/preview_toc.cs
index f96bf1f..cf38f70 100644
--- a/docs/html/preview/preview_toc.cs
+++ b/docs/html/preview/preview_toc.cs
@@ -17,7 +17,7 @@
     <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/support.html">
       Support and Release Notes</a></div>
   </li>
-  
+
   <li class="nav-section">
     <div class="nav-section-header empty"><a href="<?cs var:toroot ?>preview/setup-sdk.html"
       es-lang="Configurar el SDK de la versión preliminar"
@@ -82,12 +82,15 @@
 
         <li><a href="<?cs var:toroot ?>preview/features/icu4j-framework.html"
         >ICU4J Support</a></li>
-        
+
         <li><a href="<?cs var:toroot ?>preview/j8-jack.html"
         >Java 8 Language Features</a></li>
 
         <li><a href="<?cs var:toroot ?>preview/features/afw.html"
         >Android for Work Updates</a></li>
+
+        <li><a href="<?cs var:toroot ?>preview/features/scoped-folder-access.html"
+        >Scoped Directory Access</a></li>
       </ul>
   </li>
 
diff --git a/docs/html/preview/setup-sdk.jd b/docs/html/preview/setup-sdk.jd
index 28c4709..2793d59 100644
--- a/docs/html/preview/setup-sdk.jd
+++ b/docs/html/preview/setup-sdk.jd
@@ -15,7 +15,7 @@
       <li><a href="#docs-dl">Reference documentation</a>
     </ol>
   </li>
-  <li><a href="#java8">Get the Java 8 JDK and JRE</a></li>
+  <li><a href="#java8">Get the Java 8 JDK</a></li>
   <li><a href="#create-update">Update or Create a Project</a></li>
   <li><a href="#next">Next Steps</a></li>
 </ol>
@@ -150,13 +150,11 @@
 
 
 
-<h2 id="java8">Get the Java 8 JDK and JRE</h2>
+<h2 id="java8">Get the Java 8 JDK</h2>
 
-<p>To compile your app against the Android N platform, you need to use
-the Java 8 Developer Kit (JDK 8), and in order to use some tools with Android
-Studio 2.1, you need to install the Java 8 Runtime Environment (JRE 8). So, if
-you don't have the latest version of each already, download JDK 8 and JRE 8
-now.</p>
+<p>To compile your app against the Android N platform and use some tools with
+Android Studio 2.1, you need to install the Java 8 Developer Kit (JDK 8). So, if
+you don't already have the latest version, download JDK 8 now.</p>
 
 <p>Then set the JDK version in Android Studio as follows:</p>
 
diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd
index 3945ecd..50b6083 100644
--- a/docs/html/preview/support.jd
+++ b/docs/html/preview/support.jd
@@ -16,6 +16,222 @@
 <p>To discuss issues or ideas with other developers working with Android N, join the
 <a href="{@docRoot}preview/dev-community">Developer Preview Google+ community</a>.</p>
 
+<h2 id="dp2">Developer Preview 2</h2>
+
+<div class="wrap">
+  <div class="cols">
+    <div class="col-6of12">
+      <p>
+        <em>Date: April 2016<br>
+        Builds: NPC91K<br>
+        Emulator support: x86 &amp; ARM (32/64-bit)<br>
+        Google Play services: 8.4</em>
+      </p>
+    </div>
+  </div>
+</div>
+
+<h3 id="new">New in DP2</h3>
+
+<ul>
+  <li>Platform support for Vulkan, a new 3D rendering API that provides
+  explicit, low-overhead GPU (Graphics Processor Unit) control and offers
+  improved performance for draw-call heavy applications. For details, see the
+  <a href="{@docRoot}ndk/guides/graphics/index.html">documentation</a>.
+  </li>
+
+  <li>New people emoji with support for skin tones, and new Unicode 9 glyphs.
+  Skin tone and new emoji will not show up until keyboards build support for
+  them in the palette. Apps should not need to take any action to take
+  advantage of these new emoji, unless the apps use a non-system font. IME
+  developers need to incorporate support for the new emoji.
+  </li>
+
+  <li>
+    <a href="{@docRoot}preview/api-overview.html#launcher_shortcuts">Launcher
+    Shortcuts API</a>: Apps can use <code>ShortcutManager</code> to send
+    shortcuts to starting points within themselves to the launcher.
+  </li>
+
+  <li>
+    <a href="{@docRoot}preview/features/multi-window.html">Multi-Window</a>:
+    You can now specify a separate minimum height and minimum width for an
+    activity. In addition, several API names have been slightly changed.
+  </li>
+</ul>
+
+<h4 id="dp2-fixes">Fixes for issues reported by developers</h4>
+
+<p>
+  A number of issues reported by developers have been fixed, including:
+</p>
+
+<ul>
+  <li>Can’t connect to hidden SSID or non-broadcast Wi-Fi (bug <a href=
+  "https://code.google.com/p/android/issues/detail?id=203116">203116</a>)
+  </li>
+
+  <li>Microphone mute state persists across activities (bug <a href=
+  "https://code.google.com/p/android/issues/detail?id=205922">205922</a>)
+  </li>
+
+  <li>Changing Multiwindow focus pauses YouTube (bug <a href=
+  "https://code.google.com/p/android/issues/detail?id=203424">203424</a>)
+  </li>
+
+  <li>Direct Reply may close open activity (bug <a href=
+  "https://code.google.com/p/android/issues/detail?id=204411">204411</a>)
+  </li>
+
+  <li>Various stability fixes
+  </li>
+</ul>
+
+<h3 id="general">General advisories</h3>
+
+<p>
+  This Developer Preview release is for <strong>app developers only</strong>
+  and is designed for use in compatibility testing and early development only.
+  Please be aware of these general notes about the release:
+</p>
+
+<ul>
+  <li>This release has various stability and performance issues on all devices
+  that make it <strong>not suitable for daily use on phone or tablet</strong>,
+  especially for non-developers.
+  </li>
+
+  <li>Battery life and performance have not yet been optimized with this
+  release:
+
+    <ul>
+      <li>System and app <strong>performance is known to be periodically slow /
+      janky</strong>, and devices may become occasionally unresponsive. These
+      problems may become more acute with prolonged use.
+      </li>
+
+      <li>Battery life may be regressed in this release for screen-on and
+      screen-off use cases.
+      </li>
+    </ul>
+  </li>
+
+  <li>Some <strong>apps may not function normally</strong> on Developer Preview
+  2. This includes Google’s apps as well as other apps.
+  </li>
+
+  <li>This early build is not <strong>Compatibility Test Suite (CTS)
+  approved</strong>. Apps that depend on CTS approved builds won’t work
+  (Android Pay for example).
+  </li>
+
+  <li>This preview release supports the following devices: Nexus 5X, Nexus 6,
+  Nexus 6P, Nexus 9, and Pixel C, as well as General Mobile 4G
+  (Android One). Support for Nexus Player is coming soon.
+  </li>
+</ul>
+
+<h3 id="ki">Known Issues</h3>
+
+<h4>Performance and battery</h4>
+
+<ul>
+  <li>System and app performance is known to be <strong>periodically slow /
+  janky</strong>, and device may become occasionally unresponsive. These
+  problems may become more acute with prolonged use.
+  </li>
+</ul>
+
+<h4>Google accounts</h4>
+
+<ul>
+  <li>In some circumstances, there can be issues with
+  <code>AccountManagerService</code> that prevent logging in to Google accounts
+  </li>
+</ul>
+
+<h4>System update</h4>
+
+<ul>
+  <li>Device may restart immediately after updating to DP2.
+  </li>
+</ul>
+
+<h4>Accessibility</h4>
+
+<ul>
+  <li>Problem with listening to text-to-speech (TTS) output when pitch is set
+  near maximum level.
+  </li>
+</ul>
+
+<h4>Bluetooth</h4>
+
+<ul>
+  <li>Bluetooth Low Energy (LE) GATT characteristics are using the wrong write
+  type and will not be sent to a remote device. Thus, for example, some fitness
+  devices will not work.
+  </li>
+</ul>
+
+
+<h4>Setup wizard</h4>
+
+<ul>
+  <li>The option to restore data on a new device (or newly reset device) from
+  "Your Google Account" is not actionable in the setup wizard. You must restore
+  data from an existing device using NFC or set it up as a new device.
+  </li>
+</ul>
+
+<h4>App compatibility</h4>
+
+<ul>
+  <li>Tapping on the image of a product in the Amazon app to enlarge it causes
+  the app to crash.
+  </li>
+
+  <li>"The Spectator" app crashes on launch.
+  </li>
+
+  <li>May be unable to open downloaded archives in the Downloads app.
+  </li>
+
+  <li>Calendar app crashes on docking to multi-window.
+  </li>
+</ul>
+
+<h4>Device-specific issues</h4>
+
+
+<dl>
+  <dt>
+    <strong>Seed</strong>
+  </dt>
+
+  <dd>
+    Data connection fails when device is switched from slot 1 to slot 2 SIM.
+  </dd>
+
+  <dt>
+    <strong>Ryu</strong>
+  </dt>
+
+  <dd>
+    Unable to toggle Voice Search "Always On" option.
+  </dd>
+
+  <dt>
+    <strong>Shamu</strong>
+  </dt>
+
+  <dd>
+    Camera pictures in portrait orientation are corrupted, except for HDR+
+    photos.
+  </dd>
+</dl>
+
+<!-- DP 1 release notes archive -->
 
 <h2 id="dp1">Developer Preview 1</h2>
 
@@ -32,7 +248,7 @@
   </div>
 </div>
 
-<h3 id="general">General advisories</h3>
+<h3 id="dp1-general">General advisories</h3>
 
 <p>
   This Developer Preview release is for app developers only and is designed for
@@ -68,7 +284,7 @@
   </li>
 </ul>
 
-<h3 id="platform">Platform Issues</h3>
+<h3 id="dp1-platform">Platform Issues</h3>
 
 <h4 id="performance">Performance and battery</h4>
 
@@ -152,7 +368,7 @@
         Google Apps Device Policy</a> that is bundled with N Developer Preview
         does not yet support the Work Profile Security Challenge feature.
         Developers should instead use <a href=
-        "https://play.google.com/store/apps/details?id=com.afwsamples.testdpc">TestDPC</a>
+        "https://github.com/googlesamples/android-testdpc/releases">TestDPC</a>
         to test this feature.
       </li>
     </ul>
diff --git a/docs/html/sdk/index.jd b/docs/html/sdk/index.jd
index e95d6c8..ddc6e14 100644
--- a/docs/html/sdk/index.jd
+++ b/docs/html/sdk/index.jd
@@ -484,14 +484,15 @@
 <div class="col-2of6">
 <h4>Windows</h4>
 <ul>
-<li>Microsoft&reg;  Windows&reg;  7/8/10 (32 or 64-bit)</li>
+<li>Microsoft&reg;  Windows&reg;  7/8/10 (32- or 64-bit)</li>
 <li>2 GB RAM minimum, 8 GB RAM recommended</li>
 <li>2 GB of available disk space minimum,<br>4 GB Recommended
 (500 MB for IDE + 1.5 GB for
 Android SDK and emulator system image)</li>
 <li>1280 x 800  minimum screen resolution</li>
 <li>Java Development Kit (JDK) 8</li>
-<li>Optional for accelerated emulator: Intel® processor with support for Intel®
+<li>For accelerated emulator: 64-bit operating system and
+Intel® processor with support for Intel®
 VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality</li>
 </ul>
 </div>
@@ -515,6 +516,7 @@
 <li>GNOME or KDE desktop
 <p><i>Tested on Ubuntu®  12.04, Precise Pangolin (64-bit distribution
 capable of running 32-bit applications)</i></li>
+<li>64-bit distribution capable of running 32-bit applications</li>
 <li>GNU C Library (glibc) 2.11 or later</li>
 <li>2 GB RAM minimum, 8 GB RAM recommended</li>
 <li>2 GB of available disk space minimum,<br>4 GB Recommended
@@ -522,6 +524,9 @@
 Android SDK and emulator system image)</li>
 <li>1280 x 800 minimum screen resolution</li>
 <li>Java Development Kit (JDK) 8</li>
+<li>For accelerated emulator: Intel® processor with support for Intel®
+VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality,
+or AMD processor with support for AMD Virtualization™ (AMD-V™)</li>
 </ul>
 </div>
 
diff --git a/docs/html/tools/building/building-cmdline.jd b/docs/html/tools/building/building-cmdline.jd
index bf3e873..2e2619b 100644
--- a/docs/html/tools/building/building-cmdline.jd
+++ b/docs/html/tools/building/building-cmdline.jd
@@ -302,17 +302,12 @@
   device:</p>
 
   <ul>
-    <li>Enable <strong>USB debugging</strong> on your device.
-      <ul>
-        <li>On most devices running Android 3.2 or older, you can find the option under
-          <strong>Settings > Applications > Development</strong>.</li>
-        <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>.
+    <li>Enable <strong>USB debugging</strong> on your device. You can find the option under
+          <strong>Settings > Developer options</strong>.
           <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
           options</strong> is hidden by default. To make it available, go
           to <strong>Settings > About phone</strong> and tap <strong>Build number</strong>
           seven times. Return to the previous screen to find <strong>Developer options</strong>.</p>
-        </li>
-      </ul>
     </li>
 
     <li>Ensure that your development computer can detect your device when connected via USB</li>
diff --git a/docs/html/tools/building/building-studio.jd b/docs/html/tools/building/building-studio.jd
index 6827c57..7ba716f 100644
--- a/docs/html/tools/building/building-studio.jd
+++ b/docs/html/tools/building/building-studio.jd
@@ -548,21 +548,25 @@
   When you deploy a clean build, Android Studio instruments your app to allow
   Instant Run to push code and resource updates. Although updating the running
   app happens much more quickly, the first build may take longer to complete.
-  You can improve the build process by configuring a few DEX options, such as
-  <code>maxProcessCount</code> and <code>javaMaxHeapSize</code>.
+  You can improve the build process by configuring a few <a class=
+  "external-link" href=
+  "http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html">
+  <code>DexOptions</code></a> settings:
 </p>
 
 <dl>
   <dt>
-    <code>maxProcessCount</code>
+    <a class="external-link" href=
+    "http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html#com.android.build.gradle.internal.dsl.DexOptions:maxProcessCount">
+    <code>maxProcessCount</code></a>
   </dt>
 
   <dd>
-    Sets the maximum number of DEX processes that can be started
-    concurrently. If the Gradle daemon is already running, you need to
-    stop the process before initializing it with a new maximum process count.
-    You can terminate the Gradle daemon by calling one of the following from
-    the <em>Terminal</em> window:
+    Sets the maximum number of DEX processes that can be started concurrently.
+    If the Gradle daemon is already running, you need to stop the process
+    before initializing it with a new maximum process count. You can terminate
+    the Gradle daemon by calling one of the following from the
+    <em>Terminal</em> window:
     <ul>
       <li>On Windows, call <code>gradlew --stop</code>
       </li>
@@ -573,7 +577,9 @@
   </dd>
 
   <dt>
-    <code>javaMaxHeapSize</code>
+    <a class="external-link" href=
+    "http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html#com.android.build.gradle.internal.dsl.DexOptions:javaMaxHeapSize">
+    <code>javaMaxHeapSize</code></a>
   </dt>
 
   <dd>
@@ -593,7 +599,7 @@
 android {
   ...
   dexOptions {
-    maxProcessCount 8
+    maxProcessCount 4 // this is the default value
     javaMaxHeapSize "2g"
   }
 }
diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd
index 5d8d384..60dce3d 100644
--- a/docs/html/tools/device.jd
+++ b/docs/html/tools/device.jd
@@ -59,10 +59,10 @@
   <li>Plus many more options to simulate app stresses or enable debugging options.</li>
 </ul>
 <p>To access these settings, open the <em>Developer options</em> in the
-system Settings. On Android 4.2 and higher, the Developer options screen is
+system Settings. On Android 4.2 and higher, the <strong>Developer options</strong> screen is
 hidden by default. To make it visible, go to
 <b>Settings &gt; About phone</b> and tap <b>Build number</b> seven times. Return to the previous
-screen to find Developer options at the bottom.</p>
+screen to find <strong>Developer options</strong> at the bottom.</p>
 
 
 
@@ -89,17 +89,12 @@
     <p class="note"><strong>Note:</strong> If you manually enable debugging in the manifest
  file, be sure to disable it in your release build (your published application
 should usually <em>not</em> be debuggable).</p></li>
-  <li>Enable <strong>USB debugging</strong> on your device.
-    <ul>
-      <li>On most devices running Android 3.2 or older, you can find the option under
-        <strong>Settings > Applications > Development</strong>.</li>
-      <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>.
-        <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
+  <li>Enable <strong>USB debugging</strong> on your device by going to
+    <strong>Settings > Developer options</strong>.
+	    <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
         options</strong> is hidden by default. To make it available, go
         to <strong>Settings > About phone</strong> and tap <strong>Build number</strong>
         seven times. Return to the previous screen to find <strong>Developer options</strong>.</p>
-      </li>
-    </ul>
   </li>
   <li>Set up your system to detect your device.
     <ul>
diff --git a/docs/html/tools/help/proguard.jd b/docs/html/tools/help/proguard.jd
index e26aca0..b38aba6 100755
--- a/docs/html/tools/help/proguard.jd
+++ b/docs/html/tools/help/proguard.jd
@@ -1,192 +1,493 @@
-page.title=ProGuard
+page.title=Shrink Your Code and Resources
 parent.title=Tools
 parent.link=index.html
-page.metaDescription=Use ProGuard to shrink, optimize, and obfuscate your code prior to release.
+page.metaDescription=Make your APK file smaller and more secure by shrinking your code and resources.
 @jd:body
 
  <div id="qv-wrapper">
     <div id="qv">
       <h2>In this document</h2>
-
-      <ol>
-        <li><a href="#enabling-gradle">Enabling ProGuard (Gradle Builds)</a></li>
-
-        <li><a href="#enabling">Enabling ProGuard (Ant Builds)</a></li>
-
-        <li><a href="#configuring">Configuring ProGuard</a></li>
-
-        <li>
-          <a href="#decoding">Decoding Obfuscated Stack Traces</a>
-
-          <ol>
-            <li><a href="#considerations">Debugging considerations for published
-            applications</a></li>
-          </ol>
-        </li>
-      </ol>
+<ol>
+  <li><a href="#shrink-code">Shrink Your Code</a>
+    <ol>
+      <li><a href="#keep-code">Customize which code to keep</a></li>
+      <li><a href="#decode-stack-trace">Decode an obfuscated stack trace</a></li>
+    </ol>
+  </li>
+  <li><a href="#shrink-resources">Shrink Your Resources</a>
+    <ol>
+      <li><a href="#keep-resources">Customize which resources to keep</a></li>
+      <li><a href="#strict-reference-checks">Enable strict reference checks</a></li>
+      <li><a href="#unused-alt-resources">Remove unused alternative resources</a></li>
+      <li><a href="#merge-resources">Merge duplicate resources</a></li>
+      <li><a href="#troubleshoot-resource-shrink">Troubleshoot resource shrinking</a></li>
+    </ol>
+  </li>
+</ol>
 
       <h2>See also</h2>
-
-      <ol>
+      <ul>
         <li>
-          <a href="http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/introduction.html">ProGuard
-          Manual &raquo;</a>
+          <a class="external-link"
+          href="http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/introduction.html">ProGuard
+          Manual</a>
         </li>
-        <li>
-          <a href="http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/retrace/introduction.html">ProGuard
-          ReTrace Manual &raquo;</a>
-        </li>
-      </ol>
+      </ul>
     </div>
   </div>
 
 
- 
-  <p>The <a href="http://proguard.sourceforge.net">ProGuard</a> tool shrinks, optimizes, and
-  obfuscates your code by removing unused code and
-  renaming classes, fields, and methods with semantically obscure names. The result is a smaller
-  sized <code>.apk</code> file that is more difficult to reverse engineer. Because ProGuard makes your
-  application harder to reverse engineer, it is important that you use it
-  when your application utilizes features that are sensitive to security like when you are
-  <a href="{@docRoot}google/play/licensing/index.html">Licensing Your Applications</a>.</p>
 
-  <p>ProGuard is integrated into the Android build system, so you do not have to invoke it
-  manually. ProGuard runs only when you build your application in release mode, so you do not
-  have to deal with obfuscated code when you build your application in debug mode.
-  Having ProGuard run is completely optional, but highly recommended.</p>
+<p>To make your APK file as small as possible, you should enable shrinking for
+your code and resources in your release build. This guide describes how to do
+both and how to specify what to keep or discard during a build.</p>
 
-  <p>This document describes how to enable and configure ProGuard as well as use the
-  <code>retrace</code> tool to decode obfuscated stack traces.</p>
+<p>Code shrinking is available with ProGuard, which detects and removes unused
+classes, fields, methods, and attributes from your packaged app, including
+those from included code libraries (making it a valuable tool for working
+around the <a href="{@docRoot}tools/building/multidex.html">64k reference
+limit</a>). ProGuard also optimizes the bytecode, removes unused code
+instructions, and obfuscates the remaining classes, fields, and methods with
+short names. The obfuscated code makes your APK difficult to reverse engineer,
+which is especially valuable when your app uses security-sensitive features,
+such as <a href="{@docRoot}google/play/licensing/overview.html">licensing
+verification</a>.</p>
+
+<p>Resource shrinking is available with the Android Plugin for Gradle, which
+removes unused resources from your packaged app, including unused resources in
+code libraries. It works in conjunction with code shrinking such that once
+unused code has been removed, any resources no longer referenced can be safely
+removed as well.</p>
 
 
- <h2 id="enabling-gradle">Enabling ProGuard (Gradle Builds)</h2>
-  <p>When you create a project in Android Studio or with the Gradle build system, the
-  <code>minifyEnabled</code> property in the <code>build.gradle</code> file enables and disables
-  ProGuard for release builds. The <code>minifyEnabled</code> property is part of the
-  <code>buildTypes</code> <code>release</code> block that controls the settings applied to
-  release builds. Set the <code>minifyEnabled</code> property to <code>true</code> to enable
-  ProGuard, as shown in this example. </p>
+<p>Features in this document depend on:</p>
+<ul>
+<li><a href="{@docRoot}tools/sdk/tools-notes.html">SDK Tools</a> 25.0.10
+or higher</li>
+<li><a href="{@docRoot}tools/revisions/gradle-plugin.html">Android Plugin
+for Gradle</a> 2.0.0 or higher</li>
+</ul>
 
-  <pre class="no-pretty-print">
-  android {
-   ...
- 
-    buildTypes {
-        release {
-            minifyEnabled true
-            proguardFiles getDefaultProguardFile('proguard-android.txt'),
-            'proguard-rules.pro'
-        }
-    }
-  }
-  </pre>
+<h2 id="shrink-code">Shrink Your Code</h2>
 
-  <p>The <code>getDefaultProguardFile('proguard-android.txt')</code> method obtains the default
-  ProGuard settings from the Android SDK <code>tools/proguard/</code> folder. The
-  <code>proguard-android-optimize.txt</code> file is also available in this Android SDK
-  folder with the same rules but with optimizations enabled. ProGuard optimizations perform
-  analysis at the bytecode level, inside and across methods to help make your app smaller and run
-  faster. Android Studio adds the <code>proguard-rules.pro</code> file at the root of the module,
-  so you can also easily add custom ProGuard rules specific to the current module. </p>
+<p>To enable code shrinking with ProGuard, add <code>minifyEnabled true</code>
+to the appropriate build type in your <code>build.gradle</code> file.</p>
 
-  <p>You can also add ProGuard files to the <code>getDefaultProguardFile</code>
-  directive for all release builds or as part of the <code>productFlavor</code> settings in the
-  <code>build.gradle</code> file to customize the settings applied to build variants. This example
-  adds the <code>proguard-rules-new.pro</code> to the <code>proguardFiles</code>
-  directive and the <code>other-rules.pro</code> file to the <code>flavor2</code> product flavor. </p>
+<p>Be aware that code shrinking slows down the build time, so you should avoid
+using it on your debug build if possible. However, it's important that you
+do enable code shrinking on your final APK used for testing, because it might
+introduce bugs if you do not sufficiently <a href="#keep-code">customize which
+code to keep</a>.</p>
+
+<p>For example, the following snippet from a <code>build.gradle</code> file
+enables code shrinking for the release build:</p>
 
 <pre class="no-pretty-print">
-    android {
-   ...
- 
+android {
+    buildTypes {
+        release {
+            minifyEnabled true
+            proguardFiles getDefaultProguardFile(‘proguard-android.txt'),
+                    'proguard-rules.pro</a>'
+        }
+    }
+    ...
+}
+</pre>
+
+<p class="note"><strong>Note</strong>: Android Studio disables ProGuard when
+using <a href=
+"{@docRoot}tools/building/building-studio.html#instant-run">Instant
+Run</a>.</p>
+
+<p>In addition to the <code>minifyEnabled</code> property, the
+<code>proguardFiles</code> property defines the ProGuard rules:</p>
+
+<ul>
+<li>The <code>getDefaultProguardFile(‘proguard-android.txt')</code> method gets
+the default ProGuard settings from the Android SDK <code>tools/proguard/</code>
+folder.
+<p><strong>Tip</strong>: For even more code shrinking, try the
+<code>proguard-android-optimize.txt</code> file that's in the same location. It
+includes the same ProGuard rules, but with other optimizations that perform
+analysis at the bytecode level—inside and across methods—to reduce your APK
+size further and help it run faster.</p>
+</li>
+<li>The <code>proguard-rules.pro</code> file is where you can add custom
+ProGuard rules. By default, this file is located at the root of the module
+(next to the <code>build.gradle</code> file).</li>
+</ul>
+
+<p>To add more ProGuard rules that are specific to each build variant, add
+another <code>proguardFiles</code> property in the corresponding
+<code>productFlavor</code> block. For example, the following Gradle file adds
+<code>flavor2-rules.pro</code> to the <code>flavor2</code> product flavor. Now
+<code>flavor2</code> uses all three ProGuard rules because those from the
+<code>release</code> block are also applied.</p>
+
+<pre class="no-pretty-print">
+android {
+    ...
     buildTypes {
         release {
             minifyEnabled true
             proguardFiles getDefaultProguardFile('proguard-android.txt'),
-            'proguard-rules.pro', 'proguard-rules-new.pro'
+                   'proguard-rules.pro'</span>
         }
     }
- 
-   productFlavors {
+    productFlavors {
         flavor1 {
         }
         flavor2 {
-            proguardFile 'other-rules.pro'
+            proguardFile 'flavor2-rules.pro'
         }
     }
- }
-  </pre>
-
-
-  <h2 id="configuring">Configuring ProGuard</h2>
-
-  <p>For some situations, the default configurations in the ProGuard configuration file will
-  suffice. However, many situations are hard for ProGuard to analyze correctly and it might remove
-  code that it thinks is not used, but your application actually needs. Some examples include:</p>
-
-  <ul>
-    <li>a class that is referenced only in the <code>AndroidManifest.xml</code> file</li>
-
-    <li>a method called from JNI</li>
-
-    <li>dynamically referenced fields and methods</li>
-  </ul>
-
-  <p>The default ProGuard configuration file tries to cover general cases, but you might
-  encounter exceptions such as <code>ClassNotFoundException</code>, which happens when ProGuard
-  strips away an entire class that your application calls.</p>
-
-  <p>You can fix errors when ProGuard strips away your code by adding a <code>-keep</code> line in
-  the ProGuard configuration file. For example:</p>
-  <pre>
--keep public class &lt;MyClass&gt;
+}
 </pre>
 
-  <p>There are many options and considerations when using the <code>-keep</code> option, so it is
-  highly recommended that you read the
-  <a href="http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/introduction.html">ProGuard
-  Manual</a> for more information about customizing your configuration file. The
-  <em>Overview of Keep options</em> and <em>Examples</em> sections are particularly helpful.
-  The <a href=
-  "http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/troubleshooting.html">Troubleshooting
-  </a> section of the ProGuard Manual outlines other common problems you might encounter
-  when your code gets stripped away.</p>
+<p>With each build, ProGuard outputs the following files:</p>
+<dl>
+<dt><code>dump.txt</code></dt>
+<dd>Describes the internal structure of all the class files in the APK.</dd>
 
-  <h2 id="decoding">Decoding Obfuscated Stack Traces</h2>
+<dt><code>mapping.txt</code></dt>
+<dd>Provides a translation between the original and obfuscated class, method, and
+field names.</dd>
 
-  <p>When your obfuscated code outputs a stack trace, the method names are obfuscated, which makes
-  debugging hard, if not impossible. Fortunately, whenever ProGuard runs, it outputs a
-  <code>mapping.txt</code> file, which shows you the original class, method, and field names
-  mapped to their obfuscated names.</p>
+<dt><code>seeds.txt</code></dt>
+<dd>Lists the classes and members that were not obfuscated.</dd>
 
-  <p>The <code>retrace.bat</code> script on Windows or the <code>retrace.sh</code> script on Linux
-  or Mac OS X can convert an obfuscated stack trace to a readable one. It is located
-  in the <code>&lt;sdk_root&gt;/tools/proguard/</code> directory. The syntax for executing the
-  <code>retrace</code> tool is:</p>
-  <pre>retrace.bat|retrace.sh [-verbose] mapping.txt [&lt;stacktrace_file&gt;]</pre>
-  <p>For example:</p>
+<dt><code>usage.txt</code></dt>
+<dd>Lists the code that was removed from the APK.</dd>
+</dl>
 
-  <pre>retrace.bat -verbose mapping.txt obfuscated_trace.txt</pre>
+<p>These files are saved at
+<code>&lt;module-name&gt;/build/outputs/mapping/release/</code>.</p>
 
-  <p>If you do not specify a value for <em>&lt;stacktrace_file&gt;</em>, the <code>retrace</code> tool reads
-  from standard input.</p>
 
-  <h3 id="considerations">Debugging considerations for published applications</h3>
+<h3 id="keep-code">Customize which code to keep</h3>
 
-  <p>Save the <code>mapping.txt</code> file for every release that you publish to your users.
-  By retaining a copy of the <code>mapping.txt</code> file for each release build,
-  you ensure that you can debug a problem if a user encounters a bug and submits an obfuscated stack trace.
-  A project's <code>mapping.txt</code> file is overwritten every time you do a release build, so you must be
-  careful about saving the versions that you need. The file is stored in the app <code>build/outs/</code> folder. </p>
+<p>For some situations, the default ProGuard configuration file
+(<code>proguard-android.txt</code>) is sufficient and ProGuard removes all—and
+only—the unused code. However, many situations are difficult for ProGuard to
+analyze correctly and it might remove code your app actually needs. Some
+examples of when it might incorrectly remove code include:</p>
 
-  <p>For example, say you publish an application and continue developing new features of
-  the application for a new version. You then do a release build using ProGuard soon after. The
-  build overwrites the previous <code>mapping.txt</code> file. A user submits a bug report
-  containing a stack trace from the application that is currently published. You no longer have a way
-  of debugging the user's stack trace, because the <code>mapping.txt</code> file associated with the version
-  on the user's device is gone. There are other situations where your <code>mapping.txt</code> file can be overwritten, so
-  ensure that you save a copy for every release that you anticipate you have to debug.</p>
+<ul>
+<li>When your app references a class only from the
+<code>AndroidManifest.xml</code> file</li>
+<li>When your app calls a method from the Java Native Interface (JNI)</li>
+<li>When your app manipulates code at runtime (such as with reflection or
+introspection)</li>
+</ul>
 
-  <p>How you save the <code>mapping.txt</code> files is your decision. For example, you can rename
-  the files to include a version or build number, or you can version control them along with your
-  source code.</p>
+<p>Testing your app should reveal any errors caused by inappropriately removed
+code, but you can also inspect what code was removed by reviewing the
+<code>usage.txt</code> output file saved in
+<code>&lt;module-name&gt;/build/outputs/mapping/release/</code>.</p>
+
+<p>To fix errors and force ProGuard to keep certain code, add a <code><a
+href="https://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/usage.html"
+>-keep</a></code> line in the ProGuard configuration file. For example:</p>
+
+<pre>
+-keep public class MyClass
+</pre>
+
+<p>Alternatively, you can add the <code><a href=
+"{@docRoot}reference/android/support/annotation/Keep.html">@Keep</a></code>
+annotation to the code you want to keep. Adding <code>@Keep</code> on a class
+keeps the entire class as-is. Adding it on a method or field will keep the
+method/field (and it's name) as well as the class name intact. Note that this
+annotation is available only when using the <a href=
+"{@docRoot}tools/support-library/features.html#annotations">Annotations Support
+Library</a>.</p>
+
+
+<p>There are many considerations you should make when using the
+<code>-keep</code> option; for more information about customizing your
+configuration file, read the <a href=
+"http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/introduction.html">
+ProGuard Manual</a>. The <a href=
+"http://stuff.mit.edu/afs/sipb/project/android/sdk/android-sdk-linux/tools/proguard/docs/index.html#manual/troubleshooting.html">
+Troubleshooting</a> section outlines other common problems you might encounter
+when your code gets stripped away.</p>
+
+
+<h3 id="decode-stack-trace">Decode an obfuscated stack trace</h3>
+
+<p>After ProGuard shrinks your code, reading a stack trace is difficult (if not
+impossible) because the method names are obfuscated. Fortunately, ProGuard
+creates a <code>mapping.txt</code> file each time it runs, which shows the
+original class, method, and field names mapped to the obfuscated names.
+ProGuard saves the file in the app
+<code>&lt;module-name&gt;/build/outputs/mapping/release/</code> directory.</p>
+
+
+<p>Be aware that the <code>mapping.txt</code> file is overwritten every time
+you create a release build with ProGuard, so you must carefully save a copy
+each time you publish a new release. By retaining a copy of the
+<code>mapping.txt</code> file for each release build, you'll be able to debug a
+problem if a user submits an obfuscated stack trace from an older version of
+your app.</p>
+
+<p>When publishing your app on Google Play, you can upload the
+<code>mapping.txt</code> file for each version of your APK. Then Google Play
+will deobfuscate incoming stack traces from user-reported issues so you can
+review them in the Google Play Developer Console. For more information, see the
+Help Center article about how to <a href=
+"https://support.google.com/googleplay/android-developer/answer/6295281">deobfuscate
+crash stack traces</a>.</p>
+
+<p>To convert an obfuscated stack trace to a readable one yourself, use the
+<code>retrace</code> script (<code>retrace.bat</code> on Windows;
+<code>retrace.sh</code> on Mac/Linux). It is located in the
+<code>&lt;sdk-root&gt;/tools/proguard/</code> directory. The script takes the
+<code>mapping.txt</code> file and your stack trace, producing a new, readable
+stack trace. The syntax for using the retrace tool is:</p>
+
+<pre class="no-pretty-print">
+retrace.bat|retrace.sh [-verbose] mapping.txt [&lt;stacktrace_file&gt;]
+</pre>
+
+<p>For example:</p>
+
+<pre class="no-pretty-print">
+retrace.bat -verbose mapping.txt obfuscated_trace.txt
+</pre>
+
+<p>If you do not specify the stack trace file, the retrace tool reads from
+standard input.</p>
+
+<h2 id="shrink-resources">Shrink Your Resources</h2>
+
+<p>Resource shrinking works only in conjunction with code shrinking. After the
+code shrinker removes all unused code, the resource shrinker can identify which
+resources the app still uses. This is especially true when you add code
+libraries that include resources—you must remove unused library code so the
+library resources become unreferenced and, thus, removable by the resource
+shrinker.</p>
+
+<p>To enable resource shrinking, set the <code>shrinkResources</code> property
+to <code>true</code> in your <code>build.gradle</code> file (alongside
+<code>minifyEnabled</code> for code shrinking). For example:</p>
+
+<pre class="no-pretty-print">
+android {
+    ...
+    buildTypes {
+        release {
+            shrinkResources true
+            minifyEnabled true
+            proguardFiles getDefaultProguardFile('proguard-android.txt'),
+                    'proguard-rules.pro'
+        }
+    }
+}
+</pre>
+
+<p>If you haven't already built your app using <code>minifyEnabled</code> for
+code shrinking, then try that before enabling <code>shrinkResources</code>,
+because you might need to edit your <code>proguard-rules.pro</code> file to
+keep classes or methods that are created or invoked dynamically before you
+start removing resources.</p>
+
+<p class="note"><strong>Note</strong>: The resource shrinker currently does not
+remove resources defined in a <code>values/</code> folder (such as strings,
+dimensions, styles, and colors). This is because the Android Asset Packaging
+Tool (AAPT) does not allow the Gradle Plugin to specify predefined versions for
+resources. For details, see <a href=
+"https://code.google.com/p/android/issues/detail?id=70869">issue 70869</a>.</p>
+
+
+<h3 id="keep-resources">Customize which resources to keep</h3>
+
+<p>If there are specific resources you wish to keep or discard, create an XML
+file in your project with a <code>&lt;resources&gt;</code> tag and specify each
+resource to keep in the <code>tools:keep</code> attribute and each resource to
+discard in the <code>tools:discard</code> attribute. Both attributes accept a
+comma-separated list of resource names. You can use the asterisk character as a
+wild card.</p>
+
+<p>For example:</p>
+
+<pre>
+&lt;?xml version=1.0" encoding="utf-8"?&gt;
+&lt;resources xmlns:tools="http://schemas.android.com/tools"
+    tools:keep="&#64;layout/l_used*_c,&#64;layout/l_used_a,&#64;layout/l_used_b*"
+    tools:discard="&#64;layout/unused2" /&gt;
+</pre>
+
+<p>Save this file in your project resources, for example, at
+<code>res/raw/keep.xml</code>. The build does not package this file into your
+APK.</p>
+
+<p>Specifying which resources to discard might seem silly when you could
+instead delete them, but this can be useful when using build variants. For
+example, you might put all your resources into the common project directory,
+then create a different <code>keep.xml</code> file for each build variant when
+you know that a given resource appears to be used in code (and therefore not
+removed by the shrinker) but you know it actually won't be used for the given
+build variant.</p>
+
+<h3 id="strict-reference-checks">Enable strict reference checks</h3>
+
+<p>Normally, the resource shrinker can accurately determine whether a resource
+is used. However, if your code makes a call to {@link
+android.content.res.Resources#getIdentifier(String,String,String)
+Resources.getIdentifier()} (or if any of your libraries do that—the <a href=
+"{@docRoot}tools/support-library/features.html#v7-appcompat">AppCompat</a>
+library does), that means your code is looking up resource names based on
+dynamically-generated strings. When you do this, the resource shrinker behaves
+defensively by default and marks all resources with a matching name format as
+potentially used and unavailable for removal.</p>
+
+<p>For example, the following code causes all resources with the
+<code>img_</code> prefix to be marked as used.</p>
+
+<pre>
+String name = String.format("img_%1d", angle + 1);
+res = getResources().getIdentifier(name, "drawable", getPackageName());
+</pre>
+
+<p>The resource shrinker also looks through all the string constants in your
+code, as well as various <code>res/raw/</code> resources, looking for resource
+URLs in a format similar to
+<code>file:///android_res/drawable//ic_plus_anim_016.png</code>. If it finds
+strings like this or others that look like they could be used to construct URLs
+like this, it doesn't remove them.</p>
+
+<p>These are examples of the safe shrinking mode that is enabled by default.
+You can, however, turn off this "better safe than sorry" handling, and specify
+that the resource shrinker keep only resources that it's certain are used. To
+do this, set <code>shrinkMode</code> to <code>strict</code> in the
+<code>keep.xml</code> file, as follows:</p>
+
+<pre>
+&lt;?xml version="1.0" encoding="utf-8"?&gt;
+&lt;resources xmlns:tools="http://schemas.android.com/tools"
+    tools:shrinkMode="strict" /&gt;
+</pre>
+
+<p>If you do enable strict shrinking mode and your code also references
+resources with dynamically-generated strings, as shown above, then you must
+manually keep those resources using the <code>tools:keep</code> attribute.</p>
+
+<h3 id="unused-alt-resources">Remove unused alternative resources</h3>
+
+<p>The Gradle resource shrinker removes only resources that are not referenced
+by your app code, which means it will not remove <a href=
+"{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">
+alternative resources</a> for different device configurations. If necessary,
+you can use the Android Gradle plugin's <code>resConfigs</code> property to
+remove alternative resource files that your app does not need.</p>
+
+<p>For example, if you are using a library that includes language resources
+(such as AppCompat or Google Play Services), then your APK includes all
+translated language strings for the messages in those libraries whether the
+rest of your app is translated to the same languages or not. If you'd like to
+keep only the languages that your app officially supports, you can specify
+those languages using the <code>resConfig</code> property. Any resources for
+languages not specified are removed.</p>
+
+<p>The following snippet shows how to limit your language resources to just
+English and French:</p>
+
+<pre class="no-pretty-print">
+android {
+    defaultConfig {
+        ...
+        resConfigs "en", "fr"
+    }
+}
+</pre>
+
+<p>To customize which screen density or ABI resources to include in your APK,
+instead use <a href=
+"http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits">APK
+splits</a> to build different APKs for different devices.</p>
+
+<h3 id="merge-resources">Merge duplicate resources</h3>
+
+<p>By default, Gradle also merges identically named resources, such as
+drawables with the same name that might be in different resource folders. This
+behavior is not controlled by the <code>shrinkResources</code> property and
+cannot be disabled, because it is necessary to avoid errors when multiple
+resources match the name your code is looking up.</p>
+
+<p>Resource merging occurs only when two or more files share an identical
+resource name, type, and qualifier. Gradle selects which file it considers to
+be the best choice among the duplicates (based on a priority order described
+below) and passes only that one resource to the AAPT for distribution in the
+APK file.</p>
+
+<p>Gradle looks for duplicate resources in the following locations:</p>
+
+<ul>
+<li>The main resources, associated with the main source set, generally
+located in <code>src/main/res/</code>.</li>
+<li>The variant overlays, from the build type and build flavors.</li>
+<li>The library project dependencies.</li>
+</ul>
+
+<p>Gradle merges duplicate resources in the following cascading priority order:</p>
+
+<p>Dependencies → Main → Build flavor → Build type</p>
+
+<p>For example, if a duplicate resource appears in both your main resources and
+a build flavor, Gradle selects the one in the build flavor.</p>
+
+<p>If identical resources appear in the same source set, Gradle cannot merge
+them and emits a resource merge error. This can happen if you define multiple
+source sets in the <code>sourceSet</code> property of your
+<code>build.gradle</code> file—for example if both <code>src/main/res/</code>
+and <code>src/main/res2/</code> contain identical resources.</p>
+
+<h3 id="troubleshoot-resource-shrink">Troubleshoot resource shrinking</h3>
+
+<p>When you shrink resources, the Gradle Console shows a summary of the
+resources that it removed from the app package. For example:</p>
+
+<pre class="no-pretty-print">
+:android:shrinkDebugResources
+Removed unused resources: Binary resource data reduced from 2570KB to 1711KB: Removed 33%
+:android:validateDebugSigning
+</pre>
+
+<p>Gradle also creates a diagnostic file named <code>resources.txt</code> in
+<code>&lt;module-name&gt;/build/outputs/mapping/release/</code> (the same
+folder as ProGuard's output files). This file includes details such as which
+resources reference other resources and which resources are used or
+removed.</p>
+
+<p>For example, to find out why <code>&#64;drawable/ic_plus_anim_016</code> is
+still in your APK, open the <code>resources.txt</code> file and search for that
+file name. You might find that it's referenced from another resource, as
+follows:</p>
+
+<pre class="no-pretty-print">
+16:25:48.005 [QUIET] [system.out] &#64;drawable/add_schedule_fab_icon_anim : reachable=true
+16:25:48.009 [QUIET] [system.out]     &#64;drawable/ic_plus_anim_016
+</pre>
+
+<p>You now need to know why <code>&#64;drawable/add_schedule_fab_icon_anim</code>
+is reachable—and if you search upwards you'll find that resource is listed
+under "The root reachable resources are:". This means there is a code reference
+to <code>add_schedule_fab_icon_anim</code> (that is, its R.drawable ID was
+found in the reachable code).</p>
+
+<p>If you are not using strict checking, resource IDs can be marked as reachable
+if there are string constants that look like they might be used to construct
+resource names for dynamically loaded resources. In that case, if you search
+the build output for the resource name, you might find a message like this:</p>
+
+<pre class="no-pretty-print">
+10:32:50.590 [QUIET] [system.out] Marking drawable:ic_plus_anim_016:2130837506
+    used because it format-string matches string pool constant ic_plus_anim_%1$d.
+</pre>
+
+<p>If you see one of these strings and you are certain that the string is not
+being used to load the given resource dynamically, you can use the
+<code>tools:discard</code> attribute to inform the build system to remove it,
+as described in the section about how to <a href="#keep-resources"
+>customize which resources to keep</a>.</p>
diff --git a/docs/html/tools/projects/templates.jd b/docs/html/tools/projects/templates.jd
index 676ca50..7426010 100644
--- a/docs/html/tools/projects/templates.jd
+++ b/docs/html/tools/projects/templates.jd
@@ -111,8 +111,8 @@
       <p>This template includes:</p>
 
       <ul>
-        <li>Title bar ({@link android.app.ActionBar} on Android 3.0 and later)</li>
-        <li>Options menu (action overflow on Android 3.0 and later) </li>
+        <li>{@link android.app.ActionBar}</li>
+        <li>Action overflow</li>
         <li>Basic layout</li>
       </ul>
     </td>
diff --git a/docs/html/tools/publishing/app-signing.jd b/docs/html/tools/publishing/app-signing.jd
index 4b74f5f..21067c6 100644
--- a/docs/html/tools/publishing/app-signing.jd
+++ b/docs/html/tools/publishing/app-signing.jd
@@ -299,13 +299,9 @@
 Settings\&lt;user&gt;\.android\</code> on Windows XP, and in
 <code>C:\Users\&lt;user&gt;\.android\</code> on Windows Vista and Windows 7.</p>
 
-<p>The next time you build, the build tools will regenerate a new keystore and debug key.</p>
-
-<p>Note that, if your development machine is using a non-Gregorian locale, the build tools may
-erroneously generate an already-expired debug certificate, so that you get an error when trying
-to compile your application. For workaround information, see the troubleshooting topic
-<a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar">I can't compile my app
-because the build tools generated an expired debug certificate</a>.</p>
+<p>The next time you build and run your app, the build tools will regenerate a
+  new keystore and debug key. Note that you must run your app, building alone
+  does not regenerate the keystore and debug key.</p>
 
 
 <h2 id="signing-manually">Signing Your App Manually</h2>
diff --git a/docs/html/tools/revisions/gradle-plugin.jd b/docs/html/tools/revisions/gradle-plugin.jd
index 9d688d8..20492f7 100644
--- a/docs/html/tools/revisions/gradle-plugin.jd
+++ b/docs/html/tools/revisions/gradle-plugin.jd
@@ -29,13 +29,19 @@
 
     <ol>
       <li>
+        <a class="external-link" href=
+        "http://google.github.io/android-gradle-dsl/current/">Android Plugin DSL
+        Reference</a>
+      </li>
+
+      <li>
         <a href="{@docRoot}sdk/installing/studio-build.html">Build System
         Overview</a>
       </li>
 
       <li>
-        <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android
-        Plugin for Gradle</a>
+        <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin
+        for Gradle</a>
       </li>
     </ol>
   </div>
@@ -166,15 +172,17 @@
         connected device.
         </li>
 
-        <li>Added <code>maxProcessCount</code> to control how many slave dex processes can
-        be spawned concurrently. The following code, in the module-level
+        <li>Added <a class="external-link" href=
+        "http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html#com.android.build.gradle.internal.dsl.DexOptions:maxProcessCount">
+        <code>maxProcessCount</code></a> to control how many slave dex processes can be
+        spawned concurrently. The following code, in the module-level
         <code>build.gradle</code> file, sets the maximum number of concurrent processes
         to 4:
 <pre>
 android {
   ...
   dexOptions {
-  maxProcessCount = 4
+  maxProcessCount = 4 // this is the default value
   }
 }
 </pre>
@@ -192,11 +200,11 @@
   ...
   buildTypes {
     debug {
-      minifyEnabed true
+      minifyEnabled true
       useProguard false
     }
     release {
-      minifyEnabed true
+      minifyEnabled true
       useProguard true // this is a default setting
     }
   }
diff --git a/docs/html/tools/studio/code-tools.jd b/docs/html/tools/studio/code-tools.jd
index 4033bfc..aeae77d 100644
--- a/docs/html/tools/studio/code-tools.jd
+++ b/docs/html/tools/studio/code-tools.jd
@@ -17,10 +17,12 @@
       by allowing you to more clearly define method parameter requirements.
     </dd>
 
-  <dt><a href="{@docRoot}tools/help/app-link-indexing.html">Deep Link and App Indexing</a></dt>
-    <dd>These features help you add deep links, app indexing, and search functionality to your
-      apps. These features can make it easier to find content in an installed app, drive more
-      traffic to your app, discover which app content users view the most, and attract new users.
+  <dt><a href="{@docRoot}tools/help/app-link-indexing.html">URL and App Indexing
+  Support</a></dt>
+    <dd>Android Studio helps you add support for URLs, app indexing, and search
+    functionality to your apps. These features can help to drive more traffic
+    to your app, discover which app content is used most, make it easier for
+    users to find content in an installed app, and attract new users.
     </dd>
 
 </dl>
diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs
index baa51bc..c390523 100644
--- a/docs/html/tools/tools_toc.cs
+++ b/docs/html/tools/tools_toc.cs
@@ -96,6 +96,8 @@
               <span class="en">Improving Your Code with lint</span></a></li>
             <li><a href="<?cs var:toroot ?>tools/debugging/annotations.html">
               <span class="en">Improving Code Inspection with Annotations</span></a></li>
+            <li><a href="<?cs var:toroot ?>tools/help/proguard.html">
+              <span class="en">Shrink Your Code and Resources</span></a></li>
             <li><a href="<?cs var:toroot ?>tools/help/app-link-indexing.html">
               <span class="en">Supporting URLs and App Indexing in Android Studio</span></a></li>
           </ul>
@@ -226,7 +228,6 @@
           </ul>
       </li>
       <li><a href="<?cs var:toroot ?>tools/help/mksdcard.html">mksdcard</a></li>
-       <li><a href="<?cs var:toroot ?>tools/help/proguard.html" zh-cn-lang="ProGuard">ProGuard</a></li>
        <li><a href="<?cs var:toroot ?>tools/help/gltracer.html">Tracer for OpenGL ES</a></li>
 
 
diff --git a/docs/html/training/accessibility/testing.jd b/docs/html/training/accessibility/testing.jd
index 6563f4e..9b30b84 100644
--- a/docs/html/training/accessibility/testing.jd
+++ b/docs/html/training/accessibility/testing.jd
@@ -158,7 +158,7 @@
 the Explore by Touch system feature. The TalkBack accessibility service comes preinstalled on most
 Android devices and can also be downloaded for free from
 <a href="https://play.google.com/store/apps/details?id=com.google.android.marvin.talkback">Google
-Play</a>. The Explore by Touch system feature is available on devices running Android 4.0 and later.
+Play</a>.
 </p>
 
 <h4 id="testing-talkback">Testing with TalkBack</h4>
@@ -192,7 +192,7 @@
   hover events over user interface controls.
 </p>
 
-<p>To enable Explore by Touch on Android 4.0 and later:</p>
+<p>To enable Explore by Touch:</p>
 <ol>
   <li>Launch the <strong>Settings</strong> application.</li>
   <li>Navigate to the <strong>Accessibility</strong> category and select it.</li>
@@ -239,7 +239,7 @@
 than keyboards and D-pads. While gestures allow users to focus on nearly any on-screen
 content, keyboard and D-pad navigation only allow focus on input fields and buttons.</p>
 
-<p>To enable gesture navigation on Android 4.1 and later:</p>
+<p>To enable gesture navigation:</p>
 <ul>
   <li>Enable both TalkBack and the Explore by Touch feature as described in the
     <a href="#testing-ebt">Testing with Explore by Touch</a>. When <em>both</em> of these
diff --git a/docs/html/training/articles/security-tips.jd b/docs/html/training/articles/security-tips.jd
index 3215a0e..212fe65 100644
--- a/docs/html/training/articles/security-tips.jd
+++ b/docs/html/training/articles/security-tips.jd
@@ -150,7 +150,7 @@
 href="{@docRoot}guide/topics/manifest/grant-uri-permission-element.html">
 &lt;grant-uri-permission element&gt;</a></code>.</p>
 
-<p>When accessing a content provider, use parameterized query methods such as 
+<p>When accessing a content provider, use parameterized query methods such as
 {@link android.content.ContentProvider#query(Uri,String[],String,String[],String) query()},
 {@link android.content.ContentProvider#update(Uri,ContentValues,String,String[]) update()}, and
 {@link android.content.ContentProvider#delete(Uri,String,String[]) delete()} to avoid
@@ -207,13 +207,13 @@
 protection level</a> on permissions for IPC communication between applications
 provided by a single developer.</p>
 
-<p>Do not leak permission-protected data.  This occurs when your app exposes data
-over IPC that is only available because it has a specific permission, but does
-not require that permission of any clients of it’s IPC interface. More
-details on the potential impacts, and frequency of this type of problem is
-provided in this research paper published at USENIX: <a
-href="http://www.cs.berkeley.edu/~afelt/felt_usenixsec2011.pdf">http://www.cs.be
-rkeley.edu/~afelt/felt_usenixsec2011.pdf</a></p>
+<p>Do not leak permission-protected data. This occurs when your app exposes
+data over IPC that is available only because your app has permission to access
+that data. The clients of your app's IPC interface may not have that same
+data-access permission. More details on the frequency and potential effects
+of this issue appear in <a class="external-link"
+href="https://www.usenix.org/legacy/event/sec11/tech/full_papers/Felt.pdf"> this
+research paper</a>, published at USENIX.
 
 
 
@@ -431,14 +431,14 @@
 <p>Use {@link android.webkit.WebView#addJavascriptInterface
 addJavaScriptInterface()} with
 particular care because it allows JavaScript to invoke operations that are
-normally reserved for Android applications.  If you use it, expose 
+normally reserved for Android applications.  If you use it, expose
 {@link android.webkit.WebView#addJavascriptInterface addJavaScriptInterface()} only to
 web pages from which all input is trustworthy.  If untrusted input is allowed,
 untrusted JavaScript may be able to invoke Android methods within your app.  In general, we
 recommend exposing {@link android.webkit.WebView#addJavascriptInterface
 addJavaScriptInterface()} only to JavaScript that is contained within your application APK.</p>
 
-<p>If your application accesses sensitive data with a 
+<p>If your application accesses sensitive data with a
 {@link android.webkit.WebView}, you may want to use the
 {@link android.webkit.WebView#clearCache clearCache()} method to delete any files stored
 locally. Server-side
diff --git a/docs/html/training/monitoring-device-state/doze-standby.jd b/docs/html/training/monitoring-device-state/doze-standby.jd
index 11e81c1..9250288 100644
--- a/docs/html/training/monitoring-device-state/doze-standby.jd
+++ b/docs/html/training/monitoring-device-state/doze-standby.jd
@@ -205,13 +205,14 @@
   you can set alarms that will fire even if the device is in Doze.
 </p>
 
-<p class="note"><strong>Note:</strong> Neither
-{@link
+<p class="note">
+  <strong>Note:</strong> Neither {@link
   android.app.AlarmManager#setAndAllowWhileIdle(int, long,
   android.app.PendingIntent) setAndAllowWhileIdle()} nor {@link
   android.app.AlarmManager#setExactAndAllowWhileIdle(int, long,
-  android.app.PendingIntent) setExactAndAllowWhileIdle()} can fire alarms more than once per 15
-minutes per app.</p>
+  android.app.PendingIntent) setExactAndAllowWhileIdle()} can fire alarms more
+  than once per 9 minutes, per app.
+</p>
 
 <p>
   The Doze restriction on network access is also likely to affect your app,
diff --git a/docs/html/training/testing/start/index.jd b/docs/html/training/testing/start/index.jd
index bc87194..707ba9d 100644
--- a/docs/html/training/testing/start/index.jd
+++ b/docs/html/training/testing/start/index.jd
@@ -249,6 +249,7 @@
 }
 </pre>
 
+
 <p>
   To use JUnit 4 test classes, make sure to specify <a href=
   "{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">{@code
@@ -265,9 +266,39 @@
 }
 </pre>
 
-<h2 id="build">
-  Build and Run Your Tests
-</h2>
+<h3 id="testartifacts">Work With Test Artifacts</h3>
+<p>Android Studio has two types of test artifacts: Android Instrumentation Tests
+and Unit Tests. Previously, you could work with just one test artifact at a
+time. Now, both test artifacts are enabled.
+The advantage of enabling both test artifacts is that any changes you make to
+the underlying code affect
+them both. For example, if you rename a class that both test artifacts access,
+both will know about the class name refactoring.</p>
+
+<p>The figure shows what your project looks like with both test
+artifacts enabled. Notice the shading of both test artifacts.</p>
+
+<!-- Commenting out for now, but leaving it in case we need to add it back.
+<img src="{@docRoot}images/training/testartifactseparate.png" style="float:left;width:250px;margin-right:20px" /> -->
+<img src="{@docRoot}images/training/testartifactcombined.png" style="float:left;width:250px" />
+<!-- Commenting out for now, but leaving it in case we need to add it back.
+<p>
+By default, both test artifacts are enabled in Android Studio. To enable just
+one, deselect <strong>Enable all test artifacts</strong> in your preferences:
+</p>
+
+<ol>
+<li>Select
+<strong>Android Studio</strong> > <strong>Preferences</strong> > <strong>Build,
+Execution, Deployment</strong> > <strong>Build Tools</strong> >
+<strong>Gradle</strong> > <strong>Experimental</strong>.</li>
+<li>Deselect the test artifacts option.</li>
+<li>Click <strong>OK</strong>.</li>
+</ol>
+-->
+
+<h2 id="build">Build and Run Your Tests</h2>
+
 
 <p>
   Android Studio provides all the tools you need to build, run, and analyze
@@ -293,13 +324,17 @@
 </p>
 
 <ol>
+
   <li>In the <em>Project</em> window, right click on the project and
   synchronize your project.
   </li>
 
-  <li>Open the <em>Build Variants</em> window by clicking the left-hand tab,
-  then change the test artifact to <em>Unit Tests</em>.
-  </li>
+  <!--
+<li>If you enabled one test artifact only, open the
+<strong>Build Variants</strong> window by clicking the left-hand tab, then
+change the test artifact to <em>Unit Tests</em>.
+</li>
+-->
 
   <li>In the <em>Project</em> window, navigate to your unit test class or
   method, then right-click it and select <strong>Run</strong> <img src=
@@ -313,6 +348,7 @@
       </li>
     </ul>
   </li>
+
 </ol>
 
 <p>
@@ -330,10 +366,13 @@
   To run your instrumented tests:
 </p>
 
-<ol>
-  <li>Open the <em>Build Variants</em> window by clicking the left-hand tab,
-  then set the test artifact to <em>Android Instrumentation Tests</em>.
-  </li>
+<ul>
+  <!--
+<li>If you enabled one test artifact only, open the
+<strong>Build Variants</strong> window by clicking the left-hand tab, then set
+the test artifact to <em>Android Instrumentation Tests</em>.
+</li>
+-->
 
   <li>In the <em>Project</em> window, navigate to your instrumented test class
   or method, then right-click and run it using the Android Test configuration.
@@ -342,7 +381,7 @@
   "{@docRoot}images/tools/as-run.png" alt="" style=
   "vertical-align:bottom;margin:0;">.
   </li>
-</ol>
+</ul>
 
 <p>
   The <a href="{@docRoot}tools/building/plugin-for-gradle.html">Android Plugin
@@ -402,6 +441,7 @@
   </li>
 </ol>
 
+
 <h4 id="configure-matrix">
 Configure a test matrix and run a test
 </h4>