Camera: Connect activity resizing state to camera service
Wire up WM activity AR mismatch query to camera clients
Test: CTS continues to pass
Bug: 134631897
Change-Id: Idad6dd4536a42f0ffec37a2689a3cd8690b90e90
diff --git a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp
index 0557fcc..76927c0 100644
--- a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp
+++ b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp
@@ -120,6 +120,21 @@
proxyBinder->pingForUserUpdate();
}
+bool CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(
+ String16 packageName, int sensorOrientation, int lensFacing) {
+ sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy();
+ if (proxyBinder == nullptr) return true;
+ bool ret = true;
+ auto status = proxyBinder->isRotateAndCropOverrideNeeded(packageName, sensorOrientation,
+ lensFacing, &ret);
+ if (!status.isOk()) {
+ ALOGE("%s: Failed during top activity orientation query: %s", __FUNCTION__,
+ status.exceptionMessage().c_str());
+ }
+
+ return ret;
+}
+
void CameraServiceProxyWrapper::updateProxyDeviceState(const CameraSessionStats& sessionStats) {
sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy();
if (proxyBinder == nullptr) return;
diff --git a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
index 9525935..ad9db68 100644
--- a/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
+++ b/services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h
@@ -90,6 +90,10 @@
// Ping camera service proxy for user update
static void pingCameraServiceProxy();
+
+ // Check whether the current top activity needs a rotate and crop override.
+ static bool isRotateAndCropOverrideNeeded(String16 packageName, int sensorOrientation,
+ int lensFacing);
};
} // android