Loading health/2.0/default/Health.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ Return<void> Health::getChargeStatus(getChargeStatus_cb _hidl_cb) { Return<Result> Health::update() { if (!healthd_mode_ops || !healthd_mode_ops->battery_update) { LOG(WARNING) << "health@2.0: update: not initialized. " << "update() should not be called in charger / recovery."; << "update() should not be called in charger"; return Result::UNKNOWN; } Loading health/2.0/default/HealthImplDefault.cpp +24 −1 Original line number Diff line number Diff line Loading @@ -46,9 +46,32 @@ int healthd_board_battery_update(struct android::BatteryProperties*) { return 0; } void healthd_mode_default_impl_init(struct healthd_config*) { // noop } int healthd_mode_default_impl_preparetowait(void) { return -1; } void healthd_mode_default_impl_heartbeat(void) { // noop } void healthd_mode_default_impl_battery_update(struct android::BatteryProperties*) { // noop } static struct healthd_mode_ops healthd_mode_default_impl_ops = { .init = healthd_mode_default_impl_init, .preparetowait = healthd_mode_default_impl_preparetowait, .heartbeat = healthd_mode_default_impl_heartbeat, .battery_update = healthd_mode_default_impl_battery_update, }; extern "C" IHealth* HIDL_FETCH_IHealth(const char* name) { const static std::string providedInstance{"backup"}; healthd_mode_ops = &healthd_mode_default_impl_ops; if (providedInstance == name) { // use defaults // Health class stores static instance Loading Loading
health/2.0/default/Health.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -142,7 +142,7 @@ Return<void> Health::getChargeStatus(getChargeStatus_cb _hidl_cb) { Return<Result> Health::update() { if (!healthd_mode_ops || !healthd_mode_ops->battery_update) { LOG(WARNING) << "health@2.0: update: not initialized. " << "update() should not be called in charger / recovery."; << "update() should not be called in charger"; return Result::UNKNOWN; } Loading
health/2.0/default/HealthImplDefault.cpp +24 −1 Original line number Diff line number Diff line Loading @@ -46,9 +46,32 @@ int healthd_board_battery_update(struct android::BatteryProperties*) { return 0; } void healthd_mode_default_impl_init(struct healthd_config*) { // noop } int healthd_mode_default_impl_preparetowait(void) { return -1; } void healthd_mode_default_impl_heartbeat(void) { // noop } void healthd_mode_default_impl_battery_update(struct android::BatteryProperties*) { // noop } static struct healthd_mode_ops healthd_mode_default_impl_ops = { .init = healthd_mode_default_impl_init, .preparetowait = healthd_mode_default_impl_preparetowait, .heartbeat = healthd_mode_default_impl_heartbeat, .battery_update = healthd_mode_default_impl_battery_update, }; extern "C" IHealth* HIDL_FETCH_IHealth(const char* name) { const static std::string providedInstance{"backup"}; healthd_mode_ops = &healthd_mode_default_impl_ops; if (providedInstance == name) { // use defaults // Health class stores static instance Loading