diff options
-rw-r--r-- | cmds/svc/src/com/android/commands/svc/UsbCommand.java | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/cmds/svc/src/com/android/commands/svc/UsbCommand.java b/cmds/svc/src/com/android/commands/svc/UsbCommand.java index cd751f4e2d20..227b9e24f173 100644 --- a/cmds/svc/src/com/android/commands/svc/UsbCommand.java +++ b/cmds/svc/src/com/android/commands/svc/UsbCommand.java @@ -42,10 +42,20 @@ public class UsbCommand extends Svc.Command { + " Sets the functions which, if the device was charging, become current on" + "screen unlock. If function is blank, turn off this feature.\n" + " svc usb getFunctions\n" - + " Gets the list of currently enabled functions\n" + + " Gets the list of currently enabled functions\n" + + " possible values of [function] are any of 'mtp', 'ptp', 'rndis',\n" + + " 'midi', 'ncm (if supporting gadget hal v1.2)'\n" + " svc usb resetUsbGadget\n" - + " Reset usb gadget\n\n" - + "possible values of [function] are any of 'mtp', 'ptp', 'rndis', 'midi'\n"; + + " Reset usb gadget\n" + + " svc usb getUsbSpeed\n" + + " Gets current USB speed\n" + + " possible values of USB speed are any of 'low speed', 'full speed',\n" + + " 'high speed', 'super speed', 'super speed (10G)',\n" + + " 'super speed (20G)', or higher (future extension)\n" + + " svc usb getGadgetHalVersion\n" + + " Gets current Gadget Hal Version\n" + + " possible values of Hal version are any of 'unknown', 'V1_0', 'V1_1',\n" + + " 'V1_2'\n"; } @Override @@ -84,6 +94,23 @@ public class UsbCommand extends Svc.Command { System.err.println("Error communicating with UsbManager: " + e); } return; + } else if ("getUsbSpeed".equals(args[1])) { + try { + System.err.println( + UsbManager.usbSpeedToBandwidth(usbMgr.getCurrentUsbSpeed())); + } catch (RemoteException e) { + System.err.println("Error communicating with UsbManager: " + e); + } + return; + } else if ("getGadgetHalVersion".equals(args[1])) { + try { + System.err.println( + UsbManager.usbGadgetHalVersionToString( + usbMgr.getGadgetHalVersion())); + } catch (RemoteException e) { + System.err.println("Error communicating with UsbManager: " + e); + } + return; } } System.err.println(longHelp()); |