Commit graph

289 commits

Author SHA1 Message Date
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
Yifan Hong
9cffa8a161 healthd: move global gHealth service pointer
... to class implementation::Health. Expose APIs
InitInstance(), GetImplmentation()
for its setter and getter.

Clients that statically links to android.hardware
.health@2.0-impl (e.g. charger, recovery)
should use InitInstance().

Test: health VTS tests
Bug: 63702641
Change-Id: I51b9b976d0b723dac1a03e5113d5d9e84300c0e9
2017-11-13 12:34:47 -08:00
Yifan Hong
5382983429 healthd: remove global binder fd
It is not used elsewhere, so a local variable is
sufficient.

Also fix a shared lib order in soong file.

Test: health VTS test
Bug: 63702641
Change-Id: I53cc208d8dd388fc89119c0044c5e30acf0740fb
2017-11-10 07:58:09 +00:00
Yifan Hong
31cc64aa79 healthd connect to health@1.0 hal
This is the original code path (BatteryService
-> healthd -> health 1.0 HAL). This ensures
upgrade-ability for old devices to P.

This is a partial revert of
287c41fffe, with
some modifications to the original healthd_board_*
functions for healthd.

Bug: 65990106
Test: VTS test for healthd and health service
Change-Id: If1c65e64e2fd6750369d52c8051ca6aa2b57ef27
2017-11-08 10:37:20 -08:00
Yifan Hong
cded900b96 Refactor common code between healthd and health@2.0-service
Use healthd_board_* functions for the
code that's different between them.

Bug: 65990106
Test: boots
Test: VTS tests on healthd and health service
Change-Id: I88e6f210cb91c0cf08a9d7c52910c38fa9a75130
2017-11-07 14:03:15 -08:00
Yifan Hong
1106e83c54 Health@2.0: uses @1.0::HealthInfo
Revert "Update for expanding @2.0::HealthInfo."
BatteryService does not use these fields for posting
sticky intents.

This reverts commit be17a4f235.
Test: boots
Bug: 63702641

Change-Id: I4df61645ab38a8e205ee21efc86bbef3e39674ab
2017-11-06 13:13:15 -08:00
Yifan Hong
287c41fffe Remove unused files in healthd.
Test: mma
Change-Id: I19c13aa3f1fdecd3f7072dccfe9dbd580f09e22a
2017-10-19 14:52:00 -07:00
Yifan Hong
12df1b9508 healthd provides IHealth/backup.
Test: lshal shows IHealth/backup
Bug: 62229583
Change-Id: Ibffdd2ec392682385ed491df22084a57280e1513
2017-10-19 14:52:00 -07:00
Elliott Hughes
a3524a255f resolve merge conflicts of 796987482 to stage-aosp-master am: bb5ec4a926
am: 314ddcd9a3

Change-Id: I4fee960013f5539d85613eb09e365ee580ed1745
2017-10-17 21:57:49 +00:00
Elliott Hughes
bb5ec4a926 resolve merge conflicts of 796987482 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ica884c137c5f21e261600b2b011ab963036c0cdb
2017-10-17 12:36:14 -07:00
Elliott Hughes
a0f73f9bff <stdbool.h> not necessary in C++.
Bug: N/A
Test: builds
Change-Id: I1f32b202e353414e74ace87a7d5b495b5deb5f99
Merged-In: I1f32b202e353414e74ace87a7d5b495b5deb5f99
2017-10-17 16:21:33 +00:00
Elliott Hughes
503b63fe09 <stdbool.h> not necessary in C++.
Bug: N/A
Test: builds
Change-Id: I1f32b202e353414e74ace87a7d5b495b5deb5f99
2017-10-17 09:20:26 -07:00
Yifan Hong
be17a4f235 Update for expanding @2.0::HealthInfo.
Health service also sends other fields in callbacks.
Test: builds
Bug: 62229583

Change-Id: Icb9215c263ba34055e77db3dbb047998bb2da4e8
2017-10-11 10:53:37 -07:00
Yifan Hong
2763df8eae Implement android.hardware.health@2.0.
healthd_common.cpp uses health@2.0 for health@2.0-service
and healthd.

