summaryrefslogtreecommitdiffstats
path: root/healthd/healthd.h
diff options
context:
space:
mode:
Diffstat (limited to 'healthd/healthd.h')
-rw-r--r--healthd/healthd.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/healthd/healthd.h b/healthd/healthd.h
index 84b6d76..0b2a16e 100644
--- a/healthd/healthd.h
+++ b/healthd/healthd.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2013 The Android Open Source Project
+ * Copyright (C) 2015 The CyanogenMod Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,8 +49,25 @@
// batteryTemperaturePath: battery temperature (POWER_SUPPLY_PROP_TEMP)
// batteryTechnologyPath: battery technology (POWER_SUPPLY_PROP_TECHNOLOGY)
// batteryCurrentNowPath: battery current (POWER_SUPPLY_PROP_CURRENT_NOW)
+// batteryCurrentAvgPath: battery average (POWER_SUPPLY_PROP_CURRENT_AVG)
// batteryChargeCounterPath: battery accumulated charge
// (POWER_SUPPLY_PROP_CHARGE_COUNTER)
+//
+// dockBatteryStatusPath: dock charging status (POWER_SUPPLY_PROP_STATUS)
+// dockBatteryHealthPath: dock battery health (POWER_SUPPLY_PROP_HEALTH)
+// dockBatteryPresentPath: dock battery present (POWER_SUPPLY_PROP_PRESENT)
+// dockBatteryCapacityPath: remaining dock capacity (POWER_SUPPLY_PROP_CAPACITY)
+// dockBatteryVoltagePath: dock battery voltage (POWER_SUPPLY_PROP_VOLTAGE_NOW)
+// dockBatteryTemperaturePath: dock battery temperature (POWER_SUPPLY_PROP_TEMP)
+// dockBatteryTechnologyPath: dock battery technology (POWER_SUPPLY_PROP_TECHNOLOGY)
+// dockBatteryCurrentNowPath: dock battery current (POWER_SUPPLY_PROP_CURRENT_NOW)
+// dockBatteryCurrentAvgPath: dock battery average (POWER_SUPPLY_PROP_CURRENT_AVG)
+// dockBatteryChargeCounterPath: dock battery accumulated charge
+// (POWER_SUPPLY_PROP_CHARGE_COUNTER)
+//
+// The dockBatterySupported property indicates whether a dock battery is supported
+// by the device, and whether this module should fetch dock battery values.
+// Defaults is to false.
struct healthd_config {
int periodic_chores_interval_fast;
@@ -69,6 +87,20 @@ struct healthd_config {
int (*energyCounter)(int64_t *);
int boot_min_cap;
bool (*screen_on)(android::BatteryProperties *props);
+
+ bool dockBatterySupported;
+ android::String8 dockBatteryStatusPath;
+ android::String8 dockBatteryHealthPath;
+ android::String8 dockBatteryPresentPath;
+ android::String8 dockBatteryCapacityPath;
+ android::String8 dockBatteryVoltagePath;
+ android::String8 dockBatteryTemperaturePath;
+ android::String8 dockBatteryTechnologyPath;
+ android::String8 dockBatteryCurrentNowPath;
+ android::String8 dockBatteryCurrentAvgPath;
+ android::String8 dockBatteryChargeCounterPath;
+
+ int (*dockEnergyCounter)(int64_t *);
};
// Global helper functions
@@ -77,6 +109,8 @@ int healthd_register_event(int fd, void (*handler)(uint32_t));
void healthd_battery_update();
android::status_t healthd_get_property(int id,
struct android::BatteryProperty *val);
+android::status_t healthd_get_dock_property(int id,
+ struct android::BatteryProperty *val);
void healthd_dump_battery_state(int fd);
struct healthd_mode_ops {
@@ -121,4 +155,20 @@ void healthd_board_init(struct healthd_config *config);
int healthd_board_battery_update(struct android::BatteryProperties *props);
+//This API is called to turn on/off the display backlight incase it can't be
+//handle correcty in the display driver by calling gr_fg_blank();
+void healthd_board_mode_charger_set_backlight(bool en);
+
+//This API is called to update the battery/charging status by using the user
+//noticeable method other then the animation, such as: LEDs
+void healthd_board_mode_charger_battery_update(struct android::BatteryProperties *batt_prop);
+
+//This API is used to handle some board specific charger mode initialization,
+//such as: checking the charging is enabled or not.
+void healthd_board_mode_charger_init(void);
+
+//This API is called in the draw_battery() function to draw more infomation
+//about the battery on the animation, such as the SoC (State of Charge).
+void healthd_board_mode_charger_draw_battery(struct android::BatteryProperties *batt_prop);
+
#endif /* _HEALTHD_H_ */