Commit graph

259 commits

Author SHA1 Message Date
Thierry Strudel
f73de6f037 healthd.h: add ignorePowerSupplyNames to healthd_config
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>
2019-01-11 18:08:23 -08:00
Felix
fb55955462 health: Add CAP_WAKE_ALARM to service via init
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
2019-01-04 02:24:41 +01:00
ShevT
9d98a6ac93 healthd: BatteryMonitor: Fix compiler warning
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
2018-11-02 17:59:09 +00:00
Tao Bao
777af95c4e healthd: GRSurface now is a class.
Test: mmma -j system/core/healthd
Change-Id: I696542535cf4707c707c4f024de504ce343b1e69
2018-10-22 13:20:33 -07:00
Elliott Hughes
643268f325 Move system/core/ off NO_ERROR.
It causes trouble for Windows, and OK already exists.

Bug: N/A
Test: builds
Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
2018-10-08 11:15:52 -07:00
Jayant Chowdhary
c2d3949693 Reland "Add static libbinderthreadstate explicitly to charger module.""
This reverts commit 17a65497bb.

Reason for revert: Dependencies which broke tests due to exclusion from LOCAL_JNI_SHARED_LIBS have been added. 

Change-Id: I51e8ea7072026f233cd4a6c7e2142d92603af1f9
2018-10-01 22:50:07 +00:00
Remi NGUYEN VAN
17a65497bb Revert "Add static libbinderthreadstate explicitly to charger module."
This reverts commit f23fa3b12f.

Reason for revert: This breaks framework tests and blocks presubmit

Change-Id: Iccf29d7499c378c611ea5a783074865febf8514e
2018-09-28 07:50:18 +00:00
Jayant Chowdhary
f23fa3b12f Add static libbinderthreadstate explicitly to charger module.
Bug: 110364143

Bug: 114311116

Test: Builds

Change-Id: I367cab4f6113d72bbaf1c9a41099110124916f57
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2018-09-27 10:36:13 -07:00
Tao Bao
b6ccc78e0c healthd: Drop the unneeded include path.
libminui has been exporting headers since Oreo.

Test: mmma -j system/core/healthd
Change-Id: Iaadfa526619dcd4837a97b78cfa03dc69ffa4000
2018-09-06 15:14:31 -07:00
kentsou
ba61ea462f charger: screen blank on disconnect and 0% not displayed
Bug: 74771887
Test: m -j succeeded and confirm offmode charge UI behavior
Change-Id: I8c97230f6c1e32ac9949601a86added79a3ead82
Signed-off-by: kentsou <kentsou@google.com>
2018-08-17 03:58:19 +00:00
Tao Bao
d6b7711e3d Merge "charger: minui error handling fixups"
am: bc31fc62ce

Change-Id: I48633f51f5259d783e7f72f98576ffbd8c26abbf
2018-07-30 10:39:55 -07:00
Todd Poynor
e5d1b62300 charger: minui error handling fixups
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 8211515fbe)
2018-07-30 08:45:52 -07:00
Thierry Strudel
2cbe2c7b29 healthd_mode_charger: unblank the screen only on first frame
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>
2018-07-30 00:18:06 -07:00
Yifan Hong
ef26fe4c16 healthd: uses android.hardware.health@2.0-service_defaults
Test: builds
Test: boots
Change-Id: Ia47ba805aa0e8f7cd6c0a7f5877b3120b0265c78
2018-07-18 13:51:01 -07:00
Yifan Hong
d5c59f729e Merge "healthd: libbatterymonitor: recovery_available" into stage-aosp-master 2018-07-18 19:54:58 +00:00
Yifan Hong
90fdc72409 healthd: libbatterymonitor: recovery_available
Bug: 80132328
Test: builds
Change-Id: I4d5ac73431fb002cc839fed2d97b1acff3fde263
Merged-In: I4d5ac73431fb002cc839fed2d97b1acff3fde263
(cherry picked from commit 0e317d7873)
2018-07-18 11:28:29 -07:00
Yifan Hong
9a81d54ce3 healthd: add missing libbatteryservice_headers dep
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 530ac5bad1)
2018-07-17 15:36:14 -07:00
Yifan Hong
31150c1121 healthd: overridden by health@2.0-service
Test: boots
Bug: 79107699
Bug: 77541952
Bug: 79107699
Change-Id: Ida4cf80d3553365b673e30cdd19590c156cb52e0
Merged-In: Ida4cf80d3553365b673e30cdd19590c156cb52e0
(cherry picked from commit 28d2fb80b2)
2018-07-17 11:57:44 -07:00
Yifan Hong
3a39eec307 healthd use vintf_fragments
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 2db565d75f)
2018-07-17 11:57:38 -07:00
Yifan Hong
3da9f08903 libbatterymonitor: vendor_available
libbatterymonitor is a static library.
Also removed unused libbinder dependency.

