• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2013 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 
17 #ifndef ANDROID_BATTERYSERVICE_H
18 #define ANDROID_BATTERYSERVICE_H
19 
20 #include <sys/types.h>
21 #include <utils/Errors.h>
22 #include <utils/String8.h>
23 
24 namespace android {
25 
26 #include "BatteryServiceConstants.h"
27 
28 // must be kept in sync with definitions in
29 // frameworks/base/core/java/android/os/BatteryManager.java
30 enum {
31     BATTERY_PROP_CHARGE_COUNTER = 1, // equals BATTERY_PROPERTY_CHARGE_COUNTER
32     BATTERY_PROP_CURRENT_NOW = 2, // equals BATTERY_PROPERTY_CURRENT_NOW
33     BATTERY_PROP_CURRENT_AVG = 3, // equals BATTERY_PROPERTY_CURRENT_AVERAGE
34     BATTERY_PROP_CAPACITY = 4, // equals BATTERY_PROPERTY_CAPACITY
35     BATTERY_PROP_ENERGY_COUNTER = 5, // equals BATTERY_PROPERTY_ENERGY_COUNTER
36     BATTERY_PROP_BATTERY_STATUS = 6, // equals BATTERY_PROPERTY_BATTERY_STATUS
37 };
38 
39 struct BatteryProperties {
40     bool chargerAcOnline;
41     bool chargerUsbOnline;
42     bool chargerWirelessOnline;
43     bool chargerDockOnline;
44     int maxChargingCurrent;
45     int maxChargingVoltage;
46     int batteryStatus;
47     int batteryHealth;
48     bool batteryPresent;
49     int batteryLevel;
50     int batteryVoltage;
51     int batteryTemperature;
52     int batteryCurrent;
53     int batteryCycleCount;
54     int batteryFullCharge;
55     int batteryChargeCounter;
56     String8 batteryTechnology;
57 };
58 
59 struct BatteryProperty {
60     int64_t valueInt64;
61 };
62 
63 }; // namespace android
64 
65 #endif // ANDROID_BATTERYSERVICE_H
66