Merge "Replace sparsefile with sparseimage" into mnc-dev
diff --git a/src/compatibility/5.1/android-5.1-cdd.html b/src/compatibility/5.1/android-5.1-cdd.html
index a0287f2..29b3f14 100644
--- a/src/compatibility/5.1/android-5.1-cdd.html
+++ b/src/compatibility/5.1/android-5.1-cdd.html
@@ -42,7 +42,9 @@
 
 <p class="toc_h2"><a href="#3_3_native_api_compatibility">3.3. Native API Compatibility</a></p>
 
-<p class="toc_h3"><a href="#3_3_1_application_binary_interfaces">3.3.1 Application Binary Interfaces</a></p>
+<p class="toc_h3"><a href="#3_3_1_application_binary_interfaces">3.3.1. Application Binary Interfaces</a></p>
+
+<p class="toc_h3"><a href="#3_3_2_32-bit_arm_native_code_compatibility">3.3.2. 32-bit ARM Native Code Compatibility</a></p>
 
 <p class="toc_h2"><a href="#3_4_web_compatibility">3.4. Web Compatibility</a></p>
 
@@ -418,6 +420,7 @@
     <th>Handheld</th>
     <th>Television</th>
     <th>Watch</th>
+    <th>Automotive</th>
     <th>Other</th>
  </tr>
  <tr>
@@ -428,6 +431,7 @@
     <td>MUST</td>
     <td></td>
     <td></td>
+    <td></td>
  </tr>
  <tr>
     <td>Touchscreen </td>
@@ -435,6 +439,7 @@
     <td>MUST</td>
     <td></td>
     <td>MUST</td>
+    <td></td>
     <td>SHOULD</td>
  </tr>
  <tr>
@@ -443,6 +448,7 @@
     <td>MUST</td>
     <td>SHOULD </td>
     <td>MUST</td>
+    <td>MUST</td>
     <td>SHOULD</td>
  </tr>
  <tr>
@@ -452,6 +458,7 @@
     <td>SHOULD</td>
     <td></td>
     <td>SHOULD</td>
+    <td></td>
     <td>SHOULD</td>
  </tr>
  <tr>
@@ -460,6 +467,7 @@
     <td>SHOULD</td>
     <td></td>
     <td></td>
+    <td>SHOULD</td>
     <td></td>
  </tr>
  <tr>
@@ -470,6 +478,7 @@
     <td> MUST</td>
     <td></td>
     <td>SHOULD</td>
+    <td>SHOULD</td>
  </tr>
  <tr>
     <td>Wi-Fi Direct</td>
@@ -477,6 +486,7 @@
     <td>SHOULD</td>
     <td>SHOULD</td>
     <td></td>
+    <td></td>
     <td>SHOULD</td>
  </tr>
  <tr>
@@ -485,6 +495,7 @@
     <td>SHOULD</td>
     <td>MUST</td>
     <td>MUST</td>
+    <td>MUST</td>
     <td>SHOULD</td>
  </tr>
  <tr>
@@ -494,14 +505,16 @@
     <td>MUST</td>
     <td>SHOULD</td>
     <td>SHOULD</td>
+    <td>SHOULD</td>
  </tr>
  <tr>
-    <td>USB peripheral/ host mode</td>
+    <td>USB peripheral/host mode</td>
     <td><a href="#7_7_usb">7.7. USB</a></td>
     <td>SHOULD</td>
     <td></td>
     <td></td>
     <td>SHOULD</td>
+    <td>SHOULD</td>
  </tr>
  <tr>
     <td>Output</td>
@@ -511,6 +524,7 @@
     <td>MUST</td>
     <td></td>
     <td>MUST</td>
+    <td>MUST</td>
  </tr>
 </table>
 
@@ -823,7 +837,7 @@
 <h2 id="3_3_native_api_compatibility">3.3. Native API Compatibility</h2>
 
 
