blob: aa99ac75cbdfb9e3a0158e228dee9bfe8dd6f7df [file] [log] [blame]
Bookatz1a1b0462018-01-12 11:47:03 -08001/*
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}
47
48// These constants are defined in hardware/interfaces/health/1.0/types.hal
49// They are primarily used by android/os/BatteryManager.java.
50enum BatteryStatusEnum {
51 BATTERY_STATUS_INVALID = 0;
52 BATTERY_STATUS_UNKNOWN = 1;
53 BATTERY_STATUS_CHARGING = 2;
54 BATTERY_STATUS_DISCHARGING = 3;
55 BATTERY_STATUS_NOT_CHARGING = 4;
56 BATTERY_STATUS_FULL = 5;
57}
58
Tej Singh40298312018-02-16 00:15:09 -080059// These constants are defined in hardware/interfaces/thermal/1.0/types.hal
60// They are primarily used by android/os/HardwarePropertiesManager.java.
61// Any change to the types in the thermal hal should be made here as well.
62enum TemperatureTypeEnum {
63 TEMPERATURE_TYPE_UKNOWN = -1;
64 TEMPERATURE_TYPE_CPU = 0;
65 TEMPERATURE_TYPE_GPU = 1;
66 TEMPERATURE_TYPE_BATTERY = 2;
67 TEMPERATURE_TYPE_SKIN = 3;
68}
69
Bookatz1a1b0462018-01-12 11:47:03 -080070// Wakelock types, primarily used by android/os/PowerManager.java.
71enum WakeLockLevelEnum {
72 // NOTE: Wake lock levels were previously defined as a bit field, except
73 // that only a few combinations were actually supported so the bit field
74 // was removed. This explains why the numbering scheme is so odd. If
75 // adding a new wake lock level, any unused value can be used.
76
77 // Ensures that the CPU is running; the screen and keyboard backlight
78 // will be allowed to go off.
79 PARTIAL_WAKE_LOCK = 1;
80
81 // Ensures that the screen is on (but may be dimmed); the keyboard
82 // backlight will be allowed to go off. If the user presses the power
83 // button, then the SCREEN_DIM_WAKE_LOCK will be implicitly released by
84 // the system, causing both the screen and the CPU to be turned off.
85 SCREEN_DIM_WAKE_LOCK = 6 [deprecated = true];
86
87 // Ensures that the screen is on at full brightness; the keyboard
88 // backlight will be allowed to go off. If the user presses the power
89 // button, then the SCREEN_BRIGHT_WAKE_LOCK will be implicitly released
90 // by the system, causing both the screen and the CPU to be turned off.
91 SCREEN_BRIGHT_WAKE_LOCK = 10 [deprecated = true];
92
93 // Ensures that the screen and keyboard backlight are on at full
94 // brightness. If the user presses the power button, then the
95 // FULL_WAKE_LOCK will be implicitly released by the system, causing
96 // both the screen and the CPU to be turned off.
97 FULL_WAKE_LOCK = 26 [deprecated = true];
98
99 // Turns the screen off when the proximity sensor activates. If the
100 // proximity sensor detects that an object is nearby, the screen turns
101 // off immediately. Shortly after the object moves away, the screen
102 // turns on again.
103 // A proximity wake lock does not prevent the device from falling asleep
104 // unlike FULL_WAKE_LOCK, SCREEN_BRIGHT_WAKE_LOCK and
105 // SCREEN_DIM_WAKE_LOCK. If there is no user activity and no other wake
106 // locks are held, then the device will fall asleep (and lock) as usual.
107 // However, the device will not fall asleep while the screen has been
108 // turned off by the proximity sensor because it effectively counts as
109 // ongoing user activity.
110 PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32;
111
112 // Put the screen in a low power state and allow the CPU to suspend if
113 // no other wake locks are held. This is used by the dream manager to
114 // implement doze mode. It currently has no effect unless the power
115 // manager is in the dozing state.
116 DOZE_WAKE_LOCK = 64;
117
118 // Keep the device awake enough to allow drawing to occur. This is used
119 // by the window manager to allow applications to draw while the system
120 // is dozing. It currently has no effect unless the power manager is in
121 // the dozing state.
122 DRAW_WAKE_LOCK = 128;
123}