Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5665bacc authored by Howard Yen's avatar Howard Yen
Browse files

Add svc usb resetUsbGadget method

Add svc usb resetUsbGadget method for usb control.

Bug: 138702846
Test: adb shell svc usb resetUsbGadget
Change-Id: I260a280f20cc924e28201baf2f5ccbd67318772f
parent db8f1165
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -42,7 +42,9 @@ 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\n"
                + "          Gets the list of currently enabled functions\n"
                + "       svc usb resetUsbGadget\n"
                + "          Reset usb gadget\n\n"
                + "possible values of [function] are any of 'mtp', 'ptp', 'rndis', 'midi'\n";
    }

@@ -75,6 +77,13 @@ public class UsbCommand extends Svc.Command {
                    System.err.println("Error communicating with UsbManager: " + e);
                }
                return;
            } else if ("resetUsbGadget".equals(args[1])) {
                try {
                    usbMgr.resetUsbGadget();
                } catch (RemoteException e) {
                    System.err.println("Error communicating with UsbManager: " + e);
                }
                return;
            }
        }
        System.err.println(longHelp());