diff options
author | Adam Powell <adamp@google.com> | 2015-10-21 13:21:28 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2015-10-21 13:21:28 -0700 |
commit | 3a09c52914796135159009438a14b51b3e475fb4 (patch) | |
tree | 5a364a2a3d406f497a3f64f57419d0561db81726 /core | |
parent | 8ba1cdd9464b88375755e1976e4ee0f5620ff5be (diff) | |
download | frameworks_base-3a09c52914796135159009438a14b51b3e475fb4.zip frameworks_base-3a09c52914796135159009438a14b51b3e475fb4.tar.gz frameworks_base-3a09c52914796135159009438a14b51b3e475fb4.tar.bz2 |
Don't query ChooserTargetService apps that haven't been used recently
Resolver/ChooserActivity sort apps based on usage factors for the last
two weeks. A score of zero means no usage data within that timeframe.
For system health and UI relevance, don't bother even waking up apps
that have zero scores.
Bug 25126166
Change-Id: Iae34a9667eb1985d6fe986670f3fb3f1177576da
Diffstat (limited to 'core')
-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, |