public class UsbPortManager extends Object
Note: This interface may not be supported on all chipsets since the USB drivers must be changed to publish this information through the module. At the moment we only need this for devices with USB Type C ports to allow the System UI to control USB charging and data direction. On devices that do not support this interface the list of ports may incorrectly appear to be empty (but we don't care today).
Constructor and Description |
---|
UsbPortManager(Context context) |
Modifier and Type | Method and Description |
---|---|
void |
addSimulatedPort(String portId,
int supportedModes,
IndentingPrintWriter pw) |
void |
connectSimulatedPort(String portId,
int mode,
boolean canChangeMode,
int powerRole,
boolean canChangePowerRole,
int dataRole,
boolean canChangeDataRole,
IndentingPrintWriter pw) |
void |
disconnectSimulatedPort(String portId,
IndentingPrintWriter pw) |
void |
dump(IndentingPrintWriter pw) |
UsbPort[] |
getPorts() |
UsbPortStatus |
getPortStatus(String portId) |
void |
removeSimulatedPort(String portId,
IndentingPrintWriter pw) |
void |
resetSimulation(IndentingPrintWriter pw) |
void |
setPortRoles(String portId,
int newPowerRole,
int newDataRole,
IndentingPrintWriter pw) |
void |
systemReady() |
public UsbPortManager(Context context)
public void systemReady()
public UsbPort[] getPorts()
public UsbPortStatus getPortStatus(String portId)
public void setPortRoles(String portId, int newPowerRole, int newDataRole, IndentingPrintWriter pw)
public void addSimulatedPort(String portId, int supportedModes, IndentingPrintWriter pw)
public void connectSimulatedPort(String portId, int mode, boolean canChangeMode, int powerRole, boolean canChangePowerRole, int dataRole, boolean canChangeDataRole, IndentingPrintWriter pw)
public void disconnectSimulatedPort(String portId, IndentingPrintWriter pw)
public void removeSimulatedPort(String portId, IndentingPrintWriter pw)
public void resetSimulation(IndentingPrintWriter pw)
public void dump(IndentingPrintWriter pw)