Merge changes from topic 'svcusb' am: 5e2a2ee39e
am: 6f44072d03
Change-Id: Ic30bca41e088c2d077dc5aa09e373a02acb60be6
This commit is contained in:
@@ -36,8 +36,8 @@ public class UsbCommand extends Svc.Command {
|
|||||||
public String longHelp() {
|
public String longHelp() {
|
||||||
return shortHelp() + "\n"
|
return shortHelp() + "\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "usage: svc usb setFunction [function]\n"
|
+ "usage: svc usb setFunction [function] [usbDataUnlocked=false]\n"
|
||||||
+ " Set the current usb function.\n\n"
|
+ " Set the current usb function and optionally the data lock state.\n\n"
|
||||||
+ " svc usb getFunction\n"
|
+ " svc usb getFunction\n"
|
||||||
+ " Gets the list of currently enabled functions\n";
|
+ " Gets the list of currently enabled functions\n";
|
||||||
}
|
}
|
||||||
@@ -49,8 +49,12 @@ public class UsbCommand extends Svc.Command {
|
|||||||
if ("setFunction".equals(args[1])) {
|
if ("setFunction".equals(args[1])) {
|
||||||
IUsbManager usbMgr = IUsbManager.Stub.asInterface(ServiceManager.getService(
|
IUsbManager usbMgr = IUsbManager.Stub.asInterface(ServiceManager.getService(
|
||||||
Context.USB_SERVICE));
|
Context.USB_SERVICE));
|
||||||
|
boolean unlockData = false;
|
||||||
|
if (args.length >= 4) {
|
||||||
|
unlockData = Boolean.valueOf(args[3]);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
usbMgr.setCurrentFunction((args.length >=3 ? args[2] : null), false);
|
usbMgr.setCurrentFunction((args.length >=3 ? args[2] : null), unlockData);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
System.err.println("Error communicating with UsbManager: " + e);
|
System.err.println("Error communicating with UsbManager: " + e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
||||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||||
<uses-permission android:name="android.permission.MANAGE_NETWORK_POLICY" />
|
<uses-permission android:name="android.permission.MANAGE_NETWORK_POLICY" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_USB" />
|
||||||
<!-- System tool permissions granted to the shell. -->
|
<!-- System tool permissions granted to the shell. -->
|
||||||
<uses-permission android:name="android.permission.REAL_GET_TASKS" />
|
<uses-permission android:name="android.permission.REAL_GET_TASKS" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
|
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
|
||||||
|
|||||||
Reference in New Issue
Block a user