-<h3 id="3_3_1_application_binary_interfaces">3.3.1 Application Binary Interfaces</h3>
+<h3 id="3_3_1_application_binary_interfaces">3.3.1. Application Binary Interfaces</h3>
 
 
 <p>Managed Dalvik bytecode can call into native code provided in the application
@@ -891,6 +905,37 @@
 are <strong>very strongly encouraged</strong> to use the implementations of the libraries listed above from the upstream
 Android Open Source Project. </p>
 
+<h3 id="3_3_2_32-bit_arm_native_code_compatibility">
+3.3.2. 32-bit ARM Native Code Compatibility
+</h3>
+
+<p>The ARMv8 architecture deprecates several CPU operations, including some
+operations used in existing native code.  On 64-bit ARM devices, the following
+deprecated operations MUST remain available to 32-bit native ARM code, either
+through native CPU support or through software emulation:</p>
+
+<ul>
+<li>SWP and SWPB instructions</li>
+<li>SETEND instruction</li>
+<li>CP15ISB, CP15DSB, and CP15DMB barrier operations</li>
+</ul>
+
+<p>Legacy versions of the Android NDK used /proc/cpuinfo to discover CPU features
+from 32-bit ARM native code. For compatibility with applications built using this
+NDK, devices MUST include the following lines in /proc/cpuinfo when it is read
+by 32-bit ARM applications:</p>
+
+<ul>
+<li>&quot;Features: &quot;, followed by a list of any optional ARMv7 CPU features
+supported by the device</li>
+<li>&quot;CPU architecture: &quot;, followed by an integer describing the device's
+highest supported ARM architecture (e.g., &quot;8&quot; for ARMv8 devices)</li>
+</ul>
+
+<p>These requirements only apply when /proc/cpuinfo is read by 32-bit ARM
+applications. Devices SHOULD not alter /proc/cpuinfo when read by 64-bit ARM or
+non-ARM applications.</p>
+
 <h2 id="3_4_web_compatibility">3.4. Web Compatibility</h2>
 
 
@@ -940,9 +985,11 @@
 <h3 id="3_4_2_browser_compatibility">3.4.2. Browser Compatibility</h3>
 
 <div class="note">
-<p>Android Television and Watch Devices MAY omit a browser application, but MUST
-support the public intent patterns as described in <a href="#3_2_3_1_core_application_intents">section 3.2.3.1</a>. All other types of device implementations MUST include a standalone Browser
-application for general user web browsing.</p>
+<p>Android Television, Watch, and Android Automotive implementations MAY omit a
+browser application, but MUST support the public intent patterns as described in
+<a href="#3_2_3_1_core_application_intents">section 3.2.3.1</a>. All other types
+of device implementations MUST include a standalone Browser application for
+general user web browsing.</p>
 </div>
 
 <p>The standalone Browser MAY be based on a browser technology other than WebKit.
@@ -1070,27 +1117,24 @@
  <tr>
     <td rowspan="10">small/normal</td>
     <td>120 dpi (ldpi)</td>
-    <td>16MB</td>
+    <td rowspan="2">32MB</td>
  </tr>
  <tr>
     <td>160 dpi (mdpi)</td>
-    <td></td>
  </tr>
  <tr>
     <td>213 dpi (tvdpi)</td>
-    <td>32MB</td>
+    <td rowspan="3">48MB</td>
  </tr>
  <tr>
     <td>240 dpi (hdpi)</td>
-    <td></td>
  </tr>
  <tr>
     <td>280 dpi (280dpi)</td>
-    <td>48MB</td>
  </tr>
  <tr>
     <td>320 dpi (xhdpi)</td>
-    <td>64MB</td>
+    <td>80MB</td>
  </tr>
  <tr>
     <td>400 dpi (400dpi)</td>
@@ -1111,19 +1155,18 @@
  <tr>
     <td rowspan="10">large</td>
     <td>120 dpi (ldpi)</td>
-    <td>16MB</td>
- </tr>
- <tr>
-    <td>160 dpi (mdpi)</td>
     <td>32MB</td>
  </tr>
  <tr>
