blob: 03de0494c337035e1cbee34680898b4e3affadc3 [file] [log] [blame]
Wei Wang52150002018-10-24 19:33:10 -07001/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HARDWARE_THERMAL_V1_1_THERMALCHANGEDCALLBACK_H
18#define ANDROID_HARDWARE_THERMAL_V1_1_THERMALCHANGEDCALLBACK_H
19
20#include <android/hardware/thermal/2.0/IThermalChangedCallback.h>
21#include <android/hardware/thermal/2.0/types.h>
22#include <android/os/Temperature.h>
23#include <hidl/MQDescriptor.h>
24#include <hidl/Status.h>
25#include "services/thermalservice/ThermalService.h"
26
27namespace android {
28namespace hardware {
29namespace thermal {
30namespace V2_0 {
31namespace implementation {
32
33using ::android::hardware::Return;
34using ::android::hardware::Void;
35using ::android::os::ThermalService;
36
37class ThermalChangedCallback : public IThermalChangedCallback {
38public:
39 // Register a binder ThermalService object for sending events
40 void registerThermalService(sp<ThermalService> thermalService);
41
42 // Methods from I ThermalChangedCallback::V2_0 follow.
43 Return<void> notifyThrottling(
44 const android::hardware::thermal::V2_0::Temperature& temperature) override;
45
46private:
47 // Our registered binder ThermalService object to use for sending events
48 sp<android::os::ThermalService> mThermalService;
49};
50
51} // namespace implementation
52} // namespace V2_0
53} // namespace thermal
54} // namespace hardware
55} // namespace android
56
57#endif // ANDROID_HARDWARE_THERMAL_V1_1_THERMALCHANGEDCALLBACK_H