Include the usb data mode regardless of data role

Turns out there are valid data modes in host mode (like midi).
Need to allow these through for the dialog to set the proper
current state.

Bug: 23905770
Change-Id: I7a37ad95ccaf18f211d2b2d330c7f1d7af4cfc16
This commit is contained in:
Jason Monk
2015-09-10 10:36:58 -04:00
parent 48422b52f3
commit d3c60afe52

View File

@@ -71,8 +71,7 @@ public class UsbBackend {
if (mPort != null) { if (mPort != null) {
int power = mPortStatus.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE int power = mPortStatus.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE
? MODE_POWER_SOURCE : MODE_POWER_SINK; ? MODE_POWER_SOURCE : MODE_POWER_SINK;
return power | (mPortStatus.getCurrentDataRole() == UsbPort.DATA_ROLE_DEVICE return power | getUsbDataMode();
? getUsbDataMode() : MODE_DATA_NONE);
} }
return MODE_POWER_SINK | getUsbDataMode(); return MODE_POWER_SINK | getUsbDataMode();
} }