Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8cb19433 authored by Kunal Malhotra's avatar Kunal Malhotra Committed by Android (Google) Code Review
Browse files

Merge "Adding proc_state to logging"

parents 990228e3 e0e56359
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -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
@@ -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) {
@@ -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;
        }
    }
}
+5 −3
Original line number Diff line number Diff line
@@ -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(),
@@ -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;
@@ -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());