charger and recovery will be fixed in a follow up change.
(They still use libbatterymonitor for now).

Test: adb logcat -e "health@2.0"
Test: adb shell lshal --debug

Change-Id: I9ff0691d467df37118d7f143693c1bcd17a5bcbf
2017-10-06 15:29:59 -07:00
Yifan Hong
ffff9aae02 libbatterymonitor: vendor_available
libbatterymonitor is a static library.
Also removed unused libbinder dependency.

Test: pass
Change-Id: I1f17ee643e6ed1bb2c11a6f3189a448dba2927ac
2017-10-06 13:05:19 -07:00
Luke Song
23471afe84 resolve merge conflicts of 74a5f22d9 to oc-dr1-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.

Change-Id: Iad367b2998311e327151dbd8e9295259f6661f77
2017-07-19 18:25:51 -07:00
Luke Song
1d540dd0f4 healthd: restructure healthd_mode_charger
Refactor drawing code into separate class, and allow for split screen
drawing with offset.

Cherry picked from commit 7f386dcab9

Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
2017-07-19 22:46:54 +00:00
Luke Song
7f386dcab9 healthd: restructure healthd_mode_charger
Refactor drawing code into separate class, and allow for split screen
drawing with offset.

Bug: 63541890
Test: Verify charging mode animation
Change-Id: I6c089460f55b8c2f75f4aa3153a5736f6f434b51
2017-07-18 15:06:46 -07:00
Steven Moreland
1b13eea81f Added libhealthd-headers.
Test: use with BOARD_VNDK_VERSION=current
Change-Id: Icece8e543307498f349d7f4914ec5be6d97e98fc
2017-07-10 16:05:51 -07:00
Todd Poynor
51741d2f50 Merge "healthd: notify listeners using local copy of list, drop lock"
am: e29a6cda31

Change-Id: I94c6b076148c65e82ef13fc75b4be15b3e930901
2017-06-29 22:29:36 +00:00
Todd Poynor
8bd30b3cf3 healthd: notify listeners using local copy of list, drop lock
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting).  The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded.  The binder behavior is considered a bug and may change in
the future.  For now, work around this in healthd.

Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.

Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
2017-06-29 22:25:40 +00:00
Mark Salyzyn
ca0c0bb96e Merge changes Ibe1feb39,I05be83e4,If1422e4d am: a4f086ab20
am: 3a156e6c2b

Change-Id: I8c75910845dbf6dfbb50ad38eb234dcd68dce70f
2017-06-27 21:55:26 +00:00
Todd Poynor
a1f4cddfea healthd: notify listeners using local copy of list, drop lock
am: fd68370074

Change-Id: I8b8c8bb2b2eede878bb44afcaa08f73142a10d64
2017-06-27 21:52:29 +00:00
Mark Salyzyn
3a156e6c2b Merge changes Ibe1feb39,I05be83e4,If1422e4d
am: a4f086ab20

Change-Id: I7e5d431c992f9860ca7b42ca81edfbfd1d8e0a1c
2017-06-27 21:52:06 +00:00
Todd Poynor
fd68370074 healthd: notify listeners using local copy of list, drop lock
Binder currently may service an incoming oneway transaction whenever
an outbound oneway call is made (if there is already a pending
incoming oneway call waiting).  The unexpected nested method call
blocks forever on a recursive mutex acquire because healthd is single-
threaded.  The binder behavior is considered a bug and may change in
the future.  For now, work around this in healthd.

Make a local copy of the listeners list, then drop the lock and
perform the outbound calls on the local copy of the list.

Bug: 38201220
Test: Marlin with modified client calling scheduleUpdate() repeatedly
Change-Id: If35c2847556245921e2aff808ff747bb60356811
2017-06-27 11:58:17 -07:00
Mark Salyzyn
26f1dd764c healthd: check console-ramoops-0
On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0

Test: none
Bug: 63058217
Change-Id: I05be83e40dfc1730ed62b74a146123cdb8573ca6
2017-06-27 09:28:57 -07:00
Yueyao Zhu
8e5671f55c Merge "healthd: add battery health status values from JEITA spec" am: 5dd87c4ef6
am: 7a79592e4e

