Merge "Restrict ChooserTargets provided by a single service"
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user