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 <binder/Parcel.h> 21#include <sys/types.h> 22#include <utils/Errors.h> 23#include <utils/String8.h> 24 25namespace android { 26 27#include "BatteryServiceConstants.h" 28 29// must be kept in sync with definitions in 30// frameworks/base/core/java/android/os/BatteryManager.java 31enum { 32 BATTERY_PROP_CHARGE_COUNTER = 1, // equals BATTERY_PROPERTY_CHARGE_COUNTER 33 BATTERY_PROP_CURRENT_NOW = 2, // equals BATTERY_PROPERTY_CURRENT_NOW 34 BATTERY_PROP_CURRENT_AVG = 3, // equals BATTERY_PROPERTY_CURRENT_AVERAGE 35 BATTERY_PROP_CAPACITY = 4, // equals BATTERY_PROPERTY_CAPACITY 36 BATTERY_PROP_ENERGY_COUNTER = 5, // equals BATTERY_PROPERTY_ENERGY_COUNTER 37 BATTERY_PROP_BATTERY_STATUS = 6, // equals BATTERY_PROPERTY_BATTERY_STATUS 38}; 39 40struct BatteryProperties { 41 bool chargerAcOnline; 42 bool chargerUsbOnline; 43 bool chargerWirelessOnline; 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 status_t writeToParcel(Parcel* parcel) const; 59 status_t readFromParcel(Parcel* parcel); 60}; 61 62struct BatteryProperty { 63 int64_t valueInt64; 64 65 status_t writeToParcel(Parcel* parcel) const; 66 status_t readFromParcel(Parcel* parcel); 67}; 68 69}; // namespace android 70 71#endif // ANDROID_BATTERYSERVICE_H 72