Change-Id: Ife13b29af4f44d3d6f5cc7b00435f4c6a57e0d2b
2017-06-21 19:29:25 +00:00
Yueyao Zhu
9bbfbf7ffe healthd: add battery health status values from JEITA spec
Some vendors implement JEITA battery health spec.

Bug: 35780570
Test: build and boot
Change-Id: I532cd0fbdbcae0a32879de7d7930f3ccb8605ffd
2017-06-20 18:08:51 -07:00
Adam Lesinski
f04daccae9 Merge "healthd: Implement scheduleUpdate" am: 6edabc75ab am: c0405200b8
am: 50094d9865

Change-Id: I75976e5d4d4a38fb0fcb9e0cb5bf33a5786b146d
2017-03-23 01:12:17 +00:00
Adam Lesinski
c0405200b8 Merge "healthd: Implement scheduleUpdate"
am: 6edabc75ab

Change-Id: I80082322b77cbd74b70b4d3c25e172d1c51f6072
2017-03-23 00:48:48 +00:00
Adam Lesinski
3dec1aa66d healthd: Implement scheduleUpdate
scheduleUpdate forces a healthd battery update,
which will notify all listeners.
Test: Manual (strace -p $healthd_pid)
Bug: 32645990

Change-Id: I8b19f79b633ca8988f0e3dd5be14757f6421ddcb
2017-03-22 12:15:11 -07:00
Steven Moreland
aa47993b23 Merge "libutils: String\d+ make std_string private" am: 76850afa52 am: 2ebb1e5404
am: 4ba3f784ef

Change-Id: I14f003992db222ef285551c6d9a8ffe71620f70d
2017-03-11 09:07:23 +00:00
Steven Moreland
2ebb1e5404 Merge "libutils: String\d+ make std_string private"
am: 76850afa52

Change-Id: I1d8278c7545c67a916977983d38ea82756a17403
2017-03-11 08:59:48 +00:00
Steven Moreland
2aac335128 libutils: String\d+ make std_string private
This method is still used by prebuilts, but making it private to start
the process of removing it from everywhere.

Test: pass
Bug: 35363681
Change-Id: I4d53f68d10c9abcca32023c4d930e99912afa697
2017-03-10 22:51:55 -08:00
TreeHugger Robot
068e00b3c9 Merge "Revert "Add BMS as a Battery type"" 2017-03-06 23:34:59 +00:00
Yueyao Zhu
8d17bc6a7a Revert "Add BMS as a Battery type"
This reverts commit f13c6ff50a.

Bug: 34166515
Change-Id: I102d3ee071f214deba1a72738af62b6f6b7c52f4
2017-03-06 21:42:35 +00:00
Chris Phoenix
68f4085e07 health HAL uses "default" service name
The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds

Bug: 33844934
Change-Id: I9a1fd3ba598bf058b6212bd416ecdf90ea329539
2017-02-23 19:32:29 +00:00
Jin Qian
72adf11daf healthd: return battery status property
Bug: 34198239
Change-Id: Ib0f312c15eb75ba7482f4f0b3f30ba2feae2c209
2017-02-07 21:41:05 +00:00
Todd Poynor
c8183bb071 healthd: charger mode use reboot(), not android_reboot()
Preserve last Android reboot reason as recorded by android_reboot()
prior to entering charger mode.  For example, a thermal shutdown that
reboots to charger mode leaves that reason in place, for user
notification purposes at next Android startup.

Bug: 30994946
Test: manual
Change-Id: I003f57bfff29a471bb647d2cf6b0986ff428985a
2017-02-02 04:00:54 +00:00
Tao Bao
3d34631dbe Merge "healthd: Track the API change of minui/minui.h." am: fb8c70cf4b am: 93e35655c4 am: bf90005832
am: a2285a6a3e

Change-Id: I6573b527bd7d405203d2e8fd063358ad031065a1
2017-01-25 00:59:02 +00:00
Tao Bao
bf90005832 Merge "healthd: Track the API change of minui/minui.h." am: fb8c70cf4b
am: 93e35655c4

