Loading apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1598,7 +1598,7 @@ public class JobSchedulerService extends com.android.server.SystemService uId, null, jobStatus.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__SCHEDULED, JobProtoEnums.INTERNAL_STOP_REASON_UNKNOWN, jobStatus.getStandbyBucket(), jobStatus.getJobId(), jobStatus.getLoggingJobId(), jobStatus.hasChargingConstraint(), jobStatus.hasBatteryNotLowConstraint(), jobStatus.hasStorageNotLowConstraint(), Loading Loading @@ -2026,7 +2026,7 @@ public class JobSchedulerService extends com.android.server.SystemService cancelled.getSourceUid(), null, cancelled.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__CANCELLED, internalReasonCode, cancelled.getStandbyBucket(), cancelled.getJobId(), cancelled.getLoggingJobId(), cancelled.hasChargingConstraint(), cancelled.hasBatteryNotLowConstraint(), cancelled.hasStorageNotLowConstraint(), Loading apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +4 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,8 @@ public final class JobServiceContext implements ServiceConnection { job.getSourceUid(), null, job.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED, JobProtoEnums.INTERNAL_STOP_REASON_UNKNOWN, job.getStandbyBucket(), job.getJobId(), job.getStandbyBucket(), job.getLoggingJobId(), job.hasChargingConstraint(), job.hasBatteryNotLowConstraint(), job.hasStorageNotLowConstraint(), Loading Loading @@ -1521,7 +1522,8 @@ public final class JobServiceContext implements ServiceConnection { FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED, completedJob.getSourceUid(), null, completedJob.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED, loggingInternalStopReason, completedJob.getStandbyBucket(), completedJob.getJobId(), loggingInternalStopReason, completedJob.getStandbyBucket(), completedJob.getLoggingJobId(), completedJob.hasChargingConstraint(), completedJob.hasBatteryNotLowConstraint(), completedJob.hasStorageNotLowConstraint(), Loading apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +15 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,8 @@ public final class JobStatus { final String sourceTag; @Nullable private final String mNamespace; /** An ID that can be used to uniquely identify the job when logging statsd metrics. */ private final long mLoggingJobId; final String tag; Loading Loading @@ -568,6 +570,7 @@ public final class JobStatus { this.callingUid = callingUid; this.standbyBucket = standbyBucket; mNamespace = namespace; mLoggingJobId = generateLoggingId(namespace, job.getId()); int tempSourceUid = -1; if (sourceUserId != -1 && sourcePackageName != null) { Loading Loading @@ -804,6 +807,13 @@ public final class JobStatus { /*innerFlags=*/ 0, /* dynamicConstraints */ 0); } private long generateLoggingId(@Nullable String namespace, int jobId) { if (namespace == null) { return jobId; } return ((long) namespace.hashCode()) << 31 | jobId; } public void enqueueWorkLocked(JobWorkItem work) { if (pendingWork == null) { pendingWork = new ArrayList<>(); Loading Loading @@ -956,6 +966,11 @@ public final class JobStatus { return job.getId(); } /** Returns an ID that can be used to uniquely identify the job when logging statsd metrics. */ public long getLoggingJobId() { return mLoggingJobId; } public void printUniqueId(PrintWriter pw) { if (mNamespace != null) { pw.print(mNamespace); Loading Loading
apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +2 −2 Original line number Diff line number Diff line Loading @@ -1598,7 +1598,7 @@ public class JobSchedulerService extends com.android.server.SystemService uId, null, jobStatus.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__SCHEDULED, JobProtoEnums.INTERNAL_STOP_REASON_UNKNOWN, jobStatus.getStandbyBucket(), jobStatus.getJobId(), jobStatus.getLoggingJobId(), jobStatus.hasChargingConstraint(), jobStatus.hasBatteryNotLowConstraint(), jobStatus.hasStorageNotLowConstraint(), Loading Loading @@ -2026,7 +2026,7 @@ public class JobSchedulerService extends com.android.server.SystemService cancelled.getSourceUid(), null, cancelled.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__CANCELLED, internalReasonCode, cancelled.getStandbyBucket(), cancelled.getJobId(), cancelled.getLoggingJobId(), cancelled.hasChargingConstraint(), cancelled.hasBatteryNotLowConstraint(), cancelled.hasStorageNotLowConstraint(), Loading
apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +4 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,8 @@ public final class JobServiceContext implements ServiceConnection { job.getSourceUid(), null, job.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED, JobProtoEnums.INTERNAL_STOP_REASON_UNKNOWN, job.getStandbyBucket(), job.getJobId(), job.getStandbyBucket(), job.getLoggingJobId(), job.hasChargingConstraint(), job.hasBatteryNotLowConstraint(), job.hasStorageNotLowConstraint(), Loading Loading @@ -1521,7 +1522,8 @@ public final class JobServiceContext implements ServiceConnection { FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED, completedJob.getSourceUid(), null, completedJob.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED, loggingInternalStopReason, completedJob.getStandbyBucket(), completedJob.getJobId(), loggingInternalStopReason, completedJob.getStandbyBucket(), completedJob.getLoggingJobId(), completedJob.hasChargingConstraint(), completedJob.hasBatteryNotLowConstraint(), completedJob.hasStorageNotLowConstraint(), Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +15 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,8 @@ public final class JobStatus { final String sourceTag; @Nullable private final String mNamespace; /** An ID that can be used to uniquely identify the job when logging statsd metrics. */ private final long mLoggingJobId; final String tag; Loading Loading @@ -568,6 +570,7 @@ public final class JobStatus { this.callingUid = callingUid; this.standbyBucket = standbyBucket; mNamespace = namespace; mLoggingJobId = generateLoggingId(namespace, job.getId()); int tempSourceUid = -1; if (sourceUserId != -1 && sourcePackageName != null) { Loading Loading @@ -804,6 +807,13 @@ public final class JobStatus { /*innerFlags=*/ 0, /* dynamicConstraints */ 0); } private long generateLoggingId(@Nullable String namespace, int jobId) { if (namespace == null) { return jobId; } return ((long) namespace.hashCode()) << 31 | jobId; } public void enqueueWorkLocked(JobWorkItem work) { if (pendingWork == null) { pendingWork = new ArrayList<>(); Loading Loading @@ -956,6 +966,11 @@ public final class JobStatus { return job.getId(); } /** Returns an ID that can be used to uniquely identify the job when logging statsd metrics. */ public long getLoggingJobId() { return mLoggingJobId; } public void printUniqueId(PrintWriter pw) { if (mNamespace != null) { pw.print(mNamespace); Loading