Implement CameraIdRemapping for API1
- For API1, there's already two Ids: API1CameraId and a HAL camera Id, and they might be different. We only remap the HAL Camera Id, and leave the API1 camera ID untouched (since that is what the app sees). In that sense, there was already a "remapping" from app_camera_id to hal_camera_id in API_1, we just remap that hal_camera_id to different hal_camera_id_2. In addition: - Prevent remapping cameras for system/vendor uids. - Properly implement disconnect() for API1 & API2 clients. This includes: - Clearing binder identity before we call disconnect(), so that the PID checks in disconnect() impl pass. - Not holding the mCameraIdRemappingLock while calling disconnect(), since it can leads to a deadlock, given a call path of disconnect -> finishCameraOps -> updateStatus, which also requires mCameraIdRemappingLock. - Previously, disconnect() for API_2 clients was likely being triggered through a side channel, (e.g. impl in CameraDeviceClient after being sent an ERROR_CAMERA_DEVICE), which didn't happen for API_1 clients Bug: 286287541 Test: Manually tested E2E for API1 and API2 apps. Change-Id: I3985a3ddfb0ea1e012b078089dd76133a7b1b7e9 Merged-In: I82b92e2c94209475f0da0b48c2993ff3b0ac7f28 Merged-In: I1e166e59e9441d8c7fe030320127abcfb373e428
Loading
Please register or sign in to comment