Camera: Filter small JPEG sizes based on targetSdkVersion
To maintain backward compatbility, filter out small (<1080p) JPEG sizes
for Performance Class 12 primary cameras in camera service if the
application targets sdk version 31.
Maintain old behavior for applications targetting older sdk version.
Also remove some redundant code in CameraProviderManager.
Test: Camera CTS
Bug: 187913092
Change-Id: I302fb90e331dc9c7da26f51ab99ab150bba68493
diff --git a/camera/aidl/android/hardware/ICameraService.aidl b/camera/aidl/android/hardware/ICameraService.aidl
index 6e82968..78a77d4 100644
--- a/camera/aidl/android/hardware/ICameraService.aidl
+++ b/camera/aidl/android/hardware/ICameraService.aidl
@@ -82,7 +82,8 @@
ICamera connect(ICameraClient client,
int cameraId,
String opPackageName,
- int clientUid, int clientPid);
+ int clientUid, int clientPid,
+ int targetSdkVersion);
/**
* Open a camera device through the new camera API
@@ -92,7 +93,8 @@
String cameraId,
String opPackageName,
@nullable String featureId,
- int clientUid, int oomScoreOffset);
+ int clientUid, int oomScoreOffset,
+ int targetSdkVersion);
/**
* Add listener for changes to camera device and flashlight state.
@@ -114,13 +116,15 @@
* corresponding camera ids.
*
* @param sessions the set of camera id and session configuration pairs to be queried.
+ * @param targetSdkVersion the target sdk level of the application calling this function.
* @return true - the set of concurrent camera id and stream combinations is supported.
* false - the set of concurrent camera id and stream combinations is not supported
* OR the method was called with a set of camera ids not returned by
* getConcurrentCameraIds().
*/
boolean isConcurrentSessionConfigurationSupported(
- in CameraIdAndSessionConfiguration[] sessions);
+ in CameraIdAndSessionConfiguration[] sessions,
+ int targetSdkVersion);
/**
* Remove listener for changes to camera device and flashlight state.
@@ -131,7 +135,7 @@
* Read the static camera metadata for a camera device.
* Only supported for device HAL versions >= 3.2
*/
- CameraMetadataNative getCameraCharacteristics(String cameraId);
+ CameraMetadataNative getCameraCharacteristics(String cameraId, int targetSdkVersion);
/**
* Read in the vendor tag descriptors from the camera module HAL.