+    <td>160 dpi (mdpi)</td>
+    <td>48MB</td>
+ </tr>
+ <tr>
     <td>213 dpi (tvdpi)</td>
-    <td>64MB</td>
+    <td rowspan="2">80MB</td>
  </tr>
  <tr>
     <td>240 dpi (hdpi)</td>
-    <td></td>
  </tr>
  <tr>
     <td>280 dpi (280dpi)</td>
@@ -1150,17 +1193,20 @@
     <td>512MB</td>
  </tr>
  <tr>
-    <td rowspan="9">xlarge</td>
+    <td rowspan="10">xlarge</td>
+    <td>120 dpi (ldpi)</td>
+    <td>48MB</td>
+ </tr>
+ <tr>
     <td>160 dpi (mdpi)</td>
-    <td>64MB</td>
+    <td>80MB</td>
  </tr>
  <tr>
     <td>213 dpi (tvdpi)</td>
-    <td>96MB</td>
+    <td rowspan="2">96MB</td>
  </tr>
  <tr>
     <td>240 dpi (hdpi)</td>
-    <td></td>
  </tr>
  <tr>
     <td>280 dpi (280dpi)</td>
@@ -1412,9 +1458,8 @@
 
 
 <p>Android includes support for color emoji characters. When Android device
-implementations include an IME, devices MUST provide an input method to the
-user for the Emoji characters defined in Unicode 6.1 [<a href="http://www.unicode.org/versions/Unicode6.1.0/">Resources, 38</a>]. All devices MUST be capable of rendering these emoji characters in color
-glyph.</p>
+implementations include an IME, devices SHOULD provide an input method to the
+user for the Emoji characters defined in Unicode 6.1 [<a href="http://www.unicode.org/versions/Unicode6.1.0/">Resources, 38</a>]. All devices MUST be capable of rendering these emoji characters in color glyph.</p>
 
 <p>Android includes support for Roboto 2 font with different
 weights&mdash;sans-serif-thin, sans-serif-light, sans-serif-medium, sans-serif-black,
@@ -1429,10 +1474,14 @@
 <p>Android includes features that allow security-aware applications to perform
 device administration functions at the system level, such as enforcing password
 policies or performing remote wipe, through the Android Device Administration
-API [<a href="http://developer.android.com/guide/topics/admin/device-admin.html">Resources, 39</a>]. Device implementations MUST provide an implementation of the
-DevicePolicyManager class [<a href="http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html">Resources, 40</a>]. Device implementations that include support for lock screen MUST support the
-full range of device administration policies defined in the Android SDK
-documentation [<a href="http://developer.android.com/guide/topics/admin/device-admin.html">Resources, 39</a>] and report the platform feature android.software.device_admin.</p>
+API [<a href="http://developer.android.com/guide/topics/admin/device-admin.html">Resources, 39</a>].
+Device implementations MUST provide an implementation of the DevicePolicyManager class
+[<a href="http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html">Resources, 40</a>].
+Device implementations that include support for PIN (numeric) or PASSWORD
+(alphanumeric) based lock screens MUST support the full range of device
+administration policies defined in the Android SDK documentation
+[<a href="http://developer.android.com/guide/topics/admin/device-admin.html">Resources, 39</a>]
+and report the platform feature android.software.device_admin.</p>
 
 <p>Device implementations MAY have a preinstalled application performing device
 administration functions but this application MUST NOT be set out-of-the box as
@@ -1475,16 +1524,24 @@
 services [<a href="http://developer.android.com/reference/android/speech/tts/package-summary.html">Resources, 45</a>]. Device implementations reporting the feature android.hardware.audio.output
 MUST meet these requirements related to the Android TTS framework. </p>
 
-<p>Device implementations:</p>
+<p>Android Automotive implementations:</p>
+<ul>
+<li>MUST support the Android TTS framework APIs.</li>
+<li>MAY support installation of third-party TTS engines. If supported, partners
+MUST provide a user-accessible interface that allows the user to select a TTS
+engine for use at system level.</li>
+</ul>
+
+<p>All other device implementations:</p>
 
 <ul>
