Merge "Docs: Adding CDD_README.txt to compatibility directory"
diff --git a/src/accessories/audio.jd b/src/accessories/audio.jd
index 0b61b3f..5e2d32c 100644
--- a/src/accessories/audio.jd
+++ b/src/accessories/audio.jd
@@ -48,7 +48,8 @@
 href="custom.html#audio-over-usb">Connecting custom audio over USB</a>.</p>
 <p>Host mode enables the Android device to drive the USB bus and operate with a
 wide range of USB-based peripherals, including audio interfaces. Host mode
-audio is described in <a href="{@docRoot}devices/audio/usb.html">USB Digital Audio</a>
+audio is described in <a href="{@docRoot}devices/audio/usb.html">USB Digital Audio</a>.
+</p>
 
 <h2 id="audio-over-bluetooth">Audio over Bluetooth</h2>
 <p>An accessory that connects with Android over Bluetooth can use an Advanced Audio Distribution
diff --git a/src/compatibility/5.0/android-5.0-cdd.html b/src/compatibility/5.0/android-5.0-cdd.html
index 27e19ea..6334c85 100644
--- a/src/compatibility/5.0/android-5.0-cdd.html
+++ b/src/compatibility/5.0/android-5.0-cdd.html
@@ -4851,8 +4851,7 @@
 the port at bottom. Existing and new Android devices are <strong>very strongly encouraged to meet these requirements</strong> so they will be able to upgrade to future platform releases.
   <li> It MUST allow a USB host connected with the Android device to access the
 contents of the shared storage volume using either USB mass storage or Media
-Transfer Protocol, if the device reports the android.hardware.feature.output
-feature or the android.hardware.camera feature.
+Transfer.
   <li> It SHOULD implement the Android Open Accessory (AOA) API and specification as
 documented in the Android SDK documentation, and if it is an Android Handheld
 device it MUST implement the AOA API. Device implementations implementing the
@@ -4993,12 +4992,12 @@
 implementations MUST meet the following requirements: </p>
 
 <ul>
-  <li> <strong>Consistent frame latency</strong>—Inconsistent frame latency or a delay to render frames MUST NOT happen more
+  <li> <strong>Consistent frame latency</strong>Inconsistent frame latency or a delay to render frames MUST NOT happen more
 often than 5 frames in a second, and SHOULD be below 1 frames in a second. 
-  <li> <strong>User interface latency</strong>—Device implementations MUST ensure low latency user experience by scrolling a
+  <li> <strong>User interface latency</strong>Device implementations MUST ensure low latency user experience by scrolling a
 list of 10K list entries as defined by the Android Compatibility Test Suite
 (CTS) in less than 36 secs. 
-  <li> <strong>Task switching</strong>—When multiple applications have been launched, re-launching an already-running
+  <li> <strong>Task switching</strong>When multiple applications have been launched, re-launching an already-running
 application after it has been launched MUST take less than 1 second.
 </ul>
 
@@ -5009,13 +5008,13 @@
 and write operations. </p>
 
 <ul>
-  <li> <strong>Sequential write</strong>—Device implementations MUST ensure a sequential write performance of 10MB/s
+  <li> <strong>Sequential write</strong>Device implementations MUST ensure a sequential write performance of 5MB/s
 for a 256MB file using 10MB write buffer. 
-  <li> <strong>Random write</strong>—Device implementations MUST ensure a random write performance of 0.5MB/s for a
+  <li> <strong>Random write</strong>Device implementations MUST ensure a random write performance of 0.5MB/s for a
 256MB file using 4KB write buffer. 
-  <li> <strong>Sequential read</strong>—Device implementations MUST ensure a sequential read performance of 15MB/s for
+  <li> <strong>Sequential read</strong>Device implementations MUST ensure a sequential read performance of 15MB/s for
 a 256MB file using 10MB write buffer. 
-  <li> <strong>Random read</strong>—Device implementations MUST ensure a random read performance of 3.5MB/s for a
+  <li> <strong>Random read</strong>Device implementations MUST ensure a random read performance of 3.5MB/s for a
 256MB file using 4KB write buffer. 
 </ul>
 
@@ -5900,7 +5899,7 @@
 <p>9.9. Full-Disk Encryption</p>
 </td>
     <td>
-<p>Devices with a lock screen MUST support full-disk encryption. For new devices,
+<p>Devices with a lock screen SHOULD support full-disk encryption. For new devices,
 full-disk encryption must be enabled out of box. </p>
 </td>
  </tr>
