Loading apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +17 −2 Original line number Diff line number Diff line Loading @@ -1560,7 +1560,8 @@ public class JobSchedulerService extends com.android.server.SystemService jobStatus.getJob().getMinLatencyMillis(), jobStatus.getEstimatedNetworkDownloadBytes(), jobStatus.getEstimatedNetworkUploadBytes(), jobStatus.getWorkCount()); jobStatus.getWorkCount(), getProcState(jobStatus.getSourcePackageName())); // If the job is immediately ready to run, then we can just immediately // put it in the pending list and try to schedule it. This is especially Loading Loading @@ -1988,7 +1989,8 @@ public class JobSchedulerService extends com.android.server.SystemService cancelled.getJob().getMinLatencyMillis(), cancelled.getEstimatedNetworkDownloadBytes(), cancelled.getEstimatedNetworkUploadBytes(), cancelled.getWorkCount()); cancelled.getWorkCount(), getProcState(cancelled.getSourcePackageName())); } // If this is a replacement, bring in the new version of the job if (incomingJob != null) { Loading Loading @@ -5332,4 +5334,17 @@ public class JobSchedulerService extends com.android.server.SystemService proto.flush(); } /** * Returns OOM score for package name, to be used with * logging only. */ int getProcState(String packageName) { try { return ActivityManager.getService().getPackageProcessState( packageName, "system"); } catch (RemoteException e) { return -1; } } } apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +5 −3 Original line number Diff line number Diff line Loading @@ -439,6 +439,7 @@ public final class JobServiceContext implements ServiceConnection { removeOpTimeOutLocked(); return false; } final String sourcePackage = job.getSourcePackageName(); mJobPackageTracker.noteActive(job); FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED, job.getSourceUid(), null, job.getBatteryName(), Loading Loading @@ -476,8 +477,8 @@ public final class JobServiceContext implements ServiceConnection { job.getJob().getMinLatencyMillis(), job.getEstimatedNetworkDownloadBytes(), job.getEstimatedNetworkUploadBytes(), job.getWorkCount()); final String sourcePackage = job.getSourcePackageName(); job.getWorkCount(), mService.getProcState(sourcePackage)); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { final String componentPackage = job.getServiceComponent().getPackageName(); String traceTag = "*job*<" + job.getSourceUid() + ">" + sourcePackage; Loading Loading @@ -1447,7 +1448,8 @@ public final class JobServiceContext implements ServiceConnection { completedJob.getJob().getMinLatencyMillis(), completedJob.getEstimatedNetworkDownloadBytes(), completedJob.getEstimatedNetworkUploadBytes(), completedJob.getWorkCount()); completedJob.getWorkCount(), mService.getProcState(completedJob.getSourcePackageName())); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_SYSTEM_SERVER, "JobScheduler", getId()); Loading Loading
apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +17 −2 Original line number Diff line number Diff line Loading @@ -1560,7 +1560,8 @@ public class JobSchedulerService extends com.android.server.SystemService jobStatus.getJob().getMinLatencyMillis(), jobStatus.getEstimatedNetworkDownloadBytes(), jobStatus.getEstimatedNetworkUploadBytes(), jobStatus.getWorkCount()); jobStatus.getWorkCount(), getProcState(jobStatus.getSourcePackageName())); // If the job is immediately ready to run, then we can just immediately // put it in the pending list and try to schedule it. This is especially Loading Loading @@ -1988,7 +1989,8 @@ public class JobSchedulerService extends com.android.server.SystemService cancelled.getJob().getMinLatencyMillis(), cancelled.getEstimatedNetworkDownloadBytes(), cancelled.getEstimatedNetworkUploadBytes(), cancelled.getWorkCount()); cancelled.getWorkCount(), getProcState(cancelled.getSourcePackageName())); } // If this is a replacement, bring in the new version of the job if (incomingJob != null) { Loading Loading @@ -5332,4 +5334,17 @@ public class JobSchedulerService extends com.android.server.SystemService proto.flush(); } /** * Returns OOM score for package name, to be used with * logging only. */ int getProcState(String packageName) { try { return ActivityManager.getService().getPackageProcessState( packageName, "system"); } catch (RemoteException e) { return -1; } } }
apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +5 −3 Original line number Diff line number Diff line Loading @@ -439,6 +439,7 @@ public final class JobServiceContext implements ServiceConnection { removeOpTimeOutLocked(); return false; } final String sourcePackage = job.getSourcePackageName(); mJobPackageTracker.noteActive(job); FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED, job.getSourceUid(), null, job.getBatteryName(), Loading Loading @@ -476,8 +477,8 @@ public final class JobServiceContext implements ServiceConnection { job.getJob().getMinLatencyMillis(), job.getEstimatedNetworkDownloadBytes(), job.getEstimatedNetworkUploadBytes(), job.getWorkCount()); final String sourcePackage = job.getSourcePackageName(); job.getWorkCount(), mService.getProcState(sourcePackage)); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { final String componentPackage = job.getServiceComponent().getPackageName(); String traceTag = "*job*<" + job.getSourceUid() + ">" + sourcePackage; Loading Loading @@ -1447,7 +1448,8 @@ public final class JobServiceContext implements ServiceConnection { completedJob.getJob().getMinLatencyMillis(), completedJob.getEstimatedNetworkDownloadBytes(), completedJob.getEstimatedNetworkUploadBytes(), completedJob.getWorkCount()); completedJob.getWorkCount(), mService.getProcState(completedJob.getSourcePackageName())); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_SYSTEM_SERVER, "JobScheduler", getId()); Loading