docs: Misc. fixes for Android 6.0 OTA release.

Change-Id: I5fae8f096eb08f6ccea2ecff4aca15d07a9f8b41
diff --git a/docs/html/about/versions/marshmallow/android-6.0-changes.jd b/docs/html/about/versions/marshmallow/android-6.0-changes.jd
index a512020..33cfa11 100644
--- a/docs/html/about/versions/marshmallow/android-6.0-changes.jd
+++ b/docs/html/about/versions/marshmallow/android-6.0-changes.jd
@@ -81,8 +81,7 @@
 </ul>
 
 <p>To learn more about these power-saving changes, see
-<a href="{@docRoot}training/monitoring-device-state/battery-monitoring.html">Monitoring the
-Battery Level and Charging State</a>.</p>
+<a href="{@docRoot}training/monitoring-device-state/doze-standby.html">Optimizing for Doze and App Standby</a>.</p>
 
 <h2 id="behavior-adoptable-storage">Adoptable Storage Devices</h2>
 <p>
diff --git a/docs/html/about/versions/marshmallow/android-6.0.jd b/docs/html/about/versions/marshmallow/android-6.0.jd
index 1e01034..dcff6e9 100644
--- a/docs/html/about/versions/marshmallow/android-6.0.jd
+++ b/docs/html/about/versions/marshmallow/android-6.0.jd
@@ -93,15 +93,15 @@
 <p>This release enhances Android’s intent system by providing more powerful app linking.
 This feature allows you to associate an app with a web domain you own. Based on this
 association, the platform can determine the default app to use to handle a particular
-web link and skip prompting users to select an app. To learn how to implement this feature, see the
-<a href="{@docRoot}training/app-links/app-linking.html">App Linking</a> training.
+web link and skip prompting users to select an app. To learn how to implement this feature, see
+<a href="{@docRoot}training/app-links/index.html">Handling App Links</a>.
 
 <h2 id="backup">Auto Backup for Apps</h2>
 <p>The system now performs automatic full data backup and restore for apps. Your app must target
   Android 6.0 (API level 23) to enable this behavior; you do not need to add any additional code.
   If users delete their Google accounts, their backup data is deleted as well. To learn how this
-  feature works and how to configure what to back up on the file system, see the
-  <a href="{@docRoot}training/backup/auto-backup.html">Auto Backup for Apps</a> training.</p>
+  feature works and how to configure what to back up on the file system, see
+  <a href="{@docRoot}training/backup/autosyncapi.html">Configuring Auto Backup for Apps</a>.</p>
 
 <h2 id="authentication">Authentication</h2>
 <p>This release offers new APIs to let you authenticate users by using their fingerprint scans on
@@ -118,9 +118,9 @@
 device with a fingerprint sensor. You must implement the user interface for the fingerprint
 authentication flow on your app, and use the standard Android fingerprint icon in your UI.
 The Android fingerprint icon ({@code c_fp_40px.png}) is included in the
-<a href="https://github.com/googlesamples/android-FingerprintDialog"
-class="external-link">sample app</a>. If you are developing multiple apps that use fingerprint
-authentication, note that each app must authenticate the user’s fingerprint independently.
+<a href="{@docRoot}samples/FingerprintDialog/index.html">Fingerprint Dialog sample</a>. If you are
+developing multiple apps that use fingerprint authentication, note that each app must authenticate
+the user’s fingerprint independently.
 </p>
 
 <p>To use this feature in your app, first add the
@@ -135,8 +135,8 @@
 style="float:right; margin:0 0 10px 20px" width="282" height="476" />
 
 <p>To see an app implementation of fingerprint authentication, refer to the
-<a href="https://github.com/googlesamples/android-FingerprintDialog" class="external-link">
-  Fingerprint Dialog sample</a>. For a demonstration of how you can use these authentication
+<a href="{@docRoot}samples/FingerprintDialog/index.html">Fingerprint Dialog sample</a>. For a
+demonstration of how you can use these authentication
   APIs in conjunction with other Android APIs, see the video
   <a class="video-shadowbox-button" href="https://www.youtube.com/watch?v=VOn7VrTRlA4">
   Fingerprint and Payment APIs</a>.</p>
@@ -177,7 +177,7 @@
 </p>
 
 <p>To see an app implementation of this feature, refer to the
-<a href="https://github.com/googlesamples/android-ConfirmCredential" class="external-link">
+<a href="{@docRoot}samples/ConfirmCredential/index.html">
   Confirm Credential sample</a>.</p>
 
 <h2 id="direct-share">Direct Share</h2>
