Camera: Enable the rotate&crop heuristics in the legacy shim layer
Enable the rotate&crop heuristics within the legacy shim layer.
To avoid regressions, calls to "setDisplayOrientation" must be handled
differently. The client value passed there takes in to account both
the sensor orientation as well as the necessary extra display
compensation. The heuristics on the other hand will only include the
necessary display adjustment. In order to have consistent behavior
with the Camera2 path, the client display orientation value will
be ignored and we will only use the sensor orientation calculated
transformation instead.
Bug: 228947590
Test: Manual using legacy camera application
Change-Id: I774dbc63c3bcdc8757b3e6b667712452b42426ef
diff --git a/services/camera/libcameraservice/api1/Camera2Client.h b/services/camera/libcameraservice/api1/Camera2Client.h
index 64ab8ff..58e0e19 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.h
+++ b/services/camera/libcameraservice/api1/Camera2Client.h
@@ -238,6 +238,13 @@
status_t initializeImpl(TProviderPtr providerPtr, const String8& monitorTags);
bool isZslEnabledInStillTemplate();
+ // The current rotate & crop mode passed by camera service
+ uint8_t mRotateAndCropMode;
+ // Contains the preview stream transformation that would normally be applied
+ // when the display rotation is 0
+ int mRotateAndCropPreviewTransform;
+ // Flag indicating camera device support for the rotate & crop interface
+ bool mRotateAndCropIsSupported;
mutable Mutex mLatestRequestMutex;
Condition mLatestRequestSignal;