-  <li>MUST support the Android TTS framework APIs and SHOULD include a TTS engine
+  <li> MUST support the Android TTS framework APIs and SHOULD include a TTS engine
 supporting the languages available on the device. Note that the upstream
 Android open source software includes a full-featured TTS engine
-implementation.</li>
-  <li>MUST support installation of third-party TTS engines.</li>
-  <li>MUST provide a user-accessible interface that allows users to select a TTS
-engine for use at the system level.</li>
+implementation.
+  <li> MUST support installation of third-party TTS engines
+  <li> MUST provide a user-accessible interface that allows users to select a TTS
+engine for use at the system level
 </ul>
 
 <h2 id="3_12_tv_input_framework">3.12. TV Input Framework</h2>
@@ -2614,8 +2671,8 @@
 <h3 id="7_2_1_keyboard">7.2.1. Keyboard</h3>
 
 <div class="note">
-<p>Android Watch devices MAY but other type of device implementations MUST
-implement a soft keyboard.</p>
+<p>Android Watch and Android Automotive implementations MAY implement a soft
+keyboard. All other device implementations MUST implement a soft keyboard and:</p>
 </div>
 
 
@@ -2662,7 +2719,7 @@
 
 <p>The Home, Recents, and Back functions (mapped to the key events KEYCODE_HOME,
 KEYCODE_APP_SWITCH, KEYCODE_BACK, respectively) are essential to the Android
-navigation paradigm and therefore;</p>
+navigation paradigm and therefore:</p>
 
 <ul>
   <li>Android Handheld device implementations MUST provide the Home, Recents, and
@@ -2671,6 +2728,8 @@
 functions.</li>
   <li>Android Watch device implementations MUST have the Home function available to
 the user, and the Back function except for when it is in UI_MODE_TYPE_WATCH.</li>
+  <li>Android Automotive implementations MUST provide the Home function and MAY
+provide Back and Recent functions.</li>
   <li>All other types of device implementations MUST provide the Home and Back
 functions.</li>
 </ul>
@@ -3030,8 +3089,10 @@
 
 <ul>
   <li>MUST implement and report TYPE_ACCELEROMETER sensor [<a href="http://developer.android.com/reference/android/hardware/Sensor.html#TYPE_ACCELEROMETER">Resources, 78</a>].</li>
-  <li>MUST be able to report events up to a frequency of at least 100 Hz and SHOULD
-report events up to at least 200 Hz.</li>
+  <li>MUST be able to report events up to a frequency of at least 50 Hz for
+  Android Watch devices as such devices have a stricter power constraint and
+  100 Hz for all other device types.</li>
+  <li>SHOULD report events up to at least 200 Hz.</li>
   <li>MUST comply with the Android sensor coordinate system as detailed in the
 Android APIs [<a href="http://developer.android.com/reference/android/hardware/SensorEvent.html">Resources, 74</a>].</li>
   <li>MUST be capable of measuring from freefall up to four times the gravity (4g) or
@@ -3114,8 +3175,10 @@
 TYPE_GYROSCOPE_UNCALIBRATED sensor. Existing and new Android devices are
 strongly encouraged to implement the SENSOR_TYPE_GYROSCOPE_UNCALIBRATED sensor.</li>
   <li>MUST be capable of measuring orientation changes up to 1,000 degrees per second.</li>
-  <li>MUST be able to report events up to a frequency of at least 100 Hz and SHOULD
-report events up to at least 200 Hz.</li>
+  <li>MUST be able to report events up to a frequency of at least 50 Hz for
+  Android Watch devices as such devices have a stricter power constraint and 
+  100 Hz for all other device types.</li>
+  <li>SHOULD report events up to at least 200 Hz.</li>
   <li>MUST have a resolution of 12-bits or more and SHOULD have a resolution of
 16-bits or more.</li>
   <li>MUST be temperature compensated.</li>
@@ -3374,7 +3437,7 @@
 Forum specifications cited above.)</p>
 
 <p>Android includes support for NFC Host Card Emulation (HCE) mode. If a
