Merge "CDD: Near-ultrasound and mic resampling" into mnc-dev
diff --git a/src/accessories/accessories_toc.cs b/src/accessories/accessories_toc.cs
index 616cc5e..f4954a0 100644
--- a/src/accessories/accessories_toc.cs
+++ b/src/accessories/accessories_toc.cs
@@ -52,7 +52,7 @@
     </div>
     <ul>
       <li class="nav-section">
-        <div class="nav-section-header"><a href="<?cs var:toroot ?>accessories/protocol.html"><span class="en">Open Accessory Protocol</span>
+        <div class="nav-section-header"><a href="<?cs var:toroot ?>accessories/protocol.html"><span class="en">AOA</span>
         </a>
         </div>
         <ul>
@@ -60,8 +60,11 @@
           <li><a href="<?cs var:toroot ?>accessories/aoa.html">AOA 1.0</a></li>
         </ul>
         </li>
+        <div class="nav-section-header"><a href="<?cs var:toroot ?>accessories/stylus.html"><span class="en">Stylus</span>
+        </a>
+        </div>
        </ul>
      </li>
   </li>
   <!-- End Accessories -->
-</ul>
+</ul>
\ No newline at end of file
diff --git a/src/accessories/stylus.jd b/src/accessories/stylus.jd
new file mode 100644
index 0000000..03c2e14
--- /dev/null
+++ b/src/accessories/stylus.jd
@@ -0,0 +1,121 @@
+page.title=Stylus
+@jd:body
+
+<!--
+    Copyright 2015 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<div id="qv-wrapper">
+  <div id="qv">
+    <h2>In this document</h2>
+    <ol id="auto-toc">
+    </ol>
+  </div>
+</div>
+
+<p>Android 6.0 and higher supports a standard data format for Bluetooth stylus
+connections over Bluetooth (BT), Bluetooth Low Energy (BTLE), or USB. The
+platform correlates timing between touch input and stylus data then provides
+stylus data to render MotionEvents to the active application. The following
+sections provide guidelines for OEM partners, stylus accessory creators, and
+stylus application developers.</p>
+
+<h2 id="guide-partners">Guidelines for OEM partners</h2>
+<p>To enable Bluetooth stylus support, OEM partners must support Bluetooth
+(and should support BTLE for wider compatibility). The platform handles data
+collection, timing correlation, and rendering to the application for supported
+stylus events.</p>
+
+<p>At this time, the Android CTS <strong>does not</strong> include tests to
+ensure existing APIs for touch events support default behavior. As a
+workaround, we recommend creating a stylus accessory or emulator that can
+simulate stylus events.</p>
+
+<h2 id="guide-creators">Guidelines for stylus accessory creators</h2>
+<p>To implement support on a stylus device, partners must use the Stylus
+Human Interface Device (HID) Descriptor shown below to describe how stylus data
+(pressure sensitivity, eraser, side buttons, device ID, etc.) is represented.
+The stylus device sends the HID information to the Android mobile device,
+enabling the platform to correlate HID data with touch data from the touchscreen
+to produce stylus events via MotionEvent. Data can be sent over Bluetooth (BT),
+Bluetooth Low Energy (BTLE), or USB.</p>
+
+<h3 id="hid-descriptor">HID descriptor</h3>
+
+<p><pre>
+UsagePage(Digitizer)
+Usage(Pen)
+Collection(Application)
+    Usage(Stylus)
+    Collection(Logical)
+        Usage(Tip Pressure)
+        Logical Minimum(0)
+        Logical Maximum(1023)
+        Report Count(1)
+        Report Size(10)
+        Input(Data, Variable, Absolute, No Null)
+
+        Usage(Barrel Switch)
+        Usage(Secondary Barrel Switch)
+        Usage(Tip Switch)
+        Usage(Invert)
+        Logical Maximum(1)
+        Report Count(4)
+        Report Size(1)
+        Input(Data, Variable, Absolute, No Null)
+
+        Usage(Transducer Serial Number)
+        Report Count(1)
+        Report Size(128)
+        Feature(Constant, Variable)
+    EndCollection
+EndCollection
+
+unsigned char HID_DESC[] = {
+    0x05, 0x0D, // UsagePage(Digitizer)
+    0x09, 0x02, // Usage(Pen)
+    0xA1, 0x01, // Collection(Application)
+    0x09, 0x20, // Usage(Stylus)
+    0xA1, 0x02, // Collection(Logical)
+    0x09, 0x30, // Usage(Tip Pressure)
+    0x15, 0x00, // Logical Minimum(0)
+    0x26, 0xFF, 0x03, // Logical Maximum(1023)
+    0x95, 0x01, // Report Count(1)
+    0x75, 0x0A, // Report Size(10)
+    0x81, 0x02, // Input(Data, Variable, Absolute, No Null)
+
+    0x09, 0x44, // Usage(Barrel Switch)
+    0x09, 0x5A, // Usage(Secondary Barrel Switch)
+    0x09, 0x42, // Usage(Tip Switch)
+    0x09, 0x3C, // Usage(Invert)
+    0x25, 0x01, // Logical Maximum(1)
+    0x95, 0x04, // Report Count(4)
+    0x75, 0x01, // Report Size(1)
+    0x81, 0x02, // Input(Data, Variable, Absolute, No Null)
+
+    0x09, 0x5B, // Usage(Transducer Serial Number)
+    0x95, 0x01, // Report Count(1)
+    0x75, 0x80, // Report Size(128)
+    0xB1, 0x03, // Feature(Constant, Variable)
+    0xC0, // End Collection
+    0xC0, // End Collection
+}
+</pre></p>
+
+<h2 id="guidelines-devs">Guidelines for stylus application developers</h2>
+<p>The Android 6.0 platform automatically handles pairing and event correlation,
+so both existing and new applications running on Android 6.0 support Bluetooth
+stylus by default. For details on Bluetooth stylus APIs, refer to
+<a href="http://developer.android.com/about/versions/marshmallow/android-6.0.html#bluetooth-stylus">developer.android.com</a>.
\ No newline at end of file
diff --git a/src/compatibility/6.0/versions.jd b/src/compatibility/6.0/versions.jd
new file mode 100644
index 0000000..d0c9eca
--- /dev/null
+++ b/src/compatibility/6.0/versions.jd
@@ -0,0 +1,18 @@
+page.title=Permitted Version Strings for Android 6.0
+@jd:body
+
+<p>As described in Section 3.2.2 of the <a
+href="/compatibility/android-6.0-cdd.pdf">Android 6.0 Compatibility Definition</a>,
+only certain strings are allowable for the system property
+<code>android.os.Build.VERSION.RELEASE</code>. The reason for this is that
+applications and web sites may rely on predictable values for this string, and
+so that end users can easily and reliably identify the version of Android
+running on their devices.</p>
+<p>Because subsequent releases of the Android software may revise this string,
+but not change any API behavior, such releases may not be accompanied by a new
+Compatibility Definition Document. This page lists the versions that are
+allowable by an Android 6.0-based system. The only permitted values for
+<code>android.os.Build.VERSION.RELEASE</code> for Android 6.0 are:</p>
+<ul>
+<li>6.0</li>
+</ul>
diff --git a/src/compatibility/android-cdd.html b/src/compatibility/android-cdd.html
index 6c9b10b..7f751bb 100644
--- a/src/compatibility/android-cdd.html
+++ b/src/compatibility/android-cdd.html
@@ -80,20 +80,16 @@
 
 <p class="toc_h3"><a href="#3_8_10_lock_screen_media_control">3.8.10. Lock Screen Media Control</a></p>
 
