Implement device awareness in camera service
- Modify ICameraServiceListener to pass device id (i.e., the id of the device owning the camera, for virtual camera this would be the id of the virtual device, and for real cameras this would be Context#DEVICE_ID_DEFAULT) and the mapped camera id (for virtual devices, the back and front virtual cameras of that device would have 0 and 1 respectively as their mapped camera id, and for real cameras this would be their actual camera id) in the callbacks. Cameraserver exposes vitual cameras only to callers having context associated with a custom policy virtual device. - Modify ICameraService to accept device id and device policy for binder calls related to camera operations. Based on these, cameraserver maps the input camera id into a virtual camera id (if applicable). - Modify virtual camera HAL service to pass the device id of virtual cameras using the metadata key ANDROID_INFO_DEVICE_ID. - This change adds device-awareness to both camera2 and legacy camera API's. - This change prevents camera injection, session params injection, and package name based cameraId-remapping if a virtual camera is involved. - This change modifies the NDK implementation to ignore callbacks for non-default device id's. So virtual cameras are not accessible using the NDK with this change (if the feature flag for camera device awareness is enabled). Device awareness for camera NDK will be added in a future CL. Test: atest CtsVirtualDevicesCameraTestCases Bug: 291736219 Change-Id: Iffe2a2e337a9e5801b84495d3ce1e8a1584b4993
Loading
Please register or sign in to comment