diff --git a/src/compatibility/5.1/android-5.1-cdd.html b/src/compatibility/5.1/android-5.1-cdd.html
index 9b9ff55..a53df74 100644
--- a/src/compatibility/5.1/android-5.1-cdd.html
+++ b/src/compatibility/5.1/android-5.1-cdd.html
@@ -960,7 +960,7 @@
 build from the upstream Android Open Source Project for Android 5.1. This build
 includes a specific set of functionality and security fixes for the WebView [<a href="http://www.chromium.org/">Resources, 13</a>].</li>
   <li>The user agent string reported by the WebView MUST be in this format:
-<p>Mozilla/5.1 (Linux; Android $(VERSION); $(MODEL) Build/$(BUILD)$(WEBVIEW))
+<p>Mozilla/5.0 (Linux; Android $(VERSION); $(MODEL) Build/$(BUILD)$(WEBVIEW))
 AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 $(CHROMIUM_VER) Mobile
 Safari/537.36</p>
   <ul>
@@ -1079,7 +1079,7 @@
 namespaces. Additionally, if a device implementation includes custom APIs
 outside the standard Android namespace, those APIs MUST be packaged in an
 Android shared library so that only apps that explicitly use them (via the
-<uses-library> mechanism) are affected by the increased memory usage of such
+&lt;uses-library&gt; mechanism) are affected by the increased memory usage of such
 APIs.</p>
 
 <p>If a device implementer proposes to improve one of the package namespaces above
@@ -1622,7 +1622,7 @@
 <p>(AAC LC)</td>
     <td>REQUIRED<sup>1</sup></td>
     <td>REQUIRED</td>
-    <td>Support for mono/stereo/5.0/5.12 content with standard sampling rates from 8 to
+    <td>Support for mono/stereo/5.0/5.1<sup>2</sup> content with standard sampling rates from 8 to
 48 kHz.</td>
     <td>
     <ul>
@@ -1636,7 +1636,7 @@
     <td>MPEG-4 HE AAC Profile (AAC+)</td>
     <td>REQUIRED<sup>1</sup><br>(Android 4.1+)</td>
     <td>REQUIRED</td>
-    <td>Support for mono/stereo/5.0/5.12 content with standard sampling rates from 16
+    <td>Support for mono/stereo/5.0/5.1<sup>2</sup> content with standard sampling rates from 16
 to 48 kHz.</td>
     <td></td>
  </tr>
@@ -1646,7 +1646,7 @@
 <p>Profile (enhanced AAC+)</td>
     <td> </td>
     <td>REQUIRED</td>
-    <td>Support for mono/stereo/5.0/5.12 content with standard sampling rates from 16
+    <td>Support for mono/stereo/5.0/5.1<sup>2</sup> content with standard sampling rates from 16
 to 48 kHz.</td>
     <td></td>
  </tr>
@@ -1837,7 +1837,7 @@
     <td>3GPP (.3gp)</td>
  </tr>
  <tr>
-    <td>VP83</td>
+    <td>VP8<sup>3</sup></td>
     <td>REQUIRED<sup>2</sup></p>
 
 <p>(Android 4.3+)</td>