+</div>
+
+<div id="toc_right">
+
 <p class="toc_h3"><a href="#3_8_11_dreams">3.8.11. Dreams</a></p>
 
 <p class="toc_h3"><a href="#3_8_12_location">3.8.12. Location</a></p>
 
 <p class="toc_h3"><a href="#3_8_13_unicode_and_font">3.8.13. Unicode and Font</a></p>
 
-
-
-</div>
-
-<div id="toc_right"><br>
-
-
-
 <p class="toc_h2"><a href="#3_9_device_administration">3.9. Device Administration</a></p>
 
 <p class="toc_h3"><a href="#3_9_1_device_provisioning">3.9.1 Device Provisioning</a></p>
@@ -150,6 +146,12 @@
 
 <p class="toc_h2"><a href="#5_10_pro_audio">5.10. Professional Audio</a></p>
 
+</div>
+
+<div style="clear: both; page-break-after:always; height:1px"></div>
+
+<div id="toc_left">
+
 <p class="toc_h1"><a href="#6_developer_tools_and_options_compatibility">6. Developer Tools and Options Compatibility</a></p>
 
 <p class="toc_h2"><a href="#6_1_developer_tools">6.1. Developer Tools</a></p>
@@ -168,14 +170,6 @@
 
 <p class="toc_h4"><a href="#7_1_1_3_screen_density">7.1.1.3. Screen Density</a></p>
 
