Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 791b1c37 authored by Matt Pietal's avatar Matt Pietal
Browse files

Sharesheet - Bump up limit for shortcuts

Allow apps to provide more targets via shortcut API, and allow AIAI
or default ranker to order them appropriately.

Bug: 130812721
Test: Visual inspection using Messages which has Shortcuts!
Change-Id: I4b16f3317056a2c5daad9b0576c22faa7ad3ca7b
parent cf5746dd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2030,7 +2030,8 @@ public class ChooserActivity extends ResolverActivity {
        public static final int TARGET_STANDARD_AZ = 3;

        private static final int MAX_SUGGESTED_APP_TARGETS = 4;
        private static final int MAX_TARGETS_PER_SERVICE = 2;
        private static final int MAX_CHOOSER_TARGETS_PER_APP = 2;
        private static final int MAX_SHORTCUT_TARGETS_PER_APP = 8;

        private static final int MAX_SERVICE_TARGETS = 8;

@@ -2356,9 +2357,11 @@ public class ChooserActivity extends ResolverActivity {
            final float baseScore = getBaseScore(origTarget, isShortcutResult);
            Collections.sort(targets, mBaseTargetComparator);

            final int maxTargets = isShortcutResult ? MAX_SHORTCUT_TARGETS_PER_APP
                                       : MAX_CHOOSER_TARGETS_PER_APP;
            float lastScore = 0;
            boolean shouldNotify = false;
            for (int i = 0, N = Math.min(targets.size(), MAX_TARGETS_PER_SERVICE); i < N; i++) {
            for (int i = 0, count = Math.min(targets.size(), maxTargets); i < count; i++) {
                final ChooserTarget target = targets.get(i);
                float targetScore = target.getScore();
                targetScore *= baseScore;