Loading health/2.0/default/Health.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -17,11 +17,15 @@ #include <android-base/logging.h> #include <android-base/file.h> #include <android/hardware/health/2.0/types.h> #include <health2/Health.h> #include <hal_conversion.h> #include <hidl/HidlTransportSupport.h> using HealthInfo_1_0 = android::hardware::health::V1_0::HealthInfo; using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; extern void healthd_battery_update_internal(bool); namespace android { Loading Loading @@ -149,7 +153,9 @@ Return<Result> Health::update() { // Retrieve all information and call healthd_mode_ops->battery_update, which calls // notifyListeners. battery_monitor_->updateValues(); struct BatteryProperties props = getBatteryProperties(battery_monitor_.get()); const HealthInfo_1_0& health_info = battery_monitor_->getHealthInfo_1_0(); struct BatteryProperties props; convertFromHealthInfo(health_info, &props); bool log = healthd_board_battery_update(&props); if (log) { battery_monitor_->logValues(); Loading Loading @@ -253,10 +259,7 @@ Return<void> Health::getHealthInfo(getHealthInfo_cb _hidl_cb) { using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; updateAndNotify(nullptr); struct android::BatteryProperties p = getBatteryProperties(battery_monitor_.get()); V1_0::HealthInfo batteryInfo; convertToHealthInfo(&p, batteryInfo); HealthInfo healthInfo = battery_monitor_->getHealthInfo_2_0(); std::vector<StorageInfo> info; get_storage_info(info); Loading @@ -272,8 +275,6 @@ Return<void> Health::getHealthInfo(getHealthInfo_cb _hidl_cb) { currentAvg = static_cast<int32_t>(prop.valueInt64); } V2_0::HealthInfo healthInfo = {}; healthInfo.legacy = std::move(batteryInfo); healthInfo.batteryCurrentAverage = currentAvg; healthInfo.diskStats = stats; healthInfo.storageInfos = info; Loading Loading
health/2.0/default/Health.cpp +8 −7 Original line number Diff line number Diff line Loading @@ -17,11 +17,15 @@ #include <android-base/logging.h> #include <android-base/file.h> #include <android/hardware/health/2.0/types.h> #include <health2/Health.h> #include <hal_conversion.h> #include <hidl/HidlTransportSupport.h> using HealthInfo_1_0 = android::hardware::health::V1_0::HealthInfo; using android::hardware::health::V1_0::hal_conversion::convertFromHealthInfo; extern void healthd_battery_update_internal(bool); namespace android { Loading Loading @@ -149,7 +153,9 @@ Return<Result> Health::update() { // Retrieve all information and call healthd_mode_ops->battery_update, which calls // notifyListeners. battery_monitor_->updateValues(); struct BatteryProperties props = getBatteryProperties(battery_monitor_.get()); const HealthInfo_1_0& health_info = battery_monitor_->getHealthInfo_1_0(); struct BatteryProperties props; convertFromHealthInfo(health_info, &props); bool log = healthd_board_battery_update(&props); if (log) { battery_monitor_->logValues(); Loading Loading @@ -253,10 +259,7 @@ Return<void> Health::getHealthInfo(getHealthInfo_cb _hidl_cb) { using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo; updateAndNotify(nullptr); struct android::BatteryProperties p = getBatteryProperties(battery_monitor_.get()); V1_0::HealthInfo batteryInfo; convertToHealthInfo(&p, batteryInfo); HealthInfo healthInfo = battery_monitor_->getHealthInfo_2_0(); std::vector<StorageInfo> info; get_storage_info(info); Loading @@ -272,8 +275,6 @@ Return<void> Health::getHealthInfo(getHealthInfo_cb _hidl_cb) { currentAvg = static_cast<int32_t>(prop.valueInt64); } V2_0::HealthInfo healthInfo = {}; healthInfo.legacy = std::move(batteryInfo); healthInfo.batteryCurrentAverage = currentAvg; healthInfo.diskStats = stats; healthInfo.storageInfos = info; Loading