Loading thermal/2.0/IThermal.hal +6 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ interface IThermal extends @1.0::IThermal { generates (ThermalStatus status, vec<Temperature> temperatures); /** * Retrieves temperature thresholds in Celsius. * Retrieves static temperature thresholds in Celsius. * * @param filterType whether to filter the result for a given type. * @param type the TemperatureType such as battery or skin. Loading @@ -54,7 +54,11 @@ interface IThermal extends @1.0::IThermal { * devices (such as CPUs, GPUs and etc.) in the list must be kept * the same regardless of the number of calls to this method even if * they go offline, if these devices exist on boot. The method * always returns and never removes such temperatures. * always returns and never removes such temperatures. The thresholds * are returned as static values and must not change across calls. The actual * throttling state is determined in driver and HAL and must not be simply * compared with these thresholds. To get accurate throttling status, use * getCurrentTemperatures or registerThermalChangedCallback and listen. */ getTemperatureThresholds(bool filterType, TemperatureType type) generates (ThermalStatus status, vec<TemperatureThreshold> temperatureThresholds); Loading thermal/2.0/default/android.hardware.thermal@2.0-service.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ <hal format="hidl"> <name>android.hardware.thermal</name> <transport>hwbinder</transport> <version>1.0</version> <version>2.0</version> <interface> <name>IThermal</name> Loading thermal/2.0/types.hal +14 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,12 @@ import android.hardware.thermal@1.0::types; enum TemperatureType : @1.0::TemperatureType { USB_PORT = 4, POWER_AMPLIFIER = 5, /** * Battery Charge Limit - virtual thermal sensors */ BCL_VOLTAGE = 6, BCL_CURRENT = 7, BCL_PERCENTAGE = 8, }; Loading Loading @@ -88,6 +94,7 @@ struct TemperatureThreshold { * Hot throttling temperature constant for this temperature sensor in * level defined in ThrottlingSeverity including shutdown. Throttling * happens when temperature >= threshold. If not available, set to NAN. * Unit is same as Temperature's value. */ float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] hotThrottlingThresholds; Loading @@ -95,13 +102,14 @@ struct TemperatureThreshold { * Cold throttling temperature constant for this temperature sensor in * level defined in ThrottlingSeverity including shutdown. Throttling * happens when temperature <= threshold. If not available, set to NAN. * Unit is same as Temperature's value. */ float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] coldThrottlingThresholds; /** * Threshold temperature above which the VR mode clockrate minimums cannot * be maintained for this device. * If not available, set by HAL to NAN. * be maintained for this device. If not available, set by HAL to NAN. * Unit is same as Temperature's value. */ float vrThrottlingThreshold; }; Loading @@ -121,7 +129,10 @@ struct Temperature { string name; /** * Current temperature in Celsius. If not available set by HAL to NAN. * For BCL, this is the current reading of the virtual sensor and the unit is * millivolt, milliamp, percentage for BCL_VOLTAGE, BCL_CURRENT and BCL_PERCENTAGE * respectively. For everything else, this is the current temperature in Celsius. * If not available set by HAL to NAN. */ float value; Loading thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <VtsHalHidlTargetTestEnvBase.h> using ::android::sp; using ::android::hardware::hidl_enum_range; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; Loading Loading @@ -183,9 +184,8 @@ TEST_F(ThermalHidlTest, TemperatureTest) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); } }); for (int i = static_cast<int>(TemperatureType::UNKNOWN); i <= static_cast<int>(TemperatureType::POWER_AMPLIFIER); ++i) { auto type = static_cast<TemperatureType>(i); auto types = hidl_enum_range<TemperatureType>(); for (const auto& type : types) { mThermal->getCurrentTemperatures( true, type, [&type](ThermalStatus status, hidl_vec<Temperature> temperatures) { if (temperatures.size()) { Loading Loading
thermal/2.0/IThermal.hal +6 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ interface IThermal extends @1.0::IThermal { generates (ThermalStatus status, vec<Temperature> temperatures); /** * Retrieves temperature thresholds in Celsius. * Retrieves static temperature thresholds in Celsius. * * @param filterType whether to filter the result for a given type. * @param type the TemperatureType such as battery or skin. Loading @@ -54,7 +54,11 @@ interface IThermal extends @1.0::IThermal { * devices (such as CPUs, GPUs and etc.) in the list must be kept * the same regardless of the number of calls to this method even if * they go offline, if these devices exist on boot. The method * always returns and never removes such temperatures. * always returns and never removes such temperatures. The thresholds * are returned as static values and must not change across calls. The actual * throttling state is determined in driver and HAL and must not be simply * compared with these thresholds. To get accurate throttling status, use * getCurrentTemperatures or registerThermalChangedCallback and listen. */ getTemperatureThresholds(bool filterType, TemperatureType type) generates (ThermalStatus status, vec<TemperatureThreshold> temperatureThresholds); Loading
thermal/2.0/default/android.hardware.thermal@2.0-service.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ <hal format="hidl"> <name>android.hardware.thermal</name> <transport>hwbinder</transport> <version>1.0</version> <version>2.0</version> <interface> <name>IThermal</name> Loading
thermal/2.0/types.hal +14 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,12 @@ import android.hardware.thermal@1.0::types; enum TemperatureType : @1.0::TemperatureType { USB_PORT = 4, POWER_AMPLIFIER = 5, /** * Battery Charge Limit - virtual thermal sensors */ BCL_VOLTAGE = 6, BCL_CURRENT = 7, BCL_PERCENTAGE = 8, }; Loading Loading @@ -88,6 +94,7 @@ struct TemperatureThreshold { * Hot throttling temperature constant for this temperature sensor in * level defined in ThrottlingSeverity including shutdown. Throttling * happens when temperature >= threshold. If not available, set to NAN. * Unit is same as Temperature's value. */ float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] hotThrottlingThresholds; Loading @@ -95,13 +102,14 @@ struct TemperatureThreshold { * Cold throttling temperature constant for this temperature sensor in * level defined in ThrottlingSeverity including shutdown. Throttling * happens when temperature <= threshold. If not available, set to NAN. * Unit is same as Temperature's value. */ float[ThrottlingSeverityCount:NUM_THROTTLING_LEVELS] coldThrottlingThresholds; /** * Threshold temperature above which the VR mode clockrate minimums cannot * be maintained for this device. * If not available, set by HAL to NAN. * be maintained for this device. If not available, set by HAL to NAN. * Unit is same as Temperature's value. */ float vrThrottlingThreshold; }; Loading @@ -121,7 +129,10 @@ struct Temperature { string name; /** * Current temperature in Celsius. If not available set by HAL to NAN. * For BCL, this is the current reading of the virtual sensor and the unit is * millivolt, milliamp, percentage for BCL_VOLTAGE, BCL_CURRENT and BCL_PERCENTAGE * respectively. For everything else, this is the current temperature in Celsius. * If not available set by HAL to NAN. */ float value; Loading
thermal/2.0/vts/functional/VtsHalThermalV2_0TargetTest.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <VtsHalHidlTargetTestEnvBase.h> using ::android::sp; using ::android::hardware::hidl_enum_range; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; Loading Loading @@ -183,9 +184,8 @@ TEST_F(ThermalHidlTest, TemperatureTest) { EXPECT_NE(ThermalStatusCode::SUCCESS, status.code); } }); for (int i = static_cast<int>(TemperatureType::UNKNOWN); i <= static_cast<int>(TemperatureType::POWER_AMPLIFIER); ++i) { auto type = static_cast<TemperatureType>(i); auto types = hidl_enum_range<TemperatureType>(); for (const auto& type : types) { mThermal->getCurrentTemperatures( true, type, [&type](ThermalStatus status, hidl_vec<Temperature> temperatures) { if (temperatures.size()) { Loading