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

Commit 3512d9eb authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Restrict ChooserTargets provided by a single service"

parents f9ef9793 bba0030a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -761,6 +761,7 @@ public class ChooserActivity extends ResolverActivity {
        public static final int TARGET_STANDARD = 2;

        private static final int MAX_SERVICE_TARGETS = 8;
        private static final int MAX_TARGETS_PER_SERVICE = 4;

        private final List<ChooserTargetInfo> mServiceTargets = new ArrayList<>();
        private final List<TargetInfo> mCallerTargets = new ArrayList<>();
@@ -925,7 +926,7 @@ public class ChooserActivity extends ResolverActivity {
            final float parentScore = getScore(origTarget);
            Collections.sort(targets, mBaseTargetComparator);
            float lastScore = 0;
            for (int i = 0, N = targets.size(); i < N; i++) {
            for (int i = 0, N = Math.min(targets.size(), MAX_TARGETS_PER_SERVICE); i < N; i++) {
                final ChooserTarget target = targets.get(i);
                float targetScore = target.getScore();
                targetScore *= parentScore;
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class ResolverComparator implements Comparator<ResolvedComponentInfo> {

    private static final long RECENCY_TIME_PERIOD = 1000 * 60 * 60 * 12;

    private static final float RECENCY_MULTIPLIER = 3.f;
    private static final float RECENCY_MULTIPLIER = 2.f;

    private final Collator mCollator;
    private final boolean mHttp;