Commit graph

162 commits

Author SHA1 Message Date
Yifan Hong
54f20b6256 Update health@1.0 batteryVoltage units.
Both framework BatteryService and all implementations (that uses
BatteryMonitor) uses millivolts for batteryVoltage.

maxChargingVoltage is microvolts and that is correct.

Fixes: 115881119
Test: treehugger

Change-Id: I64044489fe6d56e0d211085d9536fe5cfd95efc4
2019-03-27 16:25:37 -07:00
Yifan Hong
03b2a3477b health vts: implement GTEST_SKIP if not defined.
gtest in Android P tree does not have GTEST_SKIP. Implement
a naive version of it.

Bug: 118852225
Test: manually undefine GTEST_SKIP, test with and without --force
Change-Id: I8df1154d8a94a67ae28e8024de6022fcfe76384d
2019-03-08 15:00:48 -08:00
Treehugger Robot
ace1da7c5b Merge "health: skip VTS on healthd if vendor HAL is present." 2019-03-08 03:18:13 +00:00
Yifan Hong
e6807ddec1 health: skip VTS on healthd if vendor HAL is present.
If vendor HAL is present, healthd is not used by the framework. VTS should
skip testing it when this is the case.

Provide a --force option to the test if one wants to test healthd.

Fixes: 118852225
Test: on walleye, test healthd with and without --force.

Change-Id: I85f792f25406b1c02887a0ac273730e719003e2f
2019-03-07 13:05:11 -08:00
Steven Moreland
a878aee9ab Update makefies: no 'types'
Bug: 123976090
Test: N/A
Change-Id: I30fb04c81889b62775e1b764b965fdb0f893de17
2019-03-04 11:27:17 -08:00
Hridya Valsaraju
bbab8f2a3e Increate testcase timeout for VtsHalHealthStorageV1_0TargetTest
The test is flaky with the current timeout and this CL
increases it to a safe value.

Bug: 120994008
Test: test passes

Change-Id: I63e0e11fcc1eb3bed490cdb21193e2c332cccf80
2019-02-13 17:21:21 -08:00
Tom Cherry
bf94481483 Move to new Fstab class
Test: treehugger
Change-Id: I0a3a58193c1482296bc5b60df3f9247e5f1366c3
2019-01-30 14:27:43 -08:00
Treehugger Robot
063024b1b6 Merge "Make health storage HAL lazy" 2019-01-07 23:25:20 +00:00
Peter Kalauskas
d2c86ff910 Make health storage HAL lazy
Make health storage HAL run only when needed.

Bug: 115675262
Test: Flash crosshatch, ensure android.hardware.health.storage@1.0-service
      is not running. Enable debug logging in vold. Run 'adb shell sm
      idle-maint run' and check logs to ensure vold runs "Start Dev GC
      on HAL"
Change-Id: I4bd48b5bb1b3ae7e1f4ccaff2042f1331e4cd76d
2019-01-07 10:45:31 -08:00
Felix
1fe2196f11 health: Add CAP_WAKE_ALARM to service
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.

Update the README to reflect the needed cap in the init file,
see also https://r.android.com/861532

Since the v1.0 HAL is in passthrough mode, the cap is needed for the 1.0
service as well.

Change-Id: I0e71da125eeef1360b5fd8bc7a69285e0b786511
Signed-off-by: Felix <google@ix5.org>
2019-01-06 16:07:50 +00:00
Felix
6a2b1b084a health: Fix typos in README
Change-Id: I64eb6cdaaccf30cf96d273db4e8d434d6ea90c51
Signed-off-by: Felix <google@ix5.org>
2019-01-04 19:57:12 +01:00
Nick Kralevich
8c038f2a2f healthd_common.cpp: use epoll_create1
epoll_create leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC)
instead.

Bug: 120983106
Test: compiles and boots
Change-Id: I50aad9f1c0633add2b44fb22be73dd292a366f39
2018-12-15 11:36:47 -08:00
Keun Soo YIM
68ae05dd2d pack VTS cc_test binaries as general-tests
Test: make general-tests
Bug: 120093339
Merged-In: I363450d205868f900e4925ccff1430e2a569f2a4
Change-Id: I363450d205868f900e4925ccff1430e2a569f2a4
2018-12-07 10:49:56 -08:00
Yifan Hong
f8a8873ee6 Merge "health VTS: split Properties test" 2018-10-02 23:37:43 +00:00
Yifan Hong
26c1200e54 health VTS: split Properties test
... into multiple test cases.
Test: run test

Change-Id: I2a03a7ab01d2918b746e06f55c2ee6d733ab4021
2018-10-02 14:54:28 -07:00
Yifan Hong
e9fc235eb4 health: registerCallback() and getHealthInfo() does not notify all callbacks
registerCallback() and getHealthInfo() unintentionally broadcast
health info to all callbacks, which has a performance impact.

* registerCallback() still invokes the new callback immediately
* getHealthInfo() does not call any callbacks at all.

