platform_hardware_interfaces/thermal/2.0/IThermal.hal
Wei Wang c4c2559e9a ThermalHAL: add BCL to temperature type
Bug: 116540200
Test: VTS test passed
Change-Id: I7cdf64a8ee55a9e14a9df673edaf25a5cd3a90d2
2018-10-26 11:01:23 -07:00

117 lines
5.5 KiB
Text

/*
* 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 driver and HAL and must not be simply
* compared with these thresholds. To get accurate throttling status, use
* getCurrentTemperatures or registerThermalChangedCallback and listen.
*/
getTemperatureThresholds(bool filterType, TemperatureType type)
generates (ThermalStatus status, vec<TemperatureThreshold> temperatureThresholds);
/**
* Register an IThermalChangedCallback, used by the Thermal HAL
* to send 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 sending
* thermal events (cannot be nullptr).
* @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);
/**
* Register an IThermalChangedCallback, used by the Thermal HAL
* to send thermal events when thermal mitigation status changed.
*
* @param callback the IThermalChangedCallback to use for sending
* thermal events, or nullptr to set no callback.
*
* @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);
};