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 int maxChargingCurrent; 44 int maxChargingVoltage; 45 int batteryStatus; 46 int batteryHealth; 47 bool batteryPresent; 48 int batteryLevel; 49 int batteryVoltage; 50 int batteryTemperature; 51 int batteryCurrent; 52 int batteryCycleCount; 53 int batteryFullCharge; 54 int batteryChargeCounter; 55 String8 batteryTechnology; 56 }; 57 58 struct BatteryProperty { 59 int64_t valueInt64; 60 }; 61 62 }; // namespace android 63 64 #endif // ANDROID_BATTERYSERVICE_H 65