Loading thermal/aidl/default/Thermal.cpp +62 −4 Original line number Original line Diff line number Diff line Loading @@ -47,27 +47,85 @@ ScopedAStatus Thermal::getCoolingDevicesWithType(CoolingType in_type, return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* /* out_temperatures */) { ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* out_temperatures) { LOG(VERBOSE) << __func__; LOG(VERBOSE) << __func__; std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "skin", .type = TemperatureType::SKIN, .value = 30.1f, }); temperatures.push_back(Temperature{ .name = "battery", .type = TemperatureType::BATTERY, .value = 30.2f, }); *out_temperatures = temperatures; return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperaturesWithType(TemperatureType in_type, ScopedAStatus Thermal::getTemperaturesWithType(TemperatureType in_type, std::vector<Temperature>* /* out_temperatures */) { std::vector<Temperature>* out_temperatures) { LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); if (in_type == TemperatureType::SKIN) { std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "skin", .type = TemperatureType::SKIN, .value = 30.1f, }); *out_temperatures = temperatures; } else if (in_type == TemperatureType::BATTERY) { std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "battery", .type = TemperatureType::BATTERY, .value = 30.2f, }); *out_temperatures = temperatures; } return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatureThresholds( ScopedAStatus Thermal::getTemperatureThresholds( std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) { std::vector<TemperatureThreshold>* out_temperatureThresholds) { LOG(VERBOSE) << __func__; LOG(VERBOSE) << __func__; std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "skin", .type = TemperatureType::SKIN, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); temperatureThresholds.push_back(TemperatureThreshold{ .name = "battery", .type = TemperatureType::BATTERY, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatureThresholdsWithType( ScopedAStatus Thermal::getTemperatureThresholdsWithType( TemperatureType in_type, TemperatureType in_type, std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) { std::vector<TemperatureThreshold>* out_temperatureThresholds) { LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); if (in_type == TemperatureType::SKIN) { std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "skin", .type = TemperatureType::SKIN, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; } else if (in_type == TemperatureType::BATTERY) { std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "battery", .type = TemperatureType::BATTERY, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; } return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } Loading Loading
thermal/aidl/default/Thermal.cpp +62 −4 Original line number Original line Diff line number Diff line Loading @@ -47,27 +47,85 @@ ScopedAStatus Thermal::getCoolingDevicesWithType(CoolingType in_type, return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* /* out_temperatures */) { ScopedAStatus Thermal::getTemperatures(std::vector<Temperature>* out_temperatures) { LOG(VERBOSE) << __func__; LOG(VERBOSE) << __func__; std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "skin", .type = TemperatureType::SKIN, .value = 30.1f, }); temperatures.push_back(Temperature{ .name = "battery", .type = TemperatureType::BATTERY, .value = 30.2f, }); *out_temperatures = temperatures; return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperaturesWithType(TemperatureType in_type, ScopedAStatus Thermal::getTemperaturesWithType(TemperatureType in_type, std::vector<Temperature>* /* out_temperatures */) { std::vector<Temperature>* out_temperatures) { LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); if (in_type == TemperatureType::SKIN) { std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "skin", .type = TemperatureType::SKIN, .value = 30.1f, }); *out_temperatures = temperatures; } else if (in_type == TemperatureType::BATTERY) { std::vector<Temperature> temperatures; temperatures.push_back(Temperature{ .name = "battery", .type = TemperatureType::BATTERY, .value = 30.2f, }); *out_temperatures = temperatures; } return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatureThresholds( ScopedAStatus Thermal::getTemperatureThresholds( std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) { std::vector<TemperatureThreshold>* out_temperatureThresholds) { LOG(VERBOSE) << __func__; LOG(VERBOSE) << __func__; std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "skin", .type = TemperatureType::SKIN, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); temperatureThresholds.push_back(TemperatureThreshold{ .name = "battery", .type = TemperatureType::BATTERY, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } ScopedAStatus Thermal::getTemperatureThresholdsWithType( ScopedAStatus Thermal::getTemperatureThresholdsWithType( TemperatureType in_type, TemperatureType in_type, std::vector<TemperatureThreshold>* /* out_temperatureThresholds */) { std::vector<TemperatureThreshold>* out_temperatureThresholds) { LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); LOG(VERBOSE) << __func__ << " TemperatureType: " << static_cast<int32_t>(in_type); if (in_type == TemperatureType::SKIN) { std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "skin", .type = TemperatureType::SKIN, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; } else if (in_type == TemperatureType::BATTERY) { std::vector<TemperatureThreshold> temperatureThresholds; temperatureThresholds.push_back(TemperatureThreshold{ .name = "battery", .type = TemperatureType::BATTERY, .hotThrottlingThresholds = {30.0f, 31.0f, 32.0f, 33.0f, 34.0f, 35.0f, 36.0f}, }); *out_temperatureThresholds = temperatureThresholds; } return ScopedAStatus::ok(); return ScopedAStatus::ok(); } } Loading