Test: VTS test call getHealthInfo does not invoke update()
Bug: 117167903
Change-Id: Ida99fdd73831e747fbf2d65089c7c0e7661fe7c4
2018-10-02 14:30:03 -07:00
Yifan Hong
a46c0dae81 health: use recursive_mutex.
Need to use an reentrant lock.

Bug: 117167903
Test: vts
Change-Id: I25a366e06ed9d983823f7276668b7f45ddcf1c2b
2018-10-02 14:30:03 -07:00
Hridya Valsaraju
bf0b9faaad Initialize healthd_mode_ops in recovery default Health HAL impl.
This is required for correct functioning of getHealthInfo() API
in recovery since BatteryMonitor requires healthd_mode_ops to be
initialized to update battery properties.

Bug: 78793464
Test: fastboot getvar battery-voltage
Change-Id: I9ff77664cada22e4aa3668bfb7d28d5f1d45590b
2018-09-28 21:30:20 +00:00
Yifan Hong
10becafa1e Merge "health.storage: Add VTS test." 2018-09-21 22:20:24 +00:00
Yifan Hong
14eea6bb3f health.storage: Add VTS test.
Test: run test
Bug: 111655771
Change-Id: I353026bcf882fcdafa9986e4f60d5853abac7e54
2018-09-21 12:25:24 -07:00
Yifan Hong
c0263aa0e4 health.storage: Add default implementation.
Test: lshal show default implementation when installed
Test: `lshal debug` (read and write successfully)
Test: `adb shell sm idle-maint run`
Bug: 111655771
Change-Id: Ibb09836b99310b6bc21e87be9c0177175efa29df
2018-09-20 17:18:53 -07:00
Yifan Hong
ec75d33d9c health.filesystem::IFileSystem -> health.storage::IStorage
Rename the HAL because it is regarding 'storage health',
not 'filesystem health'.

Bug: 111655771
Test: compiles
Change-Id: I07072c876fb07c88be8bd74cf6b84aec6020a697
Merged-In: I07072c876fb07c88be8bd74cf6b84aec6020a697
2018-09-19 13:11:59 -07:00
Yifan Hong
a0082b80ba health filesystem: update garbageCollect() function.
Bug: 111655771
Test: run dev gc on vold

Change-Id: I2cef404f9e2720c1be7822895187a590837763c8
2018-09-12 10:43:49 -07:00
Yifan Hong
6ab518e0df libhealthhalutils is recovery_available
Test: build it with recovery
Bug: 80132328
Change-Id: I0728b9a900577cc41cb8acb3d70dd0afb507fb2a
2018-08-13 12:55:36 -07:00
Yifan Hong
66a4144c96 Add health.filesystem HAL.
Test: builds
Bug: 111655771
Change-Id: I29f157912ef74b4efd64def93ea125aa079ac1eb
Merged-In: I29f157912ef74b4efd64def93ea125aa079ac1eb
2018-08-10 11:36:39 -07:00
Treehugger Robot
c07a66e169 Merge "libhealthd.default: Mark as recovery_available." 2018-08-09 01:42:06 +00:00
Yifan Hong
388897c3f2 health: convert README to markdown format.
Test: none
Change-Id: Ic9503d43a5e69cee0deb901193a99154d68f67b0
Fixes: 112277698
2018-08-08 11:06:51 -07:00
Tao Bao
a6d2cccee3 libhealthd.default: Mark as recovery_available.
Bug: 110380063
Test: `m dist` with aosp_taimen-userdebug
Change-Id: I65c13107bdf77e9e0ab49af96e92ea462435fe6a
2018-08-07 21:47:46 -07:00
Steven Moreland
2ea3fa5cc1 IWYU: healthd IPCThreadState
Bug: 65843592
Test: m
Change-Id: I6f235c8a851079f335cfbc15b9bdb6f9d34d91fe
2018-08-01 01:23:53 +00:00
Yifan Hong
4db762a4d9 healthd: add android.hardware.health@2.0-impl-default.recovery
Test: build recovery
Bug: 80132328
Change-Id: I253bd1a756f3b94f6470da12bfc4488313a16aa4
2018-07-18 16:04:39 -07:00
Yifan Hong
ad35b35621 health@2.0-impl: recovery_available: true
... so that it can be installed to recovery image.
Test: build and inspect out dir
Test: boot to recovery and 'adb shell ls /vendor/lib64/hw'
Bug: 80132328

Change-Id: Icb33c9e9e648b54db33cac23ed877392cce4e76b
Merged-In: Icb33c9e9e648b54db33cac23ed877392cce4e76b
(cherry picked from commit 4e40086d39)
2018-07-18 11:28:12 -07:00
Yifan Hong
b21b03dd35 health: libhealthstoragedefault: recovery_available
Test: builds
Bug: 80132328

