diff options
| author | Bookatz <bookatz@google.com> | 2018-01-16 11:24:30 -0800 |
|---|---|---|
| committer | Adam Bookatz <bookatz@google.com> | 2018-01-26 17:26:20 +0000 |
| commit | 8bdae8d682f922384de6076f3fa6db0f3d710b26 (patch) | |
| tree | 0a8ffc699d131990f19cdf4d1359786f528e526b /core/java/android | |
| parent | 83f489b583570523257e2b1c838ae73ad0829c4c (diff) | |
Proto enums for DeviceIdleMode
Created an enums.proto that contains the device idle modes,
which is referenced by batterystats.
Note that, currently, batterystats is the origin of these
constants in the java code, and I have kept that as is.
Thus, batterystats references the enum.
Nevertheless, because the actual control of device idle
mode is DeviceIdleController.java, where these constants
will likely one day be moved, I have put the constants
in server/enums.proto (since DeviceIdleController is
in server, not os like BatteryStats).
Bug: 69478930
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.HostAtomTests#testDeviceIdleModeStateChangedAtom
Change-Id: I6e66801ae8256aab423067f9a4b852a194564a8d
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/BatteryStats.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 03a8dba5a82c..fd0e5ae51892 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -20,6 +20,7 @@ import android.app.ActivityManager; import android.app.job.JobParameters; import android.content.Context; import android.content.pm.ApplicationInfo; +import android.server.ServerProtoEnums; import android.service.batterystats.BatteryStatsServiceDumpProto; import android.telephony.SignalStrength; import android.text.format.DateFormat; @@ -2054,17 +2055,17 @@ public abstract class BatteryStats implements Parcelable { /** * Constant for device idle mode: not active. */ - public static final int DEVICE_IDLE_MODE_OFF = 0; + public static final int DEVICE_IDLE_MODE_OFF = ServerProtoEnums.DEVICE_IDLE_MODE_OFF; // 0 /** * Constant for device idle mode: active in lightweight mode. */ - public static final int DEVICE_IDLE_MODE_LIGHT = 1; + public static final int DEVICE_IDLE_MODE_LIGHT = ServerProtoEnums.DEVICE_IDLE_MODE_LIGHT; // 1 /** * Constant for device idle mode: active in full mode. */ - public static final int DEVICE_IDLE_MODE_DEEP = 2; + public static final int DEVICE_IDLE_MODE_DEEP = ServerProtoEnums.DEVICE_IDLE_MODE_DEEP; // 2 /** * Returns the time in microseconds that device has been in idle mode while |
