xref: /aosp_15_r20/frameworks/proto_logging/stats/enums/os/enums.proto (revision 64c55175f22a2714b5ba1250098ad9bbc12ec7cd)
1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18package android.os;
19
20option java_outer_classname = "OsProtoEnums";
21option java_multiple_files = true;
22
23/**
24 * The status of a backported fix for a known issue on this device.
25 *
26 * Keep in sync with frameworks/base/core/java/android/os/Build.java
27 *
28 * Since android BAKLAVA
29 */
30enum BackportedFixStatus {
31    /** The status of the known issue on this device is not known. */
32    BACKPORTED_FIX_STATUS_UNKNOWN = 0;
33    /** The known issue is fixed on this device. */
34    BACKPORTED_FIX_STATUS_FIXED = 1;
35    /**
36     * The known issue is not applicable to this device.
37     *
38     * For example if the issue only affects a specific brand, devices from other brands would
39     * report not applicable.
40     */
41    BACKPORTED_FIX_STATUS_NOT_APPLICABLE = 2;
42    /** The known issue is not fixed on this device. */
43    BACKPORTED_FIX_STATUS_NOT_FIXED = 3;
44}
45
46// These constants are defined in hardware/interfaces/health/1.0/types.hal
47// They are primarily used by android/os/BatteryManager.java.
48enum BatteryHealthEnum {
49    BATTERY_HEALTH_INVALID = 0;
50    BATTERY_HEALTH_UNKNOWN = 1;
51    BATTERY_HEALTH_GOOD = 2;
52    BATTERY_HEALTH_OVERHEAT = 3;
53    BATTERY_HEALTH_DEAD = 4;
54    BATTERY_HEALTH_OVER_VOLTAGE = 5;
55    BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6;
56    BATTERY_HEALTH_COLD = 7;
57    BATTERY_HEALTH_FAIR = 8;
58    BATTERY_HEALTH_NOT_AVAILABLE = 11;
59    BATTERY_HEALTH_INCONSISTENT = 12;
60}
61
62// Plug states, primarily used by android/os/BatteryManager.java.
63enum BatteryPluggedStateEnum {
64    // Note that NONE is not in BatteryManager.java's constants.
65    BATTERY_PLUGGED_NONE = 0;
66    // Power source is an AC charger.
67    BATTERY_PLUGGED_AC = 1;
68    // Power source is a USB port.
69    BATTERY_PLUGGED_USB = 2;
70    // Power source is wireless.
71    BATTERY_PLUGGED_WIRELESS = 4;
72    // Power source is dock.
73    BATTERY_PLUGGED_DOCK = 8;
74}
75
76// These constants are defined in hardware/interfaces/health/1.0/types.hal
77// They are primarily used by android/os/BatteryManager.java.
78enum BatteryStatusEnum {
79    BATTERY_STATUS_INVALID = 0;
80    BATTERY_STATUS_UNKNOWN = 1;
81    BATTERY_STATUS_CHARGING = 2;
82    BATTERY_STATUS_DISCHARGING = 3;
83    BATTERY_STATUS_NOT_CHARGING = 4;
84    BATTERY_STATUS_FULL = 5;
85}
86
87enum PowerComponentEnum {
88    POWER_COMPONENT_SCREEN = 0;
89    POWER_COMPONENT_CPU = 1;
90    POWER_COMPONENT_BLUETOOTH = 2;
91    POWER_COMPONENT_CAMERA = 3;
92    POWER_COMPONENT_AUDIO = 4;
93    POWER_COMPONENT_VIDEO = 5;
94    POWER_COMPONENT_FLASHLIGHT = 6;
95    POWER_COMPONENT_SYSTEM_SERVICES = 7;
96    POWER_COMPONENT_MOBILE_RADIO = 8;
97    POWER_COMPONENT_SENSORS = 9;
98    POWER_COMPONENT_GNSS = 10;
99    POWER_COMPONENT_WIFI = 11;
100    POWER_COMPONENT_WAKELOCK = 12;
101    POWER_COMPONENT_MEMORY = 13;
102    POWER_COMPONENT_PHONE = 14;
103    POWER_COMPONENT_AMBIENT_DISPLAY = 15;
104    POWER_COMPONENT_IDLE = 16;
105    // Power that is re-attributed to other battery consumers. For example, for System Server
106    // this represents the power attributed to apps requesting system services.
107    // The value should be negative or zero.
108    POWER_COMPONENT_REATTRIBUTED_TO_OTHER_CONSUMERS = 17;
109}
110
111// These constants are defined in hardware/interfaces/thermal/1.0/types.hal
112// and in hardware/interfaces/thermal/2.0/types.hal
113// They are primarily used by android/os/HardwarePropertiesManager.java.
114// Any change to the types in the thermal hal should be made here as well.
115enum TemperatureTypeEnum {
116    TEMPERATURE_TYPE_UNKNOWN = -1;
117    TEMPERATURE_TYPE_CPU = 0;
118    TEMPERATURE_TYPE_GPU = 1;
119    TEMPERATURE_TYPE_BATTERY = 2;
120    TEMPERATURE_TYPE_SKIN = 3;
121    TEMPERATURE_TYPE_USB_PORT = 4;
122    TEMPERATURE_TYPE_POWER_AMPLIFIER = 5;
123
124    // Battery Charge Limit - virtual thermal sensors.
125    TEMPERATURE_TYPE_BCL_VOLTAGE = 6;
126    TEMPERATURE_TYPE_BCL_CURRENT = 7;
127    TEMPERATURE_TYPE_BCL_PERCENTAGE = 8;
128
129    // Neural Processing Unit.
130    TEMPERATURE_TYPE_NPU = 9;
131    TEMPERATURE_TYPE_TPU = 10;
132    TEMPERATURE_TYPE_DISPLAY = 11;
133    TEMPERATURE_TYPE_MODEM = 12;
134    TEMPERATURE_TYPE_SOC = 13;
135    TEMPERATURE_TYPE_WIFI = 14;
136    TEMPERATURE_TYPE_CAMERA = 15;
137    TEMPERATURE_TYPE_FLASHLIGHT = 16;
138    TEMPERATURE_TYPE_SPEAKER = 17;
139    TEMPERATURE_TYPE_AMBIENT = 18;
140    TEMPERATURE_TYPE_POGO = 19;
141}
142
143// Device throttling severity
144// These constants are defined in hardware/interfaces/thermal/2.0/types.hal.
145// Any change to the types in the thermal hal should be made here as well.
146enum ThrottlingSeverityEnum {
147    // Not under throttling.
148    NONE = 0;
149    // Light throttling where UX is not impacted.
150    LIGHT = 1;
151    // Moderate throttling where UX is not largely impacted.
152    MODERATE = 2;
153    // Severe throttling where UX is largely impacted.
154    // Similar to 1.0 throttlingThreshold.
155    SEVERE = 3;
156    // Platform has done everything to reduce power.
157    CRITICAL = 4;
158    // Key components in platform are shutting down due to thermal condition.
159    // Device functionalities will be limited.
160    EMERGENCY = 5;
161    // Need shutdown immediately.
162    SHUTDOWN = 6;
163};
164
165// Device cooling device types.
166// These constants are defined in hardware/interfaces/thermal/2.0/types.hal.
167// Any change to the types in the thermal hal should be made here as well.
168enum CoolingTypeEnum {
169    FAN = 0;
170    BATTERY = 1;
171    CPU = 2;
172    GPU = 3;
173    MODEM = 4;
174    NPU = 5;
175    COMPONENT = 6;
176    TPU = 7;
177    POWER_AMPLIFIER = 8;
178    DISPLAY = 9;
179    SPEAKER = 10;
180    WIFI = 11;
181    CAMERA = 12;
182    FLASHLIGHT = 13;
183    USB_PORT = 14;
184};
185
186// Wakelock types, primarily used by android/os/PowerManager.java.
187enum WakeLockLevelEnum {
188    // NOTE: Wake lock levels were previously defined as a bit field, except
189    // that only a few combinations were actually supported so the bit field
190    // was removed. This explains why the numbering scheme is so odd. If
191    // adding a new wake lock level, any unused value can be used.
192
193    // Ensures that the CPU is running; the screen and keyboard backlight
194    // will be allowed to go off.
195    PARTIAL_WAKE_LOCK = 1;
196
197    // Ensures that the screen is on (but may be dimmed); the keyboard
198    // backlight will be allowed to go off. If the user presses the power
199    // button, then the SCREEN_DIM_WAKE_LOCK will be implicitly released by
200    // the system, causing both the screen and the CPU to be turned off.
201    SCREEN_DIM_WAKE_LOCK = 6 [deprecated = true];
202
203    // Ensures that the screen is on at full brightness; the keyboard
204    // backlight will be allowed to go off. If the user presses the power
205    // button, then the SCREEN_BRIGHT_WAKE_LOCK will be implicitly released
206    // by the system, causing both the screen and the CPU to be turned off.
207    SCREEN_BRIGHT_WAKE_LOCK = 10 [deprecated = true];
208
209    // Ensures that the screen and keyboard backlight are on at full
210    // brightness. If the user presses the power button, then the
211    // FULL_WAKE_LOCK will be implicitly released by the system, causing
212    // both the screen and the CPU to be turned off.
213    FULL_WAKE_LOCK = 26 [deprecated = true];
214
215    // Turns the screen off when the proximity sensor activates. If the
216    // proximity sensor detects that an object is nearby, the screen turns
217    // off immediately. Shortly after the object moves away, the screen
218    // turns on again.
219    // A proximity wake lock does not prevent the device from falling asleep
220    // unlike FULL_WAKE_LOCK, SCREEN_BRIGHT_WAKE_LOCK and
221    // SCREEN_DIM_WAKE_LOCK. If there is no user activity and no other wake
222    // locks are held, then the device will fall asleep (and lock) as usual.
223    // However, the device will not fall asleep while the screen has been
224    // turned off by the proximity sensor because it effectively counts as
225    // ongoing user activity.
226    PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32;
227
228    // Put the screen in a low power state and allow the CPU to suspend if
229    // no other wake locks are held. This is used by the dream manager to
230    // implement doze mode. It currently has no effect unless the power
231    // manager is in the dozing state.
232    DOZE_WAKE_LOCK = 64;
233
234    // Keep the device awake enough to allow drawing to occur. This is used
235    // by the window manager to allow applications to draw while the system
236    // is dozing. It currently has no effect unless the power manager is in
237    // the dozing state.
238    DRAW_WAKE_LOCK = 128;
239
240    // Allow system service could override the current screen timeout
241    // according to the polcy.
242    SCREEN_TIMEOUT_OVERRIDE_WAKE_LOCK = 256;
243}
244
245// They are primarily used by android/os/BatteryManager.java.
246enum BatteryChargingStatusEnum {
247    BATTERY_STATUS_NORMAL = 1;
248    BATTERY_STATUS_TOO_COLD = 2;
249    BATTERY_STATUS_TOO_HOT = 3;
250    BATTERY_STATUS_LONG_LIFE = 4;
251    BATTERY_STATUS_ADAPTIVE = 5;
252}
253
254
255// They are primarily used by android/os/BatteryManager.java.
256enum BatteryChargingPolicyEnum {
257    CHARGING_POLICY_DEFAULT = 1;
258    CHARGING_POLICY_ADAPTIVE_AON = 2;
259    CHARGING_POLICY_ADAPTIVE_AC = 3;
260    CHARGING_POLICY_ADAPTIVE_LONGLIFE = 4;
261}
262