diff options
| -rw-r--r-- | services/core/java/com/android/server/job/JobServiceContext.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/job/controllers/JobStatus.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/job/JobServiceContext.java b/services/core/java/com/android/server/job/JobServiceContext.java index c359c4dbd8f7..dd634fa270c8 100644 --- a/services/core/java/com/android/server/job/JobServiceContext.java +++ b/services/core/java/com/android/server/job/JobServiceContext.java @@ -289,7 +289,7 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne final PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, runningJob.getTag()); - mWakeLock.setWorkSource(new WorkSource(runningJob.getUid())); + mWakeLock.setWorkSource(new WorkSource(runningJob.getSourceUid())); mWakeLock.setReferenceCounted(false); mWakeLock.acquire(); mCallbackHandler.obtainMessage(MSG_SERVICE_BOUND).sendToTarget(); diff --git a/services/core/java/com/android/server/job/controllers/JobStatus.java b/services/core/java/com/android/server/job/controllers/JobStatus.java index a621e6ab7b78..e6e9e49030e9 100644 --- a/services/core/java/com/android/server/job/controllers/JobStatus.java +++ b/services/core/java/com/android/server/job/controllers/JobStatus.java @@ -92,6 +92,8 @@ public class JobStatus { /** Copy constructor. */ public JobStatus(JobStatus jobStatus) { this(jobStatus.getJob(), jobStatus.getUid(), jobStatus.getNumFailures()); + this.sourceUserId = jobStatus.sourceUserId; + this.sourcePackageName = jobStatus.sourcePackageName; this.earliestRunTimeElapsedMillis = jobStatus.getEarliestRunTime(); this.latestRunTimeElapsedMillis = jobStatus.getLatestRunTimeElapsed(); } @@ -132,6 +134,8 @@ public class JobStatus { public JobStatus(JobStatus rescheduling, long newEarliestRuntimeElapsedMillis, long newLatestRuntimeElapsedMillis, int backoffAttempt) { this(rescheduling.job, rescheduling.getUid(), backoffAttempt); + this.sourceUserId = rescheduling.sourceUserId; + this.sourcePackageName = rescheduling.sourcePackageName; earliestRunTimeElapsedMillis = newEarliestRuntimeElapsedMillis; latestRunTimeElapsedMillis = newLatestRuntimeElapsedMillis; |