thermal: support cooling device status change notification
1. support the powercap in CoolingDevice
2. support the notification when CoolingDevice status changed
Bug: 312540064
Test: atest VtsHalThermalTargetTest
Change-Id: I58e39c0a2c070317b574f1a5d4abfa582cc56f34
diff --git a/thermal/aidl/default/Thermal.h b/thermal/aidl/default/Thermal.h
index 8885e63..d3d8874 100644
--- a/thermal/aidl/default/Thermal.h
+++ b/thermal/aidl/default/Thermal.h
@@ -46,6 +46,7 @@
ndk::ScopedAStatus registerThermalChangedCallback(
const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
+
ndk::ScopedAStatus registerThermalChangedCallbackWithType(
const std::shared_ptr<IThermalChangedCallback>& in_callback,
TemperatureType in_type) override;
@@ -53,9 +54,18 @@
ndk::ScopedAStatus unregisterThermalChangedCallback(
const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
+ ndk::ScopedAStatus registerCoolingDeviceChangedCallbackWithType(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback,
+ CoolingType in_type) override;
+
+ ndk::ScopedAStatus unregisterCoolingDeviceChangedCallback(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback) override;
+
private:
std::mutex thermal_callback_mutex_;
std::vector<std::shared_ptr<IThermalChangedCallback>> thermal_callbacks_;
+ std::mutex cdev_callback_mutex_;
+ std::vector<std::shared_ptr<ICoolingDeviceChangedCallback>> cdev_callbacks_;
};
} // namespace example