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>
This commit is contained in:
Mike Lockwood
2011-03-02 21:53:39 -08:00
parent c9ac3f5183
commit 611af23818

View 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 &&