@@ -1847,7 +1847,7 @@
     <td>See <a href="#5_2_video_encoding">section 5.2</a> and <a href="#5_3_video_decoding">5.3</a> for details</td>
     <td><ul>
     <li class="table_list">WebM (.webm) [<a href="http://www.webmproject.org/">Resources, 110</a></li>
-    <li class="table_list">Matroska (.mkv, Android 4.0+)4</li></ul></td>
+    <li class="table_list">Matroska (.mkv, Android 4.0+)<sup>4</sup></li></ul></td>
  </tr>
  <tr>
     <td>VP9</td>
@@ -1856,7 +1856,7 @@
     <td>See <a href="#5_3_video_decoding">section 5.3</a> for details</td>
     <td><ul>
     <li class="table_list">WebM (.webm) [<a href="http://www.webmproject.org/">Resources, 110</a>]</li>
-    <li class="table_list">Matroska (.mkv, Android 4.0+)4</li></ul></td>
+    <li class="table_list">Matroska (.mkv, Android 4.0+)<sup>4</sup></li></ul></td>
  </tr>
 </table>
 
@@ -1965,7 +1965,8 @@
 
 
 <p>Device implementations MUST support dynamic video resolution switching within
-the same stream for VP8, VP9, H.264, and H.265 codecs.</p>
+the same stream for all VP8, VP9, H.264, and H.265 codecs exposed to developers
+through the standard Android APIs.</p>
 
 <p>Android device implementations with H.264 decoders, MUST support Baseline
 Profile Level 3 and the following SD video decoding profiles and SHOULD support
@@ -2507,7 +2508,7 @@
 <p>Devices MUST NOT change their reported screen size at any time.</p>
 
 <p>Applications optionally indicate which screen sizes they support via the
-<supports-screens> attribute in the AndroidManifest.xml file. Device
+&lt;supports-screens&gt; attribute in the AndroidManifest.xml file. Device
 implementations MUST correctly honor applications' stated support for small,
 normal, large, and xlarge screens, as described in the Android SDK
 documentation.</p>
@@ -2597,7 +2598,7 @@
 OpenGL ES 1.0, OpenGL ES 2.0, OpenGL ES 3.0 or OpenGL 3.1. That is:</p>
 
 <ul>
-  <li>The managed APIs (such as via the GLES10.getString()method MUST report support
+  <li>The managed APIs (such as via the GLES10.getString() method) MUST report support
 for OpenGL ES 1.0 and OpenGL ES 2.0.</li>
   <li>The native C/C++ OpenGL APIs (APIs available to apps via libGLES_v1CM.so,
 libGLES_v2.so, or libEGL.so) MUST report support for OpenGL ES 1.0 and OpenGL
@@ -2944,14 +2945,14 @@
     <td><a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_UP">D-pad up</a><sup>1</sup></p>
 
 <p><a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_DOWN">D-pad down</a><sup>1</sup></td>
-    <td>0x01 0x00393</td>
+    <td>0x01 0x0039<sup>3</sup></td>
     <td><a href="http://developer.android.com/reference/android/view/MotionEvent.html#AXIS_HAT_Y">AXIS_HAT_Y</a><sup>4</sup></td>
  </tr>
  <tr>
     <td><a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_LEFT">D-pad left</a>1</p>
 
 <p><a href="http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_RIGHT">D-pad right</a><sup>1</sup></td>
-    <td>0x01 0x00393</td>
+    <td>0x01 0x0039<sup>3</sup></td>
     <td><a href="http://developer.android.com/reference/android/view/MotionEvent.html#AXIS_HAT_X">AXIS_HAT_X</a><sup>4</sup></td>
  </tr>
  <tr>
@@ -3729,12 +3730,12 @@
  </tr>
  <tr>
     <td><ul>
-    <li class="table_list">hdpi or lower on small/normal screens</li>
+    <li class="table_list">280dpi or lower on small/normal screens</li>
     <li class="table_list">mdpi or lower on large screens</li>
     <li class="table_list">ldpi or lower on extra large screens</li>
     </ul></td>
     <td>424MB</td>
-    <td>Not applicable</td>
+    <td>704MB</td>
  </tr>
  <tr>
     <td><ul>
@@ -4067,7 +4068,7 @@
 
 <p>Alternate runtimes MUST NOT be granted access to resources protected by
 permissions not requested in the runtime&rsquo;s AndroidManifest.xml file via the
-<uses-permission> mechanism.</p>
+&lt;uses-permission&gt; mechanism.</p>
 
 <p>Alternate runtimes MUST NOT permit applications to make use of features
 protected by Android permissions restricted to system applications.</p>
diff --git a/src/compatibility/5.1/android-5.1-cdd.pdf b/src/compatibility/5.1/android-5.1-cdd.pdf
index 78a9857..55023f5 100644
--- a/src/compatibility/5.1/android-5.1-cdd.pdf
+++ b/src/compatibility/5.1/android-5.1-cdd.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-body.pdf b/src/compatibility/5.1/android-cdd-body.pdf
index df0552d..d9dbad3 100644
--- a/src/compatibility/5.1/android-cdd-body.pdf
+++ b/src/compatibility/5.1/android-cdd-body.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-cover.pdf b/src/compatibility/5.1/android-cdd-cover.pdf
index 90f12e9..0b6649a 100644
--- a/src/compatibility/5.1/android-cdd-cover.pdf
+++ b/src/compatibility/5.1/android-cdd-cover.pdf
Binary files differ
diff --git a/src/compatibility/5.1/android-cdd-cover_5_1.html b/src/compatibility/5.1/android-cdd-cover_5_1.html
index 25eaefe..12461b9 100644
--- a/src/compatibility/5.1/android-cdd-cover_5_1.html
+++ b/src/compatibility/5.1/android-cdd-cover_5_1.html
@@ -24,7 +24,7 @@
 <tr>
 <td>
 <p class="subtitle">Android 5.1</p>
-<p class="cover-text">Last updated: June 9th, 2015</p>
+<p class="cover-text">Last updated: July 10th, 2015</p>
 <p class="cover-text">Copyright &copy; 2015, Google Inc. All rights reserved.</p>
 <p class="cover-text"><a href="mailto:compatibility@android.com">compatibility@android.com</a></p>
 </td>
diff --git a/src/compatibility/5.1/android-cdd-footer.html b/src/compatibility/5.1/android-cdd-footer.html
new file mode 100644
index 0000000..fce6481
--- /dev/null
+++ b/src/compatibility/5.1/android-cdd-footer.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Android 5.1 Compatibility Definition Footer</title>
+<link rel="stylesheet" type="text/css" href="android-cdd.css"/>
+
+<script>
+  function subst() {
+    var vars={};
+    var x=window.location.search.substring(1).split('&');
+    for (var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
+    var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
+    for (var i in x) {
+      var y = document.getElementsByClassName(x[i]);
+      for (var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
+    }
+  }
+</script>
+
+</head>
+
+<body style="border:0; margin: 0;" onload="subst()">
+<div class="footer">
+
+<table class="noborder" style="border-top: 1px solid silver; width: 100%">
+    <tr>
+      <td class="noborder"><img src="../images/android-logo.png" alt="Android logo"/></td>
+      <td class="noborder" style="text-align:right">
+        Page <span class="page"></span> of <span class="topage"></span>
+      </td>
+    </tr>
+</table>
+
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/src/compatibility/5.1/android-cdd.css b/src/compatibility/5.1/android-cdd.css
new file mode 100644
index 0000000..83c46bc
--- /dev/null
+++ b/src/compatibility/5.1/android-cdd.css
@@ -0,0 +1,372 @@
+/**
+* Link Styles
+*/
+
+
+a:link {
+    color: #09C;
+    text-decoration: underline;
+}
+
+a:visited {
+    color: #639;
+}
+
+a:hover,
+a:focus,
+a:active {
+    color: #09C;
+}
+
+/**
+* Cover Styles
+*/
+
+
+#cover {
+    width: 10.5in;
+    height: 13.25in;
+    background-color: orange;
+}
+
+#cover-top {
+    background-color: black;
+    width: 100%;
+    height: 3in;
+    padding-top: 70px;
+    margin-bottom: 10px;
+}
+
+#cover-image {
+    background-color: black;
+    width: 100%;
+    height: 5in;
+    padding: 0px;
+    margin: 20px 0px 8px 0px;
+}
+
+#cover-bottom {
+    background-color: black;
+    width: 100%;
+    height: 3.7in;
+    padding: 40px 0px 40px 0px;
+    margin-top: 8px;
+}
+
+#cover a:link,
+#cover a:visited,
+#cover a:hover {
+ text-decoration: none;
+}
+
+#main {
+    width: 950px;
+    overflow: visible;
+    page-break-before: always;
+}
+
+#footer {
+    width: 8.5in;
+    height: .75in;
+    margin-top: .25in;
+    color: #333;
+    font: 10pt/14pt Roboto, Arial, Helvetica, sans-serif;
+}
+
+
+.title {
+    color: white;
+    font: 84px/90px Roboto, Arial, Helvetica, sans-serif;
+    padding: 40pt 20pt 15pt 50pt;
+    text-align: left;
+}
+
+.subtitle {
+    color: white;
+    font: 60px/70px Roboto, Arial, Helvetica, sans-serif;
+    padding: 40pt 5pt 40pt 60pt;
+    text-align: left;
+}
+
+.right {
+    text-align: right;
+}
+
+.white {
+    color: white;
+}
+
+.padding {
+    padding: 20pt 20pt 0pt 60pt;
+}
+
+.cover-text {
+    font: 20px/25px Roboto, Arial, Helvetica, sans-serif;
+    color: white;
+    padding: 5pt 5pt 5pt 60pt;
+    text-align: left;
+}
+
+.small {
+    font-size: 65%;
+    font-weight: 700;
+}
+
+/**
+* Heading Styles
+*/
+
+h1 {
+    color: #333;
+    font: 22pt/24pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10pt 0pt 0pt 0pt;
+    text-align: left;
+}
+
+h2 {
+    color: #693;
+    font: 20pt/22pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 8pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+h3 {
+    color: #333;
+    font: bold 18pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 4pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+h4 {
+    color: #607D8B;
+    font: bold 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 4pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+
+h5 {
+    color: #333;
+    font: italic 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 0pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-after: avoid;
+}
+
+
+/**
+* Use h6 ONLY for table of contents
+*/
+
+h6 {
+    color: #333;
+    font: bold 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10pt 0pt 0pt 0pt;
+    text-align: left;
+    page-break-before: always;
+}
+
+/**
+* Body Styles
+*/
+
+body {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 5pt 5pt 10pt;
+}
+
+p {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 0pt 1pt 0pt;
+}
+
+li {
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 2pt 50pt 2pt 0pt;
+}
+
+sup {
+    font-weight: 800;
+    font-size: 10pt;
+}
+
+/**
+* Table Styles
+*/
+
+
+table {
+    border: 1px solid gray;
+    border-collapse: collapse;
+    margin: 10px 0px 10px 0px;
+    width: 100%;
+    overflow: visible;
+}
+
+td {
+    border: 1px solid gray;
+    color: #333;
+    font: 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 5pt;
+    overflow: visible;
+}
+
+th {
+    background-color: #CCC;
+    border: 1px solid gray;
+    color: #333;
+    font: bold 16pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 5pt;
+    overflow: visible;
+}
+
+p.table_footnote {
+    color: #333;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin: 0;
+    padding: 5pt 5pt 5pt 5pt;
+}
+
+li.table_list {
+    color: #333;
+    font: 16pt/20t Roboto, Arial, Helvetica, sans-serif;
+    margin-left: -10pt;
+    padding: 2pt 0pt 2pt 0pt;
+}
+
+
+/**
+* Used in the footer
+*/
+
+table.noborder {
+    border: 0px;
+    margin: 10px 0px 10px 0px;
+    width: 100%;
+}
+
+td.noborder {
+    border: 0px;
+    color: #333;
+    font: 10pt/12pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 10px 0px 5px 0px;
+}
+
+
+
+/**
+* TOC Styles
+*/
+
+#toc a:link,
+#toc a:visited,
+#toc a:hover {
+ color: black;
+ text-decoration: none;
+}
+
+#toc p.toc_h1 a:link,
+#toc p.toc_h1 a:visited,
+#toc p.toc_h1 a:hover {
+ color: #99CC00;
+}
+
+#toc {
+    width: 950px;
+}
+
+#toc_left,
+#toc_left_2 {
+    float: left;
+    padding-top:15px;
+    padding-bottom:15px;
+    width: 470px;
+}
+
+#toc_right,
+#toc_right_2 {
+    float: right;
+    padding-top:15px;
+    padding-bottom:15px;
+    width: 470px;
+}
+
+p.toc_h1 {
+    color: #99CC00;
+    font: 20pt/22pt Roboto, Arial, Helvetica, sans-serif;
+    padding: 15px 0px 0px 0px;
+}
+
+p.toc_h2 {
+    color: black;
+    font: 18pt/20pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 20px;
+    padding: 15px 0px 0px 0px;
+}
+
+p.toc_h3 {
+    color: black;
+    font: 16pt/18pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 45px;
+    padding: 10px 0px 0px 0px;
+}
+
+p.toc_h4 {
+    color: black;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 85px;
+    padding: 10px 0px 0px 0px;
+}
+
+p.toc_h5 {
+    color: black;
+    font: 14pt/16pt Roboto, Arial, Helvetica, sans-serif;
+    margin-left: 105px;
+}
+
+/**
+* Note Styles
+*/
+
+
+div.note 
+    {
+        border-left: 20px solid #0099cc;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+div.tip 
+    {
+        border-left: 4px solid #93c47d;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+div.warning 
+    {
+        border-left: 4px solid red;
+        padding-left: 10px;
+        margin: 5px 40px 5px 5px;
+    }
+
+/**
+* Media Styles
+*/
+
+@media print {
+
+    @page {
+        margin: 1in;
+    }
+
+ }
\ No newline at end of file
diff --git a/src/compatibility/android-5.1-cdd.pdf b/src/compatibility/android-5.1-cdd.pdf
index 78a9857..55023f5 100644
--- a/src/compatibility/android-5.1-cdd.pdf
+++ b/src/compatibility/android-5.1-cdd.pdf
Binary files differ
diff --git a/src/compatibility/android-cdd.pdf b/src/compatibility/android-cdd.pdf
index 78a9857..55023f5 100644
--- a/src/compatibility/android-cdd.pdf
+++ b/src/compatibility/android-cdd.pdf
Binary files differ
diff --git a/src/compatibility/downloads.jd b/src/compatibility/downloads.jd
index 04d1749..3222dfd 100644
--- a/src/compatibility/downloads.jd
+++ b/src/compatibility/downloads.jd
@@ -30,43 +30,43 @@
 <h2 id="android-51">Android 5.1</h2>
 <p>Android 5.1 is the release of the development milestone code-named Lollipop-MR1.
 The source code for the following tests can be synced with the
-'android-cts-5.1_r1' tag in the open source tree.</p>
+'android-cts-5.1_r2' tag in the open source tree.</p>
 <ul>
 <li><a href="5.1/android-5.1-cdd.pdf">Android 5.1 Compatibility Definition
 Document (CDD)</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.1_r1-linux_x86-arm.zip">Android
-5.1 R1 Compatibility Test Suite (CTS) - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.1_r2-linux_x86-arm.zip">Android
+5.1 R2 Compatibility Test Suite (CTS) - ARM</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.1_r1-linux_x86-x86.zip">Android
-5.1 R1 Compatibility Test Suite (CTS) - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.1_r2-linux_x86-x86.zip">Android
+5.1 R2 Compatibility Test Suite (CTS) - x86</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r1-linux_x86-arm.zip">Android
-5.1 R1 CTS Verifier - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r2-linux_x86-arm.zip">Android
+5.1 R2 CTS Verifier - ARM</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r1-linux_x86-x86.zip">Android
-5.1 R1 CTS Verifier - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.1_r2-linux_x86-x86.zip">Android
+5.1 R2 CTS Verifier - x86</a></li>
 </ul>
 
 <h2 id="android-50">Android 5.0</h2>
 <p>Android 5.0 is the release of the development milestone code-named Lollipop.
 The source code for the following tests can be synced with the
-'android-cts-5.0_r2' tag in the open source tree.</p>
+'android-cts-5.0_r3' tag in the open source tree.</p>
 <ul>
 <li><a href="5.0/android-5.0-cdd.pdf">Android 5.0 Compatibility Definition
 Document (CDD)</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.0_r2-linux_x86-arm.zip">Android
-5.0 R2 Compatibility Test Suite (CTS) - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.0_r3-linux_x86-arm.zip">Android
+5.0 R3 Compatibility Test Suite (CTS) - ARM</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-5.0_r2-linux_x86-x86.zip">Android
-5.0 R2 Compatibility Test Suite (CTS) - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-5.0_r3-linux_x86-x86.zip">Android
+5.0 R3 Compatibility Test Suite (CTS) - x86</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r2-linux_x86-arm.zip">Android
-5.0 R2 CTS Verifier - ARM</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r3-linux_x86-arm.zip">Android
+5.0 R3 CTS Verifier - ARM</a></li>
 <li><a
-href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r2-linux_x86-x86.zip">Android
-5.0 R2 CTS Verifier - x86</a></li>
+href="https://dl.google.com/dl/android/cts/android-cts-verifier-5.0_r3-linux_x86-x86.zip">Android
+5.0 R3 CTS Verifier - x86</a></li>
 </ul>
 
 <h2 id="android-44">Android 4.4</h2>
diff --git a/src/compatibility/images/android-logo.png b/src/compatibility/images/android-logo.png
new file mode 100644
index 0000000..4ad113c
--- /dev/null
+++ b/src/compatibility/images/android-logo.png
Binary files differ
diff --git a/src/devices/audio/avoiding_pi.jd b/src/devices/audio/avoiding_pi.jd
index 2e0a07a..022c766 100644
--- a/src/devices/audio/avoiding_pi.jd
+++ b/src/devices/audio/avoiding_pi.jd
@@ -78,6 +78,13 @@
 </p>
 
 <p>
+A common workaround for priority inversion is to increase audio buffer sizes.
+However, this method increases latency and merely hides the problem
+instead of solving it. It is better to understand and prevent priority
+inversion, as seen below.
+</p>
+
+<p>
 In the Android audio implementation, priority inversion is most
 likely to occur in these places. And so you should focus your attention here:
 </p>
diff --git a/src/devices/audio/implement.jd b/src/devices/audio/implement.jd
index 28f06b7..f8e2116 100644
--- a/src/devices/audio/implement.jd
+++ b/src/devices/audio/implement.jd
@@ -1,4 +1,4 @@
-page.title=Audio
+page.title=Audio Implementation
 @jd:body
 
 <!--
diff --git a/src/devices/audio/index.jd b/src/devices/audio/index.jd
index bfa616d..82a3886 100644
--- a/src/devices/audio/index.jd
+++ b/src/devices/audio/index.jd
@@ -17,14 +17,6 @@
     limitations under the License.
 -->
 
-<div id="qv-wrapper">
-  <div id="qv">
-    <h2>In this document</h2>
-    <ol id="auto-toc">
-    </ol>
-  </div>
-</div>
-
 <img style="float: right; margin: 0px 15px 15px 15px;"
 src="images/ape_fwk_hal_audio.png" alt="Android Audio HAL icon"/>
 
@@ -127,4 +119,4 @@
 <a href="http://developer.android.com/reference/android/media/package-summary.html">android.media</a>.
 </dd>
 
-</dl>
\ No newline at end of file
+</dl>
diff --git a/src/devices/audio/latency_app.jd b/src/devices/audio/latency_app.jd
index 22e3984..5672147 100644
--- a/src/devices/audio/latency_app.jd
+++ b/src/devices/audio/latency_app.jd
@@ -165,10 +165,16 @@
 
 <dl>
 
-<dt><a href="https://www.youtube.com/watch?v=d3kfEeMZ65c">Google I/O 2013 - High performance audio on Android</a></dt>
+<dt><a href="https://youtu.be/d3kfEeMZ65c">High performance audio on Android</a>
+(Google I/O 2013)</dt>
 <dd>The whole video is about latency.</dd>
 
-<dt><a href="https://www.youtube.com/watch?v=92fgcUNCHic">Google I/O 2014 - Building great multi-media experiences on Android</a></dt>
+<dt><a href="https://youtu.be/92fgcUNCHic">Building great multi-media experiences on Android</a>
+(Google I/O 2014)</dt>
 <dd>The first 14 minutes are about audio in general and input latency in particular.</dd>
 
+<dt><a href="https://youtu.be/PnDK17zP9BI">Audio latency: buffer sizes</a>
+(100 Days of Google Dev)</dt>
+<dd>Describes the relationship between audio latency, buffer sizes, and task scheduling.</dd>
+
 </dl>
diff --git a/src/devices/audio/latency_contrib.jd b/src/devices/audio/latency_contrib.jd
index fb7cd71..2969ba2 100644
--- a/src/devices/audio/latency_contrib.jd
+++ b/src/devices/audio/latency_contrib.jd
@@ -49,6 +49,9 @@
   system designer then increases buffer sizes or buffer counts.
   This has the desired result of eliminating the underruns or overruns, but it also
   has the undesired side effect of increasing latency.
+  For more information about buffer sizes, see the video
+  <a href="https://youtu.be/PnDK17zP9BI">Audio latency: buffer sizes</a>.
+
 </p>
 
 <p>
@@ -64,6 +67,7 @@
 <ul>
   <li>Linux CFS (Completely Fair Scheduler)</li>
   <li>high-priority threads with SCHED_FIFO scheduling</li>
+  <li>priority inversion</li>
   <li>long scheduling latency</li>
   <li>long-running interrupt handlers</li>
   <li>long interrupt disable time</li>
@@ -123,6 +127,18 @@
   with the scheduling of true periodic threads.
 </p>
 
+<h3 id="priorityInversion">Priority inversion</h3>
+<p>
+  <a href="http://en.wikipedia.org/wiki/Priority_inversion">Priority inversion</a>
+  is a classic failure mode of real-time systems,
+  where a higher-priority task is blocked for an unbounded time waiting
+  for a lower-priority task to release a resource such as (shared
+  state protected by) a
+  <a href="http://en.wikipedia.org/wiki/Mutual_exclusion">mutex</a>.
+  See the article "<a href="avoiding_pi.html">Avoiding priority inversion</a>" for techniques to
+  mitigate it.
+</p>
+
 <h3 id="schedLatency">Scheduling latency</h3>
 <p>
   Scheduling latency is the time between when a thread becomes
diff --git a/src/devices/audio/latency_measure.jd b/src/devices/audio/latency_measure.jd
index 6285ff9..9abe015 100644
--- a/src/devices/audio/latency_measure.jd
+++ b/src/devices/audio/latency_measure.jd
@@ -118,6 +118,11 @@
   precise output latency or input latency values in isolation, but might be useful
   for establishing rough estimates.</p>
 
+  <p>
+  Output latency to on-device speaker can be significantly larger than
+  output latency to headset connector.  This is due to speaker correction and protection.
+  </p>
+
 <p>
 We have published an example implementation at
 <a href="https://android.googlesource.com/platform/frameworks/wilhelm/+/master/tests/examples/slesTestFeedback.cpp">slesTestFeedback.cpp</a>.
@@ -145,6 +150,10 @@
   <strong>Figure 1.</strong> Round-trip measurement
 </p>
 
+<p>You may need to remove the USB cable to reduce noise,
+and adjust the volume level to get a stable oscillation.
+</p>
+
 <h2 id="measuringInput">Measuring Input Latency</h2>
 
 <p>
diff --git a/src/devices/audio/terminology.jd b/src/devices/audio/terminology.jd
index cec0bcd..ef4caa9 100644
--- a/src/devices/audio/terminology.jd
+++ b/src/devices/audio/terminology.jd
@@ -341,6 +341,12 @@
 Definition Audio</a>.
 </dd>
 
+<dt>line level</dt>
+<dd>
+<a href="http://en.wikipedia.org/wiki/Line_level">Line level</a> is the strength
+of an analog audio signal that passes between audio components, not transducers.
+</dd>
+
 <dt>MHL</dt>
 <dd>
 Mobile High-Definition Link. Mobile audio/video interface, often over micro-USB
@@ -389,7 +395,7 @@
 <ul>
 <li><a href="http://en.wikipedia.org/wiki/General-purpose_input/output">GPIO</a></li>
 <li><a href="http://en.wikipedia.org/wiki/I%C2%B2C">I²C</a>, for control channel</li>
-<li><a href="http://en.wikipedia.org/wiki/I%C2%B2S">I²S</a>, for audio data</li>
+<li><a href="http://en.wikipedia.org/wiki/I%C2%B2S">I²S</a>, for audio data, simpler than SLIMbus</li>
 <li><a href="http://en.wikipedia.org/wiki/McASP">McASP</a></li>
 <li><a href="http://en.wikipedia.org/wiki/SLIMbus">SLIMbus</a></li>
 <li><a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">SPI</a></li>
@@ -763,4 +769,4 @@
 operate in volume indices rather than absolute attenuation factors.
 </dd>
 
-</dl>
\ No newline at end of file
+</dl>
diff --git a/src/index.jd b/src/index.jd
index 3ef5f67..44dc6a4 100644
--- a/src/index.jd
+++ b/src/index.jd
@@ -42,6 +42,22 @@
   <div class="landing-docs">
     <div class="col-8">
     <h3>What's New</h3>
+<a href="{@docRoot}devices/audio/latency_app.html#videos">
+        <h4>Videos and Other Resources for Audio Implementation</h4></a>
+        <p>The Audio team offers video on <strong><a
+        href="https://youtu.be/PnDK17zP9BI">buffer sizes and their relationship
+        to audio latency</a></strong>, as well as <strong><a
+        href="{@docRoot}devices/audio/latency_app.html#videos">other videos on
+        improving audio performance</a></strong> and related clarifications to text
+        throughout the <strong><a href="{@docRoot}devices/audio/index.html">Audio
+        section</a></strong>.</p>
+
+<a href="{@docRoot}compatibility/downloads.html">
+        <h4>CTS 5.1 R2</h4></a>
+        <p>Packages for the 5.1 R2 version of the Android Compatibility Test
+        Suite (CTS) are available for <strong><a
+        href="{@docRoot}compatibility/downloads.html#android-51">download</a></strong>.</p>
+
 <a href="{@docRoot}devices/tech/security/selinux/customize.html">
         <h4>SELinux neverallow Rules</h4></a>
         <p>New guidance has been offered on the use of Security-Enhanced Linux (SELinux) <strong><a
@@ -83,27 +99,6 @@
         href="{@docRoot}compatibility/android-cdd.pdf">5.1 Compatibility Definition
         Document (CDD)</a></strong> has been published to reflect the
         requirements of the latest version of Android.</p>
-
-<a href="{@docRoot}devices/tech/admin/index.html">
-        <h4>Device Administration Introduction</h4></a>
-        <p>A new <strong><a
-        href="{@docRoot}devices/tech/admin/index.html">Device
-        Administration</a></strong> section summarizes use of Android in a corporate
-        environment, including <strong><a
-        href="{@docRoot}devices/tech/admin/implement.html">implementation</a></strong>, <strong><a 
-        href="{@docRoot}devices/tech/admin/provision.html">provisioning</a></strong>,
-        <strong><a
-        href="{@docRoot}devices/tech/admin/testing-setup.html">testing</a></strong>,
-        and more.</p>
-
-<a href="{@docRoot}devices/audio/midi.html">
-        <h4>MIDI and Audio Latency for Developers</h4></a>
-        <p>The Android audio team has published <strong><a
-        href="{@docRoot}devices/audio/latency_app.html">advice to developers
-        for reducing latency</a></strong> and also instructions to partners on
-        implementing the new support for <strong><a
-        href="{@docRoot}devices/audio/midi.html">MIDI</a></strong> protocol now
-        available in AOSP.</p>
     </div>
 
     <div class="col-8">