CameraService: Implement SCALER_ROTATE_AND_CROP_AUTO, part 1

When an app sets SCALER_ROTATE_AND_CROP to AUTO, the camera service
needs to select the right ROTATE_AND_CROP mode given the application
UI state at the moment, received from the window manager.

In addition, some of the metadata in the active array coordinate
system needs to be converted to/from the cropped+rotated coordinate
system to ensure roundtripping UI information works as before.

Also ensure that the available rotate and crop metadata field is
always available, with a value of NONE if nothing else.

This commit adds support for doing the coordinate transforms and
overriding AUTO to a concrete value; it does not wire up a connection
to another system service to receive the correct override value, but
does add a command to set the override value for all current camera
clients.

Test: New CTS tests pass, unit tests for RotateAndCropMapper pass
Bug: 134631897
Change-Id: Icc45530e2cfbaf838a1e4d04e4fd2aef8122e8e1
diff --git a/services/camera/libcameraservice/device3/InFlightRequest.h b/services/camera/libcameraservice/device3/InFlightRequest.h
index ceeaa71..424043b 100644
--- a/services/camera/libcameraservice/device3/InFlightRequest.h
+++ b/services/camera/libcameraservice/device3/InFlightRequest.h
@@ -91,6 +91,9 @@
     // Indicates a ZSL capture request
     bool zslCapture;
 
+    // Indicates that ROTATE_AND_CROP was set to AUTO
+    bool rotateAndCropAuto;
+
     // Requested camera ids (both logical and physical) with zoomRatio != 1.0f
     std::set<std::string> cameraIdsWithZoom;
 
@@ -112,13 +115,14 @@
             maxExpectedDuration(kDefaultExpectedDuration),
             skipResultMetadata(false),
             stillCapture(false),
-            zslCapture(false) {
+            zslCapture(false),
+            rotateAndCropAuto(false) {
     }
 
     InFlightRequest(int numBuffers, CaptureResultExtras extras, bool hasInput,
             bool hasAppCallback, nsecs_t maxDuration,
             const std::set<String8>& physicalCameraIdSet, bool isStillCapture,
-            bool isZslCapture, const std::set<std::string>& idsWithZoom,
+            bool isZslCapture, bool rotateAndCropAuto, const std::set<std::string>& idsWithZoom,
             const SurfaceMap& outSurfaces = SurfaceMap{}) :
             shutterTimestamp(0),
             sensorTimestamp(0),
@@ -133,6 +137,7 @@
             physicalCameraIds(physicalCameraIdSet),
             stillCapture(isStillCapture),
             zslCapture(isZslCapture),
+            rotateAndCropAuto(rotateAndCropAuto),
             cameraIdsWithZoom(idsWithZoom),
             outputSurfaces(outSurfaces) {
     }