AIDL's NativeHandle do not have a concept of unowned file
descriptors. If a NativeHandle object is created with an
fd, NativeHandle implicitly assumes ownership of the fd.
When passing fds over binder, ExternalCameraHAL used
makeToAidl which which accidentally transferred ownership
to the AIDL objects. Additionally, NativeHandles close
owned fds on destruction, which led to multiple closure
of fences.
This CL changes the logic to use dupToAidl to ensure that
NativeHandle objects are given ownership of a duped fds
and don't interfere with any of the fds used for internal
bookkeeping.
Bug: 313115623
Test: Verified by partner that ExternalCameraHAL no longer double closes fds.
Merged-In: Ic406634de6f22a290abb414e80a7747927368b68
Change-Id: Ic406634de6f22a290abb414e80a7747927368b68
Revert submission 24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Reason for revert: 32-bit TV build is fixed with `%zu` instead of `%lu` for size_t argument.
Reverted changes: /q/submissionid:24913374-revert-24747509-camera_fail2-OVHUVTAXRP
Change-Id: I16287ce2dbea034db41450a3a5e9c3f729e76335
Revert submission 24747509-camera_fail2
Reason for revert: DroidMonitor-triggered revert due to breakage
b/302990858.
This may cause CtsAppOpsTestCases b/300115646 to fail again,
unfortunately (b/300115646).
Bug: 302990858
Reverted changes: /q/submissionid:24747509-camera_fail2
Change-Id: I0191b3ee88846f5b2c6e37ebd6be6d1369d9dba9
HIDL mapper HAL is deprecated and instead of adding more support for the
new replacement explicitly, we can move the GraphicBufferMapper which
handles all of the backwards compatbility with the HIDL HALs for us.
Test: atest CtsCameraTestCases CtsAppOpsTestCases
Bug: 285605852
Bug: 300115646
Change-Id: Ib97e429a0f3dd1c66ec008fbf3860c9c5667bddd
Android T migrated the HAL interface to AIDL, but the reference HAL
was never updated to use AIDL. This CL migrates the reference
HAL implementation for external cameras to use AIDL as well. The
external HAL uses V4L2 standard to expose USB cameras to the
cameraserver.
The reference HAL implementation for internal camera was dropped
because it is not possible to write a generic HAL that works with some
large percentage of internal cameras.
Bug: 219974678
Test: Existing CTS tests pass with external camera connected.
Change-Id: I35f3dc32c16670eca7735a4ac00fed3daf36aa65