Change-Id: Ic77cd6f293d2875e251def1e75aff33a612d7077
2017-01-25 00:56:07 +00:00
Tao Bao
92c260159a healthd: Track the API change of minui/minui.h.
ev_init() and ev_iterate_available_keys() now take std::function
callback functions.

Test: mmma system/core/healthd
Change-Id: I8231b57ba816fcba8f698dd7145724021e235664
2017-01-18 23:02:45 -08:00
Adam Lesinski
f13c6ff50a Add BMS as a Battery type
In order to automatically use the /sys/class/power_supply/bms/charge_full
path for reading learned capacity of the battery, the BMS power supply
(Battery Management System) needs to be considered a battery.
Test: Manual

Change-Id: I66e5751547c3dbdc8de0bb3893367cc6f2c9d733
2016-12-09 19:23:46 -08:00
Nick Vaccaro
9291de89b9 healthd: Show animation before waiting on timer
am: 6f8314900f

Change-Id: I4fd5665ff1b7ce646aa0b515aeb38152a340d8a1
2016-11-29 21:40:59 +00:00
Nick Vaccaro
485c647432 resolve merge conflicts of e3083de to nyc-mr1-dev-plus-aosp
Change-Id: Iba35210bc2133d79b2ba8ceb63e355507c7c0f03
2016-11-29 11:28:26 -08:00
Damien Bargiacchi
fdce0878f1 Always show the battery percentage unless it is unknown
am: 3f0250c3cc

Change-Id: If5027f2fc94aaf1f2db1d6df79866185e2cfe86d
2016-11-29 19:10:58 +00:00
Nick Vaccaro
1e811fca22 resolve merge conflicts of 1f1a6fd to nyc-mr1-dev-plus-aosp
Change-Id: Ic07b6db6f47d2157aef0d04d025ba747d0a4247d
2016-11-28 14:58:30 -08:00
Yifan Hong
62e840fc44 Split libhidl into base and transport.
Bug: 32756130

Test: mma
Change-Id: I1b897d3984b0faf636d40b862b14872ce5d5aa9b
2016-11-17 14:45:11 -08:00
Sandeep Patil
a3681954b4 healthd: start using the new Health hal
Subsequently moves the default board hooks to hardware/interface/health
where the new HAL is defined.

This change removes 'healthd's dependency on libhealthd.<target> static hal.
The dependency has now been *temporarily* moved to the new HAL
implementation in hardware/interfaces/health. 'charger' continues to depend
the static HAL.

Test: Tested healthd with and without a board specific health HAL on
Angler.

Bug: b/32724915

Change-Id: I35b56bacde7ded0517bc960f35538d6ca46e6b06
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-11-10 15:19:24 -08:00
Sandeep Patil
526f8cf339 healthd: refactor healthd code to split into 'charger' and 'healthd'
This splits healthd code into 2 pieces as described below.

charger - statically linked executable in /sbin
 - responsible for charger-mode UI
 - battery/charger  monitoring in recovery/charger-mode.

healthd - dynamically linked (*mostly*) executable in /system/bin
 - responsible for battery / charger monitoring in Android
 - runs 'batteryproperties' service.

Both currently use libhealthd STATIC HALs. However, this now paves
way for the healthd (android) HAL to be a shared library that can
be trebelized.

   text    data     bss     dec     hex filename
 733356   15312   33864  782532   bf0c4 root/sbin/charger
  55943   10392     192   66527   103df system/bin/healthd
 789299   25704   34056  849059   cf4a3 (TOTALS)

Test: Tested recovery, charge-only and android boot with new binaries
with and without STATIC HAL.

Change-Id: I80f94948dda44d466f172d234b3fcc9064ef2476
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-11-08 07:36:07 -08:00
Sandeep Patil
6012db553c healthd: build 'charger' and 'healthd' binaries
This renames the old '/sbin/healthd' to '/sbin/charger'
which is to be only used in recovery and charger-only mode.

.. and adds a new dynamically linked executable in /system/bin/healthd
to be used as 'healthd' in Android.

   text    data     bss     dec     hex filename
 817404   36704   37960  892068   d9ca4 root/sbin/charger {was healthd}
  72717   11064   12984   96765   179fd system/bin/healthd {*new*}
 890121   47768   50944  988833   f16a1 (TOTALS)