-device implementation does include an NFC controller capable of HCE and
+device implementation does include an NFC controller chipset capable of HCE and
 Application ID (AID) routing, then it:</p>
 
 <ul>
@@ -3735,11 +3798,12 @@
 expose content from both storage paths transparently through Android&rsquo;s media
 scanner service and android.provider.MediaStore.</p>
 
-<p>Regardless of the form of shared storage used, device implementations MUST
-provide some mechanism to access the contents of shared storage from a host
-computer, such as USB mass storage (UMS) or Media Transfer Protocol (MTP).
-Device implementations MAY use USB mass storage, but SHOULD use Media Transfer
-Protocol. If the device implementation supports Media Transfer Protocol, it:</p>
+<p>Regardless of the form of shared storage used, if the device implementation
+has a USB port with USB peripheral mode support, it MUST provide some mechanism
+to access the contents of shared storage from a host computer. Device
+implementations MAY use USB mass storage, but SHOULD use Media Transfer Protocol
+to satisfy this requirement. If the device implementation supports Media
+Transfer Protocol, it:</p>
 
 <ul>
   <li>SHOULD be compatible with the reference Android MTP host, Android File Transfer
@@ -3748,10 +3812,6 @@
   <li>SHOULD report a USB interface name of 'MTP'.</li>
 </ul>
 
-<p>If the device implementation lacks USB ports, it MUST provide a host computer
-with access to the contents of shared storage by some other means, such as a
-network file system.</p>
-
 <h2 id="7_7_usb">7.7. USB</h2>
 
 
@@ -3771,8 +3831,8 @@
 screen), so that the display draws correctly when the device is oriented with
 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>
   <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
+contents of the shared storage volume using standard protocols such as USB mass
+storage or Media Transfer Protocol, if the device reports the android.hardware.feature.output
 feature or the android.hardware.camera feature.</li>
   <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
@@ -3811,7 +3871,8 @@
 <h3 id="7_8_1_microphone">7.8.1. Microphone</h3>
 
 <div class="note">
-<p>Android Handheld and Watch devices MUST include a microphone.</p>
+<p>Android Handheld, Watch, and Automotive implementations MUST include a
+microphone.</p>
 </div>
 
 
@@ -4120,12 +4181,16 @@
 
 <h2 id="9_8_privacy">9.8. Privacy</h2>
 
-
 <p>If the device implements functionality in the system that captures the contents
 displayed on the screen and/or records the audio stream played on the device,
 it MUST continuously notify the user whenever this functionality is enabled and
 actively capturing/recording.</p>
 
+<p>If a device implementation has a mechanism that routes network data traffic
+through a proxy server or VPN gateway by default (for example, preloading a VPN
+service with android.permission.CONTROL_VPN granted), the device implementation
+MUST ask for the user's consent before enabling that mechanism.</p>
+
 <h2 id="9_9_full-disk_encryption">9.9. Full-Disk Encryption</h2>
 
 <div class="note">
@@ -4133,8 +4198,9 @@
 </div>
 
 
-<p>If the device implementation has a lock screen, the device MUST support
-full-disk encryption of the application private data, (/data partition) as well
+<p>If the device implementation supports a lock screen with PIN (numeric) or
+PASSWORD (alphanumeric), the device MUST support full-disk encryption of the
+application private data (/data partition), as well
 as the SD card partition if it is a permanent, non-removable part of the device
 [<a href="http://source.android.com/devices/tech/security/encryption/index.html">Resources, 107</a>]. For devices supporting full-disk encryption, the full-disk encryption SHOULD
 be enabled all the time after the user has completed the out-of-box experience.
@@ -4225,14 +4291,20 @@
 approaches will satisfy this requirement:</p>
 
 <ul>
-  <li>Over-the-air (OTA) downloads with offline update via reboot</li>
+  <li>&ldquo;Over-the-air (OTA)&rdquo; downloads with offline update via reboot</li>
   <li>&ldquo;Tethered&rdquo; updates over USB from a host PC</li>
   <li>&ldquo;Offline&rdquo; updates via a reboot and update from a file on removable storage</li>
 </ul>
 
 <p>However, if the device implementation includes support for an unmetered data