-
-</div>
-
-<div style="clear: both; page-break-after:always; height:1px"></div>
-
-
-<div id="toc_left_2">
-
 <p class="toc_h3"><a href="#7_1_2_display_metrics">7.1.2. Display Metrics</a></p>
 
 <p class="toc_h3"><a href="#7_1_3_screen_orientation">7.1.3. Screen Orientation</a></p>
@@ -214,6 +208,10 @@
 
 <p class="toc_h3"><a href="#7_3_3_gps">7.3.3. GPS</a></p>
 
+</div>
+
+<div id="toc_right">
+
 <p class="toc_h3"><a href="#7_3_4_gyroscope">7.3.4. Gyroscope</a></p>
 
 <p class="toc_h3"><a href="#7_3_5_barometer">7.3.5. Barometer</a></p>
@@ -252,14 +250,6 @@
 
 <p class="toc_h3"><a href="#7_5_4_camera_api_behavior">7.5.4. Camera API Behavior</a></p>
 
-
-
-
-
-</div>
-
-<div id="toc_right_2">
-
 <p class="toc_h3"><a href="#7_5_5_camera_orientation">7.5.5. Camera Orientation</a></p>
 
 <p class="toc_h2"><a href="#7_6_memory_and_storage">7.6. Memory and Storage</a></p>
@@ -286,6 +276,12 @@
 
 <p class="toc_h2"><a href="#8_2_memory_performance">8.2. Memory Performance</a></p>
 
+</div>
+
+<div style="clear: both; page-break-after:always; height:1px"></div>
+
+<div id="toc_left">
+
 <p class="toc_h1"><a href="#9_security_model_compatibility">9. Security Model Compatibility</a></p>
 
 <p class="toc_h2"><a href="#9_1_permissions">9.1. Permissions</a></p>
@@ -918,6 +914,9 @@
 versions and extensions actually supported by the device must be fully
 implemented.</p>
 
+<p>Device implementations MUST NOT include a native library with the
+name libvulkan.so.</p>
+
 <p>Native code compatibility is challenging. For this reason, device implementers
 are <strong>STRONGLY RECOMMENDED</strong> to use the implementations of the libraries listed above from the upstream
 Android Open Source Project. </p>
@@ -1380,14 +1379,17 @@
 implementations MAY modify the Device Default theme attributes exposed to
 applications [<a href="http://developer.android.com/reference/android/R.style.html">Resources, 29</a>].</p>
 
-<p>Android supports a new variant theme with translucent system bars, which allows
+<p>Android supports a variant theme with translucent system bars, which allows
 application developers to fill the area behind the status and navigation bar
 with their app content. To enable a consistent developer experience in this
 configuration, it is important the status bar icon style is maintained across
 different device implementations. Therefore, Android device implementations
 MUST use white for system status icons (such as signal strength and battery
 level) and notifications issued by the system, unless the icon is indicating a
-problematic status [<a href="http://developer.android.com/reference/android/R.style.html">Resources, 29</a>].</p>
+problematic status or an app requests a light status bar using the
+SYSTEM_UI_FLAG_LIGHT_STATUS_BAR flag. When an app requests a light status bar,
+Android device implementations MUST change the color of the system status icons
+to black [<a href="http://developer.android.com/reference/android/R.style.html">Resources, 29</a>].</p>
 
 <h3 id="3_8_7_live_wallpapers">3.8.7. Live Wallpapers</h3>
 
@@ -1925,6 +1927,7 @@
 <p>Video codecs are optional for Android Watch device implementations.</p>
 </div>
 
+<p>Android device implementations with H.263 encoders, MUST support Baseline Profile Level 45.</p>
 
 <p>Android device implementations with H.264 codec support, MUST support Baseline
 Profile Level 3 and the following SD (Standard Definition) video encoding
@@ -2008,14 +2011,19 @@
 <p>Video codecs are optional for Android Watch device implementations.</p>
 </div>
 
-
 <p>Device implementations MUST support dynamic video resolution switching within
 the same stream for all VP8, VP9, H.264, and H.265 codecs exposed 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