Change-Id: I2c4d880968e6938806cb9a2cf65352c73748f4ce
Merged-In: I2c4d880968e6938806cb9a2cf65352c73748f4ce
(cherry picked from commit 14d4383762)
2018-07-18 11:28:08 -07:00
TreeHugger Robot
456c9ebbcf Merge "healthd use vintf_fragments" into stage-aosp-master 2018-07-17 22:07:51 +00:00
Yifan Hong
c4a3421bc8 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
Change-Id: I447395450060cdf17731514bb9a5e3ed912bbc66
Merged-In: I447395450060cdf17731514bb9a5e3ed912bbc66
(cherry picked from commit ae005c4610)
2018-07-17 11:58:23 -07:00
Yifan Hong
51b29c99d4 health: remove unused flag HEALTHD_USE_HEALTH_2_0
Test: boots
Bug: 79107699
Change-Id: Idc27ad452b799ef2ce4f18c787f2aa2afd1dd8cf
(cherry picked from commit 1ffc50ad70)
2018-07-17 17:55:40 +00:00
Steven Moreland
c90461c738 rename hidl_enum_{iterator,range}
This is actually a range, not an iterator.

Bug: 78573628
Test: m
Change-Id: Ie824a3eabcb7d5af94a8752e1498bdc8c7032e40
2018-05-02 00:06:33 +00:00
TreeHugger Robot
2b2ffe64d6 Merge "Remove DiskStat checks from VTS Health HAL test" into pi-dev 2018-04-10 19:24:31 +00:00
Yifan Hong
7f8caede5f Merge "health: update readme for writing kmesg" into pi-dev 2018-04-06 21:03:34 +00:00
Yifan Hong
d7b297df83 health: update readme for writing kmesg
Test: none
Bug: 77661605
Change-Id: Iea07a8361e7c23919515d8550d90d2bd329e616a
2018-04-05 19:11:10 -07:00
TreeHugger Robot
6acac5a356 Merge "health: expand debug info." into pi-dev 2018-04-05 18:40:15 +00:00
Yifan Hong
81b2833a2f health: expand debug info.
Test: lshal -m android.hardware.health@2.0::IHealth/default
Test: lshal -m android.hardware.health@2.0::IHealth/backup

Bug: 74057048
Change-Id: Iaca0a7fd32209522d7d759342b98d6e6898595ac
2018-04-04 22:32:53 +00:00
Yifan Hong
8ef2335fe0 health 2.0: update readme to uninstall healthd
Test: none
Bug: 77541952

Change-Id: I44191f2d9f4a6d328c0ec96212c2add3b02874ca
2018-04-04 14:25:00 -07:00
Hridya Valsaraju
075c182f4d Remove DiskStat checks from VTS Health HAL test
The fields being checked were uint64_t and it
is valid for them to have any value greater than
or equal to zero.

Bug: 74057048
Test: vts-tradefed run vts -m VtsHalHealthV2_0
Change-Id: If932e1d6af8e162b7c570a1d5dd0f5ddce89ad1e
2018-04-03 18:24:34 +00:00
Zhuoyao Zhang
d571a2bc57 Merge "Convert health hal test to use VtsHalHidlTargetTestEnvBase" am: 8a5a99ca3b am: ef211ccb88
am: d5e930ea16

Change-Id: Iea1bedb26ec6eabc050b4f2c7c99cda2dfe9894e
2018-02-16 00:16:15 +00:00
Zhuoyao Zhang
91456084c2 Convert health hal test to use VtsHalHidlTargetTestEnvBase
Bug: 64203181
Test: make vts
      vts-tradefed run vts -m VtsHalHealthV1_0Target

Change-Id: Ibbe9421b5a737d7eb2d021bd64757a548d3c95fc
2018-02-12 23:48:50 +00:00
Yifan Hong
9fe3cc4e34 health 2.0: update README for typo. am: de542acbbf am: 6271c38c90
am: a9e9f9182d

Change-Id: Ia2997a95ca4034e79895197c56206e0cd0a7a379
2018-01-31 02:33:45 +00:00
Yifan Hong
de542acbbf health 2.0: update README for typo.
Test: none
Change-Id: Iaede40e22b909a06592dceedb3b430232ced0b1a
2018-01-30 15:32:30 -08:00
Yifan Hong
3e6dbcbc30 health: add README.
Test: none
Bug: 63702641
Change-Id: I1d23c0cdf56516585e7c6dd0db577784baa7b74e
Merged-In: I1d23c0cdf56516585e7c6dd0db577784baa7b74e
2018-01-30 15:06:21 -08:00
Steven Moreland
5d1e41a8fd Update makefiles.
Bug: N/A
Test: N/A
Change-Id: Idb1d74aeed9b82ca6568c76f35552f3fcc894239
2018-01-23 19:44:19 +00:00
Yifan Hong
fed3bfa4bc health: add README.
Test: none
Bug: 63702641
Change-Id: I1d23c0cdf56516585e7c6dd0db577784baa7b74e
2018-01-22 12:53:15 -08:00