Loading camera/aidl/android/hardware/ICameraServiceProxy.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -37,8 +37,11 @@ interface ICameraServiceProxy oneway void notifyCameraState(in CameraSessionStats cameraSessionStats); /** * Reports whether the top activity needs a rotate and crop override. * Returns the necessary rotate and crop override for the top activity which * will be one of ({@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_NONE}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_90}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_180}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_270}). */ boolean isRotateAndCropOverrideNeeded(String packageName, int sensorOrientation, int lensFacing); int getRotateAndCropOverride(String packageName, int lensFacing); } services/camera/libcameraservice/CameraService.cpp +6 −11 Original line number Diff line number Diff line Loading @@ -1834,10 +1834,9 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8& // Set rotate-and-crop override behavior if (mOverrideRotateAndCropMode != ANDROID_SCALER_ROTATE_AND_CROP_AUTO) { client->setRotateAndCropOverride(mOverrideRotateAndCropMode); } else if ((effectiveApiLevel == API_2) && CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(clientPackageName, orientation, facing) ) { client->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90); } else if (effectiveApiLevel == API_2) { client->setRotateAndCropOverride(CameraServiceProxyWrapper::getRotateAndCropOverride( clientPackageName, facing)); } // Set camera muting behavior Loading Loading @@ -2218,13 +2217,9 @@ Status CameraService::notifyDisplayConfigurationChange() { if (current != nullptr) { const auto basicClient = current->getValue(); if (basicClient.get() != nullptr && basicClient->canCastToApiClient(API_2)) { if (CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded( basicClient->getPackageName(), basicClient->getCameraOrientation(), basicClient->getCameraFacing())) { basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90); } else { basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_NONE); } basicClient->setRotateAndCropOverride( CameraServiceProxyWrapper::getRotateAndCropOverride( basicClient->getPackageName(), basicClient->getCameraFacing())); } } } Loading services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -120,13 +120,11 @@ void CameraServiceProxyWrapper::pingCameraServiceProxy() { proxyBinder->pingForUserUpdate(); } bool CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded( String16 packageName, int sensorOrientation, int lensFacing) { int CameraServiceProxyWrapper::getRotateAndCropOverride(String16 packageName, int lensFacing) { sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy(); if (proxyBinder == nullptr) return true; bool ret = true; auto status = proxyBinder->isRotateAndCropOverrideNeeded(packageName, sensorOrientation, lensFacing, &ret); int ret = 0; auto status = proxyBinder->getRotateAndCropOverride(packageName, lensFacing, &ret); if (!status.isOk()) { ALOGE("%s: Failed during top activity orientation query: %s", __FUNCTION__, status.exceptionMessage().c_str()); Loading services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h +2 −3 Original line number Diff line number Diff line Loading @@ -91,9 +91,8 @@ public: // 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); // Return the current top activity rotate and crop override. static int getRotateAndCropOverride(String16 packageName, int lensFacing); }; } // android Loading Loading
camera/aidl/android/hardware/ICameraServiceProxy.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -37,8 +37,11 @@ interface ICameraServiceProxy oneway void notifyCameraState(in CameraSessionStats cameraSessionStats); /** * Reports whether the top activity needs a rotate and crop override. * Returns the necessary rotate and crop override for the top activity which * will be one of ({@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_NONE}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_90}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_180}, * {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_270}). */ boolean isRotateAndCropOverrideNeeded(String packageName, int sensorOrientation, int lensFacing); int getRotateAndCropOverride(String packageName, int lensFacing); }
services/camera/libcameraservice/CameraService.cpp +6 −11 Original line number Diff line number Diff line Loading @@ -1834,10 +1834,9 @@ Status CameraService::connectHelper(const sp<CALLBACK>& cameraCb, const String8& // Set rotate-and-crop override behavior if (mOverrideRotateAndCropMode != ANDROID_SCALER_ROTATE_AND_CROP_AUTO) { client->setRotateAndCropOverride(mOverrideRotateAndCropMode); } else if ((effectiveApiLevel == API_2) && CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded(clientPackageName, orientation, facing) ) { client->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90); } else if (effectiveApiLevel == API_2) { client->setRotateAndCropOverride(CameraServiceProxyWrapper::getRotateAndCropOverride( clientPackageName, facing)); } // Set camera muting behavior Loading Loading @@ -2218,13 +2217,9 @@ Status CameraService::notifyDisplayConfigurationChange() { if (current != nullptr) { const auto basicClient = current->getValue(); if (basicClient.get() != nullptr && basicClient->canCastToApiClient(API_2)) { if (CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded( basicClient->getPackageName(), basicClient->getCameraOrientation(), basicClient->getCameraFacing())) { basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_90); } else { basicClient->setRotateAndCropOverride(ANDROID_SCALER_ROTATE_AND_CROP_NONE); } basicClient->setRotateAndCropOverride( CameraServiceProxyWrapper::getRotateAndCropOverride( basicClient->getPackageName(), basicClient->getCameraFacing())); } } } Loading
services/camera/libcameraservice/utils/CameraServiceProxyWrapper.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -120,13 +120,11 @@ void CameraServiceProxyWrapper::pingCameraServiceProxy() { proxyBinder->pingForUserUpdate(); } bool CameraServiceProxyWrapper::isRotateAndCropOverrideNeeded( String16 packageName, int sensorOrientation, int lensFacing) { int CameraServiceProxyWrapper::getRotateAndCropOverride(String16 packageName, int lensFacing) { sp<ICameraServiceProxy> proxyBinder = getCameraServiceProxy(); if (proxyBinder == nullptr) return true; bool ret = true; auto status = proxyBinder->isRotateAndCropOverrideNeeded(packageName, sensorOrientation, lensFacing, &ret); int ret = 0; auto status = proxyBinder->getRotateAndCropOverride(packageName, lensFacing, &ret); if (!status.isOk()) { ALOGE("%s: Failed during top activity orientation query: %s", __FUNCTION__, status.exceptionMessage().c_str()); Loading
services/camera/libcameraservice/utils/CameraServiceProxyWrapper.h +2 −3 Original line number Diff line number Diff line Loading @@ -91,9 +91,8 @@ public: // 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); // Return the current top activity rotate and crop override. static int getRotateAndCropOverride(String16 packageName, int lensFacing); }; } // android Loading