usb: implement heuristics to flag data compliance warnings
Support flagging enum failure and flaky connection in device mode, flagging enum failure and missing data lines in host mode. No warning would be flagged until 5 secs after the data session starts to give ample time for the connection to stabilize, a timer is added to support it. Bug: 296119135 Test: manually trigger the warnings Change-Id: I25f08657e328913946add192b5ecb9ee50c3a1a8
This commit is contained in:
parent
a04e12983b
commit
42020dc458
2 changed files with 113 additions and 15 deletions
|
@ -75,9 +75,11 @@ class UsbDataSessionMonitor {
|
|||
|
||||
static void *monitorThread(void *param);
|
||||
void handleUevent();
|
||||
void handleTimerEvent();
|
||||
void handleDataRoleEvent();
|
||||
void handleDeviceStateEvent(struct usbDeviceState *deviceState);
|
||||
void clearDeviceStateEvents(struct usbDeviceState *deviceState);
|
||||
void setupNewSession();
|
||||
void reportUsbDataSessionMetrics();
|
||||
void evaluateComplianceWarning();
|
||||
void notifyComplianceWarning();
|
||||
|
@ -86,6 +88,7 @@ class UsbDataSessionMonitor {
|
|||
pthread_t mMonitor;
|
||||
unique_fd mEpollFd;
|
||||
unique_fd mUeventFd;
|
||||
unique_fd mTimerFd;
|
||||
unique_fd mDataRoleFd;
|
||||
struct usbDeviceState mDeviceState;
|
||||
struct usbDeviceState mHost1State;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue