From 4be9494c40c3e42485fb3d92ef44efec34faaf3d Mon Sep 17 00:00:00 2001 From: 1 Date: Mon, 1 May 2023 16:07:57 +0000 Subject: Limit chooser actions to 5 Bug: 280288715 Test: atest ChooserRequestParametersTest Test: manual testing with > 5 actions from ShareTest Change-Id: I32a1e616e1fb3642db190c4a76de4fb0f5b7b39a --- java/src/com/android/intentresolver/ChooserRequestParameters.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'java/src') diff --git a/java/src/com/android/intentresolver/ChooserRequestParameters.java b/java/src/com/android/intentresolver/ChooserRequestParameters.java index b3f5a722..5157986b 100644 --- a/java/src/com/android/intentresolver/ChooserRequestParameters.java +++ b/java/src/com/android/intentresolver/ChooserRequestParameters.java @@ -68,6 +68,7 @@ public class ChooserRequestParameters { private static final int LAUNCH_FLAGS_FOR_SEND_ACTION = Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK; + private static final int MAX_CHOOSER_ACTIONS = 5; private final Intent mTarget; private final String mReferrerPackageName; @@ -322,6 +323,7 @@ public class ChooserRequestParameters { true, true) .filter(UriFilters::hasValidIcon) + .limit(MAX_CHOOSER_ACTIONS) .collect(toImmutableList()); } -- cgit v1.2.3-59-g8ed1b