Todd Poynor | 46f388c | 2017-06-22 18:13:56 -0700 | [diff] [blame^] | 1 | #ifndef ANDROID_HARDWARE_THERMAL_V1_1_THERMALCALLBACK_H |
| 2 | #define ANDROID_HARDWARE_THERMAL_V1_1_THERMALCALLBACK_H |
| 3 | |
| 4 | #include <android/hardware/thermal/1.1/IThermalCallback.h> |
| 5 | #include <android/hardware/thermal/1.0/types.h> |
| 6 | #include <android/os/Temperature.h> |
| 7 | #include <hidl/MQDescriptor.h> |
| 8 | #include <hidl/Status.h> |
| 9 | #include "services/thermalservice/ThermalService.h" |
| 10 | |
| 11 | namespace android { |
| 12 | namespace hardware { |
| 13 | namespace thermal { |
| 14 | namespace V1_1 { |
| 15 | namespace implementation { |
| 16 | |
| 17 | using ::android::hardware::Return; |
| 18 | using ::android::hardware::Void; |
| 19 | using ::android::os::ThermalService; |
| 20 | |
| 21 | class ThermalCallback : public IThermalCallback { |
| 22 | public: |
| 23 | // Register a binder ThermalService object for sending events |
| 24 | void registerThermalService(sp<ThermalService> thermalService); |
| 25 | |
| 26 | // Methods from IThermalCallback::V1_1 follow. |
| 27 | Return<void> notifyThrottling( |
| 28 | bool isThrottling, |
| 29 | const android::hardware::thermal::V1_0::Temperature& temperature) |
| 30 | override; |
| 31 | |
| 32 | private: |
| 33 | // Our registered binder ThermalService object to use for sending events |
| 34 | sp<android::os::ThermalService> mThermalService; |
| 35 | }; |
| 36 | |
| 37 | } // namespace implementation |
| 38 | } // namespace V1_1 |
| 39 | } // namespace thermal |
| 40 | } // namespace hardware |
| 41 | } // namespace android |
| 42 | |
| 43 | #endif // ANDROID_HARDWARE_THERMAL_V1_1_THERMALCALLBACK_H |