-connection such as 802.11 or Bluetooth PAN (Personal Area Network) profile, the
-device MUST support Over-the-air download with offline update via reboot.</p>
+connection such as 802.11 or Bluetooth PAN (Personal Area Network) profile:</p>
+
+<ul>
+<li>Android Automotive implementations SHOULD support OTA downloads with offline
+update via reboot.</li>
+<li>All other device implementations MUST support OTA downloads with offline
+update via reboot.</li>
+</ul>
 
 <p>The update mechanism used MUST support updates without wiping user data. That
 is, the update mechanism MUST preserve application private data and application
@@ -4307,8 +4379,9 @@
  </tr>
  <tr>
     <td>3.4.2. Browser compatibility</td>
-    <td>Android Television and Watch Devices MAY omit a browser application, but all
-other types of device implementations MUST include one.</td>
+    <td>Android Television, Watch, and Android Automotive implementations MAY
+    omit a browser application, but all other types of device implementations
+    MUST include one.</td>
  </tr>
  <tr>
     <td>3.7. Runtime compatibility</td>
@@ -4351,8 +4424,12 @@
     <td>Optional for Android Watch devices. Required for all other device types.</td>
  </tr>
  <tr>
-    <td>3.8.13 Unicode and font</td>
-    <td>MUST support Roboto 2 in addition to existing requirements.</td>
+    <td>3.8.13. Unicode and font</td>
+    <td>MUST support Roboto 2 in addition to existing requirements. Added Android automotive requirements.</td>
+ </tr>
+  <tr>
+    <td>3.11. Text-To-Speech</td>
+ <td>Added Android automotive requirements.</td>
  </tr>
  <tr>
     <td>3.12. TV Input Framework</td>
@@ -4430,6 +4507,10 @@
     <td>7.1.7. External Displays</td>
     <td>Moved part of section to section 5.8. Secure Media.</td>
  </tr>
+ <tr>
+    <td>7.2.1. Keyboard</td>
+    <td>Added Android Automotive requirements.</td>
+ </tr>
   <tr>
     <td>7.2 Input Devices</td>
     <td>Added general intro statement.</td>
@@ -4439,11 +4520,12 @@
     <td>Android Television devices MUST support D-pad. </td>
  </tr>
  <tr>
-    <td>7.2.3. Navigation keys</td>
-    <td>Included language for support across different device types. </td>
+    <td>7.2.3. Navigation Keys</td>
+    <td>Included language for support across different device types. Added
+    Android Automotive requirements.</td>
  </tr>
  <tr>
-    <td>7.2.4. Touchscreen input</td>
+    <td>7.2.4. Touchscreen Input</td>
     <td>Android Watch devices MUST support touchscreen input. </td>
  </tr>
  <tr>
@@ -4533,9 +4615,13 @@
 micro-USB port. Updated requirements for Host and Peripheral mode. </td>
  </tr>
  <tr>
-    <td>7.8.1. Audio</td>
+    <td>7.8. Audio</td>
     <td>Moved microphone section here. Added requirements for Audio Output and Audio
-Analog ports. </td>
+Analog ports.</td>
+ </tr>
+ <tr>
+    <td>7.8.1. Microphone</td>
+    <td>Added Android Automotive requirements.</td>
  </tr>
  <tr>
     <td>8. Performance Compatibility</td>
@@ -4568,7 +4654,9 @@
  <tr>
     <td>11. Updatable Software</td>
     <td>If a device supports 802.11 or Bluetooth PAN (Personal Area Network) profile,
-then it MUST support Over-the-air download with offline update via reboot.</td>
+then it MUST support over-the-air (OTA) download with offline update via reboot. Clarified
+the OTA download requirement is allowed but not mandatory for Android Automotive
+implementations.</td>
  </tr>
  <tr>
     <td>14. Resources</td>