mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add optional notifyThresholdChanged API
Bump thermal HAL to v3 Bug: 360486877 Flag: EXEMPT AIDL interface changes Test: atest VtsHalThermalTargetTest Change-Id: I3954301c11351153f2df1d111f7fe2439cc16aae
This commit is contained in:
@@ -551,7 +551,7 @@
|
||||
</hal>
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.thermal</name>
|
||||
<version>2</version>
|
||||
<version>3</version>
|
||||
<interface>
|
||||
<name>IThermal</name>
|
||||
<instance>default</instance>
|
||||
|
||||
@@ -48,8 +48,7 @@ aidl_interface {
|
||||
version: "2",
|
||||
imports: [],
|
||||
},
|
||||
|
||||
],
|
||||
frozen: true,
|
||||
frozen: false,
|
||||
|
||||
}
|
||||
|
||||
@@ -36,4 +36,5 @@ package android.hardware.thermal;
|
||||
@VintfStability
|
||||
interface IThermalChangedCallback {
|
||||
oneway void notifyThrottling(in android.hardware.thermal.Temperature temperature);
|
||||
oneway void notifyThresholdChanged(in android.hardware.thermal.TemperatureThreshold threshold);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.hardware.thermal;
|
||||
|
||||
import android.hardware.thermal.Temperature;
|
||||
import android.hardware.thermal.TemperatureThreshold;
|
||||
|
||||
/**
|
||||
* IThermalChangedCallback send throttling notification to clients.
|
||||
@@ -25,11 +26,19 @@ import android.hardware.thermal.Temperature;
|
||||
@VintfStability
|
||||
interface IThermalChangedCallback {
|
||||
/**
|
||||
* Send a thermal throttling event to all ThermalHAL
|
||||
* Send a thermal throttling event to all Thermal HAL
|
||||
* thermal event listeners.
|
||||
*
|
||||
* @param temperature The temperature associated with the
|
||||
* throttling event.
|
||||
*/
|
||||
oneway void notifyThrottling(in Temperature temperature);
|
||||
|
||||
/**
|
||||
* Send a thermal threshold change event to all Thermal HAL
|
||||
* thermal event listeners.
|
||||
*
|
||||
* @param threshold The temperature threshold that changed.
|
||||
*/
|
||||
oneway void notifyThresholdChanged(in TemperatureThreshold threshold);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ cc_binary {
|
||||
vendor: true,
|
||||
stl: "c++_static",
|
||||
static_libs: [
|
||||
"android.hardware.thermal-V2-ndk",
|
||||
"android.hardware.thermal-V3-ndk",
|
||||
"libbase",
|
||||
],
|
||||
shared_libs: [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<manifest version="1.0" type="device">
|
||||
<hal format="aidl">
|
||||
<name>android.hardware.thermal</name>
|
||||
<version>2</version>
|
||||
<version>3</version>
|
||||
<fqname>IThermal/default</fqname>
|
||||
</hal>
|
||||
</manifest>
|
||||
|
||||
@@ -32,7 +32,7 @@ cc_test {
|
||||
"libbinder_ndk",
|
||||
],
|
||||
static_libs: [
|
||||
"android.hardware.thermal-V2-ndk",
|
||||
"android.hardware.thermal-V3-ndk",
|
||||
],
|
||||
test_suites: [
|
||||
"vts",
|
||||
|
||||
@@ -93,6 +93,10 @@ class ThermalCallback : public BnThermalChangedCallback {
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus notifyThresholdChanged(const TemperatureThreshold&) {
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
template <typename R, typename P>
|
||||
[[nodiscard]] bool waitForCallback(std::chrono::duration<R, P> duration) {
|
||||
std::unique_lock<std::mutex> lock(mMutex);
|
||||
|
||||
Reference in New Issue
Block a user