UsbDescriptorParser::parseDescriptors always returned true.
Remove the return value, and remove the one constructor that
doesn't parse descriptors so the device is always in a parsed state.
Bug: 74119682
Test: Built
Change-Id: I2dd8d439405867d78102a9591dd1db36fe3959dc
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.
Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.
Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
Tests with descriptors from USB-C to 3.5mm adapter in four cases:
- line level load connected, no microphone
- low impedance load with microphone
- low impedance load without microphone
- no load attached.
Test: Ran tests without fix for bug 73813676, failed.
Ran tests with fix, all passed.
Change-Id: I067a15a122996e80c70bf287c6982611b6deee01
Change UsbManager apis to use long instead of string, to match
usb hal. Change UsbDeviceManager internals to match as well.
Remove isFunctionEnabled and add getEnabledFunctions. Callers
would often call isFunctionEnabled for every possible function
to get the list of functions, so getEnabledFunctions reduces the
number of aidl calls.
Separate out dependencies between UsbHandler and UsbDeviceManager
and staticize the UsbHandler classes. Add unit tests with
mocked out dependencies to test state transitions for UsbHandler.
Bug: 62876645
Test: atest UsbTests
Change-Id: I785c4c24121a70e725de9742c6af50a6bf1baea0