Test: pass
Bug: 111454508
Merged-In: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac
Change-Id: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac
(cherry picked from commit ffff9aae02)
2018-07-16 11:26:04 -07:00
Thierry Strudel
60c3c1f305 Merge "healthd_mode_charger: unblank the screen only on first frame" into pi-dev
am: 39edb87aaf

Change-Id: Ieb39b688d44ebae9c171e6c530f3f605ab26e20a
2018-05-24 17:49:21 -07:00
Thierry Strudel
ac2aa7d7b1 healthd_mode_charger: unblank the screen only on first frame
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>
2018-05-23 17:30:16 -07:00
android-build-prod (mdb)
6c970477ac Merge "healthd: Add elsk as OWNERS" am: abf6a2e1ad
am: 2a38926b9d

Change-Id: I3798a0bfe81eac780946bc42a31a004906875626
2018-05-03 14:07:45 -07:00
Yifan Hong
a922d6b596 healthd: Add elsk as OWNERS
Test: none
Change-Id: I676621ced38308296c32259c9525a8d55948e937
2018-05-03 12:25:00 -07:00
Pirama Arumuga Nainar
970b664608 Merge "Use the non-LTO, non-PGO version of libhwbinder" into pi-dev
am: aeee02f290

Change-Id: Id94d387b59be7f95c366aadd8844241f7a64ee08
2018-04-10 11:29:55 -07:00
Pirama Arumuga Nainar
9dddfbc77a Use the non-LTO, non-PGO version of libhwbinder
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
2018-04-09 10:40:06 -07:00
Yifan Hong
bf5658e43b Merge "health service can write kernel log" into pi-dev
am: c867941783

Change-Id: Idaa35992343803752fb93e28824c0debf1512448
2018-04-06 14:28:18 -07:00
Yifan Hong
c867941783 Merge "health service can write kernel log" into pi-dev 2018-04-06 21:03:34 +00:00
Yi Kong
fb4806809b Merge "Use non-LTO variant of libhwbinder" into pi-dev
am: 715700a5a1

Change-Id: I08de6f781a1566cf85ea4dc38be4cffb3b5eaaa8
2018-04-06 13:37:03 -07:00
TreeHugger Robot
715700a5a1 Merge "Use non-LTO variant of libhwbinder" into pi-dev 2018-04-06 20:25:02 +00:00
Yifan Hong
7eed10800e health service can write kernel log
Test: device without healthd still have battery level messages
Bug: 77541952
Fixes: 77661605
Change-Id: I9b66ecde0735accf8b2d67b9562795be80071dd9
2018-04-05 19:34:43 -07:00
Yifan Hong
b36fb13bf3 Merge changes from topic "healthd_deprecate2" into pi-dev
am: 7498160272

Change-Id: I18b63bfae0890d4e2e7af9ad1a3377334c5139ff
2018-04-05 12:39:47 -07:00
Yifan Hong
1cf853fb65 healthd: a.h.health@2.0-service.override removes healthd
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
2018-04-04 14:43:58 -07:00
Yifan Hong
fd1aa70a0f healthd: add healthd.rc
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
2018-04-04 14:08:04 -07:00
Yi Kong
95958a74f6 Use non-LTO variant of libhwbinder
... as a workaround for build system does not currently infer non-LTO
usage from Android.mk.

Test: m
Bug: 77320844
Change-Id: Iefe5d08b907133b4cdf1516efee73b2c0161f77e
2018-04-03 12:43:13 -07:00
Dan Willemsen
42f9dd4997 Merge "Remove obsolete BRILLO variable" am: dbfbf85f0c
am: 2527add41a

