summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2013-06-06 15:07:06 -0700
committerJeff Sharkey <jsharkey@android.com>2013-06-06 15:07:06 -0700
commit724817b1884584aaba4c99a6a1d4cf8cb8d2f7a3 (patch)
tree2906e5cd7162b59c95651044a843be036e7bdeab
parent029aef418bbef6cfad95b85ed654f3800f71dc8b (diff)
downloadandroid_packages_providers_DownloadProvider-724817b1884584aaba4c99a6a1d4cf8cb8d2f7a3.zip
android_packages_providers_DownloadProvider-724817b1884584aaba4c99a6a1d4cf8cb8d2f7a3.tar.gz
android_packages_providers_DownloadProvider-724817b1884584aaba4c99a6a1d4cf8cb8d2f7a3.tar.bz2
Count download WakeLocks against requesting app.
This matches how network usage is already counted against the app making the request. Change-Id: I6a862e096f2f99441925a101268235615000355a
-rw-r--r--src/com/android/providers/downloads/DownloadThread.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/providers/downloads/DownloadThread.java b/src/com/android/providers/downloads/DownloadThread.java
index 28bbf49..def4d7f 100644
--- a/src/com/android/providers/downloads/DownloadThread.java
+++ b/src/com/android/providers/downloads/DownloadThread.java
@@ -48,6 +48,7 @@ import android.os.FileUtils;
import android.os.PowerManager;
import android.os.Process;
import android.os.SystemClock;
+import android.os.WorkSource;
import android.provider.Downloads;
import android.text.TextUtils;
import android.util.Log;
@@ -189,6 +190,7 @@ public class DownloadThread implements Runnable {
try {
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG);
+ wakeLock.setWorkSource(new WorkSource(mInfo.mUid));
wakeLock.acquire();
// while performing download, register for rules updates