Corresponding changes in recovery and charger-only .rc files are
required change how 'charger' is launched in each mode.

Update the seclable for healthd with the launch path in init.rc

Test: Boot tested and verified all 3 modes (recovery, charge-only,
android)

Change-Id: I4ada27a4c113258c5be1fd10adb0f58232b10024
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-11-08 07:36:07 -08:00
Sandeep Patil
fca8244080 healthd: refactor to split charger and framework facing code
The charger code lands in 'libhealthd_charger' and androoid/framework
facing code is now compiled into 'libhealtdh_android' (formerly
libhealthd_internal).

This is a pre-cursor to eventually splitting healthd into 2 binaries,
viz ..

 1. /sbin/charger - statically linked binary to be used *only* in recovery
 and  charge-only mode(s).
 2. /system/bin/healthd - dynamically linked binary to be used *only* in
 Android.

The static board hal (i.e libhealthd.<target>) will then be compiled
twice for charger and healthd seperately, paving the way for us to
seperate out the HAL for Android

Test: Boot tested and verified 'healthd' works in recovery,
charger-only mode and Android.

Change-Id: If45213ddd14c00ea3b8e1759cfd99286ca1ef2ea
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-11-08 07:35:55 -08:00
Nick Vaccaro
c3c947a7bc healthd: Show animation before waiting on timer am: 6f8314900f
am: 2ed637210e

Change-Id: Ibb768d6760a13a9b25a40fabd0fcf8cb283fdba9
2016-10-27 04:02:17 +00:00
Nick Vaccaro
6f8314900f healthd: Show animation before waiting on timer
Don't wait for first timer to expire before starting animation.

Bug: 32368190
Change-Id: If023e3a9f1dd0c3982c899bcf22e5335f9319f72
2016-10-26 19:41:21 -07:00
Tom Cherry
836a404525 resolve merge conflicts of 4897bb5 to nyc-mr2-dev-plus-aosp
Change-Id: Iacad26a1b27d032e7abd1c7c23a8ee87d61d0aa4
2016-10-24 22:15:12 -07:00
Nick Vaccaro
4897bb57e4 Enable CHARGER_ENABLE_SUSPEND to allow suspend
am: e3083dec0f

Change-Id: I58f35c426ccd6030664743c3f49adbc5af7102b2
2016-10-25 04:25:04 +00:00
TreeHugger Robot
085c91bedd Merge "Enable CHARGER_ENABLE_SUSPEND to allow suspend" into cw-f-dev 2016-10-25 04:16:25 +00:00
Damien Bargiacchi
2f65bf3e37 Always show the battery percentage unless it is unknown am: 3f0250c3cc
am: 44437259dd

Change-Id: I5f18055d0d04e642ebcc9fea4b713c1dc3298cfc
2016-10-25 01:36:50 +00:00
Damien Bargiacchi
44437259dd Always show the battery percentage unless it is unknown
am: 3f0250c3cc

Change-Id: I6e759572904fb7f505528812266fc48ecc8afd49
2016-10-25 01:33:50 +00:00
TreeHugger Robot
cd542213e8 Merge "Always show the battery percentage unless it is unknown" into cw-f-dev 2016-10-25 01:28:06 +00:00
Damien Bargiacchi
3f0250c3cc Always show the battery percentage unless it is unknown
Bug: 29547343
Change-Id: I55630be8033cd8074628a892960b5fafe0c83338
2016-10-24 16:45:29 -07:00
Nick Vaccaro
e204690ae7 resolve merge conflicts of 7c5aeb0 to nyc-mr2-dev-plus-aosp
Test: make healthd
Change-Id: I6dd20f5da5d2a9858d49db5556d8956a67ebf962
2016-10-24 14:07:35 -07:00
Nick Vaccaro
e3083dec0f Enable CHARGER_ENABLE_SUSPEND to allow suspend
Fixed a bug in makefile that was keeping CHARGER_ENABLE_SUSPEND from
getting properly set, so healthd was not trying to put kernel into
suspend.

Bug: 32162033
Change-Id: If054d7996fa5734285cbcd7d497492570076c141
2016-10-24 13:58:49 -07:00