OSDN Git Service

DO NOT MERGE: UsbManager: Don't display activity picker if there are no apps availabl...
authorMike Lockwood <lockwood@android.com>
Thu, 3 Mar 2011 05:53:39 +0000 (21:53 -0800)
committerMike Lockwood <lockwood@android.com>
Thu, 3 Mar 2011 06:00:59 +0000 (22:00 -0800)
Change-Id: I1aa578887e42aef375211eadece4c1fddaf234f8
Signed-off-by: Mike Lockwood <lockwood@android.com>
services/java/com/android/server/usb/UsbDeviceSettingsManager.java

index 07fb1cc..0cb788e 100644 (file)
@@ -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 &&