diff options
author | David Christie <dnchrist@google.com> | 2013-09-12 21:38:12 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-12 21:38:12 -0700 |
commit | 2e99735046df7dc016a0407d1806b5979cbfc445 (patch) | |
tree | b026bfe04b1ca77150744ba8249bf8bec25ab0c1 /src/com | |
parent | 6489d6f6547f5eb96d9a675ba68fa241ab699b42 (diff) | |
parent | 8b4cdbebcfb53b57ac2afec1b1e3377d6a02bb21 (diff) | |
download | packages_apps_Settings-2e99735046df7dc016a0407d1806b5979cbfc445.zip packages_apps_Settings-2e99735046df7dc016a0407d1806b5979cbfc445.tar.gz packages_apps_Settings-2e99735046df7dc016a0407d1806b5979cbfc445.tar.bz2 |
am 8b4cdbeb: Fix recent apps in appops. Prior to this fix all apps would disappear from settings->location 15 minutes after the request was first made (even if request was ongoing). Tested this out - apps requesting location longer than the threshold stay in the list
* commit '8b4cdbebcfb53b57ac2afec1b1e3377d6a02bb21':
Fix recent apps in appops. Prior to this fix all apps would disappear from settings->location 15 minutes after the request was first made (even if request was ongoing). Tested this out - apps requesting location longer than the threshold stay in the list, and apps stay in the list exactly the threshold time after the location request ENDS.
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/location/RecentLocationApps.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java index 1fa8aac..65fef80 100644 --- a/src/com/android/settings/location/RecentLocationApps.java +++ b/src/com/android/settings/location/RecentLocationApps.java @@ -194,9 +194,10 @@ public class RecentLocationApps { List<AppOpsManager.OpEntry> entries = ops.getOps(); boolean highBattery = false; boolean normalBattery = false; + // Earliest time for a location request to end and still be shown in list. + long recentLocationCutoffTime = now - RECENT_TIME_INTERVAL_MILLIS; for (AppOpsManager.OpEntry entry : entries) { - // If previous location activity is older than designated interval, ignore this app. - if (now - entry.getTime() <= RECENT_TIME_INTERVAL_MILLIS) { + if (entry.isRunning() || entry.getTime() >= recentLocationCutoffTime) { switch (entry.getOp()) { case AppOpsManager.OP_MONITOR_LOCATION: normalBattery = true; |