@@ -294,8 +294,8 @@
   drawable resource ID.</li>
   <li>New {@link android.app.NotificationManager#getActiveNotifications()} method that allows your
   apps to find out which of their notifications are currently alive. To see an app implementation
-  that uses this feature, see the <a href="https://github.com/googlesamples/android-ActiveNotifications"
-  class="external-link">Active Notifications sample</a>.</li>
+  that uses this feature, see the
+  <a href="{@docRoot}samples/ActiveNotifications/index.html">Active Notifications sample</a>.</li>
 </ul>
 
 <h2 id="bluetooth-stylus">Bluetooth Stylus Support</h2>
diff --git a/docs/html/about/versions/marshmallow/samples.jd b/docs/html/about/versions/marshmallow/samples.jd
index 7bf1492..14c704c 100644
--- a/docs/html/about/versions/marshmallow/samples.jd
+++ b/docs/html/about/versions/marshmallow/samples.jd
@@ -16,7 +16,7 @@
 
 <ul>
 <li id="ActiveNotification">
-<a href="href="{@docRoot}samples/ActiveNotifications/index.html">Active Notification</a>: This sample demonstrates how the
+<a href="{@docRoot}samples/ActiveNotifications/index.html">Active Notification</a>: This sample demonstrates how the
   <a href="{@docRoot}reference/android/app/NotificationManager.html"><code>NotificationManager</code></a>
   can tell you how many notifications your app is currently showing.
 </li>
diff --git a/docs/html/about/versions/marshmallow/testing.jd b/docs/html/about/versions/marshmallow/testing.jd
index d0fa097..c46540f 100644
--- a/docs/html/about/versions/marshmallow/testing.jd
+++ b/docs/html/about/versions/marshmallow/testing.jd
@@ -19,14 +19,14 @@
 </p>
 
 <ul>
-  <li><a href="{@docRoot}training/permissions/index.html">Permissions</a>:
+  <li><a href="{@docRoot}training/permissions/best-practices.html#testing">Permissions</a>:
     Information on the behavior of runtime permissions, of runtime permissions, testing, and best
     practices.
   </li>
-  <li><a href="{@docRoot}training/monitoring-device-state/battery-monitoring.html">Doze and App Standby</a>:
+  <li><a href="{@docRoot}training/monitoring-device-state/doze-standby.html#testing_doze_and_app_standby">Doze and App Standby</a>:
     Information on the behavior of Doze and App Standby, testing, and best practices.
   </li>
-  <li><a href="{@docRoot}training/backup/auto-backup.html">Auto Backup and Device Identifiers</a>:
-    Information on the behavior of auto backup for apps, testing, and best practices.
+  <li><a href="{@docRoot}training/backup/autosyncapi.html#testing">Auto Backup for Apps and Device Identifiers</a>:
+    Information on the behavior of Auto Backup for Apps, testing, and best practices.
   </li>
 </ul>
\ No newline at end of file
diff --git a/docs/html/training/app-links/index.jd b/docs/html/training/app-links/index.jd
index aed73c8..cef505e 100644
--- a/docs/html/training/app-links/index.jd
+++ b/docs/html/training/app-links/index.jd
@@ -557,7 +557,7 @@
         &lt;/intent-filter&gt;
       &lt;/activity&gt;
 
-  &lt;/application&gt;
+&lt;/application&gt;
 </pre>
 
 <p>
diff --git a/docs/html/training/backup/autosyncapi.jd b/docs/html/training/backup/autosyncapi.jd
index ee8a162..1e070e6 100644
--- a/docs/html/training/backup/autosyncapi.jd
+++ b/docs/html/training/backup/autosyncapi.jd
@@ -266,7 +266,7 @@
 
 <p>If you are creating a new app that targets Android 6.0, but you also want to enable cloud backup
 for devices running on Android 5.1 (API level 22) and lower, you must also
-<a href="{@docRoot}training/cloudsync/backupapi.html">implement the Backup API</a>.</p>
+<a href="{@docRoot}training/backup/backupapi.html">implement the Backup API</a>.</p>
 
 <h2 id="testing">Test Backup Configuration</h2>
 
diff --git a/docs/html/training/backup/backupapi.jd b/docs/html/training/backup/backupapi.jd
index c366f06..cdbca56 100644
--- a/docs/html/training/backup/backupapi.jd
+++ b/docs/html/training/backup/backupapi.jd
@@ -94,23 +94,23 @@
 <p>Here's an example that backs up a high scores file.</p>
 
 <pre>
- import android.app.backup.BackupAgentHelper;
- import android.app.backup.FileBackupHelper;
+import android.app.backup.BackupAgentHelper;
+import android.app.backup.FileBackupHelper;
 
 
- public class TheBackupAgent extends BackupAgentHelper {
-    // The name of the SharedPreferences file
-    static final String HIGH_SCORES_FILENAME = "scores";
+public class TheBackupAgent extends BackupAgentHelper {
+  // The name of the SharedPreferences file
+  static final String HIGH_SCORES_FILENAME = "scores";
 
-    // A key to uniquely identify the set of backup data
-    static final String FILES_BACKUP_KEY = "myfiles";
+  // A key to uniquely identify the set of backup data
+  static final String FILES_BACKUP_KEY = "myfiles";
 
-    // Allocate a helper and add it to the backup agent
-    &#64;Override
-    void onCreate() {
-        FileBackupHelper helper = new FileBackupHelper(this, HIGH_SCORES_FILENAME);
-        addHelper(FILES_BACKUP_KEY, helper);
-    }
+  // Allocate a helper and add it to the backup agent
+  &#64;Override
+  void onCreate() {
+      FileBackupHelper helper = new FileBackupHelper(this, HIGH_SCORES_FILENAME);
+      addHelper(FILES_BACKUP_KEY, helper);
+  }
 }
 </pre>
 <p>For added flexibility, {@link android.app.backup.FileBackupHelper}'s
@@ -118,11 +118,11 @@
 have backed up both a high scores file and a game progress file just by adding
 an extra parameter, like this:</p>
 <pre>
-    &#64;Override
-    void onCreate() {
-        FileBackupHelper helper = new FileBackupHelper(this, HIGH_SCORES_FILENAME, PROGRESS_FILENAME);
-        addHelper(FILES_BACKUP_KEY, helper);
-    }
+&#64;Override
+  void onCreate() {
+      FileBackupHelper helper = new FileBackupHelper(this, HIGH_SCORES_FILENAME, PROGRESS_FILENAME);
+      addHelper(FILES_BACKUP_KEY, helper);
+  }
 </pre>
 <p>Backing up preferences is similarly easy.  Create a {@link
 android.app.backup.SharedPreferencesBackupHelper}  the same way you did a {@link
@@ -132,26 +132,26 @@
 high scores are implemented as preferences instead of a flat file:</p>
 
 <pre>
- import android.app.backup.BackupAgentHelper;
- import android.app.backup.SharedPreferencesBackupHelper;
+import android.app.backup.BackupAgentHelper;
+import android.app.backup.SharedPreferencesBackupHelper;
 
- public class TheBackupAgent extends BackupAgentHelper {
-     // The names of the SharedPreferences groups that the application maintains.  These
-     // are the same strings that are passed to getSharedPreferences(String, int).
-     static final String PREFS_DISPLAY = "displayprefs";
-     static final String PREFS_SCORES = "highscores";
+public class TheBackupAgent extends BackupAgentHelper {
+    // The names of the SharedPreferences groups that the application maintains.  These
+    // are the same strings that are passed to getSharedPreferences(String, int).
+    static final String PREFS_DISPLAY = "displayprefs";
+    static final String PREFS_SCORES = "highscores";
 
-     // An arbitrary string used within the BackupAgentHelper implementation to
-     // identify the SharedPreferencesBackupHelper's data.
-     static final String MY_PREFS_BACKUP_KEY = "myprefs";
+    // An arbitrary string used within the BackupAgentHelper implementation to
+    // identify the SharedPreferencesBackupHelper's data.
+    static final String MY_PREFS_BACKUP_KEY = "myprefs";
 
-     // Simply allocate a helper and install it
-     void onCreate() {
-         SharedPreferencesBackupHelper helper =
-                 new SharedPreferencesBackupHelper(this, PREFS_DISPLAY, PREFS_SCORES);
-         addHelper(MY_PREFS_BACKUP_KEY, helper);
-     }
- }
+    // Simply allocate a helper and install it
+    void onCreate() {
+       SharedPreferencesBackupHelper helper =
+                new SharedPreferencesBackupHelper(this, PREFS_DISPLAY, PREFS_SCORES);
+        addHelper(MY_PREFS_BACKUP_KEY, helper);
+    }
+}
 </pre>
 
 <p>You can add as many backup helper instances to your backup agent helper as you
@@ -168,13 +168,13 @@
 android.app.backup.BackupManager#dataChanged()} method.</p>
 
 <pre>
- import android.app.backup.BackupManager;
- ...
+import android.app.backup.BackupManager;
+...
 
- public void requestBackup() {
-   BackupManager bm = new BackupManager(this);
-   bm.dataChanged();
- }
+public void requestBackup() {
+  BackupManager bm = new BackupManager(this);
+  bm.dataChanged();
+}
 </pre>
 
 <p>This call notifies the backup manager that there is data ready to be backed
diff --git a/docs/html/training/monitoring-device-state/doze-standby.jd b/docs/html/training/monitoring-device-state/doze-standby.jd
index fb713aa..ec4da80 100644
--- a/docs/html/training/monitoring-device-state/doze-standby.jd
+++ b/docs/html/training/monitoring-device-state/doze-standby.jd
@@ -20,7 +20,7 @@
         <li><a href="#restrictions">Doze Restrictions</a></li>
         <li><a href="#assessing_your_app">Assessing Your App</a></li>
         <li><a href="#using_gcm">Using GCM to Interact with Your App</a></li>
-        <li><a href="#support_for_other_use">Support for Other Use-Cases</a></li>
+        <li><a href="#support_for_other_use-cases">Support for Other Use-Cases</a></li>
       </ol>
       </li>
       <li><a href="#understand_app_standby">Understanding App Standby</a></li>
diff --git a/docs/html/training/monitoring-device-state/index.jd b/docs/html/training/monitoring-device-state/index.jd
index fce9f81..9507956 100644
--- a/docs/html/training/monitoring-device-state/index.jd
+++ b/docs/html/training/monitoring-device-state/index.jd
@@ -6,10 +6,10 @@
 
 @jd:body
 
-<div id="tb-wrapper"> 
+<div id="tb-wrapper">
 <div id="tb">
 
-<h2>Dependencies and prerequisites</h2> 
+<h2>Dependencies and prerequisites</h2>
 <ul>
   <li>Experience with <a href="{@docRoot}guide/components/intents-filters.html">Intents and Intent Filters</a></li>
 </ul>
@@ -19,7 +19,7 @@
   <li><a href="{@docRoot}guide/components/services.html">Services</a>
 </ul>
 
-</div> 
+</div>
 </div>
 
 <p>For your app to be a good citizen, it should seek to limit its impact on the battery life of its
@@ -30,14 +30,14 @@
 reducing the rate of such updates when the battery level is low, you can ensure that the impact of
 your app on battery life is minimized, without compromising the user experience.</p>
 
-<h2>Lessons</h2> 
- 
+<h2>Lessons</h2>
+
 <!-- Create a list of the lessons in this class along with a short description of each lesson.
 These should be short and to the point. It should be clear from reading the summary whether someone
-will want to jump to a lesson or not.--> 
- 
+will want to jump to a lesson or not.-->
+
 <dl>
-  <dt><b><a href="doze-standby.html">Optimiing for Doze and App Standby</a></b></dt>
+  <dt><b><a href="doze-standby.html">Optimizing for Doze and App Standby</a></b></dt>
   <dd>Learn how to test and optimize your app for the power-management features introduced in
   Android 6.0 Marshmallow.</dd>
 
@@ -53,7 +53,7 @@
 
   <dt><b><a href="connectivity-monitoring.html">Determining and Monitoring the Connectivity
 Status</a></b></dt>
-  <dd>Without Internet connectivity you can't update your app from an online source. Learn how to  
+  <dd>Without Internet connectivity you can't update your app from an online source. Learn how to
 check the connectivity status to alter your background update rate. You'll also learn to check for
 Wi-Fi or mobile connectivity before beginning high-bandwidth operations.</dd>
 
@@ -62,4 +62,4 @@
 those that aren't necessary due to the current device state. Learn to improve
 efficiency by toggling and cascading state change receivers and delay actions until the device is in
 a specific state.</dd>
-</dl> 
+</dl>
diff --git a/docs/html/training/training_toc.cs b/docs/html/training/training_toc.cs
index bb998ed..a4fc1ef 100644
--- a/docs/html/training/training_toc.cs
+++ b/docs/html/training/training_toc.cs
@@ -280,6 +280,30 @@
           </li>
         </ul>
       </li>
+      <li class="nav-section">
+        <div class="nav-section-header">
+          <a href="<?cs var:toroot ?>training/permissions/index.html"
+             description=
+             "How to declare that your app needs access to features and
+             resources outside of its 'sandbox', and how to request those
+             privileges at runtime."
+            >Working with System Permissions</a>
+        </div>
+        <ul>
+          <li><a href="<?cs var:toroot ?>training/permissions/declaring.html">
+            Declaring Permissions
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/permissions/requesting.html">
+            Requesting Permissions at Run Time
+          </a>
+          </li>
+          <li><a href="<?cs var:toroot ?>training/permissions/best-practices.html">
+            Best Practices for Runtime Permissions
+          </a>
+          </li>
+        </ul>
+      </li>
 
     </ul>
   </li><!-- end getting started -->
@@ -1823,6 +1847,9 @@
             </a>
         </div>
         <ul>
+         <li><a href="<?cs var:toroot ?>training/monitoring-device-state/doze-standby.html"
+            >Optimizing for Doze and App Standby</a>
+          </li>
           <li><a href="<?cs var:toroot ?>training/monitoring-device-state/battery-monitoring.html"
             zh-cn-lang="监控电池电量和充电状态"
             ja-lang="電池残量と充電状態の監視"