Commit graph

251 commits

Author SHA1 Message Date
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
Elliott Hughes
3e2b34136a Merge "Add OWNERS." am: 3289b9c928 am: 515c8fe572
am: aede8375fe

Change-Id: I28f7a8f3fa9c9837f4043768e70c0d985ed95abd
2017-12-08 01:29:20 +00:00
Elliott Hughes
3289b9c928 Merge "Add OWNERS." 2017-12-07 23:21:26 +00:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Chih-Hung Hsieh
9635266c75 Use -Werror in system/core/healthd
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I921735c9531594697e002937cd57a33c65552dbf
2017-12-01 12:32:25 -08:00
Yifan Hong
25eb37a86e healthd: clean up unused code
With migration to health 2.0 HAL, there are unused code paths
that can be removed.

Test: health VTS test
Test: charger_test
Bug: 68724651
Change-Id: I9af2f95432529a0bf6e10980a99014d570dfce93
2017-11-30 15:34:46 -08:00
Yifan Hong
b7cd45f877 charger: add charger_test
Test: charger_test
Bug: 63702641
Change-Id: Id50d024c015916cb8007742e3c17eaf1161b909f
2017-11-21 15:05:17 -08:00
Yifan Hong
10c2b4013a healthd: charger use health 2.0 HAL
Test: charger_test
Test: off-mode charging, charger runs correctly
Bug: 63702641
Bug: 69268160
Change-Id: I7dfc83ae4020ada7e9d11ab955f648abb74f435b
2017-11-20 10:28:11 -08:00
Yifan Hong
3bc12ce7df healthd: move healthd_board_init call to Health::Health() c-tor
The invocation is wrapped so that clients of -impl doesn't
have to call healthd_board_init directly.

Test: health VTS test
Test: charger_test
Bug: 69268160

Change-Id: I61f820b80ce6b03fe51ca05d07ed7e09ca369d2d
2017-11-14 12:59:54 -08:00