-the HD decoding profiles. Android Television devices MUST support High Profile
+<p>Android device implementations with H.263 decoders, MUST support Baseline
+Profile Level 30.</p>
+
+<p>Android device implementations with MPEG-4 decoders, MUST support Simple
+Profile Level 3.</p>
+
+<p>Android device implementations with H.264 decoders, MUST support Main Profile
+Level 3 and the following SD video decoding profiles and SHOULD support the
+HD decoding profiles. Android Television devices MUST support High Profile
 Level 4.2 and the HD 1080p decoding profile.</p>
 <table>
  <tr>
@@ -2542,7 +2550,8 @@
 adb tool as provided in the standard Android SDK, device implementers MUST
 provide Windows drivers allowing developers to connect to the device using the
 adb protocol. These drivers MUST be provided for Windows XP, Windows Vista,
-Windows 7, Windows 8, and Windows 9 in both 32-bit and 64-bit versions.</p>
+Windows 7, Windows 8 and Windows 10 in both 32-bit and 64-bit versions.
+</p>
 
 <h2 id="6_2_developer_options">6.2. Developer Options</h2>
 
@@ -4013,7 +4022,11 @@
     <li>MUST declare support for the hardware feature android.hardware.usb.accessory [<a href="http://developer.android.com/guide/topics/connectivity/usb/accessory.html">Resources, 97</a>].</li>
     <li>MUST implement the USB audio class as documented in the Android SDK
 documentation [<a href="http://developer.android.com/reference/android/hardware/usb/UsbConstants.html#USB_CLASS_AUDIO">Resources, 98</a>].</li>
-  </ul></li>
+    <li>And also the USB mass storage class, MUST include the string "android"
+at the end of the interface description <code>iInterface</code> string of the
+USB mass storage</li>
+  </ul>
+  </li>
   <li>It SHOULD implement support to draw 1.5 A current during HS chirp and traffic
 as specified in the USB battery charging specification [<a href="http://www.usb.org/developers/docs/devclass_docs/USB_Battery_Charging_1.2.pdf">Resources, 99</a>]. Existing and new Android devices are <strong>STRONGLY RECOMMENDED to meet these requirements</strong> so they will be able to upgrade to the future platform releases.</li>
   <li>The value of iSerialNumber in USB standard device descriptor MUST be equal to
@@ -4400,6 +4413,10 @@
 service with android.permission.CONTROL_VPN granted), the device implementation
 MUST ask for the user's consent before enabling that mechanism.</p>
 
+<p>If a device implementation has a USB port with USB peripheral mode support,
+it MUST present a user interface asking for the user's consent before allowing
+access to the contents of the shared storage over the USB port.</p>
+
 <h2 id="9_9_full-disk_encryption">9.9. Full-Disk Encryption</h2>
 
 <div class="note">
@@ -4550,7 +4567,6 @@
 
 <h1 id="12_document_changelog">12. Document Changelog</h1>
 
-
 <p>The following table contains a summary of the changes to the Compatibility
 Definition in this release. </p>
 <table>
@@ -4559,137 +4575,10 @@
     <th>Summary of change</th>
  </tr>
  <tr>
-    <td>2. Device Types</td>
-    <td>Added definition for Android automotive implementation.</td>
+    <td>text</td>
+    <td>text</td>
  </tr>
