Merge "Add signed minifloat: sample"
diff --git a/audio_utils/tinysndfile.c b/audio_utils/tinysndfile.c
index 9c20862..e94bb65 100644
--- a/audio_utils/tinysndfile.c
+++ b/audio_utils/tinysndfile.c
@@ -489,11 +489,8 @@
     handle->remaining -= actualFrames;
     switch (format) {
     case SF_FORMAT_PCM_U8:
-#if 0
-        // TODO - implement
         memcpy_to_float_from_u8(ptr, (const unsigned char *) temp,
                 actualFrames * handle->info.channels);
-#endif
         free(temp);
         break;
     case SF_FORMAT_PCM_16:
@@ -540,11 +537,8 @@
     handle->remaining -= actualFrames;
     switch (format) {
     case SF_FORMAT_PCM_U8:
-#if 0
-        // TODO - implement
         memcpy_to_i32_from_u8(ptr, (const unsigned char *) temp,
                 actualFrames * handle->info.channels);
-#endif
         free(temp);
         break;
     case SF_FORMAT_PCM_16:
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index fdf60cc..1011e9f 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -742,6 +742,10 @@
             ><a href="#static_android.scaler.streamConfigurationMap">android.scaler.streamConfigurationMap</a></li>
             <li
             ><a href="#static_android.scaler.croppingType">android.scaler.croppingType</a></li>
+            <li
+            ><a href="#static_android.scaler.availableRecommendedStreamConfigurations">android.scaler.availableRecommendedStreamConfigurations</a></li>
+            <li
+            ><a href="#static_android.scaler.availableRecommendedInputOutputFormatsMap">android.scaler.availableRecommendedInputOutputFormatsMap</a></li>
           </ul>
         </li>
         <li>
@@ -1171,6 +1175,8 @@
             ><a href="#static_android.depth.availableDepthStallDurations">android.depth.availableDepthStallDurations</a></li>
             <li
             ><a href="#static_android.depth.depthIsExclusive">android.depth.depthIsExclusive</a></li>
+            <li
+            ><a href="#static_android.depth.availableRecommendedDepthStreamConfigurations">android.depth.availableRecommendedDepthStreamConfigurations</a></li>
           </ul>
         </li>
       </ul> <!-- toc_section -->
@@ -16390,7 +16396,7 @@
   <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#RAW12">RAW12</a>.<wbr/></li>
 <li>Processed (but not-stalling): any non-RAW format without a stall duration.<wbr/>  Typically
   <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">YUV_<wbr/>420_<wbr/>888</a>,<wbr/>
-  <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#NV21">NV21</a>,<wbr/> or <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12">YV12</a>.<wbr/></li>
+  <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#NV21">NV21</a>,<wbr/> <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12">YV12</a>,<wbr/> or <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">Y8</a> .<wbr/></li>
 </ul>
             </td>
           </tr>
@@ -16527,6 +16533,7 @@
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#NV21">NV21</a></li>
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YV12">YV12</a></li>
 <li>Implementation-defined formats,<wbr/> i.<wbr/>e.<wbr/> <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#isOutputSupportedFor(Class)">StreamConfigurationMap#isOutputSupportedFor(Class)</a></li>
+<li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">Y8</a></li>
 </ul>
 <p>For full guarantees,<wbr/> query <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getOutputStallDuration">StreamConfigurationMap#getOutputStallDuration</a> with a
 processed format -- it will return 0 for a non-stalling stream.<wbr/></p>
@@ -17036,6 +17043,8 @@
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#PRIVATE">ImageFormat#PRIVATE</a> will be reprocessable into both
   <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">Image<wbr/>Format#YUV_<wbr/>420_<wbr/>888</a> and
   <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#JPEG">ImageFormat#JPEG</a> formats.<wbr/></li>
+<li>For a MONOCHROME camera supporting Y8 format,<wbr/> <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#PRIVATE">ImageFormat#PRIVATE</a> will be reprocessable into
+  <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a>.<wbr/></li>
 <li>The maximum available resolution for PRIVATE streams
   (both input/<wbr/>output) will match the maximum available
   resolution of JPEG streams.<wbr/></li>
@@ -17106,6 +17115,8 @@
   <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">Image<wbr/>Format#YUV_<wbr/>420_<wbr/>888</a> and <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#JPEG">ImageFormat#JPEG</a> formats.<wbr/></li>
 <li>The maximum available resolution for <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">Image<wbr/>Format#YUV_<wbr/>420_<wbr/>888</a> streams (both input/<wbr/>output) will match the
   maximum available resolution of <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#JPEG">ImageFormat#JPEG</a> streams.<wbr/></li>
+<li>For a MONOCHROME camera with Y8 format support,<wbr/> all the requirements mentioned
+  above for YUV_<wbr/>420_<wbr/>888 apply for Y8 format as well.<wbr/></li>
 <li>Static metadata <a href="#static_android.reprocess.maxCaptureStall">android.<wbr/>reprocess.<wbr/>max<wbr/>Capture<wbr/>Stall</a>.<wbr/></li>
 <li>Only the below controls are effective for reprocessing requests and will be present
   in capture results.<wbr/> The reprocess requests are from the original capture results
@@ -17143,8 +17154,8 @@
 <li>The <a href="#static_android.depth.depthIsExclusive">android.<wbr/>depth.<wbr/>depth<wbr/>Is<wbr/>Exclusive</a> entry is listed by this device.<wbr/></li>
 <li>As of Android P,<wbr/> the <a href="#static_android.lens.poseReference">android.<wbr/>lens.<wbr/>pose<wbr/>Reference</a> entry is listed by this device.<wbr/></li>
 <li>A LIMITED camera with only the DEPTH_<wbr/>OUTPUT capability does not have to support
-  normal YUV_<wbr/>420_<wbr/>888,<wbr/> JPEG,<wbr/> and PRIV-format outputs.<wbr/> It only has to support the DEPTH16
-  format.<wbr/></li>
+  normal YUV_<wbr/>420_<wbr/>888,<wbr/> Y8,<wbr/> JPEG,<wbr/> and PRIV-format outputs.<wbr/> It only has to support the
+  DEPTH16 format.<wbr/></li>
 </ul>
 <p>Generally,<wbr/> depth output operates at a slower frame rate than standard color capture,<wbr/>
 so the DEPTH16 and DEPTH_<wbr/>POINT_<wbr/>CLOUD formats will commonly have a stall duration that
@@ -17289,7 +17300,11 @@
                     <span class="entry_type_enum_name">MONOCHROME (v3.3)</span>
                     <span class="entry_type_enum_optional">[optional]</span>
                     <span class="entry_type_enum_notes"><p>The camera device is a monochrome camera that doesn't contain a color filter array,<wbr/>
-and the pixel values on U and V planes are all 128.<wbr/></p></span>
+and the pixel values on U and V planes are all 128.<wbr/></p>
+<p>A MONOCHROME camera must support the guaranteed stream combinations required for
+its device level and capabilities.<wbr/> Additionally,<wbr/> if the monochrome camera device
+supports Y8 format,<wbr/> all mandatory stream combination requirements related to <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">YUV_<wbr/>420_<wbr/>888</a> apply
+to <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">Y8</a> as well.<wbr/></p></span>
                   </li>
                 </ul>
 
@@ -18558,6 +18573,21 @@
                     <span class="entry_type_enum_value">0x21</span>
                     <span class="entry_type_enum_notes"><p>JPEG format</p></span>
                   </li>
+                  <li>
+                    <span class="entry_type_enum_name">RAW10 (v3.4)</span>
+                    <span class="entry_type_enum_value">0x25</span>
+                    <span class="entry_type_enum_notes"><p>RAW10</p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">RAW12 (v3.4)</span>
+                    <span class="entry_type_enum_value">0x26</span>
+                    <span class="entry_type_enum_notes"><p>RAW12</p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">Y8 (v3.4)</span>
+                    <span class="entry_type_enum_value">0x20203859</span>
+                    <span class="entry_type_enum_notes"><p>Y8</p></span>
+                  </li>
                 </ul>
 
             </td> <!-- entry_type -->
@@ -19179,6 +19209,35 @@
 or output will never hurt maximum frame rate (i.<wbr/>e.<wbr/>  <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getOutputStallDuration">getOutputStallDuration(ImageFormat.<wbr/>PRIVATE,<wbr/> size)</a> is always 0),<wbr/></p>
 <p>Attempting to configure an input stream with output streams not
 listed as available in this map is not valid.<wbr/></p>
+<p>Additionally,<wbr/> if the camera device is MONOCHROME with Y8 support,<wbr/> it will also support
+the following map of formats if its dependent capability
+(<a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a>) is supported:</p>
+<table>
+<thead>
+<tr>
+<th align="left">Input Format</th>
+<th align="left">Output Format</th>
+<th align="left">Capability</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#PRIVATE">ImageFormat#PRIVATE</a></td>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a></td>
+<td align="left">PRIVATE_<wbr/>REPROCESSING</td>
+</tr>
+<tr>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a></td>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#JPEG">ImageFormat#JPEG</a></td>
+<td align="left">YUV_<wbr/>REPROCESSING</td>
+</tr>
+<tr>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a></td>
+<td align="left"><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a></td>
+<td align="left">YUV_<wbr/>REPROCESSING</td>
+</tr>
+</tbody>
+</table>
             </td>
           </tr>
 
@@ -19589,6 +19648,7 @@
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">Image<wbr/>Format#YUV_<wbr/>420_<wbr/>888</a></li>
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#RAW10">ImageFormat#RAW10</a></li>
 <li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#RAW12">ImageFormat#RAW12</a></li>
+<li><a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#Y8">ImageFormat#Y8</a></li>
 </ul>
 <p>All other formats may or may not have an allowed stall duration on
 a per-capability basis; refer to <a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a>
@@ -19865,6 +19925,218 @@
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
            <!-- end of entry -->
         
+                
+          <tr class="entry" id="static_android.scaler.availableRecommendedStreamConfigurations">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>scaler.<wbr/>available<wbr/>Recommended<wbr/>Stream<wbr/>Configurations
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name entry_type_name_enum">int32</span>
+                <span class="entry_type_container">x</span>
+
+                <span class="entry_type_array">
+                  n x 5
+                </span>
+              <span class="entry_type_visibility"> [ndk_public as recommendedStreamConfiguration]</span>
+
+
+
+
+
+                <ul class="entry_type_enum">
+                  <li>
+                    <span class="entry_type_enum_name">PREVIEW (v3.4)</span>
+                    <span class="entry_type_enum_value">0x0</span>
+                    <span class="entry_type_enum_notes"><p>Preview must only include non-stalling processed stream configurations with
+output formats like YUV_<wbr/>420_<wbr/>888,<wbr/> IMPLEMENTATION_<wbr/>DEFINED,<wbr/> etc.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">RECORD (v3.4)</span>
+                    <span class="entry_type_enum_value">0x1</span>
+                    <span class="entry_type_enum_notes"><p>Video record must include stream configurations that match the advertised
+supported media profiles <a href="https://developer.android.com/reference/android/media/CamcorderProfile.html">CamcorderProfile</a> with
+IMPLEMENTATION_<wbr/>DEFINED format.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">VIDEO_SNAPSHOT (v3.4)</span>
+                    <span class="entry_type_enum_value">0x2</span>
+                    <span class="entry_type_enum_notes"><p>Video snapshot must include stream configurations at least as big as
+the maximum RECORD resolutions and only with format BLOB + DATASPACE_<wbr/>JFIF
+format/<wbr/>dataspace combination (JPEG).<wbr/> Additionally the configurations shouldn't cause
+preview glitches and also be able to run at 30 fps.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">SNAPSHOT (v3.4)</span>
+                    <span class="entry_type_enum_value">0x3</span>
+                    <span class="entry_type_enum_notes"><p>Recommended snapshot stream configurations must include at least one with
+size close to <a href="#static_android.sensor.info.activeArraySize">android.<wbr/>sensor.<wbr/>info.<wbr/>active<wbr/>Array<wbr/>Size</a> with BLOB + DATASPACE_<wbr/>JFIF
+format/<wbr/>dataspace combination (JPEG).<wbr/> Taking into account restrictions on aspect
+ratio,<wbr/> alignment etc.<wbr/> the area of the maximum suggested size shouldn’t be less than
+97% of the sensor array size area.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">ZSL (v3.4)</span>
+                    <span class="entry_type_enum_value">0x4</span>
+                    <span class="entry_type_enum_notes"><p>If supported,<wbr/> recommended input stream configurations must only be advertised with
+ZSL along with other processed and/<wbr/>or stalling output formats.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">RAW (v3.4)</span>
+                    <span class="entry_type_enum_value">0x5</span>
+                    <span class="entry_type_enum_notes"><p>If supported,<wbr/> recommended raw stream configurations must only include RAW based
+output formats.<wbr/></p></span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">PUBLIC_END (v3.4)</span>
+                    <span class="entry_type_enum_value">0x6</span>
+                  </li>
+                  <li>
+                    <span class="entry_type_enum_name">VENDOR_START (v3.4)</span>
+                    <span class="entry_type_enum_value">0x18</span>
+                    <span class="entry_type_enum_notes"><p>Vendor defined use cases.<wbr/> These depend on the vendor implementation.<wbr/></p></span>
+                  </li>
+                </ul>
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>Recommended stream configurations for common client use cases.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+            </td>
+
+          </tr>
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>Optional subset of the <a href="#static_android.scaler.availableStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stream<wbr/>Configurations</a> that contains
+similar tuples listed as
+(i.<wbr/>e.<wbr/> width,<wbr/> height,<wbr/> format,<wbr/> output/<wbr/>input stream,<wbr/> usecase bit field).<wbr/>
+Camera devices will be able to suggest particular stream configurations which are
+power and performance efficient for specific use cases.<wbr/> For more information about
+retrieving the suggestions see
+<a href="https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#getRecommendedStreamConfigurationMap">CameraCharacteristics#getRecommendedStreamConfigurationMap</a>.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">HAL Implementation Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>There are some requirements that need to be considered regarding the usecases and the
+suggested configurations:</p>
+<ul>
+<li>If <a href="#static_android.scaler.availableRecommendedStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Recommended<wbr/>Stream<wbr/>Configurations</a> is set,<wbr/> then recommended
+stream configurations must be present for all mandatory usecases PREVIEW,<wbr/>
+SNAPSHOT,<wbr/> RECORD,<wbr/> VIDEO_<wbr/>SNAPSHOT.<wbr/> ZSL and RAW are
+required depending on device capabilities see <a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a>.<wbr/></li>
+<li>Non-existing usecases and non-vendor usecases within the range
+(RAW : VENDOR_<wbr/>START] are prohibited as well as stream configurations not
+present in the exhaustive <a href="#static_android.scaler.availableStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stream<wbr/>Configurations</a> list.<wbr/></li>
+</ul>
+<p>For example,<wbr/> in case the camera device supports only 4K and 1080p and both resolutions are
+recommended for the mandatory usecases except preview which can run efficiently only
+on 1080p.<wbr/> The array may look like this:</p>
+<p>[3840,<wbr/> 2160,<wbr/> HAL_<wbr/>PIXEL_<wbr/>FORMAT_<wbr/>IMPLEMENTATION_<wbr/>DEFINED,<wbr/>
+ ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>OUTPUT,<wbr/>
+ (1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>RECORD |<wbr/>
+ 1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>SNAPSHOT |<wbr/>
+ 1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>VIDEO_<wbr/>SNAPSHOT),<wbr/></p>
+<p>1920,<wbr/> 1080,<wbr/> HAL_<wbr/>PIXEL_<wbr/>FORMAT_<wbr/>IMPLEMENTATION_<wbr/>DEFINED,<wbr/>
+ ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>OUTPUT,<wbr/>
+ (1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>PREVIEW |<wbr/>
+ 1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>RECORD |<wbr/>
+ 1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>SNAPSHOT |<wbr/>
+ 1&lt;&lt; ANDROID_<wbr/>SCALER_<wbr/>AVAILABLE_<wbr/>RECOMMENDED_<wbr/>STREAM_<wbr/>CONFIGURATIONS_<wbr/>VIDEO_<wbr/>SNAPSHOT)]</p>
+            </td>
+          </tr>
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
+                
+          <tr class="entry" id="static_android.scaler.availableRecommendedInputOutputFormatsMap">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>scaler.<wbr/>available<wbr/>Recommended<wbr/>Input<wbr/>Output<wbr/>Formats<wbr/>Map
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name">int32</span>
+
+              <span class="entry_type_visibility"> [ndk_public as reprocessFormatsMap]</span>
+
+
+
+
+
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>Recommended mappings of image formats that are supported by this
+camera device for input streams,<wbr/> to their corresponding output formats.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+              <ul class="entry_tags">
+                  <li><a href="#tag_REPROC">REPROC</a></li>
+              </ul>
+            </td>
+
+          </tr>
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>This is a recommended subset of the complete list of mappings found in
+<a href="#static_android.scaler.availableInputOutputFormatsMap">android.<wbr/>scaler.<wbr/>available<wbr/>Input<wbr/>Output<wbr/>Formats<wbr/>Map</a>.<wbr/> The same requirements apply here as well.<wbr/>
+The list however doesn't need to contain all available and supported mappings.<wbr/> Instead of
+this developers must list only recommended and efficient entries.<wbr/>
+If set,<wbr/> the information will be available in the ZERO_<wbr/>SHUTTER_<wbr/>LAG recommended stream
+configuration see
+<a href="https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#getRecommendedStreamConfigurationMap">CameraCharacteristics#getRecommendedStreamConfigurationMap</a>.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">HAL Implementation Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>For a code sample of the required data encoding please check
+<a href="#static_android.scaler.availableInputOutputFormatsMap">android.<wbr/>scaler.<wbr/>available<wbr/>Input<wbr/>Output<wbr/>Formats<wbr/>Map</a>.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
         
 
       <!-- end of kind -->
@@ -30100,6 +30372,78 @@
           <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
            <!-- end of entry -->
         
+                
+          <tr class="entry" id="static_android.depth.availableRecommendedDepthStreamConfigurations">
+            <td class="entry_name
+             " rowspan="5">
+              android.<wbr/>depth.<wbr/>available<wbr/>Recommended<wbr/>Depth<wbr/>Stream<wbr/>Configurations
+            </td>
+            <td class="entry_type">
+                <span class="entry_type_name">int32</span>
+                <span class="entry_type_container">x</span>
+
+                <span class="entry_type_array">
+                  n x 5
+                </span>
+              <span class="entry_type_visibility"> [ndk_public as recommendedStreamConfiguration]</span>
+
+
+
+
+
+
+            </td> <!-- entry_type -->
+
+            <td class="entry_description">
+              <p>Recommended depth stream configurations for common client use cases.<wbr/></p>
+            </td>
+
+            <td class="entry_units">
+            </td>
+
+            <td class="entry_range">
+            </td>
+
+            <td class="entry_hal_version">
+              <p>3.<wbr/>4</p>
+            </td>
+
+            <td class="entry_tags">
+            </td>
+
+          </tr>
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>Optional subset of the <a href="#static_android.depth.availableDepthStreamConfigurations">android.<wbr/>depth.<wbr/>available<wbr/>Depth<wbr/>Stream<wbr/>Configurations</a> that
+contains similar tuples listed as
+(i.<wbr/>e.<wbr/> width,<wbr/> height,<wbr/> format,<wbr/> output/<wbr/>input stream,<wbr/> usecase bit field).<wbr/>
+Camera devices will be able to suggest particular depth stream configurations which are
+power and performance efficient for specific use cases.<wbr/> For more information about
+retrieving the suggestions see
+<a href="https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#getRecommendedStreamConfigurationMap">CameraCharacteristics#getRecommendedStreamConfigurationMap</a>.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entries_header">
+            <th class="th_details" colspan="6">HAL Implementation Details</th>
+          </tr>
+          <tr class="entry_cont">
+            <td class="entry_details" colspan="6">
+              <p>Recommended depth configurations are expected to be declared with SNAPSHOT and/<wbr/>or
+ZSL if supported by the device.<wbr/>
+For additional details on how to declare recommended stream configurations,<wbr/> check
+<a href="#static_android.scaler.availableRecommendedStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Recommended<wbr/>Stream<wbr/>Configurations</a>.<wbr/>
+For additional requirements on depth streams please consider
+<a href="#static_android.depth.availableDepthStreamConfigurations">android.<wbr/>depth.<wbr/>available<wbr/>Depth<wbr/>Stream<wbr/>Configurations</a>.<wbr/></p>
+            </td>
+          </tr>
+
+          <tr class="entry_spacer"><td class="entry_spacer" colspan="7"></td></tr>
+           <!-- end of entry -->
+        
         
 
       <!-- end of kind -->
@@ -30372,8 +30716,8 @@
 will not slow down capture rate when applying correction.<wbr/> FAST may be the same as OFF if
 any correction at all would slow down capture rate.<wbr/>  Every output stream will have a
 similar amount of enhancement applied.<wbr/></p>
-<p>The correction only applies to processed outputs such as YUV,<wbr/> JPEG,<wbr/> or DEPTH16; it is not
-applied to any RAW output.<wbr/></p>
+<p>The correction only applies to processed outputs such as YUV,<wbr/> Y8,<wbr/> JPEG,<wbr/> or DEPTH16; it is
+not applied to any RAW output.<wbr/></p>
 <p>This control will be on by default on devices that support this control.<wbr/> Applications
 disabling distortion correction need to pay extra attention with the coordinate system of
 metering regions,<wbr/> crop region,<wbr/> and face rectangles.<wbr/> When distortion correction is OFF,<wbr/>
@@ -30599,8 +30943,8 @@
 will not slow down capture rate when applying correction.<wbr/> FAST may be the same as OFF if
 any correction at all would slow down capture rate.<wbr/>  Every output stream will have a
 similar amount of enhancement applied.<wbr/></p>
-<p>The correction only applies to processed outputs such as YUV,<wbr/> JPEG,<wbr/> or DEPTH16; it is not
-applied to any RAW output.<wbr/></p>
+<p>The correction only applies to processed outputs such as YUV,<wbr/> Y8,<wbr/> JPEG,<wbr/> or DEPTH16; it is
+not applied to any RAW output.<wbr/></p>
 <p>This control will be on by default on devices that support this control.<wbr/> Applications
 disabling distortion correction need to pay extra attention with the coordinate system of
 metering regions,<wbr/> crop region,<wbr/> and face rectangles.<wbr/> When distortion correction is OFF,<wbr/>
@@ -30844,6 +31188,7 @@
           <li><a href="#static_android.noiseReduction.availableNoiseReductionModes">android.noiseReduction.availableNoiseReductionModes</a> (static)</li>
           <li><a href="#static_android.request.maxNumInputStreams">android.request.maxNumInputStreams</a> (static)</li>
           <li><a href="#static_android.scaler.availableInputOutputFormatsMap">android.scaler.availableInputOutputFormatsMap</a> (static)</li>
+          <li><a href="#static_android.scaler.availableRecommendedInputOutputFormatsMap">android.scaler.availableRecommendedInputOutputFormatsMap</a> (static)</li>
           <li><a href="#controls_android.reprocess.effectiveExposureFactor">android.reprocess.effectiveExposureFactor</a> (controls)</li>
           <li><a href="#static_android.reprocess.maxCaptureStall">android.reprocess.maxCaptureStall</a> (static)</li>
           <li><a href="#static_android.distortionCorrection.availableModes">android.distortionCorrection.availableModes</a> (static)</li>
diff --git a/camera/docs/metadata_definitions.xml b/camera/docs/metadata_definitions.xml
index e8036bc..4ac99dc 100644
--- a/camera/docs/metadata_definitions.xml
+++ b/camera/docs/metadata_definitions.xml
@@ -76,6 +76,10 @@
     <typedef name="streamConfiguration">
       <language name="java">android.hardware.camera2.params.StreamConfiguration</language>
     </typedef>
+    <typedef name="recommendedStreamConfiguration">
+      <language
+      name="java">android.hardware.camera2.params.RecommendedStreamConfiguration</language>
+    </typedef>
     <typedef name="streamConfigurationDuration">
       <language name="java">android.hardware.camera2.params.StreamConfigurationDuration</language>
     </typedef>
@@ -4656,8 +4660,9 @@
             {@link android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12 RAW12}.
           * Processed (but not-stalling): any non-RAW format without a stall duration.  Typically
             {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888 YUV_420_888},
-            {@link android.graphics.ImageFormat#NV21 NV21}, or {@link
-            android.graphics.ImageFormat#YV12 YV12}.
+            {@link android.graphics.ImageFormat#NV21 NV21}, {@link
+            android.graphics.ImageFormat#YV12 YV12}, or {@link
+            android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8 Y8} .
           </details>
           <tag id="BC" />
         </entry>
@@ -4717,6 +4722,7 @@
           * {@link android.graphics.ImageFormat#YV12 YV12}
           * Implementation-defined formats, i.e. {@link
             android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class)}
+          * {@link android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8 Y8}
 
           For full guarantees, query {@link
           android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration} with a
@@ -5017,6 +5023,9 @@
               * {@link android.graphics.ImageFormat#PRIVATE} will be reprocessable into both
                 {@link android.graphics.ImageFormat#YUV_420_888} and
                 {@link android.graphics.ImageFormat#JPEG} formats.
+              * For a MONOCHROME camera supporting Y8 format, {@link
+                android.graphics.ImageFormat#PRIVATE} will be reprocessable into
+                {@link android.graphics.ImageFormat#Y8}.
               * The maximum available resolution for PRIVATE streams
                 (both input/output) will match the maximum available
                 resolution of JPEG streams.
@@ -5078,7 +5087,8 @@
 
               If the device supports the {@link
               android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}, {@link
-              android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, then those can also be
+              android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, {@link
+              android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8}, then those can also be
               captured at the same rate as the maximum-size YUV_420_888 resolution is.
 
               If the device supports the PRIVATE_REPROCESSING capability, then the same guarantees
@@ -5106,7 +5116,8 @@
 
               If the device supports the {@link
               android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}, {@link
-              android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, then those can also be
+              android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}, {@link
+              android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8}, then those can also be
               captured at the same rate as the maximum-size YUV_420_888 resolution is.
 
               In addition, the android.sync.maxLatency field is guaranted to have a value between 0
@@ -5143,6 +5154,8 @@
               * The maximum available resolution for {@link
                 android.graphics.ImageFormat#YUV_420_888} streams (both input/output) will match the
                 maximum available resolution of {@link android.graphics.ImageFormat#JPEG} streams.
+              * For a MONOCHROME camera with Y8 format support, all the requirements mentioned
+                above for YUV_420_888 apply for Y8 format as well.
               * Static metadata android.reprocess.maxCaptureStall.
               * Only the below controls are effective for reprocessing requests and will be present
                 in capture results. The reprocess requests are from the original capture results
@@ -5180,8 +5193,8 @@
               * The android.depth.depthIsExclusive entry is listed by this device.
               * As of Android P, the android.lens.poseReference entry is listed by this device.
               * A LIMITED camera with only the DEPTH_OUTPUT capability does not have to support
-                normal YUV_420_888, JPEG, and PRIV-format outputs. It only has to support the DEPTH16
-                format.
+                normal YUV_420_888, Y8, JPEG, and PRIV-format outputs. It only has to support the
+                DEPTH16 format.
 
               Generally, depth output operates at a slower frame rate than standard color capture,
               so the DEPTH16 and DEPTH_POINT_CLOUD formats will commonly have a stall duration that
@@ -5343,6 +5356,12 @@
               <notes>
               The camera device is a monochrome camera that doesn't contain a color filter array,
               and the pixel values on U and V planes are all 128.
+
+              A MONOCHROME camera must support the guaranteed stream combinations required for
+              its device level and capabilities. Additionally, if the monochrome camera device
+              supports Y8 format, all mandatory stream combination requirements related to {@link
+              android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888 YUV_420_888} apply
+              to {@link android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8 Y8} as well.
               </notes>
             </value>
 
@@ -5866,6 +5885,15 @@
             <value id="0x21">BLOB
               <notes>JPEG format</notes>
             </value>
+            <value id="0x25" hal_version="3.4">RAW10
+              <notes>RAW10</notes>
+            </value>
+            <value id="0x26" hal_version="3.4">RAW12
+              <notes>RAW12</notes>
+            </value>
+            <value id="0x20203859" hal_version="3.4">Y8
+              <notes>Y8</notes>
+            </value>
           </enum>
           <description>The list of image formats that are supported by this
           camera device for output streams.</description>
@@ -6101,6 +6129,17 @@
 
           Attempting to configure an input stream with output streams not
           listed as available in this map is not valid.
+
+          Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
+          the following map of formats if its dependent capability
+          (android.request.availableCapabilities) is supported:
+
+            Input Format                                    | Output Format                                     | Capability
+          :-------------------------------------------------|:--------------------------------------------------|:----------
+          {@link android.graphics.ImageFormat#PRIVATE}      | {@link android.graphics.ImageFormat#Y8}           | PRIVATE_REPROCESSING
+          {@link android.graphics.ImageFormat#Y8}           | {@link android.graphics.ImageFormat#JPEG}         | YUV_REPROCESSING
+          {@link android.graphics.ImageFormat#Y8}           | {@link android.graphics.ImageFormat#Y8}           | YUV_REPROCESSING
+
           </details>
           <hal_details>
           For the formats, see `system/core/include/system/graphics.h` for a definition
@@ -6341,6 +6380,7 @@
           * {@link android.graphics.ImageFormat#YUV_420_888|AIMAGE_FORMAT_YUV_420_888}
           * {@link android.graphics.ImageFormat#RAW10|AIMAGE_FORMAT_RAW10}
           * {@link android.graphics.ImageFormat#RAW12|AIMAGE_FORMAT_RAW12}
+          * {@link android.graphics.ImageFormat#Y8|AIMAGE_FORMAT_Y8}
 
           All other formats may or may not have an allowed stall duration on
           a per-capability basis; refer to android.request.availableCapabilities
@@ -6486,6 +6526,160 @@
           LEGACY capability devices will only support CENTER_ONLY cropping.
           </details>
         </entry>
+        <entry name="availableRecommendedStreamConfigurations" type="int32" visibility="ndk_public"
+            optional="true" enum="true" container="array" typedef="recommendedStreamConfiguration"
+            hal_version="3.4">
+          <array>
+            <size>n</size>
+            <size>5</size>
+          </array>
+          <enum>
+            <value id="0x0">PREVIEW
+            <notes>
+                Preview must only include non-stalling processed stream configurations with
+                output formats like YUV_420_888, IMPLEMENTATION_DEFINED, etc.
+            </notes>
+            </value>
+            <value id="0x1">RECORD
+            <notes>
+                Video record must include stream configurations that match the advertised
+                supported media profiles {@link android.media.CamcorderProfile} with
+                IMPLEMENTATION_DEFINED format.
+            </notes>
+            </value>
+            <value id="0x2">VIDEO_SNAPSHOT
+            <notes>
+                Video snapshot must include stream configurations at least as big as
+                the maximum RECORD resolutions and only with format BLOB + DATASPACE_JFIF
+                format/dataspace combination (JPEG). Additionally the configurations shouldn't cause
+                preview glitches and also be able to run at 30 fps.
+            </notes>
+            </value>
+            <value id="0x3">SNAPSHOT
+            <notes>
+                Recommended snapshot stream configurations must include at least one with
+                size close to android.sensor.info.activeArraySize with BLOB + DATASPACE_JFIF
+                format/dataspace combination (JPEG). Taking into account restrictions on aspect
+                ratio, alignment etc. the area of the maximum suggested size shouldn’t be less than
+                97% of the sensor array size area.
+            </notes>
+            </value>
+            <value id="0x4">ZSL
+            <notes>
+                If supported, recommended input stream configurations must only be advertised with
+                ZSL along with other processed and/or stalling output formats.
+            </notes>
+            </value>
+            <value id="0x5">RAW
+            <notes>
+                If supported, recommended raw stream configurations must only include RAW based
+                output formats.
+            </notes>
+            </value>
+            <value id="0x6">PUBLIC_END
+            </value>
+            <value id="0x18">VENDOR_START
+            <notes>
+                Vendor defined use cases. These depend on the vendor implementation.
+            </notes>
+            </value>
+          </enum>
+          <description>Recommended stream configurations for common client use cases.
+          </description>
+          <details>Optional subset of the android.scaler.availableStreamConfigurations that contains
+          similar tuples listed as
+          (i.e. width, height, format, output/input stream, usecase bit field).
+          Camera devices will be able to suggest particular stream configurations which are
+          power and performance efficient for specific use cases. For more information about
+          retrieving the suggestions see
+          {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap}.
+          </details>
+          <ndk_details>
+          The data representation is int[5], which maps to
+          (width, height, format, output/input stream, usecase bit field). The array can be
+          parsed using the following pseudo code:
+
+          struct StreamConfiguration {
+          int32_t format;
+          int32_t width;
+          int32_t height;
+          int32_t isInput; };
+
+          void getPreferredStreamConfigurations(
+              int32_t *array, size_t count, int32_t usecaseId,
+              Vector &lt; StreamConfiguration &gt; * scs) {
+              const size_t STREAM_CONFIGURATION_SIZE = 5;
+              const size_t STREAM_WIDTH_OFFSET = 0;
+              const size_t STREAM_HEIGHT_OFFSET = 1;
+              const size_t STREAM_FORMAT_OFFSET = 2;
+              const size_t STREAM_IS_INPUT_OFFSET = 3;
+              const size_t STREAM_USECASE_BITMAP_OFFSET = 4;
+
+              for (size_t i = 0; i &lt; count; i+= STREAM_CONFIGURATION_SIZE) {
+                  int32_t width = array[i + STREAM_WIDTH_OFFSET];
+                  int32_t height = array[i + STREAM_HEIGHT_OFFSET];
+                  int32_t format = array[i + STREAM_FORMAT_OFFSET];
+                  int32_t isInput = array[i + STREAM_IS_INPUT_OFFSET];
+                  int32_t supportedUsecases = array[i + STREAM_USECASE_BITMAP_OFFSET];
+                  if (supportedUsecases &amp; (1 &lt;&lt; usecaseId)) {
+                      StreamConfiguration sc = {format, width, height, isInput};
+                      scs->add(sc);
+                  }
+              }
+          }
+
+          </ndk_details>
+          <hal_details>
+          There are some requirements that need to be considered regarding the usecases and the
+          suggested configurations:
+
+          * If android.scaler.availableRecommendedStreamConfigurations is set, then recommended
+          stream configurations must be present for all mandatory usecases PREVIEW,
+          SNAPSHOT, RECORD, VIDEO_SNAPSHOT. ZSL and RAW are
+          required depending on device capabilities see android.request.availableCapabilities.
+          * Non-existing usecases and non-vendor usecases within the range
+          (RAW : VENDOR_START] are prohibited as well as stream configurations not
+          present in the exhaustive android.scaler.availableStreamConfigurations list.
+
+          For example, in case the camera device supports only 4K and 1080p and both resolutions are
+          recommended for the mandatory usecases except preview which can run efficiently only
+          on 1080p. The array may look like this:
+
+          [3840, 2160, HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
+           ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
+           (1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD |
+           1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT |
+           1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT),
+
+           1920, 1080, HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED,
+           ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT,
+           (1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW |
+           1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD |
+           1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT |
+           1&lt;&lt; ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT)]
+
+          </hal_details>
+        </entry>
+        <entry name="availableRecommendedInputOutputFormatsMap" type="int32" visibility="ndk_public"
+          optional="true" typedef="reprocessFormatsMap" hal_version="3.4">
+          <description>Recommended mappings of image formats that are supported by this
+          camera device for input streams, to their corresponding output formats.
+          </description>
+          <details>
+          This is a recommended subset of the complete list of mappings found in
+          android.scaler.availableInputOutputFormatsMap. The same requirements apply here as well.
+          The list however doesn't need to contain all available and supported mappings. Instead of
+          this developers must list only recommended and efficient entries.
+          If set, the information will be available in the ZERO_SHUTTER_LAG recommended stream
+          configuration see
+          {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap}.
+          </details>
+          <hal_details>
+          For a code sample of the required data encoding please check
+          android.scaler.availableInputOutputFormatsMap.
+          </hal_details>
+          <tag id="REPROC" />
+        </entry>
       </static>
     </section>
     <section name="sensor">
@@ -9882,6 +10076,36 @@
           corrupted during depth measurement.
           </details>
         </entry>
+        <entry name="availableRecommendedDepthStreamConfigurations" type="int32"
+            visibility="ndk_public" optional="true" container="array"
+            typedef="recommendedStreamConfiguration" hal_version="3.4">
+          <array>
+            <size>n</size>
+            <size>5</size>
+          </array>
+          <description>Recommended depth stream configurations for common client use cases.
+          </description>
+          <details>Optional subset of the android.depth.availableDepthStreamConfigurations that
+          contains similar tuples listed as
+          (i.e. width, height, format, output/input stream, usecase bit field).
+          Camera devices will be able to suggest particular depth stream configurations which are
+          power and performance efficient for specific use cases. For more information about
+          retrieving the suggestions see
+          {@link android.hardware.camera2.CameraCharacteristics#getRecommendedStreamConfigurationMap}.
+          </details>
+          <ndk_details>
+          For data representation please refer to
+          android.scaler.availableRecommendedStreamConfigurations
+          </ndk_details>
+          <hal_details>
+          Recommended depth configurations are expected to be declared with SNAPSHOT and/or
+          ZSL if supported by the device.
+          For additional details on how to declare recommended stream configurations, check
+          android.scaler.availableRecommendedStreamConfigurations.
+          For additional requirements on depth streams please consider
+          android.depth.availableDepthStreamConfigurations.
+          </hal_details>
+        </entry>
       </static>
     </section>
     <section name="logicalMultiCamera">
@@ -9967,8 +10191,8 @@
           any correction at all would slow down capture rate.  Every output stream will have a
           similar amount of enhancement applied.
 
-          The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
-          applied to any RAW output.
+          The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is
+          not applied to any RAW output.
 
           This control will be on by default on devices that support this control. Applications
           disabling distortion correction need to pay extra attention with the coordinate system of
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 3c9f1d7..5ffe3d4 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -296,6 +296,10 @@
     ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS,     // int64[]      | ndk_public   | HIDL v3.2
     ANDROID_SCALER_AVAILABLE_STALL_DURATIONS,         // int64[]      | ndk_public   | HIDL v3.2
     ANDROID_SCALER_CROPPING_TYPE,                     // enum         | public       | HIDL v3.2
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS,
+                                                      // enum[]       | ndk_public   | HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP,
+                                                      // int32        | ndk_public   | HIDL v3.4
     ANDROID_SCALER_END,
 
     ANDROID_SENSOR_EXPOSURE_TIME =                    // int64        | public       | HIDL v3.2
@@ -435,6 +439,8 @@
     ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS,// int64[]      | ndk_public   | HIDL v3.2
     ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS,    // int64[]      | ndk_public   | HIDL v3.2
     ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE,                 // enum         | public       | HIDL v3.2
+    ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS,
+                                                      // int32[]      | ndk_public   | HIDL v3.4
     ANDROID_DEPTH_END,
 
     ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =       // byte[]       | hidden       | HIDL v3.3
@@ -794,6 +800,9 @@
     ANDROID_SCALER_AVAILABLE_FORMATS_IMPLEMENTATION_DEFINED          = 0x22, // HIDL v3.2
     ANDROID_SCALER_AVAILABLE_FORMATS_YCbCr_420_888                   = 0x23, // HIDL v3.2
     ANDROID_SCALER_AVAILABLE_FORMATS_BLOB                            = 0x21, // HIDL v3.2
+    ANDROID_SCALER_AVAILABLE_FORMATS_RAW10                           = 0x25, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_FORMATS_RAW12                           = 0x26, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_FORMATS_Y8                              = 0x20203859, // HIDL v3.4
 } camera_metadata_enum_android_scaler_available_formats_t;
 
 // ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS
@@ -808,6 +817,24 @@
     ANDROID_SCALER_CROPPING_TYPE_FREEFORM                           , // HIDL v3.2
 } camera_metadata_enum_android_scaler_cropping_type_t;
 
+// ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS
+typedef enum camera_metadata_enum_android_scaler_available_recommended_stream_configurations {
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW
+                                                                      = 0x0, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD
+                                                                      = 0x1, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT
+                                                                      = 0x2, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT
+                                                                      = 0x3, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL   = 0x4, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW   = 0x5, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END
+                                                                      = 0x6, // HIDL v3.4
+    ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START
+                                                                      = 0x18, // HIDL v3.4
+} camera_metadata_enum_android_scaler_available_recommended_stream_configurations_t;
+
 
 // ANDROID_SENSOR_REFERENCE_ILLUMINANT1
 typedef enum camera_metadata_enum_android_sensor_reference_illuminant1 {
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index e38120d..21fee75 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -454,6 +454,12 @@
     { "availableStallDurations",       TYPE_INT64  },
     [ ANDROID_SCALER_CROPPING_TYPE - ANDROID_SCALER_START ] =
     { "croppingType",                  TYPE_BYTE   },
+    [ ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS - ANDROID_SCALER_START ] =
+    { "availableRecommendedStreamConfigurations",
+                                        TYPE_INT32  },
+    [ ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP - ANDROID_SCALER_START ] =
+    { "availableRecommendedInputOutputFormatsMap",
+                                        TYPE_INT32  },
 };
 
 static tag_info_t android_sensor[ANDROID_SENSOR_END -
@@ -710,6 +716,9 @@
     { "availableDepthStallDurations",  TYPE_INT64  },
     [ ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE - ANDROID_DEPTH_START ] =
     { "depthIsExclusive",              TYPE_BYTE   },
+    [ ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS - ANDROID_DEPTH_START ] =
+    { "availableRecommendedDepthStreamConfigurations",
+                                        TYPE_INT32  },
 };
 
 static tag_info_t android_logical_multi_camera[ANDROID_LOGICAL_MULTI_CAMERA_END -
@@ -2012,6 +2021,18 @@
                     msg = "BLOB";
                     ret = 0;
                     break;
+                case ANDROID_SCALER_AVAILABLE_FORMATS_RAW10:
+                    msg = "RAW10";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_FORMATS_RAW12:
+                    msg = "RAW12";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_FORMATS_Y8:
+                    msg = "Y8";
+                    ret = 0;
+                    break;
                 default:
                     msg = "error: enum value out of range";
             }
@@ -2077,6 +2098,48 @@
             }
             break;
         }
+        case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS: {
+            switch (value) {
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW:
+                    msg = "PREVIEW";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RECORD:
+                    msg = "RECORD";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT:
+                    msg = "VIDEO_SNAPSHOT";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_SNAPSHOT:
+                    msg = "SNAPSHOT";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_ZSL:
+                    msg = "ZSL";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW:
+                    msg = "RAW";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END:
+                    msg = "PUBLIC_END";
+                    ret = 0;
+                    break;
+                case ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VENDOR_START:
+                    msg = "VENDOR_START";
+                    ret = 0;
+                    break;
+                default:
+                    msg = "error: enum value out of range";
+            }
+            break;
+        }
+        case ANDROID_SCALER_AVAILABLE_RECOMMENDED_INPUT_OUTPUT_FORMATS_MAP: {
+            break;
+        }
 
         case ANDROID_SENSOR_EXPOSURE_TIME: {
             break;
@@ -2795,6 +2858,9 @@
             }
             break;
         }
+        case ANDROID_DEPTH_AVAILABLE_RECOMMENDED_DEPTH_STREAM_CONFIGURATIONS: {
+            break;
+        }
 
         case ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS: {
             break;