diff options
author | Mike Lockwood <lockwood@android.com> | 2011-03-10 07:50:30 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-10 07:50:30 -0800 |
commit | cc08c439bc7b0afbdafc5ca18c584d2f7724f3df (patch) | |
tree | 219bad973dd1af80c377bb8e9e5355e70b843bac /services/java | |
parent | 3de30a4c1e48d92af14154abddd4fb6fe0c6aa13 (diff) | |
parent | ac36d7c715a9cd793b2dce6de547594810101c3a (diff) | |
download | frameworks_base-cc08c439bc7b0afbdafc5ca18c584d2f7724f3df.zip frameworks_base-cc08c439bc7b0afbdafc5ca18c584d2f7724f3df.tar.gz frameworks_base-cc08c439bc7b0afbdafc5ca18c584d2f7724f3df.tar.bz2 |
Merge "UsbAccessory: Add URI string, replace type string with description" into honeycomb-mr1
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/usb/UsbDeviceSettingsManager.java | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java index 25eac6f..9398979 100644 --- a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java +++ b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java @@ -236,22 +236,18 @@ class UsbDeviceSettingsManager { public final String mManufacturer; // USB accessory model (or null for unspecified) public final String mModel; - // USB accessory type (or null for unspecified) - public final String mType; // USB accessory version (or null for unspecified) public final String mVersion; - public AccessoryFilter(String manufacturer, String model, String type, String version) { + public AccessoryFilter(String manufacturer, String model, String version) { mManufacturer = manufacturer; mModel = model; - mType = type; mVersion = version; } public AccessoryFilter(UsbAccessory accessory) { mManufacturer = accessory.getManufacturer(); mModel = accessory.getModel(); - mType = accessory.getType(); mVersion = accessory.getVersion(); } @@ -259,7 +255,6 @@ class UsbDeviceSettingsManager { throws XmlPullParserException, IOException { String manufacturer = null; String model = null; - String type = null; String version = null; int count = parser.getAttributeCount(); @@ -271,13 +266,11 @@ class UsbDeviceSettingsManager { manufacturer = value; } else if ("model".equals(name)) { model = value; - } else if ("type".equals(name)) { - type = value; } else if ("version".equals(name)) { version = value; } } - return new AccessoryFilter(manufacturer, model, type, version); + return new AccessoryFilter(manufacturer, model, version); } public void write(XmlSerializer serializer)throws IOException { @@ -288,9 +281,6 @@ class UsbDeviceSettingsManager { if (mModel != null) { serializer.attribute(null, "model", mModel); } - if (mType != null) { - serializer.attribute(null, "type", mType); - } if (mVersion != null) { serializer.attribute(null, "version", mVersion); } @@ -300,7 +290,6 @@ class UsbDeviceSettingsManager { public boolean matches(UsbAccessory acc) { if (mManufacturer != null && !acc.getManufacturer().equals(mManufacturer)) return false; if (mModel != null && !acc.getModel().equals(mModel)) return false; - if (mType != null && !acc.getType().equals(mType)) return false; if (mVersion != null && !acc.getVersion().equals(mVersion)) return false; return true; } @@ -308,21 +297,19 @@ class UsbDeviceSettingsManager { @Override public boolean equals(Object obj) { // can't compare if we have wildcard strings - if (mManufacturer == null || mModel == null || mType == null || mVersion == null) { + if (mManufacturer == null || mModel == null || mVersion == null) { return false; } if (obj instanceof AccessoryFilter) { AccessoryFilter filter = (AccessoryFilter)obj; return (mManufacturer.equals(filter.mManufacturer) && mModel.equals(filter.mModel) && - mType.equals(filter.mType) && mVersion.equals(filter.mVersion)); } if (obj instanceof UsbAccessory) { UsbAccessory accessory = (UsbAccessory)obj; return (mManufacturer.equals(accessory.getManufacturer()) && mModel.equals(accessory.getModel()) && - mType.equals(accessory.getType()) && mVersion.equals(accessory.getVersion())); } return false; @@ -332,7 +319,6 @@ class UsbDeviceSettingsManager { public int hashCode() { return ((mManufacturer == null ? 0 : mManufacturer.hashCode()) ^ (mModel == null ? 0 : mModel.hashCode()) ^ - (mType == null ? 0 : mType.hashCode()) ^ (mVersion == null ? 0 : mVersion.hashCode())); } @@ -340,7 +326,6 @@ class UsbDeviceSettingsManager { public String toString() { return "AccessoryFilter[mManufacturer=\"" + mManufacturer + "\", mModel=\"" + mModel + - "\", mType=\"" + mType + "\", mVersion=\"" + mVersion + "\"]"; } } |