Merge "Update HAL notes for pre-correction array dimens." into mnc-dev
diff --git a/camera/docs/docs.html b/camera/docs/docs.html
index 617163a..256d207 100644
--- a/camera/docs/docs.html
+++ b/camera/docs/docs.html
@@ -5094,7 +5094,7 @@
           </tr>
           <tr class="entry_cont">
             <td class="entry_details" colspan="5">
-              <p>When CONSTRAINED_<wbr/>HIGH_<wbr/>SPEED_<wbr/>VIDEO is supported in android.<wbr/>control.<wbr/>available<wbr/>Capabilities,<wbr/>
+              <p>When CONSTRAINED_<wbr/>HIGH_<wbr/>SPEED_<wbr/>VIDEO is supported in <a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a>,<wbr/>
 this metadata will list the supported high speed video size,<wbr/> fps range and max batch size
 configurations.<wbr/> All the sizes listed in this configuration will be a subset of the sizes
 reported by <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getOutputSizes">StreamConfigurationMap#getOutputSizes</a>
@@ -10438,6 +10438,18 @@
 16:9 aspect ratio,<wbr/> the primary image will be cropped vertically (letterbox) to
 generate the thumbnail image.<wbr/> The thumbnail image will always have a smaller Field
 Of View (FOV) than the primary image when aspect ratios differ.<wbr/></p>
+<p>When an <a href="#controls_android.jpeg.orientation">android.<wbr/>jpeg.<wbr/>orientation</a> of non-zero degree is requested,<wbr/>
+the camera device will handle thumbnail rotation in one of the following ways:</p>
+<ul>
+<li>Set the <a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>
+  and keep jpeg and thumbnail image data unrotated.<wbr/></li>
+<li>Rotate the jpeg and thumbnail image data and not set
+  <a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>.<wbr/> In this
+  case,<wbr/> LIMITED or FULL hardware level devices will report rotated thumnail size in
+  capture result,<wbr/> so the width and height will be interchanged if 90 or 270 degree
+  orientation is requested.<wbr/> LEGACY device will always report unrotated thumbnail
+  size.<wbr/></li>
+</ul>
             </td>
           </tr>
 
@@ -11095,6 +11107,18 @@
 16:9 aspect ratio,<wbr/> the primary image will be cropped vertically (letterbox) to
 generate the thumbnail image.<wbr/> The thumbnail image will always have a smaller Field
 Of View (FOV) than the primary image when aspect ratios differ.<wbr/></p>
+<p>When an <a href="#controls_android.jpeg.orientation">android.<wbr/>jpeg.<wbr/>orientation</a> of non-zero degree is requested,<wbr/>
+the camera device will handle thumbnail rotation in one of the following ways:</p>
+<ul>
+<li>Set the <a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>
+  and keep jpeg and thumbnail image data unrotated.<wbr/></li>
+<li>Rotate the jpeg and thumbnail image data and not set
+  <a href="https://developer.android.com/reference/android/media/ExifInterface.html#TAG_ORIENTATION">EXIF orientation flag</a>.<wbr/> In this
+  case,<wbr/> LIMITED or FULL hardware level devices will report rotated thumnail size in
+  capture result,<wbr/> so the width and height will be interchanged if 90 or 270 degree
+  orientation is requested.<wbr/> LEGACY device will always report unrotated thumbnail
+  size.<wbr/></li>
+</ul>
             </td>
           </tr>
 
@@ -15124,32 +15148,28 @@
                   <li>
                     <span class="entry_type_enum_name">BURST_CAPTURE</span>
                     <span class="entry_type_enum_optional">[optional]</span>
