summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2015-04-29 21:02:30 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-29 21:02:30 +0000
commitec317987e06c9083a54bd32b5d10eee898345fe5 (patch)
tree1b811f117f144c40e77c46eef563df0a5a25de8e /core/java
parenta7a67085107ea44a3febbd4ee85f9eb233b41f71 (diff)
parent94582c5fb632b17b751729a929ff94ef8aa216a1 (diff)
downloadframeworks_base-ec317987e06c9083a54bd32b5d10eee898345fe5.zip
frameworks_base-ec317987e06c9083a54bd32b5d10eee898345fe5.tar.gz
frameworks_base-ec317987e06c9083a54bd32b5d10eee898345fe5.tar.bz2
am 94582c5f: am 973a70d7: am f105f61d: Merge "UsbDevice: Add support for retrieving version string for a USB device" into mnc-dev
* commit '94582c5fb632b17b751729a929ff94ef8aa216a1': UsbDevice: Add support for retrieving version string for a USB device
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/hardware/usb/UsbDevice.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/java/android/hardware/usb/UsbDevice.java b/core/java/android/hardware/usb/UsbDevice.java
index 1a42319..410d550 100644
--- a/core/java/android/hardware/usb/UsbDevice.java
+++ b/core/java/android/hardware/usb/UsbDevice.java
@@ -45,6 +45,7 @@ public class UsbDevice implements Parcelable {
private final String mName;
private final String mManufacturerName;
private final String mProductName;
+ private final String mVersion;
private final String mSerialNumber;
private final int mVendorId;
private final int mProductId;
@@ -62,7 +63,7 @@ public class UsbDevice implements Parcelable {
*/
public UsbDevice(String name, int vendorId, int productId,
int Class, int subClass, int protocol,
- String manufacturerName, String productName, String serialNumber) {
+ String manufacturerName, String productName, String version, String serialNumber) {
mName = name;
mVendorId = vendorId;
mProductId = productId;
@@ -71,6 +72,7 @@ public class UsbDevice implements Parcelable {
mProtocol = protocol;
mManufacturerName = manufacturerName;
mProductName = productName;
+ mVersion = version;
mSerialNumber = serialNumber;
}
@@ -104,6 +106,15 @@ public class UsbDevice implements Parcelable {
}
/**
+ * Returns the version number of the device.
+ *
+ * @return the device version
+ */
+ public String getVersion() {
+ return mVersion;
+ }
+
+ /**
* Returns the serial number of the device.
*
* @return the serial number name
@@ -263,7 +274,7 @@ public class UsbDevice implements Parcelable {
",mVendorId=" + mVendorId + ",mProductId=" + mProductId +
",mClass=" + mClass + ",mSubclass=" + mSubclass + ",mProtocol=" + mProtocol +
",mManufacturerName=" + mManufacturerName + ",mProductName=" + mProductName +
- ",mSerialNumber=" + mSerialNumber + ",mConfigurations=[");
+ ",mVersion=" + mVersion + ",mSerialNumber=" + mSerialNumber + ",mConfigurations=[");
for (int i = 0; i < mConfigurations.length; i++) {
builder.append("\n");
builder.append(mConfigurations[i].toString());
@@ -283,10 +294,11 @@ public class UsbDevice implements Parcelable {
int protocol = in.readInt();
String manufacturerName = in.readString();
String productName = in.readString();
+ String version = in.readString();
String serialNumber = in.readString();
Parcelable[] configurations = in.readParcelableArray(UsbInterface.class.getClassLoader());
UsbDevice device = new UsbDevice(name, vendorId, productId, clasz, subClass, protocol,
- manufacturerName, productName, serialNumber);
+ manufacturerName, productName, version, serialNumber);
device.setConfigurations(configurations);
return device;
}
@@ -309,6 +321,7 @@ public class UsbDevice implements Parcelable {
parcel.writeInt(mProtocol);
parcel.writeString(mManufacturerName);
parcel.writeString(mProductName);
+ parcel.writeString(mVersion);
parcel.writeString(mSerialNumber);
parcel.writeParcelableArray(mConfigurations, 0);
}