OSDN Git Service

Fix ChooserTarget app scoring
authorAdam Powell <adamp@google.com>
Fri, 16 Oct 2015 17:47:32 +0000 (10:47 -0700)
committerAdam Powell <adamp@google.com>
Fri, 16 Oct 2015 17:58:08 +0000 (10:58 -0700)
An initial sorting step before applying modifiers to the ChooserTarget
scores provided by apps was backwards, causing subsequent target
scores to be heavily penalized. Targets are then heavily influenced by
the lowest score in the set relative to the targets from other apps.

Bug 25013559

Change-Id: I39d5d7c601712fc6a19e694d5846d2c8d17a214f

core/java/com/android/internal/app/ChooserActivity.java

index 9708cce..c6b340b 100644 (file)
@@ -920,7 +920,7 @@ public class ChooserActivity extends ResolverActivity {
         @Override
         public int compare(ChooserTarget lhs, ChooserTarget rhs) {
             // Descending order
-            return (int) Math.signum(lhs.getScore() - rhs.getScore());
+            return (int) Math.signum(rhs.getScore() - lhs.getScore());
         }
     }