camera: Add a hwlevel attribute, annotate each metadata's hardware level

* Set each metadata key to one of full,legacy,limited.
* All keys present on the lower level must also be present on higher
  levels (i.e. all legacy keys present on limited/full devices, all limited
  keys present on full devices.)
* If a key is not annotated, it is assumed to be optional even on full.
  This is usually the case only for future, deprecated, or system keys.

Bug: 17788234
Change-Id: Ie88f3750cc06d889c6750f2099598d53ccb601b7
diff --git a/camera/docs/CameraMetadataKeys.mako b/camera/docs/CameraMetadataKeys.mako
index 63811ce..989a35e 100644
--- a/camera/docs/CameraMetadataKeys.mako
+++ b/camera/docs/CameraMetadataKeys.mako
@@ -29,13 +29,20 @@
   ## Generate extra text blocks for the details field
   def generate_extra_detail(entry):
     def inner(text):
-      if entry.optional:
+      if entry.hwlevel != 'legacy': # covers any of (None, 'limited', 'full')
         text += '\n\n<b>Optional</b> - This value may be {@code null} on some devices.\n'
-      if any(tag.name == 'FULL' for tag in entry.tags):
+      if entry.hwlevel == 'full':
         text += \
           '\n<b>Full capability</b> - \n' + \
           'Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the\n' + \
           'android.info.supportedHardwareLevel key\n'
