blob: 8c989607e8db3a54a17c7e9c36c2aacbbd3fc665 [file] [log] [blame]
Todd Poynordd055822017-05-25 17:53:21 -07001/*
2** Copyright 2017, 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
17package android.os;
18
Wei Wang38e5bd72019-04-03 14:58:42 -070019import android.os.CoolingDevice;
Todd Poynordd055822017-05-25 17:53:21 -070020import android.os.IThermalEventListener;
Wei Wang37b17542018-11-12 11:02:09 -080021import android.os.IThermalStatusListener;
Todd Poynordd055822017-05-25 17:53:21 -070022import android.os.Temperature;
23
Wei Wangbad7c202018-11-01 11:57:39 -070024import java.util.List;
25
Todd Poynordd055822017-05-25 17:53:21 -070026/**
27 * {@hide}
28 */
29interface IThermalService {
30 /**
31 * Register a listener for thermal events.
32 * @param listener the IThermalEventListener to be notified.
33 * {@hide}
34 */
Wei Wang37b17542018-11-12 11:02:09 -080035 boolean registerThermalEventListener(in IThermalEventListener listener);
36
Todd Poynordd055822017-05-25 17:53:21 -070037 /**
Wei Wangbad7c202018-11-01 11:57:39 -070038 * Register a listener for thermal events on given temperature type.
39 * @param listener the IThermalEventListener to be notified.
40 * @param type the temperature type IThermalEventListener to be notified.
Wei Wang37b17542018-11-12 11:02:09 -080041 * @return true if registered successfully.
Wei Wangbad7c202018-11-01 11:57:39 -070042 * {@hide}
43 */
Wei Wang37b17542018-11-12 11:02:09 -080044 boolean registerThermalEventListenerWithType(in IThermalEventListener listener, in int type);
45
Wei Wangbad7c202018-11-01 11:57:39 -070046 /**
Todd Poynordd055822017-05-25 17:53:21 -070047 * Unregister a previously-registered listener for thermal events.
48 * @param listener the IThermalEventListener to no longer be notified.
Wei Wang37b17542018-11-12 11:02:09 -080049 * @return true if unregistered successfully.
Todd Poynordd055822017-05-25 17:53:21 -070050 * {@hide}
51 */
Wei Wang37b17542018-11-12 11:02:09 -080052 boolean unregisterThermalEventListener(in IThermalEventListener listener);
53
Todd Poynordd055822017-05-25 17:53:21 -070054 /**
Wei Wangbad7c202018-11-01 11:57:39 -070055 * Get current temperature with its throttling status.
Wei Wang38e5bd72019-04-03 14:58:42 -070056 * @return list of {@link android.os.Temperature}.
Todd Poynordd055822017-05-25 17:53:21 -070057 * {@hide}
58 */
Wei Wangbad7c202018-11-01 11:57:39 -070059 List<Temperature> getCurrentTemperatures();
Wei Wang37b17542018-11-12 11:02:09 -080060
Todd Poynordd055822017-05-25 17:53:21 -070061 /**
Wei Wangbad7c202018-11-01 11:57:39 -070062 * Get current temperature with its throttling status on given temperature type.
63 * @param type the temperature type to query.
Wei Wang37b17542018-11-12 11:02:09 -080064 * @return list of {@link android.os.Temperature}.
Todd Poynordd055822017-05-25 17:53:21 -070065 * {@hide}
66 */
Wei Wangbad7c202018-11-01 11:57:39 -070067 List<Temperature> getCurrentTemperaturesWithType(in int type);
Wei Wang37b17542018-11-12 11:02:09 -080068
69 /**
70 * Register a listener for thermal status change.
Wei Wangcc913612018-11-28 23:34:43 -080071 * @param listener the {@link android.os.IThermalStatusListener} to be notified.
Wei Wang37b17542018-11-12 11:02:09 -080072 * @return true if registered successfully.
73 * {@hide}
74 */
75 boolean registerThermalStatusListener(in IThermalStatusListener listener);
76
77 /**
78 * Unregister a previously-registered listener for thermal status.
Wei Wangcc913612018-11-28 23:34:43 -080079 * @param listener the {@link android.os.IThermalStatusListener} to no longer be notified.
Wei Wang37b17542018-11-12 11:02:09 -080080 * @return true if unregistered successfully.
81 * {@hide}
82 */
83 boolean unregisterThermalStatusListener(in IThermalStatusListener listener);
84
85 /**
86 * Get current thermal status.
87 * @return status defined in {@link android.os.Temperature}.
88 * {@hide}
89 */
Wei Wangcc913612018-11-28 23:34:43 -080090 int getCurrentThermalStatus();
Wei Wang38e5bd72019-04-03 14:58:42 -070091
92 /**
93 * Get current cooling devices.
94 * @return list of {@link android.os.CoolingDevice}.
95 * {@hide}
96 */
97 List<CoolingDevice> getCurrentCoolingDevices();
98
99 /**
100 * Get current cooling devices on given type.
101 * @param type the cooling device type to query.
102 * @return list of {@link android.os.CoolingDevice}.
103 * {@hide}
104 */
105 List<CoolingDevice> getCurrentCoolingDevicesWithType(in int type);
Todd Poynordd055822017-05-25 17:53:21 -0700106}