Count download WakeLocks against requesting app.
Jeff Sharkey [Thu, 6 Jun 2013 22:07:06 +0000 (15:07 -0700)]
This matches how network usage is already counted against the app
making the request.

Change-Id: I6a862e096f2f99441925a101268235615000355a

src/com/android/providers/downloads/DownloadThread.java

index 28bbf49..def4d7f 100644 (file)
@@ -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