am 611af238: DO NOT MERGE: UsbManager: Don\'t display activity picker if there are no apps available for an accessory

* commit '611af238185cf924a425a1a2154b8439b8f8d7a5':
  DO NOT MERGE: UsbManager: Don't display activity picker if there are no apps available for an accessory
This commit is contained in:
Mike Lockwood
2011-03-02 22:07:59 -08:00
committed by Android Git Automerger

View File

@@ -394,8 +394,11 @@ class UsbDeviceSettingsManager {
defaultPackage = mAccessoryPreferenceMap.get(new AccessoryFilter(accessory)); defaultPackage = mAccessoryPreferenceMap.get(new AccessoryFilter(accessory));
} }
if (defaultPackage != null) {
int count = matches.size(); int count = matches.size();
// don't show the resolver activity if there are no choices available
if (count == 0) return;
if (defaultPackage != null) {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
ResolveInfo rInfo = matches.get(i); ResolveInfo rInfo = matches.get(i);
if (rInfo.activityInfo != null && if (rInfo.activityInfo != null &&