summaryrefslogtreecommitdiff
path: root/usb/1.0/default/Usb.cpp
AgeCommit message (Collapse)Author
2018-10-11USB HAL: default: Fix incorrect function pointer castJack Pham
A pointer to uevent_event() is stored in epoll_event::data::ptr which is later invoked after the poll returns. The function pointer is currently cast with a signature that doesn't quite match the actual function, namely the first parameter should be uint32_t, not int. Fix the potential control flow integrity vulnerability. CRs-Fixed: 2324304 Change-Id: I42b926efd09b6978746b9b14138bafbb3921677d
2018-08-19usb: hal: default: check for PD_ACTIVE for power/data roleJack Pham
Currently the check for canChange{Power,Data}Role values is determined only by whether the respective sysfs entries can be written to or not. This is not always accurate, since the entries may have a ueventd rule to change their file ownership to system and thus specifies a static umask. Independent power or data role switching can only be supported if USB PD is supported. Check /sys/class/power_supply/usb/pd_active to determine whether the current USB connection is PD capable in order to fill in the canChange{Power,Data}Role values instead of just relying on writability. CRs-Fixed: 2268448 Change-Id: I0278cfb5e7303d7ad1c14111adb52423dcd994b0
2017-02-24Merge "USB HAL: Fix infinite loop."TreeHugger Robot
2017-02-24Allow reregistering callbackBadhri Jagan Sridharan
Callbacks would have to be allowed being reregistered to handle frameworks restarts. Bug: 35758079 Test: adb shell stop; adb shell start; and see if USB notifications happen. Change-Id: I256b4e714340f48c1dd8377e660cb28ebd716b8a
2017-02-24USB HAL: Fix infinite loop.Badhri Jagan Sridharan
Bug: 35726475 Test: usb-service no longer consumes 100% CPU Change-Id: I274caec45e7527cbacf57f9a735d711dcb481bfd
2017-01-24USB: HIDL: default implentation for the type-c interfaceBadhri Jagan Sridharan
The default implementation should take care of legacy devices that lauched before O. BUG: 31015010 Test: Manually tested on Angler and sailfish for type-c role switches. Change-Id: I8762598f4f82da5b2fe8a87aacc30728eb7921f5