From f5afdb09a64afc5e935ca29e1eeab429d67a3cab Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 18 Feb 2016 12:43:47 -0800 Subject: Restore auto-launch behavior for ACTION_CHOOSER with a single choice For the initial release of Marshmallow auto-launching was suppressed for ChooserActivity if there was only a single choice in order to let the user confirm what would be launched. In practice, many apps use ACTION_CHOOSER when they should probably use implicit intents, but still others have use cases where setting a default doesn't make sense and the user should still be able to make a choice when one is available. As the user confirmation didn't buy much in terms of developer API expectations (ACTION_CHOOSER being a forced choice) and it adds speedbumps to existing apps in the ecosystem, revert this change. Bug 27243827 Change-Id: Id8fd5385d5b1f459e80b0096efe7e2944264739a --- .../java/com/android/internal/app/ChooserActivity.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index 8c3c2b5c8022..6085164b74d2 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -310,24 +310,6 @@ public class ChooserActivity extends ResolverActivity { return true; } - @Override - public boolean shouldAutoLaunchSingleChoice(TargetInfo target) { - final Intent intent = target.getResolvedIntent(); - final ResolveInfo resolve = target.getResolveInfo(); - - // When GET_CONTENT is handled by the DocumentsUI system component, - // we're okay automatically launching it, since it offers it's own - // intent disambiguation UI. - if (intent != null && Intent.ACTION_GET_CONTENT.equals(intent.getAction()) - && resolve != null && resolve.priority > 0 - && resolve.activityInfo != null && DocumentsContract.PACKAGE_DOCUMENTS_UI - .equals(resolve.activityInfo.packageName)) { - return true; - } - - return false; - } - @Override public void showTargetDetails(ResolveInfo ri) { ComponentName name = ri.activityInfo.getComponentName(); -- cgit v1.2.3-59-g8ed1b