1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.thermal@2.0;
import android.hardware.thermal@1.0::IThermal;
import android.hardware.thermal@1.0::ThermalStatus;
import IThermalChangedCallback;
interface IThermal extends @1.0::IThermal {
/**
* Retrieves temperatures in Celsius.
*
* @param filterType whether to filter the result for a given type.
* @param type the TemperatureType such as battery or skin.
*
* @return status Status of the operation. If status code is FAILURE,
* the status.debugMessage must be populated with a human-readable
* error message.
*
* @return temperatures If status code is SUCCESS, it's filled with the
* current temperatures. The order of temperatures of built-in
* devices (such as CPUs, GPUs and etc.) in the list must be kept
* the same regardless of the number of calls to this method even if
* they go offline, if these devices exist on boot. The method
* always returns and never removes such temperatures.
*/
getCurrentTemperatures(bool filterType, TemperatureType type)
generates (ThermalStatus status, vec<Temperature> temperatures);
/**
* Retrieves static temperature thresholds in Celsius.
*
* @param filterType whether to filter the result for a given type.
* @param type the TemperatureType such as battery or skin.
*
* @return status Status of the operation. If status code is FAILURE,
* the status.debugMessage must be populated with a human-readable error message.
* @return temperatureThresholds If status code is SUCCESS, it's filled with the
* temperatures thresholds. The order of temperatures of built-in
* devices (such as CPUs, GPUs and etc.) in the list must be kept
* the same regardless of the number of calls to this method even if
* they go offline, if these devices exist on boot. The method
* always returns and never removes such temperatures. The thresholds
* are returned as static values and must not change across calls. The actual
* throttling state is determined in device thermal mitigation policy/agorithm
* which might not be simple thresholds so these values Thermal HAL provided
* may not be accurate to detemin the throttling status. To get accurate
* throttling status, use getCurrentTemperatures or registerThermalChangedCallback
* and listen to the callback.
*/
getTemperatureThresholds(bool filterType, TemperatureType type)
generates (ThermalStatus status, vec<TemperatureThreshold> temperatureThresholds);
/**
* Register an IThermalChangedCallback, used by the Thermal HAL
* to receive thermal events when thermal mitigation status changed.
* Multiple registrations with different IThermalChangedCallback must be allowed.
* Multiple registrations with same IThermalChangedCallback is not allowed, client
* should unregister the given IThermalChangedCallback first.
*
* @param callback the IThermalChangedCallback to use for receiving
* thermal events (nullptr callback will lead to failure with status code FAILURE).
* @param filterType if filter for given sensor type.
* @param type the type to be filtered.
*
* @return status Status of the operation. If status code is FAILURE,
* the status.debugMessage must be populated with a human-readable error message.
*/
registerThermalChangedCallback(IThermalChangedCallback callback,
bool filterType,
TemperatureType type)
generates (ThermalStatus status);
/**
* Unregister an IThermalChangedCallback, used by the Thermal HAL
* to receive thermal events when thermal mitigation status changed.
*
* @param callback the IThermalChangedCallback used for receiving
* thermal events (nullptr callback will lead to failure with status code FAILURE).
*
* @return status Status of the operation. If status code is FAILURE,
* the status.debugMessage must be populated with a human-readable error message.
*/
unregisterThermalChangedCallback(IThermalChangedCallback callback)
generates (ThermalStatus status);
/**
* Retrieves the cooling devices information.
*
* @param filterType whether to filter the result for a given type.
* @param type the CoolingDevice such as CPU/GPU.
*
* @return status Status of the operation. If status code is FAILURE,
* the status.debugMessage must be populated with the human-readable
* error message.
* @return devices If status code is SUCCESS, it's filled with the current
* cooling device information. The order of built-in cooling
* devices in the list must be kept the same regardless of the number
* of calls to this method even if they go offline, if these devices
* exist on boot. The method always returns and never removes from
* the list such cooling devices.
*/
getCurrentCoolingDevices(bool filterType, CoolingType type)
generates (ThermalStatus status, vec<CoolingDevice> devices);
};
|