summaryrefslogtreecommitdiffstats
path: root/healthd
Commit message (Collapse)AuthorAgeFilesLines
* charger: fix show 0% symptom when start to draw UIKen Tsou2019-03-292-1/+20
| | | | | | Bug: 123060995 Test: m -j succeeded and confirm offmode charge UI behavior Change-Id: I7412157cfe829a86e72b3f43d9c43032f3567ed3
* charger: android_get_control_file on last_kmsgYifan Hong2019-03-261-12/+14
| | | | | | | | | | | | | | Call android_get_control_file on last_kmsg files if the file descriptor is provided by init. Also, uses base::Read(File|Fd)ToString functions to read the files (because load_file doesn't support fd arguments). Test: charger mode Test: manual kernel panic, then start charger; seen last kmsg. Bug: 129138950 Change-Id: Idd3376e349f29586a1e66faab2c0f1bf73e0eda5
* healthd: Add charger.recovery module.Tao Bao2019-03-067-98/+212
| | | | | | | | | | | | | | | | | | | | | This CL splits out healthd_mode_charger_nops for building charger.recovery. It doesn't change the functionality of the charger module under recovery, i.e. a) it still doesn't do much work other than reporting the battery status periodically; b) it keeps calling device-specific healthd functions (healthd_board_init and healthd_board_battery_update) via the statically linked HAL. Previously `charger -r` was used to indicate starting charger under recovery mode. This CL makes it a noop since we've changed the caller in recovery. Bug: 73660730 Bug: 114042635 Test: Boot into charger mode on walleye. Check that charger UI works. Test: Boot into recovery mode on walleye. Check that /system/bin/charger keeps working. Test: Run charger_test on walleye. Change-Id: Id91acfcc77ec315c2382392dc54e36c3e85de2eb
* healthd: charger uses shared libraries.Tao Bao2019-03-061-31/+25
| | | | | | | | | | | | | | | | | With the change in [1], /sbin/charger always gets included into system.img (as opposed to ramdisk) and started by second-stage-init. It no longer needs to be statically linked. This CL switches it to use shared libraries, and moves it to /system/bin/charger. With this change, charger no longer gets installed into recovery image, which will be handled by a follow-up CL. [1] https://android-review.googlesource.com/c/platform/build/+/728287 Bug: 73660730 Test: Boot into charger mode on taimen. Check that charger UI works. Test: Run charger_test on taimen. Change-Id: Idff70cfad09c825cdba4d35a471ff7ecd5f8a8f7
* libprocessgroup: Add support for task profilesSuren Baghdasaryan2019-02-031-0/+1
| | | | | | | | | | | | | | | | | Abstract usage of cgroups into task profiles that allows for changes in cgroup hierarchy and version without affecting framework codebase. Rework current processgroup and sched_policy API function implementations to use task profiles instead of hardcoded paths and attributes. Mount cgroups using information from cgroups.json rather than from init.rc Exempt-From-Owner-Approval: already approved in internal master Bug: 111307099 Test: builds, boots Change-Id: If5532d6dc570add825cebd5b5148e00c7d688e32 Merged-In: If5532d6dc570add825cebd5b5148e00c7d688e32 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* Merge "healthd: update owners"Treehugger Robot2019-01-291-1/+1
|\
| * healthd: update ownersYifan Hong2019-01-281-1/+1
| | | | | | | | | | Test: pass Change-Id: I2efea4086ef9f8d9865da387bfc91345a31fc123
* | healthd: charger loads resources from /productYifan Hong2019-01-282-3/+30
|/ | | | | | | | | | | | Load resources from /product/etc/res/{values,images}/charger. If a resource fails, falls back to /res/{values,images}/charger. If the device has GSI flashed, resources may exist in both paths. Resources in /product is used with a higher priority. Test: turn off device, charge, observe animation Bug: 119549685 Change-Id: I5a5143d132a0cc6ce9135469fb523feeeafd1b1b
* Add dependencies on libprocessgroup for sched_policy usersSuren Baghdasaryan2019-01-221-0/+1
| | | | | | | | | | | | | | After moving sched_policy functions into libprocessgroup its users require additional dependency and inclusion of sched_policy_ctrl.h header. Exempt-From-Owner-Approval: janitorial Bug: 111307099 Test: builds, boots Merged-In: Icc052080e1bce46ce06f7264446950cab0490a95 Change-Id: Icc052080e1bce46ce06f7264446950cab0490a95 Signed-off-by: Suren Baghdasaryan <surenb@google.com>
* healthd.h: add ignorePowerSupplyNames to healthd_configThierry Strudel2019-01-112-0/+11
| | | | | | | | | | In case some power supply paths should not be considered, add a black list to the healthd_config to instruct BatteryMonitor of the power supply paths to ignore on init. Bug: 117903348 Change-Id: I6f9ddeff9351ad01772b43728ddc2627da81df2a Signed-off-by: Thierry Strudel <tstrudel@google.com>
* health: Add CAP_WAKE_ALARM to service via initFelix2019-01-041-0/+1
| | | | | | | | | | | | | | platform/interfaces/health/2.0/default/healthd_common.cpp wants to use timerfd_create() to register a wakealarm. To use the timerfd_create() syscall with CLOCK_BOOTTIME_ALARM, CAP_WAKE_ALARM is needed. Since the .rc file for android.hardware.health@2.0 is shipped here in system/core, update it here. Signed-off-by: Felix <google@ix5.org> Change-Id: I6cd5701b6e5cac37eb021d894251a3a9dc590b95
* healthd: BatteryMonitor: Fix compiler warningShevT2018-11-021-2/+1
| | | | | | | | | | system/core/healthd/BatteryMonitor.cpp:248:19: note: initialize the variable 'i' to silence this warning unsigned int i; ^ = 0 1 warning generated. Change-Id: Ib2fa0061d657fd93871ca8a9056d173d5b7ab58d
* healthd: `GRSurface` now is a class.Tao Bao2018-10-221-1/+1
| | | | | Test: mmma -j system/core/healthd Change-Id: I696542535cf4707c707c4f024de504ce343b1e69
* Move system/core/ off NO_ERROR.Elliott Hughes2018-10-081-5/+5
| | | | | | | | It causes trouble for Windows, and OK already exists. Bug: N/A Test: builds Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
* Reland "Add static libbinderthreadstate explicitly to charger module.""Jayant Chowdhary2018-10-011-0/+1
| | | | | | | | This reverts commit 17a65497bb33d2fffd83ee17871633af1faa6b47. Reason for revert: Dependencies which broke tests due to exclusion from LOCAL_JNI_SHARED_LIBS have been added. Change-Id: I51e8ea7072026f233cd4a6c7e2142d92603af1f9
* Revert "Add static libbinderthreadstate explicitly to charger module."Remi NGUYEN VAN2018-09-281-1/+0
| | | | | | | | This reverts commit f23fa3b12f980d71680df9ce9357d35507231ff6. Reason for revert: This breaks framework tests and blocks presubmit Change-Id: Iccf29d7499c378c611ea5a783074865febf8514e
* Add static libbinderthreadstate explicitly to charger module.Jayant Chowdhary2018-09-271-0/+1
| | | | | | | | | | | Bug: 110364143 Bug: 114311116 Test: Builds Change-Id: I367cab4f6113d72bbaf1c9a41099110124916f57 Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
* healthd: Drop the unneeded include path.Tao Bao2018-09-061-1/+1
| | | | | | | libminui has been exporting headers since Oreo. Test: mmma -j system/core/healthd Change-Id: Iaadfa526619dcd4837a97b78cfa03dc69ffa4000
* charger: screen blank on disconnect and 0% not displayedkentsou2018-08-172-12/+39
| | | | | | | Bug: 74771887 Test: m -j succeeded and confirm offmode charge UI behavior Change-Id: I8c97230f6c1e32ac9949601a86added79a3ead82 Signed-off-by: kentsou <kentsou@google.com>
* Merge "charger: minui error handling fixups"Tao Bao2018-07-302-95/+123
|\ | | | | | | | | | | am: bc31fc62ce Change-Id: I48633f51f5259d783e7f72f98576ffbd8c26abbf
| * charger: minui error handling fixupsTodd Poynor2018-07-302-95/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Log an error if minui init fails, and avoid subsequent calls to minui in this case (which are likely to crash). Warn if no system text font available. This is now expected on most devices, and the fallback text is not expected to be needed, but just in case. Avoid the attempt to print text if no system font available, log warnings instead. Bug: 80249440 Test: manual: charger mode with no system font Change-Id: Ib0c761d37e41a893b2a192438eebcf48c4827049 Merged-In: Ib0c761d37e41a893b2a192438eebcf48c4827049 (cherry picked from commit 8211515fbe81c49d1e53a903ef890718ff01cadc)
| * healthd_mode_charger: unblank the screen only on first frameThierry Strudel2018-07-301-4/+4
| | | | | | | | | | | | | | | | | | | | Original code is unblank screen for all frames of the first cycle, unblank is needed only before the first frame of the first cycle. Bug: 74771887 Change-Id: I51d8390e359335a0b1cb127b096db1a8b889b169 Signed-off-by: Thierry Strudel <tstrudel@google.com>
| * libbatterymonitor: vendor_availableYifan Hong2018-07-163-9/+13
| | | | | | | | | | | | | | | | | | | | | | libbatterymonitor is a static library. Also removed unused libbinder dependency. Test: pass Bug: 111454508 Merged-In: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac Change-Id: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac (cherry picked from commit ffff9aae0219091662811b5949ed3767d7df12aa)
* | healthd: uses android.hardware.health@2.0-service_defaultsYifan Hong2018-07-181-27/+9
| | | | | | | | | | | | Test: builds Test: boots Change-Id: Ia47ba805aa0e8f7cd6c0a7f5877b3120b0265c78
* | Merge "healthd: libbatterymonitor: recovery_available" into stage-aosp-masterYifan Hong2018-07-181-0/+2
|\ \
| * | healthd: libbatterymonitor: recovery_availableYifan Hong2018-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 80132328 Test: builds Change-Id: I4d5ac73431fb002cc839fed2d97b1acff3fde263 Merged-In: I4d5ac73431fb002cc839fed2d97b1acff3fde263 (cherry picked from commit 0e317d787307dafd8b38961d21ad5f95480eb06a)
* | | healthd: add missing libbatteryservice_headers depYifan Hong2018-07-171-0/+2
|/ / | | | | | | | | | | | | | | | | | | It used to use global header include dirs, which is bad. Test: builds Bug: 68724651 Change-Id: Ib5354c66633499ad57fe5997e2c35283ba5e408f Merged-In: Ib5354c66633499ad57fe5997e2c35283ba5e408f (cherry picked from commit 530ac5bad143b5281b1c90f2f86380407406e614)
* | healthd: overridden by health@2.0-serviceYifan Hong2018-07-171-0/+4
| | | | | | | | | | | | | | | | | | | | Test: boots Bug: 79107699 Bug: 77541952 Bug: 79107699 Change-Id: Ida4cf80d3553365b673e30cdd19590c156cb52e0 Merged-In: Ida4cf80d3553365b673e30cdd19590c156cb52e0 (cherry picked from commit 28d2fb80b2a370d16aeb872f16d9947d699cc7b2)
* | healthd use vintf_fragmentsYifan Hong2018-07-172-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This encourages device manufacturers to use service.override over service and to remove healthd on device, because it is one less step to do. Test: make VINTF metadata Bug: 66917623 Bug: 77541952 Bug: 79107699 Change-Id: I1cac3570f64a0308b1f2d465205f98a97e4b4320 Merged-In: I1cac3570f64a0308b1f2d465205f98a97e4b4320 (cherry picked from commit 2db565d75f81031ea0dfe5693ab0fe02714c2b88)
* | Merge "healthd_mode_charger: unblank the screen only on first frame" into pi-devThierry Strudel2018-05-241-4/+4
|\ \ | | | | | | | | | | | | | | | am: 39edb87aaf Change-Id: Ieb39b688d44ebae9c171e6c530f3f605ab26e20a
| * | healthd_mode_charger: unblank the screen only on first frameThierry Strudel2018-05-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original code is unblank screen for all frames of the first cycle, unblank is needed only before the first frame of the first cycle. Bug: 74771887 Change-Id: I51d8390e359335a0b1cb127b096db1a8b889b169 Signed-off-by: Thierry Strudel <tstrudel@google.com>
* | | Merge "healthd: Add elsk as OWNERS" am: abf6a2e1adandroid-build-prod (mdb)2018-05-031-0/+1
|\ \ \ | | |/ | |/| | | | | | | | | | am: 2a38926b9d Change-Id: I3798a0bfe81eac780946bc42a31a004906875626
| * | healthd: Add elsk as OWNERSYifan Hong2018-05-031-0/+1
| | | | | | | | | | | | | | | Test: none Change-Id: I676621ced38308296c32259c9525a8d55948e937
* | | Merge "Use the non-LTO, non-PGO version of libhwbinder" into pi-devPirama Arumuga Nainar2018-04-101-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | am: aeee02f290 Change-Id: Id94d387b59be7f95c366aadd8844241f7a64ee08
| * | Use the non-LTO, non-PGO version of libhwbinderPirama Arumuga Nainar2018-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: http://b/77320844 Android.mk doesn't have support for PGO either. This causes linker error (about missing __llvm_profile symbols) in the PGO-instrumentation enabled builds in the release branch. Test: m ANDROID_PGO_INSTRUMENT=ALL Change-Id: I84fda4f1ac4f00ac26869507c6f5640b4ec9f6f3
* | | Merge "health service can write kernel log" into pi-devYifan Hong2018-04-061-0/+1
|\| | | | | | | | | | | | | | | | | am: c867941783 Change-Id: Idaa35992343803752fb93e28824c0debf1512448
| * | Merge "health service can write kernel log" into pi-devYifan Hong2018-04-061-0/+1
| |\ \
| | * | health service can write kernel logYifan Hong2018-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: device without healthd still have battery level messages Bug: 77541952 Fixes: 77661605 Change-Id: I9b66ecde0735accf8b2d67b9562795be80071dd9
* | | | Merge "Use non-LTO variant of libhwbinder" into pi-devYi Kong2018-04-061-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | am: 715700a5a1 Change-Id: I08de6f781a1566cf85ea4dc38be4cffb3b5eaaa8
| * | | Merge "Use non-LTO variant of libhwbinder" into pi-devTreeHugger Robot2018-04-061-1/+1
| |\ \ \ | | |/ / | |/| |
| | * | Use non-LTO variant of libhwbinderYi Kong2018-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as a workaround for build system does not currently infer non-LTO usage from Android.mk. Test: m Bug: 77320844 Change-Id: Iefe5d08b907133b4cdf1516efee73b2c0161f77e
* | | | Merge changes from topic "healthd_deprecate2" into pi-devYifan Hong2018-04-052-2/+21
|\| | | | | | | | | | | | | | | | | | | | | | | am: 7498160272 Change-Id: I18b63bfae0890d4e2e7af9ad1a3377334c5139ff
| * | | healthd: a.h.health@2.0-service.override removes healthdYifan Hong2018-04-041-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes healthd from the build if -service.override is provided. This encourages developers to deprecate healthd for their devices when they can. When -service.override is used, framework manifest needs to remove the /backup instance as well; this can be done by including manifest_healthd_exclude.xml in DEVICE_FRAMEWORK_MANIFEST_FILE. Test: build and boot on 2016/2017 Pixel devices Test: build and boot on a new device Test: lshal and vts_treble_vintf_test on all these devices Bug: 77541952 Change-Id: I25744feaad3034441cd7a96a5343d4ce3eedc288
| * | | healthd: add healthd.rcYifan Hong2018-04-042-0/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Split healthd section from init.rc into its own. This allows healthd.rc to be excluded from the build when healthd is excluded. Test: builds Test: exclude healthd from build, healthd.rc is not installed Bug: 77541952 Change-Id: I1c055f14c5862631f359fd0029289da8f43af063
* | | Merge "Remove obsolete BRILLO variable" am: dbfbf85f0cDan Willemsen2018-03-121-3/+0
|\ \ \ | |/ / |/| / | |/ | | | | am: 2527add41a Change-Id: Idc0c29c1accca9738755844c866859f440f7c94c
| * Remove obsolete BRILLO variableDan Willemsen2018-03-101-3/+0
| | | | | | | | | | Test: none Change-Id: Iaf563b78819d63cb5ab7316a195a860b150d69c6
* | Merge "healthd: Fix negativity check after cast to unsigned enum" am: ↵Yi Kong2018-03-031-3/+3
|\| | | | | | | | | | | | | | | 3dad67af05 am: 4734981245 am: eb066ae098 Change-Id: I2327adfd50fceb232ef2a52e535914743c25cf3a
| * healthd: Fix negativity check after cast to unsigned enumYi Kong2018-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | mapSysfsString return code is checked for negativity after being casted to unsigned enum type, which will always be false. This is obviously unintended behaviour. Fixes tautological-unsigned-enum-zero-compare warning. Bug: 72331526 Test: m Change-Id: Icec76d7a1121cb56fd9d05feb70cede69954c322
| * healthd: don't report fake data for battery-less devicesTodd Poynor2018-02-052-21/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the kernel does not implement a power_supply class device of type battery, do not report fake data, instead report the following by default: * batteryPresent = false (instead of true), * charging status = unknown (instead of charging), * capacity = 0 (instead of 100%), * health = unknown (instead of good), * AC charger online not modified (instead of forcing true) If no charger and no battery devices are supplied by the kernel, the AC charger online property will no longer be forced to true. Devices that are always plugged into AC power should either implement a power_supply class charger device or implement a Health HAL that sets properties appropriately. Bug: 34507420 Test: manual: gce_x6_phone (no battery or charger), boots and stays booted, inspect properties Merged-In: I14cb3b685e8130428e417e7d08c4246f7415210a Change-Id: I64bd4431af10f3d232f36fcf8d356b6d88b08013
* | healthd: Remove access to /sys/class/power_supply/battery/batt_vol and batt_tempYifan Hong2018-02-011-12/+0
| | | | | | | | | | | | | | | | | | | | These are custom paths from early Android devices that the framework used to read, and that code was copied into healthd. Removed because this is not defined in upstream kernel. Change-Id: I375a8a62610c1235d82c1f27568437b16e0f96a8 Fixes: 72824944 Test: health 2.0 VTS test