Merge "CDD: Clarify language around Assistant requirements" into mnc-dev
diff --git a/src/compatibility/android-cdd.html b/src/compatibility/android-cdd.html
index 827b78a..47f0dc3 100644
--- a/src/compatibility/android-cdd.html
+++ b/src/compatibility/android-cdd.html
@@ -293,6 +293,10 @@
 
 <p class="toc_h2"><a href="#8_2_file_i_o_access_performance">8.2. File I/O Access Performance</a></p>
 
+<p class="toc_h2"><a href="#8_3_power_saving_modes">8.3. Power-Saving Modes</a></p>
+
+<p class="toc_h2"><a href="#8_4_power_consumption_accounting">8.4. Power Consumption Accounting</a></p>
+
 </div>
 
 <div style="clear: both; page-break-after:always; height:1px"></div>
@@ -1680,7 +1684,9 @@
 <ul>
   <li>Declare the platform feature flag android.software.managed_users.</li>
   <li>Support managed profiles via the android.app.admin.DevicePolicyManager APIs</li>
-  <li>Allow a managed profile to be created [<a href="http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#ACTION_PROVISION_MANAGED_PROFILE"> Resources, XX</a>]</li>
+  <li>Allow one and only one managed profile to be created [<a
+href="http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#ACTION_PROVISION_MANAGED_PROFILE">Resources,
+XX</a>]</li>
   <li>Use an icon badge (similar to the AOSP upstream work badge) to represent
 the managed applications and widgets and other badged UI elements like Recents
 &amp; Notifications</li>
@@ -1690,26 +1696,28 @@
 device wakes up (ACTION_USER_PRESENT) and the foreground application is within
 the managed profile</li>
   <li>Where a managed profile exists, show a visual affordance in the Intent
-'Chooser' to allow the user to forward the intent from the managed to the personal
-profiles or vice versa, if enabled by the Device Policy Controller</li>
-  <li>Expose the following user affordances for both primary and managed profiles
-(when they exist):
+'Chooser' to allow the user to forward the intent from the managed profile to
+the primary user or vice versa, if enabled by the Device Policy Controller</li>
+  <li>Where a managed profile exists, expose the following user affordances for both
+the primary user and the managed profile:
     <ul>
       <li>Separate accounting for battery, location, mobile data and storage usage
-      for the primary and managed profiles</li>
+      for the primary user and managed profile.</li>
       <li>Independent management of VPN Applications installed within the primary
-      or managed profiles</li>
-      <li>Independent management of applications installed within the primary or
-      managed profiles</li>
-      <li>Independent management of user accounts within the primary or managed
-      profiles</li>
+      user or managed profile.</li>
+      <li>Independent management of applications installed within the primary user
+      user or managed profile.</li>
+      <li>Independent management of accounts within the primary user or managed
+      profile.</li>
     </ul>
   </li>
   <li>Ensure the default dialer can look up caller information from the managed
-profile (if one exists) alongside those from the primary profile</li>
-  <li>Ensure that all the security requirements for multi user (see
-<a href="#9_5_multi-user_support">section 9.5</a>) apply to
-managed profiles.</li>
+profile (if one exists) alongside those from the primary profile, if the Device
+Policy Controller permits it.</li>
+  <li>MUST ensure that it satisfies all the security requirements applicable for a device
+    with multiple users enabled (see <a href="#9_5_multi-user_support">section 9.5</a>),
+    even though the managed profile is not counted as another user in addition to the
+    primary user.</li>
 </ul>
 
 <h2 id="3_10_accessibility">3.10. Accessibility</h2>
@@ -2250,9 +2258,10 @@
 <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>Device implementations MUST support dynamic video resolution and frame rate
+switching through the standard Android APIs within the same stream for all VP8,
+VP9, H.264, and H.265 codecs in real time and up to the maximum resolution
+supported on the device.</p>
 
 <p>Android device implementations with H.263 decoders, MUST support Baseline
 Profile Level 30.</p>
@@ -2261,7 +2270,7 @@
 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
+Level 3.1 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>
@@ -2296,10 +2305,10 @@
 </table>
 
 
-<p class="table_footnote">1 Required for Android Television device implementations, but for other device
-types only when supported by hardware.</p>
+<p class="table_footnote">1 REQUIRED for when the height as reported by the
+Display.getSupportedModes() method is not smaller than the video resolution.</p>
 
-<p class="table_footnote">2 Required for Android Television device implementations.</p>
+<p class="table_footnote">2 REQUIRED for Android Television device implementations.</p>
 
 <p>Android device implementations when supporting VP8 codec as described in <a href="#5_1_3_video_codecs">section 5.1.3</a>, MUST support the following SD decoding profiles and SHOULD support the HD
 decoding profiles. Android Television devices MUST support the HD 1080p
