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

Commit 9be42d8d authored by Kweku Adams's avatar Kweku Adams
Browse files

Add new fields to ScheduledJobStateChanged.

Add priority, prefetch, and num failure fields in order to track
the effectiveness of the feature and policy changes.

Bug: 138239687
Bug: 142272435
Bug: 194532703
Test: atest CtsStatsdAtomHostTestCases:JobSchedulerStatsTests
Change-Id: Id76e9eb872b92ee64baab1898d9acdc08e386f74
parent ddb27f8d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1371,7 +1371,11 @@ public class JobSchedulerService extends com.android.server.SystemService
                    jobStatus.hasContentTriggerConstraint(),
                    jobStatus.isRequestedExpeditedJob(),
                    /* isRunningAsExpeditedJob */ false,
                    JobProtoEnums.STOP_REASON_UNDEFINED);
                    JobProtoEnums.STOP_REASON_UNDEFINED,
                    jobStatus.getJob().isPrefetch(),
                    jobStatus.getJob().getPriority(),
                    jobStatus.getEffectivePriority(),
                    jobStatus.getNumFailures());

            // 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
+10 −2
Original line number Diff line number Diff line
@@ -356,7 +356,11 @@ public final class JobServiceContext implements ServiceConnection {
                    job.hasContentTriggerConstraint(),
                    job.isRequestedExpeditedJob(),
                    job.shouldTreatAsExpeditedJob(),
                    JobProtoEnums.STOP_REASON_UNDEFINED);
                    JobProtoEnums.STOP_REASON_UNDEFINED,
                    job.getJob().isPrefetch(),
                    job.getJob().getPriority(),
                    job.getEffectivePriority(),
                    job.getNumFailures());
            try {
                mBatteryStats.noteJobStart(job.getBatteryName(), job.getSourceUid());
            } catch (RemoteException e) {
@@ -1028,7 +1032,11 @@ public final class JobServiceContext implements ServiceConnection {
                completedJob.hasContentTriggerConstraint(),
                completedJob.isRequestedExpeditedJob(),
                completedJob.startedAsExpeditedJob,
                mParams.getStopReason());
                mParams.getStopReason(),
                completedJob.getJob().isPrefetch(),
                completedJob.getJob().getPriority(),
                completedJob.getEffectivePriority(),
                completedJob.getNumFailures());
        try {
            mBatteryStats.noteJobFinish(mRunningJob.getBatteryName(), mRunningJob.getSourceUid(),
                    internalStopReason);
+6 −0
Original line number Diff line number Diff line
@@ -50,6 +50,12 @@
                {"include-filter": "com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testMeteredNetworkAccess_expeditedJob"},
                {"include-filter": "com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testNonMeteredNetworkAccess_expeditedJob"}
            ]
        },
        {
            "name": "CtsStatsdAtomHostTestCases",
            "options": [
                {"include-filter": "android.cts.statsdatom.jobscheduler"}
            ]
        }
    ]
}