• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// These constants are defined in hardware/interfaces/health/1.0/types.hal
24// They are primarily used by android/os/BatteryManager.java.
25enum BatteryHealthEnum {
26    BATTERY_HEALTH_INVALID = 0;
27    BATTERY_HEALTH_UNKNOWN = 1;
28    BATTERY_HEALTH_GOOD = 2;
29    BATTERY_HEALTH_OVERHEAT = 3;
30    BATTERY_HEALTH_DEAD = 4;
31    BATTERY_HEALTH_OVER_VOLTAGE = 5;
32    BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6;
33    BATTERY_HEALTH_COLD = 7;
34    BATTERY_HEALTH_FAIR = 8;
35    BATTERY_HEALTH_NOT_AVAILABLE = 11;
36    BATTERY_HEALTH_INCONSISTENT = 12;
37}
38
39// Plug states, primarily used by android/os/BatteryManager.java.
40enum BatteryPluggedStateEnum {
41    // Note that NONE is not in BatteryManager.java's constants.
42    BATTERY_PLUGGED_NONE = 0;
43    // Power source is an AC charger.
44    BATTERY_PLUGGED_AC = 1;
45    // Power source is a USB port.
46    BATTERY_PLUGGED_USB = 2;
47    // Power source is wireless.
48    BATTERY_PLUGGED_WIRELESS = 4;
49    // Power source is dock.
50    BATTERY_PLUGGED_DOCK = 8;
51}
52
53// These constants are defined in hardware/interfaces/health/1.0/types.hal
54// They are primarily used by android/os/BatteryManager.java.
55enum BatteryStatusEnum {
56    BATTERY_STATUS_INVALID = 0;
57    BATTERY_STATUS_UNKNOWN = 1;
58    BATTERY_STATUS_CHARGING = 2;
59    BATTERY_STATUS_DISCHARGING = 3;
60    BATTERY_STATUS_NOT_CHARGING = 4;
61    BATTERY_STATUS_FULL = 5;
62}
63
64enum PowerComponentEnum {
65    POWER_COMPONENT_SCREEN = 0;
66    POWER_COMPONENT_CPU = 1;
67    POWER_COMPONENT_BLUETOOTH = 2;
68    POWER_COMPONENT_CAMERA = 3;
69    POWER_COMPONENT_AUDIO = 4;
70    POWER_COMPONENT_VIDEO = 5;
71    POWER_COMPONENT_FLASHLIGHT = 6;
72    POWER_COMPONENT_SYSTEM_SERVICES = 7;
73    POWER_COMPONENT_MOBILE_RADIO = 8;
74    POWER_COMPONENT_SENSORS = 9;
75    POWER_COMPONENT_GNSS = 10;
76    POWER_COMPONENT_WIFI = 11;
77    POWER_COMPONENT_WAKELOCK = 12;
78    POWER_COMPONENT_MEMORY = 13;
79    POWER_COMPONENT_PHONE = 14;
80    POWER_COMPONENT_AMBIENT_DISPLAY = 15;
81    POWER_COMPONENT_IDLE = 16;
82    // Power that is re-attributed to other battery consumers. For example, for System Server
83    // this represents the power attributed to apps requesting system services.
84    // The value should be negative or zero.
85    POWER_COMPONENT_REATTRIBUTED_TO_OTHER_CONSUMERS = 17;
86}
87
88// These constants are defined in hardware/interfaces/thermal/1.0/types.hal
89// and in hardware/interfaces/thermal/2.0/types.hal
90// They are primarily used by android/os/HardwarePropertiesManager.java.
91// Any change to the types in the thermal hal should be made here as well.
92enum TemperatureTypeEnum {
93    TEMPERATURE_TYPE_UNKNOWN = -1;
94    TEMPERATURE_TYPE_CPU = 0;
95    TEMPERATURE_TYPE_GPU = 1;
96    TEMPERATURE_TYPE_BATTERY = 2;
97    TEMPERATURE_TYPE_SKIN = 3;
98    TEMPERATURE_TYPE_USB_PORT = 4;
99    TEMPERATURE_TYPE_POWER_AMPLIFIER = 5;
100
101    // Battery Charge Limit - virtual thermal sensors.
102    TEMPERATURE_TYPE_BCL_VOLTAGE = 6;
103    TEMPERATURE_TYPE_BCL_CURRENT = 7;
104    TEMPERATURE_TYPE_BCL_PERCENTAGE = 8;
105
106    // Neural Processing Unit.
107    TEMPERATURE_TYPE_NPU = 9;
108}
109
110// Device throttling severity
111// These constants are defined in hardware/interfaces/thermal/2.0/types.hal.
112// Any change to the types in the thermal hal should be made here as well.
113enum ThrottlingSeverityEnum {
114    // Not under throttling.
115    NONE = 0;
116    // Light throttling where UX is not impacted.
117    LIGHT = 1;
118    // Moderate throttling where UX is not largely impacted.
119    MODERATE = 2;
120    // Severe throttling where UX is largely impacted.
121    // Similar to 1.0 throttlingThreshold.
122    SEVERE = 3;
123    // Platform has done everything to reduce power.
124    CRITICAL = 4;
125    // Key components in platform are shutting down due to thermal condition.
126    // Device functionalities will be limited.
127    EMERGENCY = 5;
128    // Need shutdown immediately.
129    SHUTDOWN = 6;
130};
131
132// Device cooling device types.
133// These constants are defined in hardware/interfaces/thermal/2.0/types.hal.
134// Any change to the types in the thermal hal should be made here as well.
135enum CoolingTypeEnum {
136    FAN = 0;
137    BATTERY = 1;
138    CPU = 2;
139    GPU = 3;
140    MODEM = 4;
141    NPU = 5;
142    COMPONENT = 6;
143};
144
145// Wakelock types, primarily used by android/os/PowerManager.java.
146enum WakeLockLevelEnum {
147    // NOTE: Wake lock levels were previously defined as a bit field, except
148    // that only a few combinations were actually supported so the bit field
149    // was removed. This explains why the numbering scheme is so odd. If
150    // adding a new wake lock level, any unused value can be used.
151
152    // Ensures that the CPU is running; the screen and keyboard backlight
153    // will be allowed to go off.
154    PARTIAL_WAKE_LOCK = 1;
155
156    // Ensures that the screen is on (but may be dimmed); the keyboard
157    // backlight will be allowed to go off. If the user presses the power
158    // button, then the SCREEN_DIM_WAKE_LOCK will be implicitly released by
159    // the system, causing both the screen and the CPU to be turned off.
160    SCREEN_DIM_WAKE_LOCK = 6 [deprecated = true];
161
162    // Ensures that the screen is on at full brightness; the keyboard
163    // backlight will be allowed to go off. If the user presses the power
164    // button, then the SCREEN_BRIGHT_WAKE_LOCK will be implicitly released
165    // by the system, causing both the screen and the CPU to be turned off.
166    SCREEN_BRIGHT_WAKE_LOCK = 10 [deprecated = true];
167
168    // Ensures that the screen and keyboard backlight are on at full
169    // brightness. If the user presses the power button, then the
170    // FULL_WAKE_LOCK will be implicitly released by the system, causing
171    // both the screen and the CPU to be turned off.
172    FULL_WAKE_LOCK = 26 [deprecated = true];
173
174    // Turns the screen off when the proximity sensor activates. If the
175    // proximity sensor detects that an object is nearby, the screen turns
176    // off immediately. Shortly after the object moves away, the screen
177    // turns on again.
178    // A proximity wake lock does not prevent the device from falling asleep
179    // unlike FULL_WAKE_LOCK, SCREEN_BRIGHT_WAKE_LOCK and
180    // SCREEN_DIM_WAKE_LOCK. If there is no user activity and no other wake
181    // locks are held, then the device will fall asleep (and lock) as usual.
182    // However, the device will not fall asleep while the screen has been
183    // turned off by the proximity sensor because it effectively counts as
184    // ongoing user activity.
185    PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32;
186
187    // Put the screen in a low power state and allow the CPU to suspend if
188    // no other wake locks are held. This is used by the dream manager to
189    // implement doze mode. It currently has no effect unless the power
190    // manager is in the dozing state.
191    DOZE_WAKE_LOCK = 64;
192
193    // Keep the device awake enough to allow drawing to occur. This is used
194    // by the window manager to allow applications to draw while the system
195    // is dozing. It currently has no effect unless the power manager is in
196    // the dozing state.
197    DRAW_WAKE_LOCK = 128;
198}
199
200// They are primarily used by android/os/BatteryManager.java.
201enum BatteryChargingStatusEnum {
202    BATTERY_STATUS_NORMAL = 1;
203    BATTERY_STATUS_TOO_COLD = 2;
204    BATTERY_STATUS_TOO_HOT = 3;
205    BATTERY_STATUS_LONG_LIFE = 4;
206    BATTERY_STATUS_ADAPTIVE = 5;
207}
208
209
210// They are primarily used by android/os/BatteryManager.java.
211enum BatteryChargingPolicyEnum {
212    CHARGING_POLICY_DEFAULT = 1;
213    CHARGING_POLICY_ADAPTIVE_AON = 2;
214    CHARGING_POLICY_ADAPTIVE_AC = 3;
215    CHARGING_POLICY_ADAPTIVE_LONGLIFE = 4;
216}
217