-                    <span class="entry_type_enum_notes"><p>The camera device supports capturing maximum-resolution
-images at &gt;= 20 frames per second,<wbr/> in at least the
-uncompressed YUV format,<wbr/> when post-processing settings
-are set to FAST.<wbr/></p>
-<p>More specifically,<wbr/> this means that a size matching the
-camera device's active array size is listed as a
-supported size for the YUV_<wbr/>420_<wbr/>888 format in
-<a href="#static_android.scaler.streamConfigurationMap">android.<wbr/>scaler.<wbr/>stream<wbr/>Configuration<wbr/>Map</a>,<wbr/> the minimum frame
-duration for that format and size is &lt;= 1/<wbr/>20 s,<wbr/> and
-the <a href="#static_android.control.aeAvailableTargetFpsRanges">android.<wbr/>control.<wbr/>ae<wbr/>Available<wbr/>Target<wbr/>Fps<wbr/>Ranges</a> entry
-lists at least one FPS range where the minimum FPS is</p>
-<blockquote>
-<p>= 1 /<wbr/> minimumFrameDuration for the maximum-size
-YUV_<wbr/>420_<wbr/>888 format.<wbr/></p>
-</blockquote>
-<p>In addition,<wbr/> the <a href="#static_android.sync.maxLatency">android.<wbr/>sync.<wbr/>max<wbr/>Latency</a> field is
-guaranted to have a value between 0 and 4,<wbr/> inclusive.<wbr/>
-<a href="#static_android.control.aeLockAvailable">android.<wbr/>control.<wbr/>ae<wbr/>Lock<wbr/>Available</a> and
-<a href="#static_android.control.awbLockAvailable">android.<wbr/>control.<wbr/>awb<wbr/>Lock<wbr/>Available</a> are also guaranteed
-to be <code>true</code> so burst capture with these two locks ON
-yields consistent image output.<wbr/></p>
-<p>On a camera device that reports the HIGH_<wbr/>RESOLUTION hardware
-level,<wbr/> meaning the device supports very large capture sizes,<wbr/>
-BURST_<wbr/>CAPTURE means that at least 8-megapixel images can be
-captured at <code>&gt;=</code> 20 fps,<wbr/> and maximum-resolution images can be
-captured at <code>&gt;=</code> 10 fps.<wbr/></p></span>
+                    <span class="entry_type_enum_notes"><p>The camera device supports capturing high-resolution images at &gt;= 20 frames per
+second,<wbr/> in at least the uncompressed YUV format,<wbr/> when post-processing settings are set
+to FAST.<wbr/> Additionally,<wbr/> maximum-resolution images can be captured at &gt;= 10 frames
+per second.<wbr/>  Here,<wbr/> 'high resolution' means at least 8 megapixels,<wbr/> or the maximum
+resolution of the device,<wbr/> whichever is smaller.<wbr/></p>
+<p>More specifically,<wbr/> this means that a size matching the camera device's active array
+size is listed as a supported size for the <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#YUV_420_888">Image<wbr/>Format#YUV_<wbr/>420_<wbr/>888</a> format in either <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getOutputSizes">StreamConfigurationMap#getOutputSizes</a> or <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getHighResolutionOutputSizes">StreamConfigurationMap#getHighResolutionOutputSizes</a>,<wbr/>
+with a minimum frame duration for that format and size of either &lt;= 1/<wbr/>20 s,<wbr/> or
+&lt;= 1/<wbr/>10 s,<wbr/> respectively; and the <a href="#static_android.control.aeAvailableTargetFpsRanges">android.<wbr/>control.<wbr/>ae<wbr/>Available<wbr/>Target<wbr/>Fps<wbr/>Ranges</a> entry
+lists at least one FPS range where the minimum FPS is &gt;= 1 /<wbr/> minimumFrameDuration
+for the maximum-size YUV_<wbr/>420_<wbr/>888 format.<wbr/>  If that maximum size is listed in <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getHighResolutionOutputSizes">StreamConfigurationMap#getHighResolutionOutputSizes</a>,<wbr/>
+then the list of resolutions for YUV_<wbr/>420_<wbr/>888 from <a href="https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap.html#getOutputSizes">StreamConfigurationMap#getOutputSizes</a> contains at
+least one resolution &gt;= 8 megapixels,<wbr/> with a minimum frame duration of &lt;= 1/<wbr/>20
+s.<wbr/></p>
+<p>If the device supports the <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#RAW10">ImageFormat#RAW10</a>,<wbr/> <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#RAW12">ImageFormat#RAW12</a>,<wbr/> then those can also be captured at the same rate
+as the maximum-size YUV_<wbr/>420_<wbr/>888 resolution is.<wbr/></p>
+<p>If the device supports the PRIVATE_<wbr/>REPROCESSING capability,<wbr/> then the same guarantees
+as for the YUV_<wbr/>420_<wbr/>888 format also apply to the <a href="https://developer.android.com/reference/android/graphics/ImageFormat.html#PRIVATE">ImageFormat#PRIVATE</a> format.<wbr/></p>
+<p>In addition,<wbr/> the <a href="#static_android.sync.maxLatency">android.<wbr/>sync.<wbr/>max<wbr/>Latency</a> field is guaranted to have a value between 0
+and 4,<wbr/> inclusive.<wbr/> <a href="#static_android.control.aeLockAvailable">android.<wbr/>control.<wbr/>ae<wbr/>Lock<wbr/>Available</a> and <a href="#static_android.control.awbLockAvailable">android.<wbr/>control.<wbr/>awb<wbr/>Lock<wbr/>Available</a>
+are also guaranteed to be <code>true</code> so burst capture with these two locks ON yields
+consistent image output.<wbr/></p></span>
                   </li>
                   <li>
                     <span class="entry_type_enum_name">YUV_REPROCESSING</span>
