diff options
author | Adam Powell <adamp@google.com> | 2015-10-21 20:40:45 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-10-21 20:40:45 +0000 |
commit | b8cfc12c3f0b83e9d00b1f324be4ff5c977645ce (patch) | |
tree | 478070efc9ea65a0e101350bc95a2f49873c012b | |
parent | 688e046bad87cc722e8571b8f4180604623239a8 (diff) | |
parent | 3a09c52914796135159009438a14b51b3e475fb4 (diff) | |
download | frameworks_base-b8cfc12c3f0b83e9d00b1f324be4ff5c977645ce.zip frameworks_base-b8cfc12c3f0b83e9d00b1f324be4ff5c977645ce.tar.gz frameworks_base-b8cfc12c3f0b83e9d00b1f324be4ff5c977645ce.tar.bz2 |
Merge "Don't query ChooserTargetService apps that haven't been used recently" into mnc-dr-dev
-rw-r--r-- | core/java/com/android/internal/app/ChooserActivity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index c6b340b..7699673 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -373,6 +373,11 @@ public class ChooserActivity extends ResolverActivity { int targetsToQuery = 0; for (int i = 0, N = adapter.getDisplayResolveInfoCount(); i < N; i++) { final DisplayResolveInfo dri = adapter.getDisplayResolveInfo(i); + if (adapter.getScore(dri) == 0) { + // A score of 0 means the app hasn't been used in some time; + // don't query it as it's not likely to be relevant. + continue; + } final ActivityInfo ai = dri.getResolveInfo().activityInfo; final Bundle md = ai.metaData; final String serviceName = md != null ? convertServiceName(ai.packageName, |