Loading core/java/android/hardware/camera2/CameraCharacteristics.java +14 −7 Original line number Diff line number Diff line Loading @@ -2511,9 +2511,9 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>Not all output formats may be supported in a configuration with * an input stream of a particular format. For more details, see * android.scaler.availableInputOutputFormatsMap.</p> * <p>The following table describes the minimum required output stream * configurations based on the hardware level * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}), prior to Android 12:</p> * <p>For applications targeting SDK version older than 31, the following table * describes the minimum required output stream configurations based on the hardware level * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p> * <table> * <thead> * <tr> Loading Loading @@ -2574,10 +2574,13 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * </tr> * </tbody> * </table> * <p>Starting from Android 12, the camera device may not support JPEG sizes smaller than the * minimum of 1080p and the camera sensor active array size. The requirements for * IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. This new minimum required output * stream configurations are illustrated by the table below:</p> * <p>For applications targeting SDK version 31 or newer, if the mobile device declares to be * {@link android.os.Build.VERSION_CDOES.MEDIA_PERFORMANCE_CLASS media performance class} S, * the primary camera devices (first rear/front camera in the camera ID list) will not * support JPEG sizes smaller than 1080p. If the application configures a JPEG stream * smaller than 1080p, the camera device will round up the JPEG image size to at least * 1080p. The requirements for IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. * This new minimum required output stream configurations are illustrated by the table below:</p> * <table> * <thead> * <tr> Loading Loading @@ -2644,6 +2647,10 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * </tr> * </tbody> * </table> * <p>For applications targeting SDK version 31 or newer, if the mobile device doesn't declare * to be media performance class S, or if the camera device isn't a primary rear/front * camera, the minimum required output stream configurations are the same as for applications * targeting SDK version older than 31.</p> * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional * mandatory stream configurations on a per-capability basis.</p> * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for Loading core/java/android/hardware/camera2/CameraManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ public final class CameraManager { @NonNull Map<String, SessionConfiguration> cameraIdAndSessionConfig) throws CameraAccessException { return CameraManagerGlobal.get().isConcurrentSessionConfigurationSupported( cameraIdAndSessionConfig); cameraIdAndSessionConfig, mContext.getApplicationInfo().targetSdkVersion); } /** Loading Loading @@ -413,7 +413,8 @@ public final class CameraManager { try { for (String physicalCameraId : physicalCameraIds) { CameraMetadataNative physicalCameraInfo = cameraService.getCameraCharacteristics(physicalCameraId); cameraService.getCameraCharacteristics(physicalCameraId, mContext.getApplicationInfo().targetSdkVersion); StreamConfiguration[] configs = physicalCameraInfo.get( CameraCharacteristics. SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS); Loading Loading @@ -472,7 +473,8 @@ public final class CameraManager { try { Size displaySize = getDisplaySize(); CameraMetadataNative info = cameraService.getCameraCharacteristics(cameraId); CameraMetadataNative info = cameraService.getCameraCharacteristics(cameraId, mContext.getApplicationInfo().targetSdkVersion); try { info.setCameraId(Integer.parseInt(cameraId)); } catch (NumberFormatException e) { Loading Loading @@ -590,7 +592,7 @@ public final class CameraManager { } cameraUser = cameraService.connectDevice(callbacks, cameraId, mContext.getOpPackageName(), mContext.getAttributionTag(), uid, oomScoreOffset); oomScoreOffset, mContext.getApplicationInfo().targetSdkVersion); } catch (ServiceSpecificException e) { if (e.errorCode == ICameraService.ERROR_DEPRECATED_HAL) { throw new AssertionError("Should've gone down the shim path"); Loading Loading @@ -1613,8 +1615,8 @@ public final class CameraManager { } public boolean isConcurrentSessionConfigurationSupported( @NonNull Map<String, SessionConfiguration> cameraIdsAndSessionConfigurations) throws CameraAccessException { @NonNull Map<String, SessionConfiguration> cameraIdsAndSessionConfigurations, int targetSdkVersion) throws CameraAccessException { if (cameraIdsAndSessionConfigurations == null) { throw new IllegalArgumentException("cameraIdsAndSessionConfigurations was null"); Loading Loading @@ -1650,7 +1652,7 @@ public final class CameraManager { } try { return mCameraService.isConcurrentSessionConfigurationSupported( cameraIdsAndConfigs); cameraIdsAndConfigs, targetSdkVersion); } catch (ServiceSpecificException e) { throwAsPublicException(e); } catch (RemoteException e) { Loading core/jni/android_hardware_Camera.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -566,8 +566,9 @@ static jint android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz, env->ReleaseStringChars(clientPackageName, reinterpret_cast<const jchar*>(rawClientName)); sp<Camera> camera = Camera::connect(cameraId, clientName, Camera::USE_CALLING_UID, Camera::USE_CALLING_PID); int targetSdkVersion = android_get_application_target_sdk_version(); sp<Camera> camera = Camera::connect(cameraId, clientName, Camera::USE_CALLING_UID, Camera::USE_CALLING_PID, targetSdkVersion); if (camera == NULL) { return -EACCES; } Loading media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -158,7 +158,8 @@ public class CameraBinderTest extends AndroidTestCase { ICamera cameraUser = mUtils.getCameraService() .connect(dummyCallbacks, cameraId, clientPackageName, ICameraService.USE_CALLING_UID, ICameraService.USE_CALLING_PID); ICameraService.USE_CALLING_PID, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", cameraId), cameraUser); Log.v(TAG, String.format("Camera %s connected", cameraId)); Loading Loading @@ -262,7 +263,8 @@ public class CameraBinderTest extends AndroidTestCase { mUtils.getCameraService().connectDevice( dummyCallbacks, String.valueOf(cameraId), clientPackageName, clientAttributionTag, ICameraService.USE_CALLING_UID, 0 /*oomScoreOffset*/); ICameraService.USE_CALLING_UID, 0 /*oomScoreOffset*/, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", cameraId), cameraUser); Log.v(TAG, String.format("Camera %s connected", cameraId)); Loading media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -244,7 +244,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { mCameraUser = mUtils.getCameraService().connectDevice(mMockCb, mCameraId, clientPackageName, clientAttributionTag, ICameraService.USE_CALLING_UID, /*oomScoreOffset*/0); /*oomScoreOffset*/0, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", mCameraId), mCameraUser); mHandlerThread = new HandlerThread(TAG); mHandlerThread.start(); Loading Loading @@ -416,7 +416,8 @@ public class CameraDeviceBinderTest extends AndroidTestCase { @SmallTest public void testCameraCharacteristics() throws RemoteException { CameraMetadataNative info = mUtils.getCameraService().getCameraCharacteristics(mCameraId); CameraMetadataNative info = mUtils.getCameraService().getCameraCharacteristics(mCameraId, getContext().getApplicationInfo().targetSdkVersion); assertFalse(info.isEmpty()); assertNotNull(info.get(CameraCharacteristics.SCALER_AVAILABLE_FORMATS)); Loading Loading
core/java/android/hardware/camera2/CameraCharacteristics.java +14 −7 Original line number Diff line number Diff line Loading @@ -2511,9 +2511,9 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>Not all output formats may be supported in a configuration with * an input stream of a particular format. For more details, see * android.scaler.availableInputOutputFormatsMap.</p> * <p>The following table describes the minimum required output stream * configurations based on the hardware level * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}), prior to Android 12:</p> * <p>For applications targeting SDK version older than 31, the following table * describes the minimum required output stream configurations based on the hardware level * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p> * <table> * <thead> * <tr> Loading Loading @@ -2574,10 +2574,13 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * </tr> * </tbody> * </table> * <p>Starting from Android 12, the camera device may not support JPEG sizes smaller than the * minimum of 1080p and the camera sensor active array size. The requirements for * IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. This new minimum required output * stream configurations are illustrated by the table below:</p> * <p>For applications targeting SDK version 31 or newer, if the mobile device declares to be * {@link android.os.Build.VERSION_CDOES.MEDIA_PERFORMANCE_CLASS media performance class} S, * the primary camera devices (first rear/front camera in the camera ID list) will not * support JPEG sizes smaller than 1080p. If the application configures a JPEG stream * smaller than 1080p, the camera device will round up the JPEG image size to at least * 1080p. The requirements for IMPLEMENTATION_DEFINED and YUV_420_888 stay the same. * This new minimum required output stream configurations are illustrated by the table below:</p> * <table> * <thead> * <tr> Loading Loading @@ -2644,6 +2647,10 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * </tr> * </tbody> * </table> * <p>For applications targeting SDK version 31 or newer, if the mobile device doesn't declare * to be media performance class S, or if the camera device isn't a primary rear/front * camera, the minimum required output stream configurations are the same as for applications * targeting SDK version older than 31.</p> * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional * mandatory stream configurations on a per-capability basis.</p> * <p>Exception on 176x144 (QCIF) resolution: camera devices usually have a fixed capability for Loading
core/java/android/hardware/camera2/CameraManager.java +9 −7 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ public final class CameraManager { @NonNull Map<String, SessionConfiguration> cameraIdAndSessionConfig) throws CameraAccessException { return CameraManagerGlobal.get().isConcurrentSessionConfigurationSupported( cameraIdAndSessionConfig); cameraIdAndSessionConfig, mContext.getApplicationInfo().targetSdkVersion); } /** Loading Loading @@ -413,7 +413,8 @@ public final class CameraManager { try { for (String physicalCameraId : physicalCameraIds) { CameraMetadataNative physicalCameraInfo = cameraService.getCameraCharacteristics(physicalCameraId); cameraService.getCameraCharacteristics(physicalCameraId, mContext.getApplicationInfo().targetSdkVersion); StreamConfiguration[] configs = physicalCameraInfo.get( CameraCharacteristics. SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS); Loading Loading @@ -472,7 +473,8 @@ public final class CameraManager { try { Size displaySize = getDisplaySize(); CameraMetadataNative info = cameraService.getCameraCharacteristics(cameraId); CameraMetadataNative info = cameraService.getCameraCharacteristics(cameraId, mContext.getApplicationInfo().targetSdkVersion); try { info.setCameraId(Integer.parseInt(cameraId)); } catch (NumberFormatException e) { Loading Loading @@ -590,7 +592,7 @@ public final class CameraManager { } cameraUser = cameraService.connectDevice(callbacks, cameraId, mContext.getOpPackageName(), mContext.getAttributionTag(), uid, oomScoreOffset); oomScoreOffset, mContext.getApplicationInfo().targetSdkVersion); } catch (ServiceSpecificException e) { if (e.errorCode == ICameraService.ERROR_DEPRECATED_HAL) { throw new AssertionError("Should've gone down the shim path"); Loading Loading @@ -1613,8 +1615,8 @@ public final class CameraManager { } public boolean isConcurrentSessionConfigurationSupported( @NonNull Map<String, SessionConfiguration> cameraIdsAndSessionConfigurations) throws CameraAccessException { @NonNull Map<String, SessionConfiguration> cameraIdsAndSessionConfigurations, int targetSdkVersion) throws CameraAccessException { if (cameraIdsAndSessionConfigurations == null) { throw new IllegalArgumentException("cameraIdsAndSessionConfigurations was null"); Loading Loading @@ -1650,7 +1652,7 @@ public final class CameraManager { } try { return mCameraService.isConcurrentSessionConfigurationSupported( cameraIdsAndConfigs); cameraIdsAndConfigs, targetSdkVersion); } catch (ServiceSpecificException e) { throwAsPublicException(e); } catch (RemoteException e) { Loading
core/jni/android_hardware_Camera.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -566,8 +566,9 @@ static jint android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz, env->ReleaseStringChars(clientPackageName, reinterpret_cast<const jchar*>(rawClientName)); sp<Camera> camera = Camera::connect(cameraId, clientName, Camera::USE_CALLING_UID, Camera::USE_CALLING_PID); int targetSdkVersion = android_get_application_target_sdk_version(); sp<Camera> camera = Camera::connect(cameraId, clientName, Camera::USE_CALLING_UID, Camera::USE_CALLING_PID, targetSdkVersion); if (camera == NULL) { return -EACCES; } Loading
media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraBinderTest.java +4 −2 Original line number Diff line number Diff line Loading @@ -158,7 +158,8 @@ public class CameraBinderTest extends AndroidTestCase { ICamera cameraUser = mUtils.getCameraService() .connect(dummyCallbacks, cameraId, clientPackageName, ICameraService.USE_CALLING_UID, ICameraService.USE_CALLING_PID); ICameraService.USE_CALLING_PID, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", cameraId), cameraUser); Log.v(TAG, String.format("Camera %s connected", cameraId)); Loading Loading @@ -262,7 +263,8 @@ public class CameraBinderTest extends AndroidTestCase { mUtils.getCameraService().connectDevice( dummyCallbacks, String.valueOf(cameraId), clientPackageName, clientAttributionTag, ICameraService.USE_CALLING_UID, 0 /*oomScoreOffset*/); ICameraService.USE_CALLING_UID, 0 /*oomScoreOffset*/, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", cameraId), cameraUser); Log.v(TAG, String.format("Camera %s connected", cameraId)); Loading
media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/integration/CameraDeviceBinderTest.java +3 −2 Original line number Diff line number Diff line Loading @@ -244,7 +244,7 @@ public class CameraDeviceBinderTest extends AndroidTestCase { mCameraUser = mUtils.getCameraService().connectDevice(mMockCb, mCameraId, clientPackageName, clientAttributionTag, ICameraService.USE_CALLING_UID, /*oomScoreOffset*/0); /*oomScoreOffset*/0, getContext().getApplicationInfo().targetSdkVersion); assertNotNull(String.format("Camera %s was null", mCameraId), mCameraUser); mHandlerThread = new HandlerThread(TAG); mHandlerThread.start(); Loading Loading @@ -416,7 +416,8 @@ public class CameraDeviceBinderTest extends AndroidTestCase { @SmallTest public void testCameraCharacteristics() throws RemoteException { CameraMetadataNative info = mUtils.getCameraService().getCameraCharacteristics(mCameraId); CameraMetadataNative info = mUtils.getCameraService().getCameraCharacteristics(mCameraId, getContext().getApplicationInfo().targetSdkVersion); assertFalse(info.isEmpty()); assertNotNull(info.get(CameraCharacteristics.SCALER_AVAILABLE_FORMATS)); Loading