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

Commit 2d2baf30 authored by Kweku Adams's avatar Kweku Adams Committed by Android (Google) Code Review
Browse files

Merge "Trace job execution."

parents 02dbebc7 e5e162b4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.Trace;
import android.os.UserHandle;
import android.util.EventLog;
import android.util.IndentingPrintWriter;
@@ -361,6 +362,9 @@ public final class JobServiceContext implements ServiceConnection {
                    job.getJob().getPriority(),
                    job.getEffectivePriority(),
                    job.getNumFailures());
            // Use the context's ID to distinguish traces since there'll only be one job running
            // per context.
            Trace.asyncTraceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, job.getBatteryName(), getId());
            try {
                mBatteryStats.noteJobStart(job.getBatteryName(), job.getSourceUid());
            } catch (RemoteException e) {
@@ -1024,6 +1028,7 @@ public final class JobServiceContext implements ServiceConnection {
                completedJob.getJob().getPriority(),
                completedJob.getEffectivePriority(),
                completedJob.getNumFailures());
        Trace.asyncTraceEnd(Trace.TRACE_TAG_SYSTEM_SERVER, completedJob.getBatteryName(), getId());
        try {
            mBatteryStats.noteJobFinish(mRunningJob.getBatteryName(), mRunningJob.getSourceUid(),
                    internalStopReason);
+1 −1
Original line number Diff line number Diff line
@@ -496,7 +496,7 @@ public final class JobStatus {
        this.batteryName = this.sourceTag != null
                ? this.sourceTag + ":" + job.getService().getPackageName()
                : job.getService().flattenToShortString();
        this.tag = "*job*/" + this.batteryName;
        this.tag = "*job*/" + this.batteryName + "#" + job.getId();

        this.earliestRunTimeElapsedMillis = earliestRunTimeElapsedMillis;
        this.latestRunTimeElapsedMillis = latestRunTimeElapsedMillis;