- <tr>
-    <td>2.1 Device Configurations</td>
-    <td>Added column for Android automotive implementation.</td>
- </tr>
- <tr>
-    <td>3.3.2. 32-bit ARM Native Code Compatibility</td>
-    <td>New section added.</td>
- </tr>
- <tr>
-    <td>3.4.1. WebView Compatibility</td>
-    <td>Updated webview user agent string requirement to accomodate upstream
-        implementation change.</td>
- </tr>
- <tr>
-    <td>3.4.2. Browser compatibility</td>
-    <td>Added Android automotive implementations as another case that MAY omit a
-        browser application.</td>
- </tr>
- <tr>
-    <td>3.7. Runtime Compatibility</td>
-    <td>Updated required runtime heap size for smaller screens and added requirement
-        for the new dpi bucket (280dpi).</td>
- </tr>
- <tr>
-    <td>3.8.3. Notifications</td>
-    <td>Clarified notification requirement for Android Watch, Television and
-        Automotive implementations.</td>
- </tr>
- <tr>
-    <td>3.8.10. Lock Screen Media Control<</td>
-    <td>Clarified requirement for Android Watch and Automotive implementations.</td>
- </tr>
- <tr>
-    <td>3.8.13. Unicode and font</td>
-    <td>Relaxed Emoji character input method requirement.</td>
- </tr>
- <tr>
-    <td>3.9. Device Administration</td>
-    <td>Clarified condition when the full range of device administration policies
-        has to be supported.</td>
- </tr>
- <tr>
-    <td>3.10. Accessibility</td>
-    <td>Added Android automotive requirements.</td>
- </tr>
- <tr>
-    <td>3.11. Text-To-Speech</td>
-    <td>Added Android automotive requirements.</td>
- </tr>
- <tr>
-    <td>5.1. Media Codecs</td>
-    <td>Mandated decoding support for codecs reported by CamcorderProfile.</td>
- </tr>
-   <tr>
-    <td>5.1.3 Video Codecs</td>
-    <td>Added Android automotive requirements.</td>
- </tr>
- <tr>
-    <td>7.1.1.3. Screen Density</td>
-    <td>Added a new screen dpi (280dpi).</td>
- </tr>
- <tr>
-    <td>7.1.5. Legacy Application Compatibility Mode</td>
-    <td>Added Android automotive requirements.</td>
- </tr>
- <tr>
-    <td>7.2 Input Devices</td>
-    <td>Added general introduction statement.</td>
- </tr>
- <tr>
-    <td>7.2.1. Keyboard</td>
-    <td>Added Android Automotive requirements.</td>
- </tr>
- <tr>
-    <td>7.2.3. Navigation Keys</td>
-    <td>Added Android Automotive requirements.</td>
- </tr>
- <tr>
-    <td>7.3.1. Accelerometer</td>
-    <td>Relaxed requirement for reporting frequency on Android Watch.</td>
- </tr>
- <tr>
-    <td>7.3.4. Gyroscope</td>
-    <td>Relaxed requirement for reporting frequency on Android Watch.</td>
- </tr>
- <tr>
-    <td>7.4.3 Bluetooth</td>
-    <td>Added Android Automotive requirements.</td>
- </tr>
- <tr>
-    <td>7.4.4. Near-Field Communications</td>
-    <td>Clarified condition for when Host Card Emulation is a requirement.</td>
- </tr>
- <tr>
-    <td>7.6.1. Minimum Memory and Storage</td>
-    <td>Updated minimum memory requirements for lower resulution screen devices
-        and added hard-limit requirement isLowRamDevice().</td>
- </tr>
- <tr>
-    <td>7.6.2. Application Shared Storage</td>
-    <td>Updated requirements when support for host machine access is mandatory.</td>
- </tr>
- <tr>
-    <td>7.8.1. Microphone</td>
-    <td>Added Android Automotive requirements.</td>
- </tr>
- <tr>
-    <td>8.2. File I/O Access Performance</td>
-    <td>Clarified requirements.</td>
- </tr>
- <tr>
-    <td>9.8. Privacy</td>
-    <td>Added privacy requirement for preloaded VPNs.</td>
- </tr>
- <tr>
-    <td>9.9. Full-Disk Encryption</td>
-    <td>Clarified condition when Full-Disk encryption support is mandatory.</td>
- </tr>
- <tr>
-    <td>9.10. Verified Boot</td>
-    <td>Clarified definition of verified boot.</td>
- </tr>
- <tr>
-    <td>11. Updatable Software</td>
-    <td>Clarified the OTA download requirement is allowed but not mandatory for
-        Android Automotive implementations.</td>
- </tr>
-</table>
+ </table>
 
 
 <h1 id="13_contact_us">13. Contact Us</h1>
diff --git a/src/compatibility/source/android-cdd.css b/src/compatibility/source/android-cdd.css
index 83c46bc..cef5969 100644
--- a/src/compatibility/source/android-cdd.css
+++ b/src/compatibility/source/android-cdd.css
@@ -284,16 +284,14 @@
     width: 950px;
 }
 
-#toc_left,
-#toc_left_2 {
+#toc_left {
     float: left;
     padding-top:15px;
     padding-bottom:15px;
     width: 470px;
 }
 
-#toc_right,
-#toc_right_2 {
+#toc_right {
     float: right;
     padding-top:15px;
     padding-bottom:15px;
diff --git a/src/source/jack.jd b/src/source/jack.jd
index ecddd90..7abead7 100644
--- a/src/source/jack.jd
+++ b/src/source/jack.jd
@@ -175,7 +175,7 @@
 setting one variable, as follows:</p>
 
 <pre class=prettyprint>
-$ export ANDROID_JACK_EXTRA_ARGS= "--verbose debug \ --sanity-checks on -D
+$ export ANDROID_JACK_EXTRA_ARGS= "--verbose debug --sanity-checks on -D
 sched.runner=single-threaded"
 </pre>