health: get batteryStateOfHealth from healthd
Bug: 251427118 Test: m android.hardware.health-update-api Change-Id: I556570782b0a9698fd3530be86f8ede33b11afe2 Signed-off-by: Jack Wu <wjack@google.com>
This commit is contained in:
parent
39c564112b
commit
cbbf24f15d
1 changed files with 5 additions and 0 deletions
|
@ -148,6 +148,11 @@ ndk::ScopedAStatus Health::getBatteryHealthData(BatteryHealthData* out) {
|
|||
!res.isOk()) {
|
||||
LOG(WARNING) << "Cannot get First_usage_date: " << res.getDescription();
|
||||
}
|
||||
if (auto res = GetProperty<int64_t>(&battery_monitor_, ::android::BATTERY_PROP_STATE_OF_HEALTH,
|
||||
0, &out->batteryStateOfHealth);
|
||||
!res.isOk()) {
|
||||
LOG(WARNING) << "Cannot get Battery_state_of_health: " << res.getDescription();
|
||||
}
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue