Refactor and clean up USB, add tests
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
Loading
Please register or sign in to comment