summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-05-19 11:52:40 -0400
committerMike Lockwood <lockwood@android.com>2011-05-19 12:57:41 -0400
commita88b42d569a91290477d8f5731a2ee43931271da (patch)
treebd3b4a2abc8971a62b983651898f0ab0a6c62567 /core/java
parentb7ec3e41a6b3423d1669ae784a8ad8fbe32df29d (diff)
downloadframeworks_base-a88b42d569a91290477d8f5731a2ee43931271da.zip
frameworks_base-a88b42d569a91290477d8f5731a2ee43931271da.tar.gz
frameworks_base-a88b42d569a91290477d8f5731a2ee43931271da.tar.bz2
USB: Add method to access raw USB device descriptors
Change-Id: Id5b46ede14a838198a59bdc8ed4732942044cfa8 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/hardware/usb/UsbDeviceConnection.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/hardware/usb/UsbDeviceConnection.java b/core/java/android/hardware/usb/UsbDeviceConnection.java
index a153c0b..b536490 100644
--- a/core/java/android/hardware/usb/UsbDeviceConnection.java
+++ b/core/java/android/hardware/usb/UsbDeviceConnection.java
@@ -69,6 +69,17 @@ public class UsbDeviceConnection {
}
/**
+ * Returns the raw USB descriptors for the device.
+ * This can be used to access descriptors not supported directly
+ * via the higher level APIs.
+ *
+ * @return raw USB descriptors
+ */
+ public byte[] getRawDescriptors() {
+ return native_get_desc();
+ }
+
+ /**
* Claims exclusive access to a {@link android.hardware.usb.UsbInterface}.
* This must be done before sending or receiving data on any
* {@link android.hardware.usb.UsbEndpoint}s belonging to the interface.
@@ -160,6 +171,7 @@ public class UsbDeviceConnection {
private native boolean native_open(String deviceName, FileDescriptor pfd);
private native void native_close();
private native int native_get_fd();
+ private native byte[] native_get_desc();
private native boolean native_claim_interface(int interfaceID, boolean force);
private native boolean native_release_interface(int interfaceID);
private native int native_control_request(int requestType, int request, int value,