diff options
author | Amith Yamasani <yamasani@google.com> | 2015-04-10 16:16:30 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2015-04-13 15:36:32 -0700 |
commit | 96a0fd65e18e5b9a0eaed3c24fd8a60a1fac1c3a (patch) | |
tree | 497996afd2d57bc9b65602bd4bcd595c60c4917e /services/usage/java/com/android/server | |
parent | fb1e9b79782580acabf0dd4dda6a74349fafc978 (diff) | |
download | frameworks_base-96a0fd65e18e5b9a0eaed3c24fd8a60a1fac1c3a.zip frameworks_base-96a0fd65e18e5b9a0eaed3c24fd8a60a1fac1c3a.tar.gz frameworks_base-96a0fd65e18e5b9a0eaed3c24fd8a60a1fac1c3a.tar.bz2 |
Delay syncs for idle apps
Apps that haven't been in use for a while and are considered idle
are not synced until the device is charging or the app is used.
Bug: 20066058
Change-Id: I3471e3a11edae04777163b0dbd74e86495743caa
Diffstat (limited to 'services/usage/java/com/android/server')
-rw-r--r-- | services/usage/java/com/android/server/usage/UsageStatsService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index cc0ab81..3d54dfb 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -53,6 +53,7 @@ import android.util.SparseArray; import com.android.internal.os.BackgroundThread; import com.android.internal.util.IndentingPrintWriter; +import com.android.server.SystemConfig; import com.android.server.SystemService; import java.io.File; @@ -383,6 +384,9 @@ public class UsageStatsService extends SystemService implements } boolean isAppIdle(String packageName, int userId) { + if (SystemConfig.getInstance().getAllowInPowerSave().contains(packageName)) { + return false; + } final long lastUsed = getLastPackageAccessTime(packageName, userId); return hasPassedIdleDuration(lastUsed); } |