@@ -24827,11 +24847,6 @@
                     <span class="entry_type_enum_name">LEGACY</span>
                     <span class="entry_type_enum_notes"><p>This camera device is running in backward compatibility mode.<wbr/></p></span>
                   </li>
-                  <li>
-                    <span class="entry_type_enum_name">HIGH_RESOLUTION</span>
-                    <span class="entry_type_enum_notes"><p>This camera device is capable of supporting advanced imaging applications at full rate,<wbr/>
-and additional high-resolution outputs at lower rates.<wbr/></p></span>
-                  </li>
                 </ul>
 
             </td> <!-- entry_type -->
@@ -24858,9 +24873,7 @@
               <p>Camera devices will come in three flavors: LEGACY,<wbr/> LIMITED and FULL.<wbr/></p>
 <p>A FULL device will support below capabilities:</p>
 <ul>
-<li>30fps operation at maximum resolution (== sensor resolution) is preferred,<wbr/> more than
-  20fps is required,<wbr/> for at least uncompressed YUV
-  output.<wbr/> (<a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a> contains BURST_<wbr/>CAPTURE)</li>
+<li>BURST_<wbr/>CAPTURE capability (<a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a> contains BURST_<wbr/>CAPTURE)</li>
 <li>Per frame control (<a href="#static_android.sync.maxLatency">android.<wbr/>sync.<wbr/>max<wbr/>Latency</a> <code>==</code> PER_<wbr/>FRAME_<wbr/>CONTROL)</li>
 <li>Manual sensor control (<a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a> contains MANUAL_<wbr/>SENSOR)</li>
 <li>Manual post-processing control (<a href="#static_android.request.availableCapabilities">android.<wbr/>request.<wbr/>available<wbr/>Capabilities</a> contains
@@ -24868,7 +24881,7 @@
 <li>Arbitrary cropping region (<a href="#static_android.scaler.croppingType">android.<wbr/>scaler.<wbr/>cropping<wbr/>Type</a> <code>==</code> FREEFORM)</li>
 <li>At least 3 processed (but not stalling) format output streams
   (<a href="#static_android.request.maxNumOutputProc">android.<wbr/>request.<wbr/>max<wbr/>Num<wbr/>Output<wbr/>Proc</a> <code>&gt;=</code> 3)</li>
-<li>The required stream configuration defined in <a href="#static_android.scaler.availableStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stream<wbr/>Configurations</a></li>
+<li>The required stream configurations defined in <a href="#static_android.scaler.availableStreamConfigurations">android.<wbr/>scaler.<wbr/>available<wbr/>Stream<wbr/>Configurations</a></li>
 <li>The required exposure time range defined in <a href="#static_android.sensor.info.exposureTimeRange">android.<wbr/>sensor.<wbr/>info.<wbr/>exposure<wbr/>Time<wbr/>Range</a></li>
 <li>The required maxFrameDuration defined in <a href="#static_android.sensor.info.maxFrameDuration">android.<wbr/>sensor.<wbr/>info.<wbr/>max<wbr/>Frame<wbr/>Duration</a></li>
 </ul>
@@ -24888,17 +24901,6 @@
 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>
-<p>A HIGH_<wbr/>RESOLUTION device is equivalent to a FULL device,<wbr/> except that:</p>
-<ul>
-<li>At least one output resolution of 8 megapixels or higher in uncompressed YUV is
-  supported at <code>&gt;=</code> 20 fps.<wbr/></li>
-<li>Maximum-size (sensor resolution) uncompressed YUV is supported  at <code>&gt;=</code> 10
-  fps.<wbr/></li>
-<li>For devices that list the RAW capability and support either RAW10 or RAW12 output,<wbr/>
-  maximum-resolution RAW10 or RAW12 capture will operate at least at the rate of
-  maximum-resolution YUV capture,<wbr/> and at least one supported output resolution of
-  8 megapixels or higher in RAW10 or RAW12 is supported <code>&gt;=</code> 20 fps.<wbr/></li>
-</ul>
             </td>
           </tr>
 
diff --git a/camera/docs/metadata_properties.xml b/camera/docs/metadata_properties.xml
index 32dcc61..fe058da 100644
--- a/camera/docs/metadata_properties.xml
+++ b/camera/docs/metadata_properties.xml
@@ -2547,7 +2547,7 @@
           For each configuration, the fps_max &amp;gt;= 120fps.
           </range>
           <details>
-          When CONSTRAINED_HIGH_SPEED_VIDEO is supported in android.control.availableCapabilities,
+          When CONSTRAINED_HIGH_SPEED_VIDEO is supported in android.request.availableCapabilities,
           this metadata will list the supported high speed video size, fps range and max batch size
           configurations. All the sizes listed in this configuration will be a subset of the sizes
           reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes}