@@ -2335,11 +2344,10 @@
  </tr>
 </table>
 
+<p class="table_footnote">1 REQUIRED for when the height as reported by the
+Display.getSupportedModes() method is not smaller than the video resolution.</p>
 
-<p class="table_footnote">1 Required for Android Television device implementations, but for other type of
-devices only when supported by hardware.</p>
-
-<p class="table_footnote">2 Required for Android Television device implementations.</p>
+<p class="table_footnote">2 REQUIRED for Android Television device implementations.</p>
 
 <p>Android device implementations, when supporting VP9 codec as described in <a href="#5_1_3_video_codecs">section 5.1.3</a>, MUST support the following SD video decoding profiles and SHOULD support the
 HD decoding profiles. Android Television devices are STRONGLY RECOMMENDED to
@@ -3869,8 +3877,11 @@
   <li>MUST report the hardware feature flag android.hardware.wifi.</li>
   <li>MUST implement the multicast API as described in the SDK documentation [<a href="http://developer.android.com/reference/android/net/wifi/WifiManager.MulticastLock.html">Resources, 79</a>].</li>
   <li>MUST support multicast DNS (mDNS) and MUST NOT filter mDNS packets
-(224.0.0.251) at any time of operation including when the screen is not in an
-active state.</li>
+(224.0.0.251) at any time of operation including:
+    <ul>
+      <li>Even when the screen is not in an active state.</li>
+      <li>For Android Television device implementations, even when in standby power states.</li>
+    </ul>
 </ul>
 
 <h4 id="7_4_2_1_wi-fi_direct">7.4.2.1. Wi-Fi Direct</h4>
@@ -4585,11 +4596,11 @@
   </li>
 </ul>
 
-<h1 id="8_performance_compatibility">8. Performance Compatibility</h1>
+<h1 id="8_performance_compatibility">8. Performance and Power</h1>
 
 
-<p>Some minimum performance criterias are critical to the user experience and
-impacts the baseline assumptions developers would have when developing an app.
+<p>Some minimum performance and power criteria are critical to the user experience
+and impact the baseline assumptions developers would have when developing an app.
 Android Watch devices SHOULD and other type of device implementations MUST meet
 the following criteria:</p>
 
@@ -4627,6 +4638,44 @@
 256MB file using 4KB write buffer.</li>
 </ul>
 
+<h2 id="8_3_power_saving_modes">8.3. Power-Saving Modes</h2>
+
+<p>All apps exempted from App Standby and/or Doze mode MUST be made visible to
+the end user. Further, the triggering, maintenance, wakeup algorithms and
+the use of Global system settings of these power-saving modes MUST not deviate
+from the Android Open Source Project.</p>
+
+<h2 id="8_4_power_consumption_accounting">8.4. Power Consumption Accounting</h2>
+
+<p>A more accurate accounting and reporting of the power consumption provides the
+app developer both the incentives and the tools to optimize the power usage pattern
+of the application. Therefore, device implementations:</p>
+
+<ul>
+  <li>MUST be able to track hardware component power usage and attribute that power
+    usage to specific applications. Specifically, implementations:
+    <ul>
+      <li>MUST provide a per-component power profile that defines the current consumption
+        value for each hardware component and the approximate battery drain caused by the
+        components over time as documented in the Android Open Source Project site [<a
+href="http://source.android.com/devices/tech/power/values.html">Resources, XX</a>].</li>
+      <li>MUST report all power consumption values in milliampere hours (mAh)</li>
+      <li>SHOULD be attributed to the hardware component itself if unable to
+        attribute hardware component power usage to an application.</li>
+      <li>MUST report CPU power consumption per each process's UID. The Android Open
+        Source Project meets the requirement through the <code>uid_cputime</code>
+        kernel module implementation.</li>
+    </ul>
+  </li>
+  <li>MUST make this power usage available via the <code>adb shell dumpsys
+    batterystats</code> shell command to the app developer [<a
+href="http://source.android.com/devices/tech/power/batterystats.html">Resources,XX</a>].</li>
+  <li>MUST honor the android.intent.action.POWER_USAGE_SUMMARY intent and display
+    a settings menu that shows this power usage [<a
+href="http://developer.android.com/reference/android/content/Intent.html#ACTION_POWER_USAGE_SUMMARY">Resources,
+XX</a>].</li>
+</ul>
+
 <h1 id="9_security_model_compatibility">9. Security Model Compatibility</h1>