| Index: device/usb/android/java/src/org/chromium/device/usb/ChromeUsbDevice.java
|
| diff --git a/device/usb/android/java/src/org/chromium/device/usb/ChromeUsbDevice.java b/device/usb/android/java/src/org/chromium/device/usb/ChromeUsbDevice.java
|
| index 92e4e1481cf4340241fe441012a429b2bc49af5e..38b78e5763a95926e35a2872d0ecf39d5eea1703 100644
|
| --- a/device/usb/android/java/src/org/chromium/device/usb/ChromeUsbDevice.java
|
| +++ b/device/usb/android/java/src/org/chromium/device/usb/ChromeUsbDevice.java
|
| @@ -37,6 +37,21 @@ final class ChromeUsbDevice {
|
| }
|
|
|
| @CalledByNative
|
| + private int getDeviceClass() {
|
| + return mDevice.getDeviceClass();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private int getDeviceSubclass() {
|
| + return mDevice.getDeviceSubclass();
|
| + }
|
| +
|
| + @CalledByNative
|
| + private int getDeviceProtocol() {
|
| + return mDevice.getDeviceProtocol();
|
| + }
|
| +
|
| + @CalledByNative
|
| private int getVendorId() {
|
| return mDevice.getVendorId();
|
| }
|
| @@ -46,6 +61,19 @@ final class ChromeUsbDevice {
|
| return mDevice.getProductId();
|
| }
|
|
|
| + @TargetApi(Build.VERSION_CODES.M)
|
| + @CalledByNative
|
| + private int getDeviceVersion() {
|
| + // The Android framework generates this string with:
|
| + // Integer.toString(version >> 8) + "." + (version & 0xFF)
|
| + //
|
| + // This is not technically correct because the low nibble is actually
|
| + // two separate version components (per spec). This undoes it at least.
|
| + String[] parts = mDevice.getVersion().split("\\.");
|
| + assert parts.length == 2;
|
| + return Integer.parseInt(parts[0]) << 8 | Integer.parseInt(parts[1]);
|
| + }
|
| +
|
| @CalledByNative
|
| private String getManufacturerName() {
|
| return mDevice.getManufacturerName();
|
|
|