Skip to content

Commit 611af23

Browse files
committed
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>
1 parent c9ac3f5 commit 611af23

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

services/java/com/android/server/usb/UsbDeviceSettingsManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,11 @@ public void accessoryAttached(UsbAccessory accessory) {
394394
defaultPackage = mAccessoryPreferenceMap.get(new AccessoryFilter(accessory));
395395
}
396396

397+
int count = matches.size();
398+
// don't show the resolver activity if there are no choices available
399+
if (count == 0) return;
400+
397401
if (defaultPackage != null) {
398-
int count = matches.size();
399402
for (int i = 0; i < count; i++) {
400403
ResolveInfo rInfo = matches.get(i);
401404
if (rInfo.activityInfo != null &&

0 commit comments

Comments
 (0)