blob: 788af4aae13e02d8ec19ca5273470d67de3b52b8 [file] [log] [blame]
Peiyong Lin56960752022-09-30 21:52:52 +00001/*
2 * Copyright (C) 2022 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#pragma once
18
19#include <set>
20
21#include <aidl/android/hardware/thermal/BnThermal.h>
22
23namespace aidl {
24namespace android {
25namespace hardware {
26namespace thermal {
27namespace impl {
28namespace example {
29
30class Thermal : public BnThermal {
31 public:
32 ndk::ScopedAStatus getCoolingDevices(std::vector<CoolingDevice>* out_devices) override;
33 ndk::ScopedAStatus getCoolingDevicesWithType(CoolingType in_type,
34 std::vector<CoolingDevice>* out_devices) override;
35
36 ndk::ScopedAStatus getTemperatures(std::vector<Temperature>* out_temperatures) override;
37 ndk::ScopedAStatus getTemperaturesWithType(TemperatureType in_type,
38 std::vector<Temperature>* out_temperatures) override;
39
40 ndk::ScopedAStatus getTemperatureThresholds(
41 std::vector<TemperatureThreshold>* out_temperatureThresholds) override;
42
43 ndk::ScopedAStatus getTemperatureThresholdsWithType(
44 TemperatureType in_type,
45 std::vector<TemperatureThreshold>* out_temperatureThresholds) override;
46
47 ndk::ScopedAStatus registerThermalChangedCallback(
48 const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
49 ndk::ScopedAStatus registerThermalChangedCallbackWithType(
50 const std::shared_ptr<IThermalChangedCallback>& in_callback,
51 TemperatureType in_type) override;
52
53 ndk::ScopedAStatus unregisterThermalChangedCallback(
54 const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
55
56 private:
57 std::set<std::shared_ptr<IThermalChangedCallback>> mCallbacks;
58};
59
60} // namespace example
61} // namespace impl
62} // namespace thermal
63} // namespace hardware
64} // namespace android
65} // namespace aidl