summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-03-02 21:53:39 -0800
committerMike Lockwood <lockwood@android.com>2011-03-02 22:00:59 -0800
commit611af238185cf924a425a1a2154b8439b8f8d7a5 (patch)
treec250195da106d2f1f760ffb2e62c65dafd846403 /services
parentc9ac3f5183be3f124f34ed49ac5766e0ba1aff77 (diff)
downloadframeworks_base-611af238185cf924a425a1a2154b8439b8f8d7a5.zip
frameworks_base-611af238185cf924a425a1a2154b8439b8f8d7a5.tar.gz
frameworks_base-611af238185cf924a425a1a2154b8439b8f8d7a5.tar.bz2
DO NOT MERGE: UsbManager: Don't display activity picker if there are no apps available for an accessory
Change-Id: I1aa578887e42aef375211eadece4c1fddaf234f8 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/usb/UsbDeviceSettingsManager.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java
index 07fb1cc..0cb788e 100644
--- a/services/java/com/android/server/usb/UsbDeviceSettingsManager.java
+++ b/services/java/com/android/server/usb/UsbDeviceSettingsManager.java
@@ -394,8 +394,11 @@ class UsbDeviceSettingsManager {
defaultPackage = mAccessoryPreferenceMap.get(new AccessoryFilter(accessory));
}
+ int count = matches.size();
+ // don't show the resolver activity if there are no choices available
+ if (count == 0) return;
+
if (defaultPackage != null) {
- int count = matches.size();
for (int i = 0; i < count; i++) {
ResolveInfo rInfo = matches.get(i);
if (rInfo.activityInfo != null &&