Change-Id: Idc0c29c1accca9738755844c866859f440f7c94c
2018-03-12 22:05:38 +00:00
Dan Willemsen
fd72bde475 Remove obsolete BRILLO variable
Test: none
Change-Id: Iaf563b78819d63cb5ab7316a195a860b150d69c6
2018-03-10 15:41:37 -08:00
Yi Kong
979ace46ed Merge "healthd: Fix negativity check after cast to unsigned enum" am: 3dad67af05 am: 4734981245
am: eb066ae098

Change-Id: I2327adfd50fceb232ef2a52e535914743c25cf3a
2018-03-03 00:46:57 +00:00
Yi Kong
808e57e3f3 healthd: Fix negativity check after cast to unsigned enum
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
2018-03-02 18:42:03 +00:00
Todd Poynor
4d7ee2ebbb healthd: don't report fake data for battery-less devices
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
2018-02-05 19:48:30 +00:00
Yifan Hong
43f731ae45 healthd: Remove access to /sys/class/power_supply/battery/batt_vol and batt_temp
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
2018-02-01 13:51:04 -08:00
Todd Poynor
e030a10d0f Revert "Revert "healthd: don't report fake data for battery-less devices""
This reverts commit 1bc572dfe8.

The presubmit test that (incorrectly) fails on the original commit
has been marked @FlakyTest and a bug is failed on Assistant.

Bug: 34507420
Test: manual: gce_x6_phone (no battery or charger),
      boots and stays booted, inspect properties,
      presubmit tests on gce_x86
Change-Id: I5509bf5de9fceffdd5fd8abc3f1f4f6101119248
2018-01-23 19:07:23 +00:00
Yifan Hong
affa24f28f healthd: move HealthServiceCommon
... to hardware/interfaces. HealthServiceCommon
becomes two separate libraries:
- libhealthservicedefault for services on vendor
- libhealthservicehealthd for healthd

Test: boots
Bug: 63702641
Change-Id: Ibc7096328bb36356cb653e542bab900cd046fe8a
2018-01-22 12:34:04 -08:00
Hridya Valsaraju
79d38ebcaf health: Modify IHealthInfo Callback interface to return V2.0 HealthInfo
Bug: 71860528
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: I7de39ffa4c21772d8878c9a3f054bc6dbbde2fb9
2018-01-18 14:51:26 -08:00
Hridya Valsaraju
7fa7225cc4 Create a friend method for reporting battery health
Bug: 71860528
Test: Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: I6c56c601ee59fe33ee4a19dd4aeafbe3a1bd4c72
2018-01-16 11:15:51 -08:00
Hridya Valsaraju
89178e79d5 Add libhealthstoragedefault to make files
This is to add empty implementations of methods
reporting storage health.

Bug: 68388678
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: If6180c22a4b356650084df61b1e24af3de0ca67e
2018-01-11 22:16:16 -08:00
Martijn Coenen
a5c1eecde7 healthd: Replace hwbinder-specific calls with generic ones.
To remove dependencies on libhwbinder.

Bug: 34388964
Test: sailfish boots
Change-Id: Ia1b8d8d8da91a510ef5739bac14236b7b3a9d3b9
2017-12-18 10:07:43 +01:00
Todd Poynor
1bc572dfe8 Revert "healthd: don't report fake data for battery-less devices"
This reverts commit de610c9a0e.

Reason for revert: May trigger flakiness in CTS ActivityManagerAssistantStackTests.

Change-Id: I02f831048f7802d91331e67bd9006860e4572b92
2017-12-15 06:51:04 +00:00
Todd Poynor
de610c9a0e healthd: don't report fake data for battery-less devices
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
Change-Id: I14cb3b685e8130428e417e7d08c4246f7415210a
2017-12-14 21:13:06 +00:00
Hridya Valsaraju
ffb13032b6 Move healthd default implementation to hardware/interfaces.
Bug: 70533363 63702641
Test: make -j32

Change-Id: Icb6eaea8641dc8ae53ed3af1fca81ddca39f8421
2017-12-12 17:20:13 -08:00