+      if entry.hwlevel == 'limited':
+        text += \
+          '\n<b>Limited capability</b> - \n' + \
+          'Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the\n' + \
+          'android.info.supportedHardwareLevel key\n'
+      if entry.hwlevel == 'legacy':
+        text += "\nThis key is available on all devices."
       return text
     return inner
 %>
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 1addcdc..54a4831 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -60,6 +60,7 @@
     .entry_type_name_enum:after { color: #669900; font-weight: bold; content:" (enum)" }
     .entry_type_visibility { font-weight: bolder; padding-left:1em}
     .entry_type_synthetic { font-weight: bolder; color: #996600; }
+    .entry_type_hwlevel { font-weight: bolder; color: #000066; }
     .entry_type_deprecated { font-weight: bolder; color: #4D4D4D; }
     .entry_type_enum_name { font-family: monospace; font-weight: bolder; }
     .entry_type_enum_notes:before { content:" - " }
@@ -1092,6 +1093,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -1211,6 +1214,8 @@
               <span class="entry_type_visibility"> [public as colorSpaceTransform]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">3x3 rational matrix in row-major order</div>
 
@@ -1269,6 +1274,8 @@
               <span class="entry_type_visibility"> [public as rggbChannelVector]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">A 1D array of floats for 4 color channel gains</div>
 
@@ -1335,6 +1342,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -1387,6 +1396,7 @@
 use the highest-quality aberration correction algorithms,<wbr/> even if it slows down
 capture rate.<wbr/> FAST means the camera device will not slow down capture rate when
 applying aberration correction.<wbr/></p>
+<p>LEGACY devices will always be in FAST mode.<wbr/></p>
             </td>
           </tr>
 
@@ -1433,6 +1443,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -1552,6 +1564,8 @@
               <span class="entry_type_visibility"> [public as colorSpaceTransform]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">3x3 rational matrix in row-major order</div>
 
@@ -1610,6 +1624,8 @@
               <span class="entry_type_visibility"> [public as rggbChannelVector]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">A 1D array of floats for 4 color channel gains</div>
 
@@ -1676,6 +1692,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -1728,6 +1746,7 @@
 use the highest-quality aberration correction algorithms,<wbr/> even if it slows down
 capture rate.<wbr/> FAST means the camera device will not slow down capture rate when
 applying aberration correction.<wbr/></p>
+<p>LEGACY devices will always be in FAST mode.<wbr/></p>
             </td>
           </tr>
 
@@ -1778,6 +1797,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -1813,6 +1834,7 @@
 OFF mode.<wbr/></p>
 <p>For FULL capability device (<a href="#static_android.info.supportedHardwareLevel">android.<wbr/>info.<wbr/>supported<wbr/>Hardware<wbr/>Level</a> <code>==</code> FULL),<wbr/> OFF must be
 included.<wbr/></p>
+<p>LEGACY devices will always only support FAST mode.<wbr/></p>
             </td>
           </tr>
 
@@ -1864,6 +1886,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -1977,6 +2001,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -2041,6 +2067,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2055,7 +2083,9 @@
 must not update the exposure and sensitivity parameters
 while the lock is active.<wbr/></p>
 <p><a href="#controls_android.control.aeExposureCompensation">android.<wbr/>control.<wbr/>ae<wbr/>Exposure<wbr/>Compensation</a> setting changes
-will still take effect while auto-exposure is locked.<wbr/></p></span>
+will still take effect while auto-exposure is locked.<wbr/></p>
+<p>Some rare LEGACY devices may not support
+this,<wbr/> in which case the value will always be overridden to OFF.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -2115,6 +2145,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2125,7 +2157,9 @@
 <a href="#controls_android.sensor.sensitivity">android.<wbr/>sensor.<wbr/>sensitivity</a> and
 <a href="#controls_android.sensor.frameDuration">android.<wbr/>sensor.<wbr/>frame<wbr/>Duration</a> are used by the camera
 device,<wbr/> along with android.<wbr/>flash.<wbr/>* fields,<wbr/> if there's
-a flash unit for this camera device.<wbr/></p></span>
+a flash unit for this camera device.<wbr/></p>
+<p>LEGACY devices do not support the OFF mode and will
+override attempts to use this value to ON.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">ON</span>
@@ -2240,6 +2274,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -2251,7 +2286,7 @@
             </td>
 
             <td class="entry_range">
-              <p><code>area_<wbr/>count &lt;= <a href="#static_android.control.maxRegions">android.<wbr/>control.<wbr/>max<wbr/>Regions</a>[0]</code></p>
+              <p><code>area_<wbr/>count &lt;= <a href="#static_android.control.maxRegionsAe">android.<wbr/>control.<wbr/>max<wbr/>Regions<wbr/>Ae</a></code></p>
             </td>
 
             <td class="entry_tags">
@@ -2319,6 +2354,8 @@
               <span class="entry_type_visibility"> [public as rangeInt]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -2369,6 +2406,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2445,6 +2484,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2616,6 +2657,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -2691,6 +2733,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2763,6 +2807,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -2808,6 +2854,7 @@
               <p>Note that AWB lock is only meaningful when
 <a href="#controls_android.control.awbMode">android.<wbr/>control.<wbr/>awb<wbr/>Mode</a> is in the AUTO mode; in other modes,<wbr/>
 AWB is already fixed to a specific setting.<wbr/></p>
+<p>Some LEGACY devices may not support ON; the value is then overridden to OFF.<wbr/></p>
             </td>
           </tr>
 
@@ -2827,6 +2874,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3007,6 +3056,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -3082,6 +3132,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3114,7 +3166,8 @@
 image while recording video) use case.<wbr/></p>
 <p>The camera device should take the highest-quality image
 possible (given the other settings) without disrupting the
-frame rate of video recording.<wbr/>  </p></span>
+frame rate of video recording.<wbr/><br/>
+</p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">ZERO_SHUTTER_LAG</span>
@@ -3184,6 +3237,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3295,6 +3350,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3385,6 +3442,9 @@
 update,<wbr/> as if this frame is never captured.<wbr/> This mode can be used in the scenario
 where the application doesn't want a 3A manual control capture to affect
 the subsequent auto 3A capture results.<wbr/></p>
+<p>LEGACY mode devices will only support AUTO and USE_<wbr/>SCENE_<wbr/>MODE modes.<wbr/>
+LIMITED mode devices will only support OFF and OFF_<wbr/>KEEP_<wbr/>STATE if they
+support the MANUAL_<wbr/>SENSOR capability.<wbr/></p>
             </td>
           </tr>
 
@@ -3404,6 +3464,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3574,7 +3636,9 @@
                     <span class="entry_type_enum_name">HDR</span>
                     <span class="entry_type_enum_optional">[optional]</span>
                     <span class="entry_type_enum_optional">[hidden]</span>
-                    <span class="entry_type_enum_notes"><p>Turn on custom high dynamic range (HDR) mode.<wbr/></p></span>
+                    <span class="entry_type_enum_notes"><p>Turn on custom high dynamic range (HDR) mode.<wbr/></p>
+<p>This is intended for LEGACY mode devices only;
+HAL3+ camera devices should not implement this mode.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -3650,6 +3714,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -3700,6 +3766,8 @@
 <p>If a camera device supports both this mode and OIS (<a href="#controls_android.lens.opticalStabilizationMode">android.<wbr/>lens.<wbr/>optical<wbr/>Stabilization<wbr/>Mode</a>),<wbr/>
 turning both modes on may produce undesirable interaction,<wbr/> so it is recommended not to
 enable both at the same time.<wbr/></p>
+<p>Some LEGACY camera devices will not support changing video stabilization
+mode; in this case the value will always override to OFF.<wbr/></p>
             </td>
           </tr>
 
@@ -3750,6 +3818,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -3806,6 +3876,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -3839,12 +3911,14 @@
 given camera device,<wbr/> especially if no flash unit is
 available.<wbr/> This entry lists the valid modes for
 <a href="#controls_android.control.aeMode">android.<wbr/>control.<wbr/>ae<wbr/>Mode</a> for this camera device.<wbr/></p>
-<p>All camera devices support ON,<wbr/> and all camera devices with
-flash units support ON_<wbr/>AUTO_<wbr/>FLASH and
-ON_<wbr/>ALWAYS_<wbr/>FLASH.<wbr/></p>
+<p>All camera devices support ON,<wbr/> and all camera devices with flash
+units support ON_<wbr/>AUTO_<wbr/>FLASH and ON_<wbr/>ALWAYS_<wbr/>FLASH.<wbr/></p>
 <p>FULL mode camera devices always support OFF mode,<wbr/>
 which enables application control of camera exposure time,<wbr/>
 sensitivity,<wbr/> and frame duration.<wbr/></p>
+<p>LEGACY mode camera devices never support OFF mode.<wbr/>
+LIMITED mode devices support OFF if they support the MANUAL_<wbr/>SENSOR
+capability.<wbr/></p>
             </td>
           </tr>
 
@@ -3868,6 +3942,8 @@
               <span class="entry_type_visibility"> [public as rangeInt]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">list of pairs of frame rates</div>
 
@@ -3913,6 +3989,8 @@
               <span class="entry_type_visibility"> [public as rangeInt]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -3956,6 +4034,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4001,6 +4081,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums</div>
 
@@ -4036,6 +4118,9 @@
 <p>All LIMITED and FULL mode camera devices will support OFF mode,<wbr/> and all
 camera devices with adjustable focuser units
 (<code><a href="#static_android.lens.info.minimumFocusDistance">android.<wbr/>lens.<wbr/>info.<wbr/>minimum<wbr/>Focus<wbr/>Distance</a> &gt; 0</code>) will support AUTO mode.<wbr/></p>
+<p>LEGACY devices will support OFF mode only if they support
+focusing to infinity (by also setting <a href="#controls_android.lens.focusDistance">android.<wbr/>lens.<wbr/>focus<wbr/>Distance</a> to
+<code>0.<wbr/>0f</code>).<wbr/></p>
             </td>
           </tr>
 
@@ -4059,6 +4144,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums (android.<wbr/>control.<wbr/>effect<wbr/>Mode).<wbr/></div>
 
@@ -4122,6 +4209,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums (android.<wbr/>control.<wbr/>scene<wbr/>Mode).<wbr/></div>
 
@@ -4183,6 +4272,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums.<wbr/></div>
 
@@ -4229,6 +4320,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums</div>
 
@@ -4288,6 +4381,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4335,6 +4430,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4386,6 +4483,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4436,6 +4535,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4490,6 +4591,8 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
 
@@ -4575,6 +4678,8 @@
               <span class="entry_type_visibility"> [hidden as highSpeedVideoConfiguration]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
 
@@ -4685,6 +4790,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -4735,6 +4841,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -4848,6 +4956,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -4912,6 +5022,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -4926,7 +5038,9 @@
 must not update the exposure and sensitivity parameters
 while the lock is active.<wbr/></p>
 <p><a href="#controls_android.control.aeExposureCompensation">android.<wbr/>control.<wbr/>ae<wbr/>Exposure<wbr/>Compensation</a> setting changes
-will still take effect while auto-exposure is locked.<wbr/></p></span>
+will still take effect while auto-exposure is locked.<wbr/></p>
+<p>Some rare LEGACY devices may not support
+this,<wbr/> in which case the value will always be overridden to OFF.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -4986,6 +5100,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -4996,7 +5112,9 @@
 <a href="#controls_android.sensor.sensitivity">android.<wbr/>sensor.<wbr/>sensitivity</a> and
 <a href="#controls_android.sensor.frameDuration">android.<wbr/>sensor.<wbr/>frame<wbr/>Duration</a> are used by the camera
 device,<wbr/> along with android.<wbr/>flash.<wbr/>* fields,<wbr/> if there's
-a flash unit for this camera device.<wbr/></p></span>
+a flash unit for this camera device.<wbr/></p>
+<p>LEGACY devices do not support the OFF mode and will
+override attempts to use this value to ON.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">ON</span>
@@ -5111,6 +5229,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -5122,7 +5241,7 @@
             </td>
 
             <td class="entry_range">
-              <p><code>area_<wbr/>count &lt;= <a href="#static_android.control.maxRegions">android.<wbr/>control.<wbr/>max<wbr/>Regions</a>[0]</code></p>
+              <p><code>area_<wbr/>count &lt;= <a href="#static_android.control.maxRegionsAe">android.<wbr/>control.<wbr/>max<wbr/>Regions<wbr/>Ae</a></code></p>
             </td>
 
             <td class="entry_tags">
@@ -5190,6 +5309,8 @@
               <span class="entry_type_visibility"> [public as rangeInt]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -5240,6 +5361,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -5316,6 +5439,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -5581,6 +5706,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -5752,6 +5879,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -5827,6 +5955,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -5899,6 +6029,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -5958,7 +6090,9 @@
                     <span class="entry_type_enum_notes"><p>AF finished a passive scan without finding focus,<wbr/>
 and may restart scanning at any time.<wbr/></p>
 <p>Only used by CONTINUOUS_<wbr/>* AF modes.<wbr/> This is a transient state,<wbr/> the camera
-device may skip reporting this state in capture result.<wbr/></p></span>
+device may skip reporting this state in capture result.<wbr/></p>
+<p>LEGACY camera devices do not support this state.<wbr/> When a passive
+scan has finished,<wbr/> it will always go to PASSIVE_<wbr/>FOCUSED.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -6383,6 +6517,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -6432,6 +6567,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -6477,6 +6614,7 @@
               <p>Note that AWB lock is only meaningful when
 <a href="#controls_android.control.awbMode">android.<wbr/>control.<wbr/>awb<wbr/>Mode</a> is in the AUTO mode; in other modes,<wbr/>
 AWB is already fixed to a specific setting.<wbr/></p>
+<p>Some LEGACY devices may not support ON; the value is then overridden to OFF.<wbr/></p>
             </td>
           </tr>
 
@@ -6496,6 +6634,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -6676,6 +6816,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -6751,6 +6892,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -6783,7 +6926,8 @@
 image while recording video) use case.<wbr/></p>
 <p>The camera device should take the highest-quality image
 possible (given the other settings) without disrupting the
-frame rate of video recording.<wbr/>  </p></span>
+frame rate of video recording.<wbr/><br/>
+</p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">ZERO_SHUTTER_LAG</span>
@@ -6853,6 +6997,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7037,6 +7183,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7148,6 +7296,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7238,6 +7388,9 @@
 update,<wbr/> as if this frame is never captured.<wbr/> This mode can be used in the scenario
 where the application doesn't want a 3A manual control capture to affect
 the subsequent auto 3A capture results.<wbr/></p>
+<p>LEGACY mode devices will only support AUTO and USE_<wbr/>SCENE_<wbr/>MODE modes.<wbr/>
+LIMITED mode devices will only support OFF and OFF_<wbr/>KEEP_<wbr/>STATE if they
+support the MANUAL_<wbr/>SENSOR capability.<wbr/></p>
             </td>
           </tr>
 
@@ -7257,6 +7410,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7427,7 +7582,9 @@
                     <span class="entry_type_enum_name">HDR</span>
                     <span class="entry_type_enum_optional">[optional]</span>
                     <span class="entry_type_enum_optional">[hidden]</span>
-                    <span class="entry_type_enum_notes"><p>Turn on custom high dynamic range (HDR) mode.<wbr/></p></span>
+                    <span class="entry_type_enum_notes"><p>Turn on custom high dynamic range (HDR) mode.<wbr/></p>
+<p>This is intended for LEGACY mode devices only;
+HAL3+ camera devices should not implement this mode.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -7503,6 +7660,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7553,6 +7712,8 @@
 <p>If a camera device supports both this mode and OIS (<a href="#controls_android.lens.opticalStabilizationMode">android.<wbr/>lens.<wbr/>optical<wbr/>Stabilization<wbr/>Mode</a>),<wbr/>
 turning both modes on may produce undesirable interaction,<wbr/> so it is recommended not to
 enable both at the same time.<wbr/></p>
+<p>Some LEGACY camera devices will not support changing video stabilization
+mode; in this case the value will always override to OFF.<wbr/></p>
             </td>
           </tr>
 
@@ -7606,6 +7767,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">FAST</span>
@@ -7688,6 +7850,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -7761,6 +7925,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -7830,6 +7995,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -7906,6 +8073,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -8011,6 +8180,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8062,6 +8232,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8110,6 +8281,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -8213,6 +8386,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -8273,6 +8448,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8327,6 +8503,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8369,6 +8546,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8438,6 +8616,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8489,6 +8668,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -8537,6 +8717,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -8611,6 +8793,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -8664,6 +8848,16 @@
               <p>When the camera device doesn't have flash unit
 (i.<wbr/>e.<wbr/> <code><a href="#static_android.flash.info.available">android.<wbr/>flash.<wbr/>info.<wbr/>available</a> == false</code>),<wbr/> this state will always be UNAVAILABLE.<wbr/>
 Other states indicate the current flash status.<wbr/></p>
+<p>In certain conditions,<wbr/> this will be available on LEGACY devices:</p>
+<ul>
+<li>Flash-less cameras always return UNAVAILABLE.<wbr/></li>
+<li>Using <a href="#controls_android.control.aeMode">android.<wbr/>control.<wbr/>ae<wbr/>Mode</a> <code>==</code> ON_<wbr/>ALWAYS_<wbr/>FLASH
+   will always return FIRED.<wbr/></li>
+<li>Using <a href="#controls_android.flash.mode">android.<wbr/>flash.<wbr/>mode</a> <code>==</code> TORCH
+   will always return FIRED.<wbr/></li>
+</ul>
+<p>In all other conditions the state will not be available on
+LEGACY devices (i.<wbr/>e.<wbr/> it will be <code>null</code>).<wbr/></p>
             </td>
           </tr>
 
@@ -8717,6 +8911,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -8820,6 +9015,7 @@
 
 
 
+
                 <div class="entry_type_notes">list of enums</div>
 
 
@@ -8908,6 +9104,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -9012,6 +9209,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9052,6 +9251,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">latitude,<wbr/> longitude,<wbr/> altitude.<wbr/> First two in degrees,<wbr/> the third in meters</div>
 
@@ -9094,6 +9295,8 @@
               <span class="entry_type_visibility"> [hidden as string]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9135,6 +9338,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9176,6 +9381,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9218,6 +9425,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9267,6 +9476,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9312,6 +9523,8 @@
               <span class="entry_type_visibility"> [public as size]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9411,6 +9624,8 @@
               <span class="entry_type_visibility"> [public as size]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9475,6 +9690,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -9548,6 +9764,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9588,6 +9806,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">latitude,<wbr/> longitude,<wbr/> altitude.<wbr/> First two in degrees,<wbr/> the third in meters</div>
 
@@ -9630,6 +9850,8 @@
               <span class="entry_type_visibility"> [hidden as string]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9671,6 +9893,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9712,6 +9936,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9754,6 +9980,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9806,6 +10034,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -9859,6 +10088,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -9904,6 +10135,8 @@
               <span class="entry_type_visibility"> [public as size]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -10004,6 +10237,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -10068,6 +10303,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -10130,6 +10367,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -10187,6 +10426,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -10218,12 +10459,14 @@
           </tr>
           <tr class="entry_cont">
             <td class="entry_details" colspan="5">
-              <p>0 means infinity focus.<wbr/> Used value will be clamped
-to [0,<wbr/> <a href="#static_android.lens.info.minimumFocusDistance">android.<wbr/>lens.<wbr/>info.<wbr/>minimum<wbr/>Focus<wbr/>Distance</a>].<wbr/></p>
+              <p><code>0.<wbr/>0f</code> means infinity focus.<wbr/> Used value will be clamped
+to <code>[0.<wbr/>0f,<wbr/> <a href="#static_android.lens.info.minimumFocusDistance">android.<wbr/>lens.<wbr/>info.<wbr/>minimum<wbr/>Focus<wbr/>Distance</a>]</code>.<wbr/></p>
 <p>Like <a href="#controls_android.lens.focalLength">android.<wbr/>lens.<wbr/>focal<wbr/>Length</a>,<wbr/> this setting won't be applied
 instantaneously,<wbr/> and it may take several frames before the lens
 can move to the requested focus distance.<wbr/> While the lens is still moving,<wbr/>
 <a href="#dynamic_android.lens.state">android.<wbr/>lens.<wbr/>state</a> will be set to MOVING.<wbr/></p>
+<p>LEGACY devices support at most setting this to <code>0.<wbr/>0f</code>
+for infinity focus.<wbr/></p>
             </td>
           </tr>
 
@@ -10243,6 +10486,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -10352,6 +10597,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -10408,6 +10655,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -10464,6 +10713,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">The list of available focal lengths</div>
 
@@ -10523,6 +10774,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -10574,6 +10827,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
 
@@ -10622,6 +10877,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
 
@@ -10689,6 +10946,8 @@
               <span class="entry_type_visibility"> [hidden as size]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">width and height (N,<wbr/> M) of lens shading map provided by the camera device.<wbr/></div>
 
@@ -10739,6 +10998,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -10838,6 +11099,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -10890,6 +11153,7 @@
 
 
 
+
                 <div class="entry_type_notes">degrees.<wbr/> First defines the angle of separation between the perpendicular to the screen and the camera optical axis.<wbr/> The second then defines the clockwise rotation of the optical axis from native device up.<wbr/></div>
 
 
@@ -10955,6 +11219,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -11019,6 +11284,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -11083,6 +11350,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -11145,6 +11414,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -11202,6 +11473,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -11256,6 +11529,8 @@
               <span class="entry_type_visibility"> [public as pairFloatFloat]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
                 <div class="entry_type_notes">Range of scene distances that are in focus</div>
 
@@ -11309,6 +11584,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -11385,6 +11662,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -11496,6 +11775,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -11570,6 +11851,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -11640,6 +11922,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -11670,6 +11954,7 @@
             <td class="entry_details" colspan="5">
               <p>This tag lists the valid modes for <a href="#controls_android.noiseReduction.mode">android.<wbr/>noise<wbr/>Reduction.<wbr/>mode</a>.<wbr/></p>
 <p>Full-capability camera devices must always support OFF and FAST.<wbr/></p>
+<p>Legacy-capability camera devices will only support FAST mode.<wbr/></p>
             </td>
           </tr>
 
@@ -11716,6 +12001,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -11820,6 +12107,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -11876,6 +12164,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -11929,6 +12218,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -11984,6 +12274,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12073,6 +12364,7 @@
               <span class="entry_type_visibility"> [hidden as boolean]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12187,6 +12479,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12233,6 +12526,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -12278,6 +12572,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12333,6 +12628,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">NONE</span>
@@ -12395,6 +12691,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12452,6 +12749,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12540,6 +12838,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -12611,6 +12911,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -12650,6 +12952,8 @@
 <li>ImageFormat#RAW10</li>
 <li>Opaque <code>RAW</code></li>
 </ul>
+<p>LEGACY mode devices (<a href="#static_android.info.supportedHardwareLevel">android.<wbr/>info.<wbr/>supported<wbr/>Hardware<wbr/>Level</a> <code>==</code> LEGACY)
+never support raw streams.<wbr/></p>
             </td>
           </tr>
 
@@ -12670,6 +12974,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -12715,6 +13021,7 @@
 </ul>
 <p>For full guarantees,<wbr/> query StreamConfigurationMap#getOutputStallDuration with
 a processed format -- it will return 0 for a non-stalling stream.<wbr/></p>
+<p>LEGACY devices will support up to 3 processing/<wbr/>non-stalling streams.<wbr/></p>
             </td>
           </tr>
 
@@ -12735,6 +13042,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -12772,6 +13081,7 @@
 Typically only the <code>JPEG</code> format (ImageFormat#JPEG)</p>
 <p>For full guarantees,<wbr/> query StreamConfigurationMap#getOutputStallDuration with
 a processed format -- it will return a non-0 value for a stalling stream.<wbr/></p>
+<p>LEGACY devices will support up to 1 processing/<wbr/>stalling stream.<wbr/></p>
             </td>
           </tr>
 
@@ -12796,6 +13106,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -12848,6 +13159,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -12902,6 +13215,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -12969,6 +13284,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -13027,6 +13343,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -13245,6 +13563,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -13315,6 +13635,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -13395,6 +13717,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -13489,6 +13813,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -13542,6 +13867,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -13584,6 +13910,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">NONE</span>
@@ -13646,6 +13973,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -13702,6 +14030,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -13797,6 +14127,8 @@
               <span class="entry_type_visibility"> [public as rectangle]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -13923,6 +14255,7 @@
               <span class="entry_type_visibility"> [hidden as imageFormat]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14069,6 +14402,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14131,6 +14465,7 @@
               <span class="entry_type_visibility"> [hidden as size]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14192,6 +14527,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -14245,6 +14582,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14307,6 +14645,7 @@
               <span class="entry_type_visibility"> [hidden as size]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14392,6 +14731,7 @@
               <span class="entry_type_visibility"> [system]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14454,6 +14794,7 @@
               <span class="entry_type_visibility"> [system as size]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
 
@@ -14500,6 +14841,8 @@
               <span class="entry_type_visibility"> [hidden as imageFormat]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -14638,6 +14981,8 @@
               <span class="entry_type_visibility"> [hidden as streamConfiguration]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -14823,6 +15168,8 @@
               <span class="entry_type_visibility"> [hidden as streamConfigurationDuration]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -14887,6 +15234,8 @@
               <span class="entry_type_visibility"> [hidden as streamConfigurationDuration]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -15001,6 +15350,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -15163,6 +15514,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -15206,7 +15559,7 @@
 is inside of the active array.<wbr/> The camera device will apply the same crop region and
 return the final used crop region in capture result metadata <a href="#controls_android.scaler.cropRegion">android.<wbr/>scaler.<wbr/>crop<wbr/>Region</a>.<wbr/></p>
 <p>FULL capability devices (<a href="#static_android.info.supportedHardwareLevel">android.<wbr/>info.<wbr/>supported<wbr/>Hardware<wbr/>Level</a> <code>==</code> FULL) will support
-FREEFORM cropping.<wbr/></p>
+FREEFORM cropping.<wbr/> LEGACY capability devices will only support CENTER_<wbr/>ONLY cropping.<wbr/></p>
             </td>
           </tr>
 
@@ -15257,6 +15610,8 @@
               <span class="entry_type_visibility"> [public as rectangle]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -15383,6 +15738,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -15434,6 +15791,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -15563,6 +15922,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -15636,6 +15997,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -15696,6 +16058,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -15882,6 +16245,8 @@
               <span class="entry_type_visibility"> [public as rectangle]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">Four ints defining the active pixel rectangle</div>
 
@@ -15939,6 +16304,8 @@
               <span class="entry_type_visibility"> [public as rangeInt]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">Range of supported sensitivities</div>
 
@@ -15992,6 +16359,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -16057,6 +16426,8 @@
               <span class="entry_type_visibility"> [public as rangeLong]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">nanoseconds</div>
 
@@ -16121,6 +16492,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -16206,6 +16579,8 @@
               <span class="entry_type_visibility"> [public as sizeF]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">width x height in millimeters</div>
 
@@ -16269,6 +16644,8 @@
               <span class="entry_type_visibility"> [public as size]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -16327,6 +16704,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -16390,6 +16768,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -16462,6 +16842,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">DAYLIGHT</span>
@@ -16629,6 +17010,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -16686,6 +17068,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -16746,6 +17129,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -16809,6 +17193,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -16873,6 +17258,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -16939,6 +17325,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -17001,6 +17388,7 @@
 
 
 
+
                 <div class="entry_type_notes">3x3 matrix in row-major-order</div>
 
 
@@ -17063,6 +17451,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -17105,6 +17494,7 @@
 
 
 
+
                 <div class="entry_type_notes">2x2 raw count block</div>
 
 
@@ -17169,6 +17559,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -17221,6 +17613,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -17272,6 +17666,7 @@
 
 
 
+
                 <div class="entry_type_notes">Number of samples for hue,<wbr/> saturation,<wbr/> and value</div>
 
 
@@ -17331,6 +17726,7 @@
 
 
 
+
                 <div class="entry_type_notes">list of enums</div>
 
 
@@ -17403,6 +17799,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -17454,6 +17852,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -17583,6 +17983,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -17649,6 +18051,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -17729,6 +18133,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -17777,6 +18182,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -17832,6 +18238,7 @@
 
 
 
+
                 <div class="entry_type_notes">Pairs of noise model coefficients</div>
 
 
@@ -17911,6 +18318,7 @@
 
 
 
+
                 <div class="entry_type_notes">Mapping for hue,<wbr/> saturation,<wbr/> and value</div>
 
 
@@ -17976,6 +18384,7 @@
 
 
 
+
                 <div class="entry_type_notes">Samples defining a spline for a tone-mapping curve</div>
 
 
@@ -18032,6 +18441,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -18125,6 +18535,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -18185,6 +18596,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -18338,6 +18750,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[limited] </span>
+
 
 
 
@@ -18434,6 +18848,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -18521,6 +18937,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -18587,6 +19004,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -18703,6 +19122,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -18782,6 +19203,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -18830,6 +19252,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -18878,6 +19301,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -18936,6 +19360,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -18963,6 +19389,9 @@
             </td>
 
             <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_RAW">RAW</a></li>
+              </ul>
             </td>
 
           </tr>
@@ -18974,6 +19403,7 @@
               <p>When set to ON,<wbr/>
 <a href="#dynamic_android.statistics.lensShadingMap">android.<wbr/>statistics.<wbr/>lens<wbr/>Shading<wbr/>Map</a> will be provided in
 the output result metadata.<wbr/></p>
+<p>Required for devices with the RAW capability.<wbr/></p>
             </td>
           </tr>
 
@@ -19026,6 +19456,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">List of enums from android.<wbr/>statistics.<wbr/>face<wbr/>Detect<wbr/>Mode</div>
 
@@ -19085,6 +19517,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -19123,6 +19556,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -19137,8 +19572,9 @@
             </td>
 
             <td class="entry_range">
-              <p>&gt;= 4 if <a href="#static_android.statistics.info.availableFaceDetectModes">android.<wbr/>statistics.<wbr/>info.<wbr/>available<wbr/>Face<wbr/>Detect<wbr/>Modes</a> lists
-modes besides OFF,<wbr/> otherwise 0</p>
+              <p>0 for cameras without available face detection; otherwise:
+<code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
+<code>&gt;0</code> for LEGACY devices.<wbr/></p>
             </td>
 
             <td class="entry_tags">
@@ -19168,6 +19604,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -19208,6 +19645,7 @@
 
 
 
+
             </td> <!-- entry_type -->
 
             <td class="entry_description">
@@ -19250,6 +19688,7 @@
 
 
 
+
                 <div class="entry_type_notes">width x height</div>
 
 
@@ -19296,6 +19735,7 @@
 
 
 
+
                 <div class="entry_type_notes">list of enums</div>
 
 
@@ -19328,6 +19768,7 @@
 <p>If no hotpixel map is available for this camera device,<wbr/> this will contain
 only OFF.<wbr/>  If the hotpixel map is available,<wbr/> this will include both
 the ON and OFF options.<wbr/></p>
+<p>Required on devices with the RAW capability.<wbr/></p>
             </td>
           </tr>
 
@@ -19377,6 +19818,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -19458,6 +19901,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -19512,6 +19957,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">(leftEyeX,<wbr/> leftEyeY,<wbr/> rightEyeX,<wbr/> rightEyeY,<wbr/> mouthX,<wbr/> mouthY)</div>
 
@@ -19567,6 +20014,8 @@
               <span class="entry_type_visibility"> [hidden as rectangle]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
                 <div class="entry_type_notes">(xmin,<wbr/> ymin,<wbr/> xmax,<wbr/> ymax).<wbr/> (0,<wbr/>0) is top-left of active pixel area</div>
 
@@ -19622,6 +20071,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -19685,6 +20136,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
 
@@ -19735,6 +20188,7 @@
 
 
 
+
                 <div class="entry_type_notes">count of pixels for each color channel that fall into each histogram bucket,<wbr/> scaled to be between 0 and maxHistogramCount</div>
 
 
@@ -19788,6 +20242,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -19839,6 +20294,7 @@
 
 
 
+
                 <div class="entry_type_notes">estimated sharpness for each region of the input image.<wbr/> Normalized to be between 0 and maxSharpnessMapValue.<wbr/> Higher values mean sharper (better focused)</div>
 
 
@@ -19890,6 +20346,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -19936,6 +20393,8 @@
               <span class="entry_type_visibility"> [public as lensShadingMap]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -20022,6 +20481,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">2D array of float gain factors per channel to correct lens shading</div>
 
@@ -20127,6 +20588,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
                 <div class="entry_type_notes">A 1D array of floats for 4 color channel gains</div>
@@ -20187,6 +20649,7 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+
               <span class="entry_type_deprecated">[deprecated] </span>
 
                 <div class="entry_type_notes">3x3 rational matrix in row-major order</div>
@@ -20247,6 +20710,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -20323,6 +20788,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -20386,6 +20852,7 @@
 
 
 
+
                 <div class="entry_type_notes">list of coordinates based on android.<wbr/>sensor.<wbr/>pixel<wbr/>Array<wbr/>Size</div>
 
 
@@ -20456,6 +20923,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -20483,6 +20952,9 @@
             </td>
 
             <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_RAW">RAW</a></li>
+              </ul>
             </td>
 
           </tr>
@@ -20494,6 +20966,7 @@
               <p>When set to ON,<wbr/>
 <a href="#dynamic_android.statistics.lensShadingMap">android.<wbr/>statistics.<wbr/>lens<wbr/>Shading<wbr/>Map</a> will be provided in
 the output result metadata.<wbr/></p>
+<p>Required for devices with the RAW capability.<wbr/></p>
             </td>
           </tr>
 
@@ -20549,6 +21022,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -20602,6 +21077,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -20655,6 +21132,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -20755,6 +21234,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -20851,6 +21332,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -20963,6 +21446,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -21027,6 +21512,8 @@
               <span class="entry_type_visibility"> [public as enumList]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">list of enums</div>
 
@@ -21105,6 +21592,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -21158,6 +21647,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -21211,6 +21702,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
                 <div class="entry_type_notes">1D array of float pairs (P_<wbr/>IN,<wbr/> P_<wbr/>OUT).<wbr/> The maximum number of pairs is specified by android.<wbr/>tonemap.<wbr/>max<wbr/>Curve<wbr/>Points.<wbr/></div>
 
@@ -21311,6 +21804,8 @@
 
               <span class="entry_type_synthetic">[synthetic] </span>
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
 
@@ -21407,6 +21902,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -21526,6 +22023,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -21606,6 +22104,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">OFF</span>
@@ -21690,6 +22189,7 @@
 
 
 
+
                 <ul class="entry_type_enum">
                   <li>
                     <span class="entry_type_enum_name">TRANSMIT</span>
@@ -21762,6 +22262,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -21801,7 +22303,7 @@
           </tr>
           <tr class="entry_cont">
             <td class="entry_details" colspan="5">
-              <p>Camera devices will come in two flavors: LIMITED and FULL.<wbr/></p>
+              <p>Camera devices will come in three flavors: LEGACY,<wbr/> LIMITED and FULL.<wbr/></p>
 <p>A FULL device has the most support possible and will support below capabilities:</p>
 <ul>
 <li>30fps at maximum resolution (== sensor resolution) is preferred,<wbr/> more than 20fps is required.<wbr/></li>
@@ -21818,6 +22320,8 @@
 To find out more refer to <a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a>.<wbr/></p>
 <p>A LEGACY device does not support per-frame control,<wbr/> manual sensor control,<wbr/> manual
 post-processing,<wbr/> arbitrary cropping regions,<wbr/> and has relaxed performance constraints.<wbr/></p>
+<p>Each higher level supports everything the lower level supports
+in this order: FULL <code>&gt;</code> LIMITED <code>&gt;</code> LEGACY.<wbr/></p>
             </td>
           </tr>
 
@@ -21834,6 +22338,9 @@
 older or inexpensive devices.<wbr/> Full is a strict superset of
 limited,<wbr/> and they share the same essential operational flow.<wbr/></p>
 <p>For full details refer to "S3.<wbr/> Operational Modes" in camera3.<wbr/>h</p>
+<p>Camera HAL3+ must not implement LEGACY mode.<wbr/> It is there
+for backwards compatibility in the <code>android.<wbr/>hardware.<wbr/>camera2</code>
+user-facing API only.<wbr/></p>
             </td>
           </tr>
 
@@ -21884,6 +22391,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -22014,6 +22523,8 @@
               <span class="entry_type_visibility"> [public as boolean]</span>
 
 
+              <span class="entry_type_hwlevel">[full] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -22118,6 +22629,8 @@
               <span class="entry_type_visibility"> [hidden]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -22283,6 +22796,8 @@
               <span class="entry_type_visibility"> [public]</span>
 
 
+              <span class="entry_type_hwlevel">[legacy] </span>
+
 
 
                 <ul class="entry_type_enum">
@@ -22546,6 +23061,7 @@
           <li><a href="#controls_android.statistics.hotPixelMapMode">android.statistics.hotPixelMapMode</a> (controls)</li>
           <li><a href="#static_android.statistics.info.availableHotPixelMapModes">android.statistics.info.availableHotPixelMapModes</a> (static)</li>
           <li><a href="#dynamic_android.statistics.hotPixelMap">android.statistics.hotPixelMap</a> (dynamic)</li>
+          <li><a href="#controls_android.statistics.lensShadingMapMode">android.statistics.lensShadingMapMode</a> (controls)</li>
           <li><a href="#dynamic_android.hotPixel.mode">android.hotPixel.mode</a> (dynamic)</li>
         </ul>
       </li> <!-- tag_RAW -->
diff --git a/camera/docs/html.mako b/camera/docs/html.mako
index b94ca31..9e8d4c8 100644
--- a/camera/docs/html.mako
+++ b/camera/docs/html.mako
@@ -61,6 +61,7 @@
     .entry_type_name_enum:after { color: #669900; font-weight: bold; content:" (enum)" }
     .entry_type_visibility { font-weight: bolder; padding-left:1em}
     .entry_type_synthetic { font-weight: bolder; color: #996600; }
+    .entry_type_hwlevel { font-weight: bolder; color: #000066; }
     .entry_type_deprecated { font-weight: bolder; color: #4D4D4D; }
     .entry_type_enum_name { font-family: monospace; font-weight: bolder; }
     .entry_type_enum_notes:before { content:" - " }
@@ -261,6 +262,10 @@
               <span class="entry_type_synthetic">[synthetic] </span>
               % endif
 
+              % if prop.hwlevel:
+              <span class="entry_type_hwlevel">[${prop.hwlevel}] </span>
+              % endif
+
               % if prop.deprecated:
               <span class="entry_type_deprecated">[deprecated] </span>
               % endif
diff --git a/camera/docs/metadata_model.py b/camera/docs/metadata_model.py
index b546517..e4e1810 100644
--- a/camera/docs/metadata_model.py
+++ b/camera/docs/metadata_model.py
@@ -1030,6 +1030,10 @@
                list of entries (in C code). In general a synthetic entry is
                glued together at the Java layer from multiple visibiltity=hidden
                entries.
+    hwlevel: The lowest hardware level at which the entry is guaranteed
+             to be supported by the camera device. All devices with higher
+             hwlevels will also include this entry. None means that the
+             entry is optional on any hardware level.
     deprecated: Marks an entry as @Deprecated in the Java layer; if within an
                unreleased version this needs to be removed altogether. If applied
                to an entry from an older release, then this means the entry
@@ -1090,6 +1094,7 @@
                   'public'
       synthetic: A bool to mark whether this entry is visible only at the Java
                  layer (True), or at both layers (False = default).
+      hwlevel: A string of the HW level (one of 'legacy', 'limited', 'full')
       deprecated: A bool to mark whether this is @Deprecated at the Java layer
                  (default = False).
       optional: A bool to mark whether optional for non-full hardware devices
@@ -1130,9 +1135,14 @@
     return self._synthetic
 
   @property
+  def hwlevel(self):
+    return self._hwlevel
+
+  @property
   def deprecated(self):
     return self._deprecated
 
+  # TODO: optional should just return hwlevel is None
   @property
   def optional(self):
     return self._optional
@@ -1254,6 +1264,7 @@
 
     self._visibility = kwargs.get('visibility')
     self._synthetic = kwargs.get('synthetic', False)
+    self._hwlevel = kwargs.get('hwlevel')
     self._deprecated = kwargs.get('deprecated', False)
     self._optional = kwargs.get('optional')
 
@@ -1453,6 +1464,7 @@
                     'type_notes',
                     'visibility',
                     'synthetic',
+                    'hwlevel',
                     'deprecated',
                     'optional',
                     'typedef'
diff --git a/camera/docs/metadata_parser_xml.py b/camera/docs/metadata_parser_xml.py
index fb83490..b72c683 100755
--- a/camera/docs/metadata_parser_xml.py
+++ b/camera/docs/metadata_parser_xml.py
@@ -180,6 +180,11 @@
     d['synthetic'] = entry.get('synthetic') == 'true'
 
     #
+    # Hardware Level (one of limited, legacy, full)
+    #
+    d['hwlevel'] = entry.get('hwlevel')
+
+    #
     # Deprecated ?
     #
     d['deprecated'] = entry.get('deprecated') == 'true'
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 8e8a757..fe96508 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -120,7 +120,7 @@
   <namespace name="android">
     <section name="colorCorrection">
       <controls>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
           <enum>
             <value>TRANSFORM_MATRIX
               <notes>Use the android.colorCorrection.transform matrix
@@ -220,7 +220,7 @@
         </entry>
         <entry name="transform" type="rational" visibility="public"
                type_notes="3x3 rational matrix in row-major order"
-               container="array" typedef="colorSpaceTransform" >
+               container="array" typedef="colorSpaceTransform" hwlevel="full">
           <array>
             <size>3</size>
             <size>3</size>
@@ -242,7 +242,7 @@
         </entry>
         <entry name="gains" type="float" visibility="public"
                type_notes="A 1D array of floats for 4 color channel gains"
-               container="array" typedef="rggbChannelVector" >
+               container="array" typedef="rggbChannelVector" hwlevel="full">
           <array>
             <size>4</size>
           </array>
@@ -269,7 +269,7 @@
           `G_odd` equal to `G_even` in the output result metadata.
           </hal_details>
         </entry>
-        <entry name="aberrationMode" type="byte" visibility="public" enum="true">
+        <entry name="aberrationMode" type="byte" visibility="public" enum="true" hwlevel="legacy">
           <enum>
             <value>OFF
               <notes>
@@ -307,6 +307,8 @@
             use the highest-quality aberration correction algorithms, even if it slows down
             capture rate. FAST means the camera device will not slow down capture rate when
             applying aberration correction.
+
+            LEGACY devices will always be in FAST mode.
           </details>
         </entry>
       </controls>
@@ -322,7 +324,7 @@
       </dynamic>
       <static>
         <entry name="availableAberrationModes" type="byte" visibility="public"
-        type_notes="list of enums" container="array" typedef="enumList">
+        type_notes="list of enums" container="array" typedef="enumList" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -340,6 +342,8 @@
 
             For FULL capability device (android.info.supportedHardwareLevel `==` FULL), OFF must be
             included.
+
+            LEGACY devices will always only support FAST mode.
           </details>
           <tag id="V1" />
         </entry>
@@ -348,7 +352,7 @@
     <section name="control">
       <controls>
         <entry name="aeAntibandingMode" type="byte" visibility="public"
-               enum="true" >
+               enum="true" hwlevel="legacy">
           <enum>
             <value>OFF
               <notes>
@@ -429,7 +433,7 @@
           </hal_details>
           <tag id="BC" />
         </entry>
-        <entry name="aeExposureCompensation" type="int32" visibility="public">
+        <entry name="aeExposureCompensation" type="int32" visibility="public" hwlevel="legacy">
           <description>Adjustment to auto-exposure (AE) target image
           brightness.</description>
           <units>count of positive/negative EV steps</units>
@@ -456,7 +460,7 @@
           <tag id="BC" />
         </entry>
         <entry name="aeLock" type="byte" visibility="public" enum="true"
-               typedef="boolean">
+               typedef="boolean" hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>Auto-exposure lock is disabled; the AE algorithm
@@ -468,6 +472,9 @@
 
             android.control.aeExposureCompensation setting changes
             will still take effect while auto-exposure is locked.
+
+            Some rare LEGACY devices may not support
+            this, in which case the value will always be overridden to OFF.
             </notes></value>
           </enum>
           <description>Whether auto-exposure (AE) is currently locked to its latest
@@ -490,7 +497,7 @@
           </details>
           <tag id="BC" />
         </entry>
-        <entry name="aeMode" type="byte" visibility="public" enum="true">
+        <entry name="aeMode" type="byte" visibility="public" enum="true" hwlevel="legacy">
           <enum>
             <value>OFF
               <notes>
@@ -501,6 +508,9 @@
                 android.sensor.frameDuration are used by the camera
                 device, along with android.flash.* fields, if there's
                 a flash unit for this camera device.
+
+                LEGACY devices do not support the OFF mode and will
+                override attempts to use this value to ON.
               </notes>
             </value>
             <value>ON
@@ -590,7 +600,7 @@
           </array>
           <description>List of areas to use for
           metering.</description>
-          <range>`area_count &lt;= android.control.maxRegions[0]`</range>
+          <range>`area_count &lt;= android.control.maxRegionsAe`</range>
           <details>
               Optional. Not available if android.control.maxRegionsAe is 0.
               Otherwise will always be present.
@@ -624,7 +634,7 @@
           <tag id="BC" />
         </entry>
         <entry name="aeTargetFpsRange" type="int32" visibility="public"
-               container="array" typedef="rangeInt">
+               container="array" typedef="rangeInt" hwlevel="legacy">
           <array>
             <size>2</size>
           </array>
@@ -636,7 +646,7 @@
           <tag id="BC" />
         </entry>
         <entry name="aePrecaptureTrigger" type="byte" visibility="public"
-               enum="true">
+               enum="true" hwlevel="limited">
           <enum>
             <value>IDLE
               <notes>The trigger is idle.</notes>
@@ -672,7 +682,8 @@
           details.</details>
           <tag id="BC" />
         </entry>
-        <entry name="afMode" type="byte" visibility="public" enum="true">
+        <entry name="afMode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>The auto-focus routine does not control the lens;
@@ -834,7 +845,8 @@
           </hal_details>
           <tag id="BC" />
         </entry>
-        <entry name="afTrigger" type="byte" visibility="public" enum="true">
+        <entry name="afTrigger" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>IDLE
               <notes>The trigger is idle.</notes>
@@ -869,7 +881,7 @@
           <tag id="BC" />
         </entry>
         <entry name="awbLock" type="byte" visibility="public" enum="true"
-               typedef="boolean">
+               typedef="boolean" hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>Auto-white balance lock is disabled; the AWB
@@ -884,10 +896,14 @@
           latest calculated values.</description>
           <details>Note that AWB lock is only meaningful when
           android.control.awbMode is in the AUTO mode; in other modes,
-          AWB is already fixed to a specific setting.</details>
+          AWB is already fixed to a specific setting.
+
+          Some LEGACY devices may not support ON; the value is then overridden to OFF.
+          </details>
           <tag id="BC" />
         </entry>
-        <entry name="awbMode" type="byte" visibility="public" enum="true">
+        <entry name="awbMode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>
@@ -1086,7 +1102,8 @@
           </hal_details>
           <tag id="BC" />
         </entry>
-        <entry name="captureIntent" type="byte" visibility="public" enum="true">
+        <entry name="captureIntent" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>CUSTOM
             <notes>The goal of this request doesn't fall into the other
@@ -1141,7 +1158,8 @@
           contains MANUAL_SENSOR.</details>
           <tag id="BC" />
         </entry>
-        <entry name="effectMode" type="byte" visibility="public" enum="true">
+        <entry name="effectMode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>OFF
               <notes>
@@ -1215,7 +1233,8 @@
           </details>
           <tag id="BC" />
         </entry>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>Full application control of pipeline.
@@ -1282,10 +1301,15 @@
           update, as if this frame is never captured. This mode can be used in the scenario
           where the application doesn't want a 3A manual control capture to affect
           the subsequent auto 3A capture results.
+
+          LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
+          LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
+          support the MANUAL_SENSOR capability.
           </details>
           <tag id="BC" />
         </entry>
-        <entry name="sceneMode" type="byte" visibility="public" enum="true">
+        <entry name="sceneMode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value id="0">DISABLED
               <notes>
@@ -1461,6 +1485,9 @@
             <value optional="true" hidden="true">HDR
               <notes>
               Turn on custom high dynamic range (HDR) mode.
+
+              This is intended for LEGACY mode devices only;
+              HAL3+ camera devices should not implement this mode.
               </notes>
             </value>
           </enum>
@@ -1498,7 +1525,7 @@
           <tag id="BC" />
         </entry>
         <entry name="videoStabilizationMode" type="byte" visibility="public"
-               enum="true">
+               enum="true" hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>
@@ -1527,13 +1554,17 @@
           If a camera device supports both this mode and OIS (android.lens.opticalStabilizationMode),
           turning both modes on may produce undesirable interaction, so it is recommended not to
           enable both at the same time.
+
+          Some LEGACY camera devices will not support changing video stabilization
+          mode; in this case the value will always override to OFF.
           </details>
           <tag id="BC" />
         </entry>
       </controls>
       <static>
         <entry name="aeAvailableAntibandingModes" type="byte" visibility="public"
-               type_notes="list of enums" container="array" typedef="enumList" >
+               type_notes="list of enums" container="array" typedef="enumList"
+               hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1550,7 +1581,8 @@
           <tag id="BC" />
         </entry>
         <entry name="aeAvailableModes" type="byte" visibility="public"
-               type_notes="list of enums" container="array" typedef="enumList">
+               type_notes="list of enums" container="array" typedef="enumList"
+               hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1564,19 +1596,23 @@
             available. This entry lists the valid modes for
             android.control.aeMode for this camera device.
 
-            All camera devices support ON, and all camera devices with
-            flash units support ON_AUTO_FLASH and
-            ON_ALWAYS_FLASH.
+            All camera devices support ON, and all camera devices with flash
+            units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.
 
             FULL mode camera devices always support OFF mode,
             which enables application control of camera exposure time,
             sensitivity, and frame duration.
+
+            LEGACY mode camera devices never support OFF mode.
+            LIMITED mode devices support OFF if they support the MANUAL_SENSOR
+            capability.
           </details>
           <tag id="BC" />
         </entry>
         <entry name="aeAvailableTargetFpsRanges" type="int32" visibility="public"
                type_notes="list of pairs of frame rates"
-               container="array" typedef="rangeInt">
+               container="array" typedef="rangeInt"
+               hwlevel="legacy">
           <array>
             <size>2</size>
             <size>n</size>
@@ -1586,7 +1622,8 @@
           <tag id="BC" />
         </entry>
         <entry name="aeCompensationRange" type="int32" visibility="public"
-               container="array" typedef="rangeInt">
+               container="array" typedef="rangeInt"
+               hwlevel="legacy">
           <array>
             <size>2</size>
           </array>
@@ -1597,14 +1634,16 @@
           size)</range>
           <tag id="BC" />
         </entry>
-        <entry name="aeCompensationStep" type="rational" visibility="public">
+        <entry name="aeCompensationStep" type="rational" visibility="public"
+               hwlevel="legacy">
           <description>Smallest step by which exposure compensation
           can be changed</description>
           <range>&lt;= 1/2</range>
           <tag id="BC" />
         </entry>
         <entry name="afAvailableModes" type="byte" visibility="public"
-        type_notes="List of enums" container="array" typedef="enumList">
+               type_notes="List of enums" container="array" typedef="enumList"
+               hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1618,12 +1657,16 @@
           All LIMITED and FULL mode camera devices will support OFF mode, and all
           camera devices with adjustable focuser units
           (`android.lens.info.minimumFocusDistance &gt; 0`) will support AUTO mode.
+
+          LEGACY devices will support OFF mode only if they support
+          focusing to infinity (by also setting android.lens.focusDistance to
+          `0.0f`).
           </details>
           <tag id="BC" />
         </entry>
         <entry name="availableEffects" type="byte" visibility="public"
                type_notes="List of enums (android.control.effectMode)." container="array"
-               typedef="enumList">
+               typedef="enumList" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1651,7 +1694,7 @@
         </entry>
         <entry name="availableSceneModes" type="byte" visibility="public"
                type_notes="List of enums (android.control.sceneMode)."
-               container="array" typedef="enumList">
+               container="array" typedef="enumList" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1676,7 +1719,7 @@
         </entry>
         <entry name="availableVideoStabilizationModes" type="byte"
                visibility="public" type_notes="List of enums." container="array"
-               typedef="enumList">
+               typedef="enumList" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1687,7 +1730,7 @@
         </entry>
         <entry name="awbAvailableModes" type="byte" visibility="public"
                type_notes="List of enums"
-               container="array" typedef="enumList">
+               container="array" typedef="enumList" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -1707,7 +1750,8 @@
           </details>
           <tag id="BC" />
         </entry>
-        <entry name="maxRegions" type="int32" visibility="hidden" container="array">
+        <entry name="maxRegions" type="int32" visibility="hidden"
+               container="array" hwlevel="legacy">
           <array>
             <size>3</size>
           </array>
@@ -1724,7 +1768,8 @@
           `(AE, AWB, AF)`.</range>
           <tag id="BC" />
         </entry>
-        <entry name="maxRegionsAe" type="int32" visibility="public" synthetic="true">
+        <entry name="maxRegionsAe" type="int32" visibility="public"
+               synthetic="true" hwlevel="legacy">
           <description>
           List of the maximum number of regions that can be used for metering in
           auto-exposure (AE);
@@ -1739,7 +1784,8 @@
           maxRegions to have this entry be automatically populated.
           </hal_details>
         </entry>
-        <entry name="maxRegionsAwb" type="int32" visibility="public" synthetic="true">
+        <entry name="maxRegionsAwb" type="int32" visibility="public"
+               synthetic="true" hwlevel="legacy">
           <description>
           List of the maximum number of regions that can be used for metering in
           auto-white balance (AWB);
@@ -1753,7 +1799,8 @@
           maxRegions to have this entry be automatically populated.
           </hal_details>
         </entry>
-        <entry name="maxRegionsAf" type="int32" visibility="public" synthetic="true">
+        <entry name="maxRegionsAf" type="int32" visibility="public"
+               synthetic="true" hwlevel="legacy">
           <description>
           List of the maximum number of regions that can be used for metering in
           auto-focus (AF);
@@ -1769,7 +1816,7 @@
           </hal_details>
         </entry>
         <entry name="sceneModeOverrides" type="byte" visibility="system"
-               container="array">
+               container="array" hwlevel="limited">
           <array>
             <size>3</size>
             <size>length(availableSceneModes)</size>
@@ -1839,7 +1886,8 @@
         </clone>
         <clone entry="android.control.aePrecaptureTrigger" kind="controls">
         </clone>
-        <entry name="aeState" type="byte" visibility="public" enum="true">
+        <entry name="aeState" type="byte" visibility="public" enum="true"
+               hwlevel="limited">
           <enum>
             <value>INACTIVE
             <notes>AE is off or recently reset.
@@ -1937,7 +1985,8 @@
         </clone>
         <clone entry="android.control.afTrigger" kind="controls">
         </clone>
-        <entry name="afState" type="byte" visibility="public" enum="true">
+        <entry name="afState" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>INACTIVE
             <notes>AF is off or has not yet tried to scan/been asked
@@ -1993,7 +2042,11 @@
             and may restart scanning at any time.
 
             Only used by CONTINUOUS_* AF modes. This is a transient state, the camera
-            device may skip reporting this state in capture result.</notes></value>
+            device may skip reporting this state in capture result.
+
+            LEGACY camera devices do not support this state. When a passive
+            scan has finished, it will always go to PASSIVE_FOCUSED.
+            </notes></value>
           </enum>
           <description>Current state of auto-focus (AF) algorithm.</description>
           <details>
@@ -2116,7 +2169,8 @@
         </clone>
         <clone entry="android.control.captureIntent" kind="controls">
         </clone>
-        <entry name="awbState" type="byte" visibility="public" enum="true">
+        <entry name="awbState" type="byte" visibility="public" enum="true"
+               hwlevel="limited">
           <enum>
             <value>INACTIVE
             <notes>AWB is not in auto mode, or has not yet started metering.
@@ -2197,7 +2251,7 @@
       </dynamic>
       <static>
         <entry name="availableHighSpeedVideoConfigurations" type="int32" visibility="hidden"
-               container="array" typedef="highSpeedVideoConfiguration">
+               container="array" typedef="highSpeedVideoConfiguration" hwlevel="limited">
           <array>
             <size>4</size>
             <size>n</size>
@@ -2266,7 +2320,7 @@
     </section>
     <section name="edge">
       <controls>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
           <enum>
             <value>OFF
             <notes>No edge enhancement is applied.</notes></value>
@@ -2300,7 +2354,8 @@
       </controls>
       <static>
         <entry name="availableEdgeModes" type="byte" visibility="public"
-        type_notes="list of enums" container="array" typedef="enumList">
+               type_notes="list of enums" container="array" typedef="enumList"
+               hwlevel="full">
           <array>
             <size>n</size>
           </array>
@@ -2341,7 +2396,7 @@
           duration).</details>
           <tag id="FUTURE" />
         </entry>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="legacy">
           <enum>
             <value>OFF
               <notes>
@@ -2386,7 +2441,8 @@
       </controls>
       <static>
         <namespace name="info">
-          <entry name="available" type="byte" visibility="public" enum="true" typedef="boolean">
+          <entry name="available" type="byte" visibility="public" enum="true"
+                 typedef="boolean" hwlevel="legacy">
             <enum>
               <value>FALSE</value>
               <value>TRUE</value>
@@ -2428,7 +2484,8 @@
         <clone entry="android.flash.firingTime" kind="controls">
         </clone>
         <clone entry="android.flash.mode" kind="controls"></clone>
-        <entry name="state" type="byte" visibility="public" enum="true">
+        <entry name="state" type="byte" visibility="public" enum="true"
+               hwlevel="limited">
           <enum>
             <value>UNAVAILABLE
             <notes>No flash on camera.</notes></value>
@@ -2451,6 +2508,17 @@
           When the camera device doesn't have flash unit
           (i.e. `android.flash.info.available == false`), this state will always be UNAVAILABLE.
           Other states indicate the current flash status.
+
+          In certain conditions, this will be available on LEGACY devices:
+
+           * Flash-less cameras always return UNAVAILABLE.
+           * Using android.control.aeMode `==` ON_ALWAYS_FLASH
+             will always return FIRED.
+           * Using android.flash.mode `==` TORCH
+             will always return FIRED.
+
+          In all other conditions the state will not be available on
+          LEGACY devices (i.e. it will be `null`).
           </details>
         </entry>
       </dynamic>
@@ -2534,14 +2602,14 @@
     <section name="jpeg">
       <controls>
         <entry name="gpsLocation" type="byte" visibility="public" synthetic="true"
-        typedef="location">
+        typedef="location" hwlevel="legacy">
           <description>
           A location object to use when generating image GPS metadata.
           </description>
         </entry>
         <entry name="gpsCoordinates" type="double" visibility="hidden"
         type_notes="latitude, longitude, altitude. First two in degrees, the third in meters"
-        container="array">
+        container="array" hwlevel="legacy">
           <array>
             <size>3</size>
           </array>
@@ -2551,40 +2619,40 @@
           <tag id="BC" />
         </entry>
         <entry name="gpsProcessingMethod" type="byte" visibility="hidden"
-               typedef="string">
+               typedef="string" hwlevel="legacy">
           <description>32 characters describing GPS algorithm to
           include in EXIF</description>
           <units>UTF-8 null-terminated string</units>
           <tag id="BC" />
         </entry>
-        <entry name="gpsTimestamp" type="int64" visibility="hidden">
+        <entry name="gpsTimestamp" type="int64" visibility="hidden" hwlevel="legacy">
           <description>Time GPS fix was made to include in
           EXIF</description>
           <units>UTC in seconds since January 1, 1970</units>
           <tag id="BC" />
         </entry>
-        <entry name="orientation" type="int32" visibility="public">
+        <entry name="orientation" type="int32" visibility="public" hwlevel="legacy">
           <description>Orientation of JPEG image to
           write</description>
           <units>Degrees in multiples of 90</units>
           <range>0, 90, 180, 270</range>
           <tag id="BC" />
         </entry>
-        <entry name="quality" type="byte" visibility="public">
+        <entry name="quality" type="byte" visibility="public" hwlevel="legacy">
           <description>Compression quality of the final JPEG
           image.</description>
           <range>1-100; larger is higher quality</range>
           <details>85-95 is typical usage range.</details>
           <tag id="BC" />
         </entry>
-        <entry name="thumbnailQuality" type="byte" visibility="public">
+        <entry name="thumbnailQuality" type="byte" visibility="public" hwlevel="legacy">
           <description>Compression quality of JPEG
           thumbnail.</description>
           <range>1-100; larger is higher quality</range>
           <tag id="BC" />
         </entry>
         <entry name="thumbnailSize" type="int32" visibility="public"
-        container="array" typedef="size">
+        container="array" typedef="size" hwlevel="legacy">
           <array>
             <size>2</size>
           </array>
@@ -2614,7 +2682,7 @@
       </controls>
       <static>
         <entry name="availableThumbnailSizes" type="int32" visibility="public"
-        container="array" typedef="size">
+        container="array" typedef="size" hwlevel="legacy">
           <array>
             <size>2</size>
             <size>n</size>
@@ -2681,7 +2749,7 @@
     </section>
     <section name="lens">
       <controls>
-        <entry name="aperture" type="float" visibility="public">
+        <entry name="aperture" type="float" visibility="public" hwlevel="full">
           <description>The ratio of lens focal length to the effective
           aperture diameter.</description>
           <units>f-number (f/NNN)</units>
@@ -2706,7 +2774,7 @@
           back to the user in the corresponding result.</details>
           <tag id="V1" />
         </entry>
-        <entry name="filterDensity" type="float" visibility="public">
+        <entry name="filterDensity" type="float" visibility="public" hwlevel="full">
           <description>
           State of lens neutral density filter(s).
           </description>
@@ -2732,7 +2800,7 @@
           </details>
           <tag id="V1" />
         </entry>
-        <entry name="focalLength" type="float" visibility="public">
+        <entry name="focalLength" type="float" visibility="public" hwlevel="legacy">
           <description>
           The current lens focal length; used for optical zoom.
           </description>
@@ -2753,24 +2821,27 @@
           </details>
           <tag id="V1" />
         </entry>
-        <entry name="focusDistance" type="float" visibility="public">
+        <entry name="focusDistance" type="float" visibility="public" hwlevel="full">
           <description>Distance to plane of sharpest focus,
           measured from frontmost surface of the lens.</description>
           <units>See android.lens.info.focusDistanceCalibration for details.</units>
           <range>&amp;gt;= 0</range>
-          <details>0 means infinity focus. Used value will be clamped
-          to [0, android.lens.info.minimumFocusDistance].
+          <details>`0.0f` means infinity focus. Used value will be clamped
+          to `[0.0f, android.lens.info.minimumFocusDistance]`.
 
           Like android.lens.focalLength, this setting won't be applied
           instantaneously, and it may take several frames before the lens
           can move to the requested focus distance. While the lens is still moving,
           android.lens.state will be set to MOVING.
+
+          LEGACY devices support at most setting this to `0.0f`
+          for infinity focus.
           </details>
           <tag id="BC" />
           <tag id="V1" />
         </entry>
         <entry name="opticalStabilizationMode" type="byte" visibility="public"
-        enum="true">
+        enum="true" hwlevel="limited">
           <enum>
             <value>OFF
               <notes>Optical stabilization is unavailable.</notes>
@@ -2812,7 +2883,7 @@
       <static>
         <namespace name="info">
           <entry name="availableApertures" type="float" visibility="public"
-          container="array">
+          container="array" hwlevel="full">
             <array>
               <size>n</size>
             </array>
@@ -2827,7 +2898,7 @@
             <tag id="V1" />
           </entry>
           <entry name="availableFilterDensities" type="float" visibility="public"
-          container="array">
+          container="array" hwlevel="full">
             <array>
               <size>n</size>
             </array>
@@ -2848,7 +2919,7 @@
           </entry>
           <entry name="availableFocalLengths" type="float" visibility="public"
           type_notes="The list of available focal lengths"
-          container="array">
+          container="array" hwlevel="legacy">
             <array>
               <size>n</size>
             </array>
@@ -2871,7 +2942,7 @@
           </entry>
           <entry name="availableOpticalStabilization" type="byte"
           visibility="public" type_notes="list of enums" container="array"
-          typedef="enumList">
+          typedef="enumList" hwlevel="limited">
             <array>
               <size>n</size>
             </array>
@@ -2886,7 +2957,8 @@
             </details>
             <tag id="V1" />
           </entry>
-          <entry name="hyperfocalDistance" type="float" visibility="public" optional="true">
+          <entry name="hyperfocalDistance" type="float" visibility="public" optional="true"
+                 hwlevel="limited">
             <description>Optional. Hyperfocal distance for this lens.</description>
             <units>See android.lens.info.focusDistanceCalibration for details.</units>
             <range>If lens is fixed focus, &amp;gt;= 0. If lens has focuser unit, the range is
@@ -2896,7 +2968,8 @@
             field when android.lens.info.focusDistanceCalibration is APPROXIMATE or CALIBRATED.
             </details>
           </entry>
-          <entry name="minimumFocusDistance" type="float" visibility="public" optional="true">
+          <entry name="minimumFocusDistance" type="float" visibility="public" optional="true"
+                 hwlevel="limited">
             <description>Shortest distance from frontmost surface
             of the lens that can be focused correctly.</description>
             <units>See android.lens.info.focusDistanceCalibration for details.</units>
@@ -2913,7 +2986,7 @@
           </entry>
           <entry name="shadingMapSize" type="int32" visibility="hidden"
                  type_notes="width and height (N, M) of lens shading map provided by the camera device."
-                 container="array" typedef="size">
+                 container="array" typedef="size" hwlevel="full">
             <array>
               <size>2</size>
             </array>
@@ -2925,7 +2998,8 @@
             </details>
             <tag id="V1" />
           </entry>
-          <entry name="focusDistanceCalibration" type="byte" visibility="public" enum="true">
+          <entry name="focusDistanceCalibration" type="byte" visibility="public"
+                 enum="true" hwlevel="limited">
             <enum>
               <value>UNCALIBRATED
                 <notes>
@@ -2983,7 +3057,7 @@
           <tag id="V1" />
         </entry>
         </namespace>
-        <entry name="facing" type="byte" visibility="public" enum="true">
+        <entry name="facing" type="byte" visibility="public" enum="true" hwlevel="legacy">
           <enum>
             <value>FRONT
             <notes>
@@ -3047,7 +3121,7 @@
         </clone>
         <entry name="focusRange" type="float" visibility="public"
         type_notes="Range of scene distances that are in focus"
-        container="array" typedef="pairFloatFloat">
+        container="array" typedef="pairFloatFloat" hwlevel="limited">
           <array>
             <size>2</size>
           </array>
@@ -3064,7 +3138,7 @@
         kind="controls">
           <tag id="V1" />
         </clone>
-        <entry name="state" type="byte" visibility="public" enum="true">
+        <entry name="state" type="byte" visibility="public" enum="true" hwlevel="limited">
           <enum>
             <value>STATIONARY
               <notes>
@@ -3111,7 +3185,7 @@
     </section>
     <section name="noiseReduction">
       <controls>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
           <enum>
             <value>OFF
             <notes>No noise reduction is applied.</notes></value>
@@ -3133,7 +3207,8 @@
           will be applied. HIGH_QUALITY mode indicates that the camera device
           will use the highest-quality noise filtering algorithms,
           even if it slows down capture rate. FAST means the camera device will not
-          slow down capture rate when applying noise filtering.</details>
+          slow down capture rate when applying noise filtering.
+        </details>
           <tag id="V1" />
         </entry>
         <entry name="strength" type="byte">
@@ -3146,7 +3221,7 @@
       </controls>
       <static>
         <entry name="availableNoiseReductionModes" type="byte" visibility="public"
-        type_notes="list of enums" container="array" typedef="enumList">
+        type_notes="list of enums" container="array" typedef="enumList" hwlevel="limited">
           <array>
             <size>n</size>
           </array>
@@ -3157,6 +3232,8 @@
           This tag lists the valid modes for android.noiseReduction.mode.
 
           Full-capability camera devices must always support OFF and FAST.
+
+          Legacy-capability camera devices will only support FAST mode.
           </details>
           <tag id="V1" />
         </entry>
@@ -3353,7 +3430,7 @@
       </controls>
       <static>
         <entry name="maxNumOutputStreams" type="int32" visibility="hidden"
-        container="array">
+        container="array" hwlevel="legacy">
           <array>
             <size>3</size>
           </array>
@@ -3391,7 +3468,7 @@
           </details>
           <tag id="BC" />
         </entry>
-        <entry name="maxNumOutputRaw" type="int32" visibility="public" synthetic="true">
+        <entry name="maxNumOutputRaw" type="int32" visibility="public" synthetic="true" hwlevel="legacy">
           <description>The maximum numbers of different types of output streams
           that can be configured and used simultaneously by a camera device
           for any `RAW` formats.
@@ -3413,9 +3490,12 @@
           * ImageFormat#RAW_SENSOR
           * ImageFormat#RAW10
           * Opaque `RAW`
+
+          LEGACY mode devices (android.info.supportedHardwareLevel `==` LEGACY)
+          never support raw streams.
           </details>
         </entry>
-        <entry name="maxNumOutputProc" type="int32" visibility="public" synthetic="true">
+        <entry name="maxNumOutputProc" type="int32" visibility="public" synthetic="true" hwlevel="legacy">
           <description>The maximum numbers of different types of output streams
           that can be configured and used simultaneously by a camera device
           for any processed (but not-stalling) formats.
@@ -3444,9 +3524,11 @@
 
           For full guarantees, query StreamConfigurationMap#getOutputStallDuration with
           a processed format -- it will return 0 for a non-stalling stream.
+
+          LEGACY devices will support up to 3 processing/non-stalling streams.
           </details>
         </entry>
-        <entry name="maxNumOutputProcStalling" type="int32" visibility="public" synthetic="true">
+        <entry name="maxNumOutputProcStalling" type="int32" visibility="public" synthetic="true" hwlevel="legacy">
           <description>The maximum numbers of different types of output streams
           that can be configured and used simultaneously by a camera device
           for any processed (and stalling) formats.
@@ -3468,6 +3550,8 @@
 
           For full guarantees, query StreamConfigurationMap#getOutputStallDuration with
           a processed format -- it will return a non-0 value for a stalling stream.
+
+          LEGACY devices will support up to 1 processing/stalling stream.
           </details>
         </entry>
         <entry name="maxNumReprocessStreams" type="int32" visibility="system"
@@ -3485,7 +3569,7 @@
           </details>
           <tag id="HAL2" />
         </entry>
-        <entry name="maxNumInputStreams" type="int32" visibility="hidden">
+        <entry name="maxNumInputStreams" type="int32" visibility="hidden" hwlevel="full">
           <description>
           The maximum numbers of any type of input streams
           that can be configured and used simultaneously by a camera device.
@@ -3521,7 +3605,7 @@
         kind="controls"></clone>
         <clone entry="android.request.outputStreams"
         kind="controls"></clone>
-        <entry name="pipelineDepth" type="byte" visibility="public">
+        <entry name="pipelineDepth" type="byte" visibility="public" hwlevel="legacy">
           <description>Specifies the number of pipeline stages the frame went
           through from when it was exposed to when the final completed result
           was available to the framework.</description>
@@ -3539,7 +3623,7 @@
         </entry>
       </dynamic>
       <static>
-        <entry name="pipelineMaxDepth" type="byte" visibility="public">
+        <entry name="pipelineMaxDepth" type="byte" visibility="public" hwlevel="legacy">
           <description>Specifies the number of maximum pipeline stages a frame
           has to go through from when it's exposed to when it's available
           to the framework.</description>
@@ -3584,7 +3668,7 @@
           </details>
         </entry>
         <entry name="availableCapabilities" type="byte" visibility="public"
-          enum="true" container="array">
+          enum="true" container="array" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -3748,7 +3832,7 @@
           </hal_details>
         </entry>
         <entry name="availableRequestKeys" type="int32" visibility="hidden"
-          container="array">
+          container="array" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -3779,7 +3863,7 @@
           </hal_details>
         </entry>
         <entry name="availableResultKeys" type="int32" visibility="hidden"
-          container="array">
+          container="array" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -3822,7 +3906,7 @@
           </hal_details>
         </entry>
         <entry name="availableCharacteristicsKeys" type="int32" visibility="hidden"
-          container="array">
+          container="array" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -3856,7 +3940,7 @@
     <section name="scaler">
       <controls>
         <entry name="cropRegion" type="int32" visibility="public"
-               container="array" typedef="rectangle">
+               container="array" typedef="rectangle" hwlevel="legacy">
           <array>
             <size>4</size>
           </array>
@@ -4052,7 +4136,8 @@
           </hal_details>
           <tag id="BC" />
         </entry>
-        <entry name="availableMaxDigitalZoom" type="float" visibility="public">
+        <entry name="availableMaxDigitalZoom" type="float" visibility="public"
+              hwlevel="legacy">
           <description>The maximum ratio between both active area width
           and crop region width, and active area height and
           crop region height.
@@ -4170,7 +4255,8 @@
       <static>
         <entry name="availableInputOutputFormatsMap" type="int32"
         visibility="hidden"
-        container="array" typedef="imageFormat">
+        container="array" typedef="imageFormat"
+        hwlevel="full">
           <array>
             <size>n</size>
           </array>
@@ -4247,7 +4333,7 @@
         </entry>
         <entry name="availableStreamConfigurations" type="int32" visibility="hidden"
           enum="true" container="array"
-          typedef="streamConfiguration">
+          typedef="streamConfiguration" hwlevel="legacy">
           <array>
             <size>n</size>
             <size>4</size>
@@ -4349,7 +4435,7 @@
         </entry>
         <entry name="availableMinFrameDurations" type="int64" visibility="hidden"
                container="array"
-               typedef="streamConfigurationDuration" >
+               typedef="streamConfigurationDuration" hwlevel="legacy">
           <array>
             <size>4</size>
             <size>n</size>
@@ -4379,7 +4465,7 @@
           <tag id="V1" />
         </entry>
         <entry name="availableStallDurations" type="int64" visibility="hidden"
-               container="array" typedef="streamConfigurationDuration">
+               container="array" typedef="streamConfigurationDuration" hwlevel="legacy">
           <array>
             <size>4</size>
             <size>n</size>
@@ -4461,7 +4547,9 @@
           </hal_details>
           <tag id="V1" />
         </entry>
-        <entry name="streamConfigurationMap" type="int32" visibility="public" synthetic="true" typedef="streamConfigurationMap">
+        <entry name="streamConfigurationMap" type="int32" visibility="public"
+               synthetic="true" typedef="streamConfigurationMap"
+               hwlevel="legacy">
           <description>The available stream configurations that this
           camera device supports; also includes the minimum frame durations
           and the stall durations for each format/size combination.
@@ -4543,7 +4631,8 @@
           * available[Processed,Raw,Jpeg]Sizes
           </hal_details>
         </entry>
-        <entry name="croppingType" type="byte" visibility="public" enum="true">
+        <entry name="croppingType" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>CENTER_ONLY
               <notes>
@@ -4569,14 +4658,14 @@
           return the final used crop region in capture result metadata android.scaler.cropRegion.
 
           FULL capability devices (android.info.supportedHardwareLevel `==` FULL) will support
-          FREEFORM cropping.
+          FREEFORM cropping. LEGACY capability devices will only support CENTER_ONLY cropping.
           </details>
         </entry>
       </static>
     </section>
     <section name="sensor">
       <controls>
-        <entry name="exposureTime" type="int64" visibility="public">
+        <entry name="exposureTime" type="int64" visibility="public" hwlevel="full">
           <description>Duration each pixel is exposed to
           light.</description>
           <units>nanoseconds</units>
@@ -4586,7 +4675,7 @@
           </details>
           <tag id="V1" />
         </entry>
-        <entry name="frameDuration" type="int64" visibility="public">
+        <entry name="frameDuration" type="int64" visibility="public" hwlevel="full">
           <description>Duration from start of frame exposure to
           start of next frame exposure.</description>
           <units>nanoseconds</units>
@@ -4674,7 +4763,7 @@
           </hal_details>
           <tag id="V1" />
         </entry>
-        <entry name="sensitivity" type="int32" visibility="public">
+        <entry name="sensitivity" type="int32" visibility="public" hwlevel="full">
           <description>The amount of gain applied to sensor data
           before processing.</description>
           <units>ISO arithmetic units</units>
@@ -4701,7 +4790,8 @@
           <entry name="activeArraySize" type="int32" visibility="public"
           type_notes="Four ints defining the active pixel rectangle"
           container="array"
-          typedef="rectangle">
+          typedef="rectangle"
+          hwlevel="legacy">
             <array>
               <size>4</size>
             </array>
@@ -4717,7 +4807,8 @@
           </entry>
           <entry name="sensitivityRange" type="int32" visibility="public"
           type_notes="Range of supported sensitivities"
-          container="array" typedef="rangeInt">
+          container="array" typedef="rangeInt"
+          hwlevel="full">
             <array>
               <size>2</size>
             </array>
@@ -4734,7 +4825,8 @@
             <tag id="BC" />
             <tag id="V1" />
           </entry>
-          <entry name="colorFilterArrangement" type="byte" visibility="public" enum="true">
+          <entry name="colorFilterArrangement" type="byte" visibility="public" enum="true"
+            hwlevel="full">
             <enum>
               <value>RGGB</value>
               <value>GRBG</value>
@@ -4751,7 +4843,8 @@
             <tag id="RAW" />
           </entry>
           <entry name="exposureTimeRange" type="int64" visibility="public"
-          type_notes="nanoseconds" container="array" typedef="rangeLong">
+                 type_notes="nanoseconds" container="array" typedef="rangeLong"
+                 hwlevel="full">
             <array>
               <size>2</size>
             </array>
@@ -4768,7 +4861,8 @@
             1 second (1e9), MUST be at least 100ms.</hal_details>
             <tag id="V1" />
           </entry>
-          <entry name="maxFrameDuration" type="int64" visibility="public">
+          <entry name="maxFrameDuration" type="int64" visibility="public"
+                 hwlevel="full">
             <description>Maximum possible frame duration (minimum frame
             rate).</description>
             <units>nanoseconds</units>
@@ -4811,7 +4905,7 @@
           </entry>
           <entry name="physicalSize" type="float" visibility="public"
           type_notes="width x height in millimeters"
-          container="array" typedef="sizeF">
+          container="array" typedef="sizeF" hwlevel="legacy">
             <array>
               <size>2</size>
             </array>
@@ -4825,7 +4919,7 @@
             <tag id="BC" />
           </entry>
           <entry name="pixelArraySize" type="int32" visibility="public"
-          container="array" typedef="size">
+          container="array" typedef="size" hwlevel="legacy">
             <array>
               <size>2</size>
             </array>
@@ -4867,7 +4961,8 @@
             </hal_details>
             <tag id="RAW" />
           </entry>
-          <entry name="timestampSource" type="byte" visibility="public" enum="true">
+          <entry name="timestampSource" type="byte" visibility="public"
+                 enum="true" hwlevel="legacy">
             <enum>
               <value>UNKNOWN
                 <notes>
@@ -4898,7 +4993,8 @@
           <tag id="V1" />
         </entry>
         </namespace>
-        <entry name="referenceIlluminant1" type="byte" visibility="public" enum="true">
+        <entry name="referenceIlluminant1" type="byte" visibility="public"
+               enum="true">
           <enum>
             <value id="1">DAYLIGHT</value>
             <value id="2">FLUORESCENT</value>
@@ -4995,7 +5091,7 @@
         <entry name="calibrationTransform1" type="rational"
         visibility="public" optional="true"
         type_notes="3x3 matrix in row-major-order" container="array"
-        typedef="colorSpaceTransform" >
+        typedef="colorSpaceTransform">
           <array>
             <size>3</size>
             <size>3</size>
@@ -5049,7 +5145,7 @@
         <entry name="colorTransform1" type="rational"
         visibility="public" optional="true"
         type_notes="3x3 matrix in row-major-order" container="array"
-        typedef="colorSpaceTransform" >
+        typedef="colorSpaceTransform">
           <array>
             <size>3</size>
             <size>3</size>
@@ -5079,7 +5175,7 @@
         <entry name="colorTransform2" type="rational"
         visibility="public" optional="true"
         type_notes="3x3 matrix in row-major-order" container="array"
-        typedef="colorSpaceTransform" >
+        typedef="colorSpaceTransform">
           <array>
             <size>3</size>
             <size>3</size>
@@ -5112,7 +5208,7 @@
         <entry name="forwardMatrix1" type="rational"
         visibility="public" optional="true"
         type_notes="3x3 matrix in row-major-order" container="array"
-        typedef="colorSpaceTransform" >
+        typedef="colorSpaceTransform">
           <array>
             <size>3</size>
             <size>3</size>
@@ -5140,7 +5236,7 @@
         <entry name="forwardMatrix2" type="rational"
         visibility="public" optional="true"
         type_notes="3x3 matrix in row-major-order" container="array"
-        typedef="colorSpaceTransform" >
+        typedef="colorSpaceTransform">
           <array>
             <size>3</size>
             <size>3</size>
@@ -5202,7 +5298,7 @@
           <tag id="RAW" />
         </entry>
         <entry name="maxAnalogSensitivity" type="int32" visibility="public"
-        optional="true">
+               optional="true" hwlevel="full">
           <description>Maximum sensitivity that is implemented
           purely through analog gain.</description>
           <details>For android.sensor.sensitivity values less than or
@@ -5212,7 +5308,8 @@
           <tag id="V1" />
           <tag id="FULL" />
         </entry>
-        <entry name="orientation" type="int32" visibility="public">
+        <entry name="orientation" type="int32" visibility="public"
+               hwlevel="legacy">
           <description>Clockwise angle through which the output
           image needs to be rotated to be upright on the device
           screen in its native orientation. Also defines the
@@ -5255,7 +5352,8 @@
         kind="controls"></clone>
         <clone entry="android.sensor.sensitivity" kind="controls">
         </clone>
-        <entry name="timestamp" type="int64" visibility="public">
+        <entry name="timestamp" type="int64" visibility="public"
+               hwlevel="legacy">
           <description>Time at start of exposure of first
           row of the image sensor active array, in nanoseconds.</description>
           <units>nanoseconds</units>
@@ -5647,7 +5745,7 @@
         </entry>
       </static>
       <dynamic>
-        <entry name="rollingShutterSkew" type="int64" visibility="public">
+        <entry name="rollingShutterSkew" type="int64" visibility="public" hwlevel="limited">
           <description>Duration between the start of first row exposure
           and the start of last row exposure.</description>
           <units>nanoseconds</units>
@@ -5671,7 +5769,7 @@
     </section>
     <section name="shading">
       <controls>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true" hwlevel="full">
           <enum>
             <value>OFF
             <notes>No lens shading correction is applied.</notes></value>
@@ -5728,7 +5826,8 @@
     </section>
     <section name="statistics">
       <controls>
-        <entry name="faceDetectMode" type="byte" visibility="public" enum="true">
+        <entry name="faceDetectMode" type="byte" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value>OFF
             <notes>Do not include face detection statistics in capture
@@ -5807,7 +5906,8 @@
                  visibility="public"
                  type_notes="List of enums from android.statistics.faceDetectMode"
                  container="array"
-                 typedef="enumList">
+                 typedef="enumList"
+                 hwlevel="legacy">
             <array>
               <size>n</size>
             </array>
@@ -5835,11 +5935,12 @@
             <range>&amp;gt;= 64</range>
             <tag id="FUTURE" />
           </entry>
-          <entry name="maxFaceCount" type="int32" visibility="public" >
+          <entry name="maxFaceCount" type="int32" visibility="public" hwlevel="legacy">
             <description>The maximum number of simultaneously detectable
             faces.</description>
-            <range>&amp;gt;= 4 if android.statistics.info.availableFaceDetectModes lists
-            modes besides OFF, otherwise 0</range>
+            <range>0 for cameras without available face detection; otherwise:
+            `&gt;=4` for LIMITED or FULL hwlevel devices or
+            `&gt;0` for LEGACY devices.</range>
             <tag id="BC" />
           </entry>
           <entry name="maxHistogramCount" type="int32">
@@ -5863,7 +5964,7 @@
             <tag id="FUTURE" />
           </entry>
           <entry name="availableHotPixelMapModes" type="byte" visibility="public"
-          type_notes="list of enums" container="array" typedef="boolean">
+                 type_notes="list of enums" container="array" typedef="boolean">
             <array>
               <size>n</size>
             </array>
@@ -5876,6 +5977,8 @@
             If no hotpixel map is available for this camera device, this will contain
             only OFF.  If the hotpixel map is available, this will include both
             the ON and OFF options.
+
+            Required on devices with the RAW capability.
             </details>
             <tag id="V1" />
             <tag id="RAW" />
@@ -5884,8 +5987,9 @@
       </static>
       <dynamic>
         <clone entry="android.statistics.faceDetectMode"
-        kind="controls"></clone>
-        <entry name="faceIds" type="int32" visibility="hidden" container="array">
+               kind="controls"></clone>
+        <entry name="faceIds" type="int32" visibility="hidden" container="array"
+               hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -5900,7 +6004,7 @@
         </entry>
         <entry name="faceLandmarks" type="int32" visibility="hidden"
         type_notes="(leftEyeX, leftEyeY, rightEyeX, rightEyeY, mouthX, mouthY)"
-        container="array">
+        container="array" hwlevel="legacy">
           <array>
             <size>n</size>
             <size>6</size>
@@ -5916,7 +6020,7 @@
         </entry>
         <entry name="faceRectangles" type="int32" visibility="hidden"
         type_notes="(xmin, ymin, xmax, ymax). (0,0) is top-left of active pixel area"
-        container="array" typedef="rectangle">
+        container="array" typedef="rectangle" hwlevel="legacy">
           <array>
             <size>n</size>
             <size>4</size>
@@ -5930,7 +6034,8 @@
             Only available if android.statistics.faceDetectMode != OFF</details>
           <tag id="BC" />
         </entry>
-        <entry name="faceScores" type="byte" visibility="hidden" container="array">
+        <entry name="faceScores" type="byte" visibility="hidden" container="array"
+               hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -5944,7 +6049,8 @@
           all times is illegal).</hal_details>
           <tag id="BC" />
         </entry>
-        <entry name="faces" type="int32" visibility="public" synthetic="true" container="array" typedef="face">
+        <entry name="faces" type="int32" visibility="public" synthetic="true"
+               container="array" typedef="face" hwlevel="legacy">
           <array>
             <size>n</size>
           </array>
@@ -5986,8 +6092,9 @@
           <tag id="FUTURE" />
         </entry>
         <clone entry="android.statistics.sharpnessMapMode"
-        kind="controls"></clone>
-        <entry name="lensShadingCorrectionMap" type="byte" visibility="public" typedef="lensShadingMap">
+               kind="controls"></clone>
+        <entry name="lensShadingCorrectionMap" type="byte" visibility="public"
+               typedef="lensShadingMap" hwlevel="full">
           <description>The shading map is a low-resolution floating-point map
           that lists the coefficients used to correct for vignetting, for each
           Bayer color channel.</description>
@@ -6041,7 +6148,7 @@
         </entry>
         <entry name="lensShadingMap" type="float" visibility="hidden"
                type_notes="2D array of float gain factors per channel to correct lens shading"
-               container="array">
+               container="array" hwlevel="full">
           <array>
             <size>4</size>
             <size>n</size>
@@ -6164,7 +6271,8 @@
           regardless of the android.control.* current values.
           </details>
         </entry>
-        <entry name="sceneFlicker" type="byte" visibility="public" enum="true">
+        <entry name="sceneFlicker" type="byte" visibility="public" enum="true"
+               hwlevel="full">
           <enum>
             <value>NONE
             <notes>The camera device does not detect any flickering illumination
@@ -6236,7 +6344,7 @@
         </entry>
       </dynamic>
       <controls>
-        <entry name="lensShadingMapMode" type="byte" visibility="public" enum="true">
+        <entry name="lensShadingMapMode" type="byte" visibility="public" enum="true" hwlevel="full">
           <enum>
             <value>OFF
             <notes>Do not include a lens shading map in the capture result.</notes></value>
@@ -6247,7 +6355,11 @@
           shading map in output result metadata.</description>
           <details>When set to ON,
           android.statistics.lensShadingMap will be provided in
-          the output result metadata.</details>
+          the output result metadata.
+
+          Required for devices with the RAW capability.
+          </details>
+          <tag id="RAW" />
         </entry>
       </controls>
       <dynamic>
@@ -6259,7 +6371,7 @@
       <controls>
         <entry name="curveBlue" type="float" visibility="hidden"
         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
-        container="array">
+        container="array" hwlevel="full">
           <array>
             <size>n</size>
             <size>2</size>
@@ -6273,7 +6385,7 @@
         </entry>
         <entry name="curveGreen" type="float" visibility="hidden"
         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
-        container="array">
+        container="array" hwlevel="full">
           <array>
             <size>n</size>
             <size>2</size>
@@ -6287,7 +6399,7 @@
         </entry>
         <entry name="curveRed" type="float" visibility="hidden"
         type_notes="1D array of float pairs (P_IN, P_OUT). The maximum number of pairs is specified by android.tonemap.maxCurvePoints."
-        container="array">
+        container="array" hwlevel="full">
           <array>
             <size>n</size>
             <size>2</size>
@@ -6360,7 +6472,9 @@
           control points used as are available.
         </hal_details>
         </entry>
-        <entry name="curve" type="float" visibility="public" synthetic="true" typedef="tonemapCurve">
+        <entry name="curve" type="float" visibility="public" synthetic="true"
+               typedef="tonemapCurve"
+               hwlevel="full">
           <description>Tonemapping / contrast / gamma curve to use when android.tonemap.mode
           is CONTRAST_CURVE.</description>
           <details>
@@ -6425,7 +6539,8 @@
             curveBlue entries.
         </hal_details>
         </entry>
-        <entry name="mode" type="byte" visibility="public" enum="true">
+        <entry name="mode" type="byte" visibility="public" enum="true"
+               hwlevel="full">
           <enum>
             <value>CONTRAST_CURVE
               <notes>Use the tone mapping curve specified in
@@ -6482,7 +6597,8 @@
         </entry>
       </controls>
       <static>
-        <entry name="maxCurvePoints" type="int32" visibility="public" >
+        <entry name="maxCurvePoints" type="int32" visibility="public"
+               hwlevel="full">
           <description>Maximum number of supported points in the
             tonemap curve that can be used for android.tonemap.curve.
           </description>
@@ -6502,7 +6618,7 @@
           </hal_details>
         </entry>
         <entry name="availableToneMapModes" type="byte" visibility="public"
-        type_notes="list of enums" container="array" typedef="enumList">
+        type_notes="list of enums" container="array" typedef="enumList" hwlevel="full">
           <array>
             <size>n</size>
           </array>
@@ -6532,8 +6648,8 @@
     </section>
     <section name="led">
       <controls>
-        <entry name="transmit" type="byte" visibility="hidden" enum="true"
-               typedef="boolean">
+        <entry name="transmit" type="byte" visibility="hidden" optional="true"
+               enum="true" typedef="boolean">
           <enum>
             <value>OFF</value>
             <value>ON</value>
@@ -6557,8 +6673,9 @@
         <clone entry="android.led.transmit" kind="controls"></clone>
       </dynamic>
       <static>
-        <entry name="availableLeds" type="byte" visibility="hidden" enum="true"
-               container="array" >
+        <entry name="availableLeds" type="byte" visibility="hidden" optional="true"
+               enum="true"
+               container="array">
           <array>
             <size>n</size>
           </array>
@@ -6575,7 +6692,7 @@
     <section name="info">
       <static>
         <entry name="supportedHardwareLevel" type="byte" visibility="public"
-               enum="true" >
+               enum="true" hwlevel="legacy">
           <enum>
             <value>
               LIMITED
@@ -6601,7 +6718,7 @@
           </description>
           <range>Default value is LIMITED.</range>
           <details>
-          Camera devices will come in two flavors: LIMITED and FULL.
+          Camera devices will come in three flavors: LEGACY, LIMITED and FULL.
 
           A FULL device has the most support possible and will support below capabilities:
 
@@ -6620,6 +6737,9 @@
 
           A LEGACY device does not support per-frame control, manual sensor control, manual
           post-processing, arbitrary cropping regions, and has relaxed performance constraints.
+
+          Each higher level supports everything the lower level supports
+          in this order: FULL `&gt;` LIMITED `&gt;` LEGACY.
           </details>
           <hal_details>
           The camera 3 HAL device can implement one of two possible
@@ -6631,6 +6751,10 @@
           limited, and they share the same essential operational flow.
 
           For full details refer to "S3. Operational Modes" in camera3.h
+
+          Camera HAL3+ must not implement LEGACY mode. It is there
+          for backwards compatibility in the `android.hardware.camera2`
+          user-facing API only.
           </hal_details>
         </entry>
       </static>
@@ -6638,7 +6762,7 @@
     <section name="blackLevel">
       <controls>
         <entry name="lock" type="byte" visibility="public" enum="true"
-               typedef="boolean">
+               typedef="boolean" hwlevel="full">
           <enum>
             <value>OFF</value>
             <value>ON</value>
@@ -6708,7 +6832,8 @@
     </section>
     <section name="sync">
       <dynamic>
-        <entry name="frameNumber" type="int64" visibility="hidden" enum="true">
+        <entry name="frameNumber" type="int64" visibility="hidden" enum="true"
+               hwlevel="legacy">
           <enum>
             <value id="-1">CONVERGING
               <notes>
@@ -6818,7 +6943,8 @@
         </entry>
       </dynamic>
       <static>
-        <entry name="maxLatency" type="int32" visibility="public" enum="true">
+        <entry name="maxLatency" type="int32" visibility="public" enum="true"
+               hwlevel="legacy">
           <enum>
             <value id="0">PER_FRAME_CONTROL
               <notes>
diff --git a/camera/docs/metadata_properties.xsd b/camera/docs/metadata_properties.xsd
index 6d36c13..2bf2049 100644
--- a/camera/docs/metadata_properties.xsd
+++ b/camera/docs/metadata_properties.xsd
@@ -225,6 +225,15 @@
             </simpleType>
         </attribute>
         <attribute name="typedef" type="string" />
+        <attribute name="hwlevel" default="full">
+            <simpleType>
+                <restriction base="string">
+                    <enumeration value="full" />
+                    <enumeration value="limited" />
+                    <enumeration value="legacy" />
+                </restriction>
+            </simpleType>
+        </attribute>
     </complexType>
 
     <complexType name="EnumType">
diff --git a/camera/docs/metadata_template.mako b/camera/docs/metadata_template.mako
index d86c899..3dfa1bf 100644
--- a/camera/docs/metadata_template.mako
+++ b/camera/docs/metadata_template.mako
@@ -111,6 +111,10 @@
           % if prop.typedef is not None:
                 typedef="${prop.typedef.name}"
           % endif
+
+          % if prop.hwlevel:
+                hwlevel="${prop.hwlevel}"
+          % endif
             >
 
               % if prop.container == 'array':