summaryrefslogtreecommitdiffstats
path: root/healthd/BatteryMonitor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-1/+18
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/core into HEAD Android 6.0.1 release 3 Change-Id: I8b65c0223e3444360432abd871a9d8f007831ba0
| * healthd: Adds fake battery properties for devices with no battery.Ruchi Kandoi2015-10-121-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices which have no battery and are always plugged in will not have any battery property initialized. This causes the 'stable power' to never be switched which is required for updating apps. This change recognizes such a device and manually sets the battery to 100% and charger status to connected to AC mains. It will also fake the battery temperature. Bug: 24258855 Change-Id: I98e5ed0dbeb7f2ab6d3802cd7e0f3a269bd8f31f Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
* | Revert "healthd: Support QC2.0 type charger"Chao Chen2015-12-021-1/+0
| | | | | | | | | | | | | | The change is duplicated. This reverts commit c2333e109087e1d50dcf6937bd67663cb195e020. Change-Id: I9cf3ca50a48ca22eafe3e12c0c00562ba2cb8645
* | Merge tag 'android-6.0.0_r26' into cm-13.0Ricardo Cerqueira2015-11-051-2/+12
|\ \ | |/ | | | | | | | | Android 6.0.0 release 26 Change-Id: I93d1e3767cbacab2b18cff360065c91b9eaf1d96
| * healthd: logd: add timestamp to kernel logged battery messagesMark Salyzyn2015-08-271-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry pick from commit acb1ddf56c98a75a49b263f99ef07ce361dc4323) Aid monotonic to realtime logging synchronization correction in the Android ecosystem by providing a periodic notification. We now have the following messages in the kernel logs: - PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC - PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC - Suspended for %s.%03q seconds - healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC Alter klogd to resynchronize on healthd messages as well. NB: Time using strftime format, %q is a reference to fractional second as introduced into log_time strptime method. Bug: 21868540 Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
| * Show charging speed on KeyguardAdrian Roos2015-07-131-2/+12
| | | | | | | | | | Bug: 8099739 Change-Id: I2e5c21dd7ec028ce47fb03ab71e74f7fccaa9e36
* | healthd: logd: add timestamp to kernel logged battery messagesMark Salyzyn2015-11-011-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aid monotonic to realtime logging synchronization correction in the Android ecosystem by providing a periodic notification. We now have the following messages in the kernel logs: - PM: suspend entry %Y-%m-%d %H:%M:%S.%09q UTC - PM: suspend exit %Y-%m-%d %H:%M:%S.%09q UTC - Suspended for %s.%03q seconds - healthd: battery l=100 ... %Y-%m-%d %H:%M:%S.%09q UTC Alter klogd to resynchronize on healthd messages as well. NB: Time using strftime format, %q is a reference to fractional second as introduced into log_time strptime method. Bug: 21868540 Change-Id: I854afc0a07dff9c7f26d2b2f68990e52bf90e300
* | healthd: Support QC2.0 type chargerChao Chen2015-11-011-0/+1
| | | | | | | | Change-Id: I838ef54ac358ac9ce851a93c47e87030b4219c1c
* | healthd: dock batteryJorge Ruesga2015-10-191-7/+278
| | | | | | | | | | | | Change-Id: I2ad09e5e87d55c47af4d1efc14cc585cc08e2dce Require: topic:dock_battery Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* | healthd: Detect power supply type for all charger devicesmyfluxi2015-10-191-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Power supply type is not determined via the device name, hence iterate over all available devices in the subsystem node and read the type from device file. shell@hammerhead:/ $ ls /sys/class/power_supply ac batt_therm battery touch usb wireless <4>[ 3184.867782] healthd: touch: Unknown power supply type <4>[ 3184.868039] healthd: batt_therm: Unknown power supply type <6>[ 3184.880506] healthd: battery l=89 v=4181 t=25.5 h=2 st=2 c=-288 chg=u <4>[ 3184.890362] healthd: touch: Unknown power supply type <4>[ 3184.890549] healthd: batt_therm: Unknown power supply type <6>[ 3184.899419] healthd: battery l=89 v=4181 t=25.5 h=2 st=2 c=-59 chg=u <4>[ 3184.908756] healthd: touch: Unknown power supply type <4>[ 3184.908984] healthd: batt_therm: Unknown power supply type <6>[ 3184.919672] healthd: battery l=89 v=4181 t=25.6 h=2 st=2 c=-25 chg=u Change-Id: I863bfab95193899460237b51997e0418eeb4ee2c
* | healthd: Add support for HVDCP_3 chargersAbhijeet Dharmapurikar2015-10-061-0/+1
| | | | | | | | | | | | | | | | HVDCP_3 is a high voltage DCP charger where the charger's voltage can be changed by issuing pulses on the D+/D- lines. Add support to recognize it and treat it as an AC power source. Change-Id: Ib719529904e8b7a676bbdc5f5953f0f9da6df3fa
* | healthd: Add support for HVDCP and Wipower chargersAbhijeet Dharmapurikar2015-10-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | HVDCP charger is high voltage DCP chargers. Add support to recognize it and treat them as AC power source. Also, Wipower charging is a wireless charger where the power transfer is via resonance and power control messages are exchanged over BLE. Treat Wipower as a wireless charger. CRs-Fixed: 775241 Change-Id: Id49bc31111825721ffce5a71c29f79659c5fddf0
* | healthd: Reinitialize mChargerNames for every battery updateRamakrishnan Ganesh2015-10-061-25/+53
|/ | | | | | | | | | | | | | Booting up the device without usb, the kernel sets the usb power supply type as UNKNOWN. The type of usb power supply changes at run-time as various chargers are plugged in/out. However, healthd initilizes the charger list only at bootup. Change it such that it checks for charger type changes with every battery or usb uevent. While at it, the kernel may have a power supply type which is not known to healthd. This is perfectly fine. Update healthd to not print a warning. Change-Id: I2ec9f9a420ca61814d43c316b418ce94de3691bc
* resolved conflicts for merge of 03be4928 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-251-1/+0
|\ | | | | | | Change-Id: I7c72ed2c54ceae19c9dfe8b2e1707f869faad110
| * Healthd: Remove unused variablesAndreas Gampe2014-11-241-1/+0
| | | | | | | | | | | | For build-system CFLAGS clean-up, remove unused variables. Change-Id: Ifc5884518bfdb744ea9823b98db544dbe59c20d2
* | healthd: use warning level for info logsTodd Poynor2014-09-231-5/+5
|/ | | | | | | To allow healthd/charger info to appear in systems where the loglevel has been bumped to squelch chatty drivers. Change-Id: I4ab135765700d7584a1ce5d972ea473d77f299f8
* healthd: Reports arbitrary numbers for capacity and temperature whenRuchi Kandoi2014-07-111-5/+7
| | | | | | | | | connected to fake battery. Detects if the device is attached to a fake battery if yes, healthd reports 42% battery charge and 42.2 degrees temperature. Change-Id: I2508fd91c8d3848ea64f57ab59d20be1c2817913
* healthd: Set fixed battery level and temperature via propertiesTodd Poynor2014-05-221-2/+14
| | | | | | | | | | | | | setprop persist.sys.battery.capacity 77 setprop persist.sys.battery.temperature 123 and reboot to cause a fixed battery level of 77% and temperature of 12.3C to be reported to Android. Typically used on power evaluation boards without batteries connected. Bug: 14839868 Change-Id: Ibae5e16429d05891cb0787d74a2fe93b07013699
* healthd: Add hooks for ENERGY_COUNTER propertyTodd Poynor2014-05-201-1/+6
| | | | | Bug: 10118565 Change-Id: Ibabae2a78a600ae37ce9b91da0f5980ee94b05c2
* healthd: Add ENERGY_COUNTER property placeholder, and 64-bit propertiesTodd Poynor2014-05-161-7/+10
| | | | | | | Will add healthd HAL support for ENERGY_COUNTER, and support in some HALs, in following CLs. Change-Id: Ife2eaa30473be3a59183c6ce61fdaa61f32dd01b
* healthd: Turn on -WerrorMark Salyzyn2014-05-151-1/+1
| | | | Change-Id: I72caf38008ee7d842dfacd3f58add9bc8e4787e8
* healthd: Add battery capacity to getPropertyPaul Lawrence2014-03-201-0/+10
| | | | | | | Add support for BATTERY_PROP_CAPACITY property in getProperty Bug: 11985952 Change-Id: I905cda68f990fa96138a16a11c55f2d902d0bbc1
* healthd: remove/rearrange extra battery property handlingTodd Poynor2013-10-221-18/+10
| | | | Change-Id: I6cc1570e23c1c1468f08579f633997e95327347a
* healthd: BatteryService dumpstate supportTodd Poynor2013-10-221-5/+35
| | | | Change-Id: Ia6938b7126751801310632c995af0f96e41f5f64
* healthd: Fixups for systems without batteries or removable batteriesTodd Poynor2013-10-221-16/+29
| | | | | | | | | | | | | * Replace unnecessary warnings about missing attributes with a more informative message when no battery devices provided by the system. * Turn off periodic battery checks when no battery devices (thereby reducing unnecessary kernel log spam). * Replace battery properties in log messages with a more informative message when no battery is provided or the battery is removed. Change-Id: I68a514aa7315ae2b5d22cb8861d3c9b1b38035a1
* healthd: start switchover to BatteryExtraPropertiesTodd Poynor2013-09-301-5/+11
| | | | Change-Id: I47a24d4284f502858ee929b2cda8881165ef4ef3
* healthd: move Android communication code to separate sourceTodd Poynor2013-09-171-10/+2
| | | | | | | | | | * add ops for different "modes" of healthd operation: android vs. recovery * recovery mode selected by runstring options -r * binder/Android communication moved to android mode * recovery mode ops avoiding binder service registration * "no service manager" flag removed; now handled by android vs. other modes Change-Id: I3d8c89bf96a18a6a00cc85306f9a07d3f408f2a0
* healthd: break link between BatteryMonitor and BatteryPropertiesRegistrarTodd Poynor2013-09-171-1/+1
| | | | | | | | | | Make it easier to later separate out binder-related code. Add helper functions healthd_battery_update(), healthd_get_property() to allow these operations without needing references to the BatteryMonitor object. Change-Id: Ie584bf53e5178ce0a098d0d940d6c311fdff62d4
* healthd: Add average current propertyTodd Poynor2013-09-041-0/+18
| | | | Change-Id: Ibc901fe1b550c0d72095ef5590e2db8962d1a7b2
* healthd: read individual battery property value on demandTodd Poynor2013-08-221-0/+35
| | | | | | | Adding support for batteryChargeCounter and batteryCurrentNow as parameters likely to be useful for power consumption analysis. Change-Id: Ib23b05d3c31c22ece0d21e55cc481c1b5dabe59e
* healthd: Move power_supply attribute paths to healthd_configTodd Poynor2013-08-141-63/+97
| | | | | | | Allow health HAL to select specific paths to be used, overriding default search for arbitrary power supplies with the named paths. Change-Id: I5f724739f58ef56087ab592b7403fc083db8f173
* healthd: fix botched logging callTodd Poynor2013-08-121-1/+1
| | | | Change-Id: Ibf5e28c657e0d9d193b266acd7b2912bebc3e71f
* healthd: preserve uA and uAh units for current_now and charge_counterTodd Poynor2013-08-091-3/+3
| | | | Change-Id: I20b3f47c541c4321b0593e504090ad6573b9cb01
* healthd: add health HAL supportTodd Poynor2013-08-071-17/+23
| | | | | | | | | | Adds board-specific battery monitoring capabilities: * processing of battery property values and additional charging logic. * adjusted (or removed) polling intervals. * replaced (or removed) battery status heartbeat in kernel log. Change-Id: Ia77bca8dc92c6c2a51afa65d516cacca08da73ac
* healthd: add optional current_now and charge_counter to tracked stateTodd Poynor2013-08-071-6/+36
| | | | | | | | uA and uAh units are converted to mA and mAh. If current_now is present, add it to the heartbeat log (c=nnn). Change-Id: I2b5fe7b4505c98ca2d11c3f94564c1c38493c8b9
* healthd: Add system health monitoring daemonTodd Poynor2013-07-261-0/+354
Initially moving battery health monitoring here. Command line flag -n tells healthd not to use (or wait for) servicemanager in this execution, for charger and recovery modes. Change-Id: I1720594724af0c068497b359f9c6ad65aeaa1519