Loading cmds/statsd/src/atoms.proto +5 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ option java_outer_classname = "AtomsProto"; import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; import "frameworks/base/core/proto/android/app/enums.proto"; import "frameworks/base/core/proto/android/app/job/enums.proto"; import "frameworks/base/core/proto/android/bluetooth/enums.proto"; import "frameworks/base/core/proto/android/os/enums.proto"; import "frameworks/base/core/proto/android/server/enums.proto"; Loading Loading @@ -362,7 +363,10 @@ message ScheduledJobStateChanged { } optional State state = 3; // TODO: Consider adding the stopReason (int) // The reason a job has stopped. // This is only applicable when the state is FINISHED. // The default value is CANCELED. optional android.app.job.StopReasonEnum stop_reason = 4; } /** Loading core/java/android/app/job/JobParameters.java +6 −5 Original line number Diff line number Diff line Loading @@ -36,15 +36,16 @@ import android.os.RemoteException; public class JobParameters implements Parcelable { /** @hide */ public static final int REASON_CANCELED = 0; public static final int REASON_CANCELED = JobProtoEnums.STOP_REASON_CANCELLED; // 0. /** @hide */ public static final int REASON_CONSTRAINTS_NOT_SATISFIED = 1; public static final int REASON_CONSTRAINTS_NOT_SATISFIED = JobProtoEnums.STOP_REASON_CONSTRAINTS_NOT_SATISFIED; //1. /** @hide */ public static final int REASON_PREEMPT = 2; public static final int REASON_PREEMPT = JobProtoEnums.STOP_REASON_PREEMPT; // 2. /** @hide */ public static final int REASON_TIMEOUT = 3; public static final int REASON_TIMEOUT = JobProtoEnums.STOP_REASON_TIMEOUT; // 3. /** @hide */ public static final int REASON_DEVICE_IDLE = 4; public static final int REASON_DEVICE_IDLE = JobProtoEnums.STOP_REASON_DEVICE_IDLE; // 4. /** @hide */ public static String getReasonName(int reason) { Loading core/java/com/android/internal/os/BatteryStatsImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.os; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.job.JobProtoEnums; import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.UidTraffic; import android.content.ContentResolver; Loading Loading @@ -10045,7 +10046,8 @@ public class BatteryStatsImpl extends BatteryStats { if (t != null) { t.startRunningLocked(elapsedRealtimeMs); StatsLog.write_non_chained(StatsLog.SCHEDULED_JOB_STATE_CHANGED, getUid(), null, name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED); name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED, JobProtoEnums.STOP_REASON_CANCELLED); } } Loading @@ -10055,7 +10057,8 @@ public class BatteryStatsImpl extends BatteryStats { t.stopRunningLocked(elapsedRealtimeMs); if (!t.isRunningLocked()) { // only tell statsd if truly stopped StatsLog.write_non_chained(StatsLog.SCHEDULED_JOB_STATE_CHANGED, getUid(), null, name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED); name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED, stopReason); } } if (mBsi.mOnBatteryTimeBase.isRunning()) { Loading core/proto/android/app/jobparameters.proto→core/proto/android/app/job/enums.proto +12 −13 Original line number Diff line number Diff line Loading @@ -15,19 +15,18 @@ */ syntax = "proto2"; option java_multiple_files = true; package android.app; package android.app.job; /** * An android.app.JobParameters object. */ message JobParametersProto { enum CancelReason { REASON_CANCELLED = 0; REASON_CONSTRAINTS_NOT_SATISFIED = 1; REASON_PREEMPT = 2; REASON_TIMEOUT = 3; REASON_DEVICE_IDLE = 4; } option java_outer_classname = "JobProtoEnums"; option java_multiple_files = true; // Reasons a job is stopped. // Primarily used in android.app.job.JobParameters.java. enum StopReasonEnum { STOP_REASON_CANCELLED = 0; STOP_REASON_CONSTRAINTS_NOT_SATISFIED = 1; STOP_REASON_PREEMPT = 2; STOP_REASON_TIMEOUT = 3; STOP_REASON_DEVICE_IDLE = 4; } core/proto/android/os/batterystats.proto +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ option java_multiple_files = true; package android.os; import "frameworks/base/core/proto/android/app/jobparameters.proto"; import "frameworks/base/core/proto/android/app/job/enums.proto"; import "frameworks/base/core/proto/android/os/powermanager.proto"; import "frameworks/base/core/proto/android/telephony/enums.proto"; import "frameworks/base/libs/incident/proto/android/privacy.proto"; Loading Loading @@ -637,7 +637,7 @@ message UidProto { message ReasonCount { option (android.msg_privacy).dest = DEST_AUTOMATIC; optional android.app.JobParametersProto.CancelReason name = 1; optional android.app.job.StopReasonEnum name = 1; optional int32 count = 2; } repeated ReasonCount reason_count = 2; Loading Loading
cmds/statsd/src/atoms.proto +5 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ option java_outer_classname = "AtomsProto"; import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; import "frameworks/base/core/proto/android/app/enums.proto"; import "frameworks/base/core/proto/android/app/job/enums.proto"; import "frameworks/base/core/proto/android/bluetooth/enums.proto"; import "frameworks/base/core/proto/android/os/enums.proto"; import "frameworks/base/core/proto/android/server/enums.proto"; Loading Loading @@ -362,7 +363,10 @@ message ScheduledJobStateChanged { } optional State state = 3; // TODO: Consider adding the stopReason (int) // The reason a job has stopped. // This is only applicable when the state is FINISHED. // The default value is CANCELED. optional android.app.job.StopReasonEnum stop_reason = 4; } /** Loading
core/java/android/app/job/JobParameters.java +6 −5 Original line number Diff line number Diff line Loading @@ -36,15 +36,16 @@ import android.os.RemoteException; public class JobParameters implements Parcelable { /** @hide */ public static final int REASON_CANCELED = 0; public static final int REASON_CANCELED = JobProtoEnums.STOP_REASON_CANCELLED; // 0. /** @hide */ public static final int REASON_CONSTRAINTS_NOT_SATISFIED = 1; public static final int REASON_CONSTRAINTS_NOT_SATISFIED = JobProtoEnums.STOP_REASON_CONSTRAINTS_NOT_SATISFIED; //1. /** @hide */ public static final int REASON_PREEMPT = 2; public static final int REASON_PREEMPT = JobProtoEnums.STOP_REASON_PREEMPT; // 2. /** @hide */ public static final int REASON_TIMEOUT = 3; public static final int REASON_TIMEOUT = JobProtoEnums.STOP_REASON_TIMEOUT; // 3. /** @hide */ public static final int REASON_DEVICE_IDLE = 4; public static final int REASON_DEVICE_IDLE = JobProtoEnums.STOP_REASON_DEVICE_IDLE; // 4. /** @hide */ public static String getReasonName(int reason) { Loading
core/java/com/android/internal/os/BatteryStatsImpl.java +5 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.internal.os; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.job.JobProtoEnums; import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.UidTraffic; import android.content.ContentResolver; Loading Loading @@ -10045,7 +10046,8 @@ public class BatteryStatsImpl extends BatteryStats { if (t != null) { t.startRunningLocked(elapsedRealtimeMs); StatsLog.write_non_chained(StatsLog.SCHEDULED_JOB_STATE_CHANGED, getUid(), null, name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED); name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__STARTED, JobProtoEnums.STOP_REASON_CANCELLED); } } Loading @@ -10055,7 +10057,8 @@ public class BatteryStatsImpl extends BatteryStats { t.stopRunningLocked(elapsedRealtimeMs); if (!t.isRunningLocked()) { // only tell statsd if truly stopped StatsLog.write_non_chained(StatsLog.SCHEDULED_JOB_STATE_CHANGED, getUid(), null, name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED); name, StatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__FINISHED, stopReason); } } if (mBsi.mOnBatteryTimeBase.isRunning()) { Loading
core/proto/android/app/jobparameters.proto→core/proto/android/app/job/enums.proto +12 −13 Original line number Diff line number Diff line Loading @@ -15,19 +15,18 @@ */ syntax = "proto2"; option java_multiple_files = true; package android.app; package android.app.job; /** * An android.app.JobParameters object. */ message JobParametersProto { enum CancelReason { REASON_CANCELLED = 0; REASON_CONSTRAINTS_NOT_SATISFIED = 1; REASON_PREEMPT = 2; REASON_TIMEOUT = 3; REASON_DEVICE_IDLE = 4; } option java_outer_classname = "JobProtoEnums"; option java_multiple_files = true; // Reasons a job is stopped. // Primarily used in android.app.job.JobParameters.java. enum StopReasonEnum { STOP_REASON_CANCELLED = 0; STOP_REASON_CONSTRAINTS_NOT_SATISFIED = 1; STOP_REASON_PREEMPT = 2; STOP_REASON_TIMEOUT = 3; STOP_REASON_DEVICE_IDLE = 4; }
core/proto/android/os/batterystats.proto +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ option java_multiple_files = true; package android.os; import "frameworks/base/core/proto/android/app/jobparameters.proto"; import "frameworks/base/core/proto/android/app/job/enums.proto"; import "frameworks/base/core/proto/android/os/powermanager.proto"; import "frameworks/base/core/proto/android/telephony/enums.proto"; import "frameworks/base/libs/incident/proto/android/privacy.proto"; Loading Loading @@ -637,7 +637,7 @@ message UidProto { message ReasonCount { option (android.msg_privacy).dest = DEST_AUTOMATIC; optional android.app.JobParametersProto.CancelReason name = 1; optional android.app.job.StopReasonEnum name = 1; optional int32 count = 2; } repeated ReasonCount reason_count = 2; Loading