@@ -3087,6 +3087,18 @@
           16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
           generate the thumbnail image. The thumbnail image will always have a smaller Field
           Of View (FOV) than the primary image when aspect ratios differ.
+
+          When an android.jpeg.orientation of non-zero degree is requested,
+          the camera device will handle thumbnail rotation in one of the following ways:
+
+          * Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
+            and keep jpeg and thumbnail image data unrotated.
+          * Rotate the jpeg and thumbnail image data and not set
+            {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
+            case, LIMITED or FULL hardware level devices will report rotated thumnail size in
+            capture result, so the width and height will be interchanged if 90 or 270 degree
+            orientation is requested. LEGACY device will always report unrotated thumbnail
+            size.
           </details>
           <hal_details>
           The HAL must not squeeze or stretch the downscaled primary image to generate thumbnail.
@@ -4500,33 +4512,39 @@
             </value>
             <value optional="true">BURST_CAPTURE
               <notes>
-              The camera device supports capturing maximum-resolution
-              images at &gt;= 20 frames per second, in at least the
-              uncompressed YUV format, when post-processing settings
-              are set to FAST.
+              The camera device supports capturing high-resolution images at &gt;= 20 frames per
+              second, in at least the uncompressed YUV format, when post-processing settings are set
+              to FAST. Additionally, maximum-resolution images can be captured at &gt;= 10 frames
+              per second.  Here, 'high resolution' means at least 8 megapixels, or the maximum
+              resolution of the device, whichever is smaller.
 
-              More specifically, this means that a size matching the
-              camera device's active array size is listed as a
-              supported size for the YUV_420_888 format in
-              android.scaler.streamConfigurationMap, the minimum frame
-              duration for that format and size is &lt;= 1/20 s, and
-              the android.control.aeAvailableTargetFpsRanges entry
-              lists at least one FPS range where the minimum FPS is
-              &gt;= 1 / minimumFrameDuration for the maximum-size
-              YUV_420_888 format.
+              More specifically, this means that a size matching the camera device's active array
+              size is listed as a supported size for the {@link
+              android.graphics.ImageFormat#YUV_420_888} format in either {@link
+              android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes} or {@link
+              android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes},
+              with a minimum frame duration for that format and size of either &lt;= 1/20 s, or
+              &lt;= 1/10 s, respectively; and the android.control.aeAvailableTargetFpsRanges entry
+              lists at least one FPS range where the minimum FPS is &gt;= 1 / minimumFrameDuration
+              for the maximum-size YUV_420_888 format.  If that maximum size is listed in {@link
+              android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes},
+              then the list of resolutions for YUV_420_888 from {@link
+              android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes} contains at
+              least one resolution &gt;= 8 megapixels, with a minimum frame duration of &lt;= 1/20
+              s.
 
-              In addition, the android.sync.maxLatency field is
-              guaranted to have a value between 0 and 4, inclusive.
-              android.control.aeLockAvailable and
-              android.control.awbLockAvailable are also guaranteed
-              to be `true` so burst capture with these two locks ON
-              yields consistent image output.
+              If the device supports the {@link android.graphics.ImageFormat#RAW10}, {@link
+              android.graphics.ImageFormat#RAW12}, then those can also be captured at the same rate
+              as the maximum-size YUV_420_888 resolution is.
 
-              On a camera device that reports the HIGH_RESOLUTION hardware
-              level, meaning the device supports very large capture sizes,
-              BURST_CAPTURE means that at least 8-megapixel images can be
-              captured at `&gt;=` 20 fps, and maximum-resolution images can be
-              captured at `&gt;=` 10 fps.
+              If the device supports the PRIVATE_REPROCESSING capability, then the same guarantees
+              as for the YUV_420_888 format also apply to the {@link
+              android.graphics.ImageFormat#PRIVATE} format.
+
+              In addition, the android.sync.maxLatency field is guaranted to have a value between 0
+              and 4, inclusive. android.control.aeLockAvailable and android.control.awbLockAvailable
+              are also guaranteed to be `true` so burst capture with these two locks ON yields
+              consistent image output.
               </notes>
             </value>
             <value optional="true">YUV_REPROCESSING
@@ -7924,13 +7942,6 @@
               This camera device is running in backward compatibility mode.
               </notes>
             </value>
-            <value>
-              HIGH_RESOLUTION
-              <notes>
-              This camera device is capable of supporting advanced imaging applications at full rate,
-              and additional high-resolution outputs at lower rates.
-              </notes>
-            </value>
           </enum>
           <description>
           Generally classifies the overall set of the camera device functionality.
@@ -7940,9 +7951,7 @@
 
           A FULL device will support below capabilities:
 
-          * 30fps operation at maximum resolution (== sensor resolution) is preferred, more than
-            20fps is required, for at least uncompressed YUV
-            output. (android.request.availableCapabilities contains BURST_CAPTURE)
+          * BURST_CAPTURE capability (android.request.availableCapabilities contains BURST_CAPTURE)
           * Per frame control (android.sync.maxLatency `==` PER_FRAME_CONTROL)
           * Manual sensor control (android.request.availableCapabilities contains MANUAL_SENSOR)
           * Manual post-processing control (android.request.availableCapabilities contains
@@ -7950,7 +7959,7 @@
           * Arbitrary cropping region (android.scaler.croppingType `==` FREEFORM)
           * At least 3 processed (but not stalling) format output streams
             (android.request.maxNumOutputProc `&gt;=` 3)
-          * The required stream configuration defined in android.scaler.availableStreamConfigurations
+          * The required stream configurations defined in android.scaler.availableStreamConfigurations
           * The required exposure time range defined in android.sensor.info.exposureTimeRange
           * The required maxFrameDuration defined in android.sensor.info.maxFrameDuration
 
@@ -7972,17 +7981,6 @@
 
           Each higher level supports everything the lower level supports
           in this order: FULL `&gt;` LIMITED `&gt;` LEGACY.
-
-          A HIGH_RESOLUTION device is equivalent to a FULL device, except that:
-
-          * At least one output resolution of 8 megapixels or higher in uncompressed YUV is
-            supported at `&gt;=` 20 fps.
-          * Maximum-size (sensor resolution) uncompressed YUV is supported  at `&gt;=` 10
-            fps.
-          * For devices that list the RAW capability and support either RAW10 or RAW12 output,
-            maximum-resolution RAW10 or RAW12 capture will operate at least at the rate of
-            maximum-resolution YUV capture, and at least one supported output resolution of
-            8 megapixels or higher in RAW10 or RAW12 is supported `&gt;=` 20 fps.
           </details>
           <hal_details>
           The camera 3 HAL device can implement one of two possible
diff --git a/camera/include/system/camera_metadata_tags.h b/camera/include/system/camera_metadata_tags.h
index 42a7f0f..0585701 100644
--- a/camera/include/system/camera_metadata_tags.h
+++ b/camera/include/system/camera_metadata_tags.h
@@ -878,7 +878,6 @@
     ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED,
     ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL,
     ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY,
-    ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_HIGH_RESOLUTION,
 } camera_metadata_enum_android_info_supported_hardware_level_t;
 
 
diff --git a/camera/src/camera_metadata_tag_info.c b/camera/src/camera_metadata_tag_info.c
index 8b896ec..f8cf617 100644
--- a/camera/src/camera_metadata_tag_info.c
+++ b/camera/src/camera_metadata_tag_info.c
@@ -2448,10 +2448,6 @@
                     msg = "LEGACY";
                     ret = 0;
                     break;
-                case ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_HIGH_RESOLUTION:
-                    msg = "HIGH_RESOLUTION";
-                    ret = 0;
-                    break;
                 default:
                     msg = "error: enum value out of range";
             }