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