summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2014-01-08 07:59:06 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-01-08 07:59:06 -0800
commit992065938a95e5273b22dea009b8581bcc693e61 (patch)
treeddfa0958d508ea6c678791c64c118d29738bdc92 /core/java/android
parentc156021debb8e13324e451cb288da7edd7e112ca (diff)
parent9607d78f5144792993bd254a4b5983b2a9d5bf83 (diff)
downloadframeworks_base-992065938a95e5273b22dea009b8581bcc693e61.zip
frameworks_base-992065938a95e5273b22dea009b8581bcc693e61.tar.gz
frameworks_base-992065938a95e5273b22dea009b8581bcc693e61.tar.bz2
am 9607d78f: Merge "Added missing USB device descriptor fields needed for intent filters"
* commit '9607d78f5144792993bd254a4b5983b2a9d5bf83': Added missing USB device descriptor fields needed for intent filters
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/hardware/usb/UsbDevice.java49
1 files changed, 46 insertions, 3 deletions
diff --git a/core/java/android/hardware/usb/UsbDevice.java b/core/java/android/hardware/usb/UsbDevice.java
index 9bd38f9..d1e63f6 100644
--- a/core/java/android/hardware/usb/UsbDevice.java
+++ b/core/java/android/hardware/usb/UsbDevice.java
@@ -46,6 +46,9 @@ public class UsbDevice implements Parcelable {
private static final String TAG = "UsbDevice";
private final String mName;
+ private final String mManufacturerName;
+ private final String mProductName;
+ private final String mSerialNumber;
private final int mVendorId;
private final int mProductId;
private final int mClass;
@@ -58,13 +61,18 @@ public class UsbDevice implements Parcelable {
* @hide
*/
public UsbDevice(String name, int vendorId, int productId,
- int Class, int subClass, int protocol, Parcelable[] interfaces) {
+ int Class, int subClass, int protocol,
+ String manufacturerName, String productName, String serialNumber,
+ Parcelable[] interfaces) {
mName = name;
mVendorId = vendorId;
mProductId = productId;
mClass = Class;
mSubclass = subClass;
mProtocol = protocol;
+ mManufacturerName = manufacturerName;
+ mProductName = productName;
+ mSerialNumber = serialNumber;
mInterfaces = interfaces;
}
@@ -80,6 +88,33 @@ public class UsbDevice implements Parcelable {
}
/**
+ * Returns the manufacturer name of the device.
+ *
+ * @return the manufacturer name
+ */
+ public String getManufacturerName() {
+ return mManufacturerName;
+ }
+
+ /**
+ * Returns the product name of the device.
+ *
+ * @return the product name
+ */
+ public String getProductName() {
+ return mProductName;
+ }
+
+ /**
+ * Returns the serial number of the device.
+ *
+ * @return the serial number name
+ */
+ public String getSerialNumber() {
+ return mSerialNumber;
+ }
+
+ /**
* Returns a unique integer ID for the device.
* This is a convenience for clients that want to use an integer to represent
* the device, rather than the device name.
@@ -176,7 +211,8 @@ public class UsbDevice implements Parcelable {
return "UsbDevice[mName=" + mName + ",mVendorId=" + mVendorId +
",mProductId=" + mProductId + ",mClass=" + mClass +
",mSubclass=" + mSubclass + ",mProtocol=" + mProtocol +
- ",mInterfaces=" + mInterfaces + "]";
+ ",mManufacturerName=" + mManufacturerName + ",mProductName=" + mProductName +
+ ",mSerialNumber=" + mSerialNumber + ",mInterfaces=" + mInterfaces + "]";
}
public static final Parcelable.Creator<UsbDevice> CREATOR =
@@ -188,8 +224,12 @@ public class UsbDevice implements Parcelable {
int clasz = in.readInt();
int subClass = in.readInt();
int protocol = in.readInt();
+ String manufacturerName = in.readString();
+ String productName = in.readString();
+ String serialNumber = in.readString();
Parcelable[] interfaces = in.readParcelableArray(UsbInterface.class.getClassLoader());
- return new UsbDevice(name, vendorId, productId, clasz, subClass, protocol, interfaces);
+ return new UsbDevice(name, vendorId, productId, clasz, subClass, protocol,
+ manufacturerName, productName, serialNumber, interfaces);
}
public UsbDevice[] newArray(int size) {
@@ -208,6 +248,9 @@ public class UsbDevice implements Parcelable {
parcel.writeInt(mClass);
parcel.writeInt(mSubclass);
parcel.writeInt(mProtocol);
+ parcel.writeString(mManufacturerName);
+ parcel.writeString(mProductName);
+ parcel.writeString(mSerialNumber);
parcel.writeParcelableArray(mInterfaces, 0);
}