pthread_cond_timedwait used wall time so it might introduce racing,
pthread_cond_timedwait_monotonic_np is Android specific but it is being
deprecated. And now Android support pthread_condattr_setclock so use it
to wait on CLOCK_MONOTONIC instead.
Bug: 64623895
Test: USB switch function works, charging/MTP/PTP
Change-Id: I136533ff90ef1be2b042ef1e0829643f2f7aa968
Adds a thread that handles add uevents of USB devices, and
enables auto suspend on that USB device (i.e. set power/control
to auto) if the device idProduct/idVendor is whitelisted.
The android kernel will already autosuspend audio devices,
however this enables autosuspend for the Google USB-C to
3.5mm adapter, which presents an HID-only interface when
no 3.5mm headset is connected.
Test: with the selinux and .rc changes for access permission
- MIR without headset: power/control set to auto
- MIR with headset: power/control set to auto
- regular mouse: power/control set to on
Bug: 38352281
Change-Id: I81572584ea02f6bdc814e70ab3439ab86c34a50a
This CL rebases wahoo HAL based on the kernel change to update
sysfs interface.
https://partner-android-review.googlesource.com/#/c/836088/
Bug: 62272992
Test: Verify USB dialog on wahoo
Change-Id: I8bc8f494176c7648abeb9783fbd18dc837793bda
This CL adds support to notify frameworks when an audio
or debug accessory is attached.
Bug: 36604276
Test: Manually test inserting an Audio accessory.
Change-Id: I9ec0f88ed85ed593b31132ba58bfedb51a435cd8