Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | package android.hardware.thermal@1.0; |
| 18 | |
| 19 | interface IThermal { |
| 20 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 21 | /** |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 22 | * Retrieves temperatures in Celsius. |
| 23 | * |
| 24 | * @return status Status of the operation. If status code is FAILURE, |
| 25 | * the status.debugMessage must be populated with the human-readable |
| 26 | * error message. |
| 27 | * @return temperatures If status code is SUCCESS, it's filled with the |
| 28 | * current temperatures. The order of temperatures of built-in |
| 29 | * devices (such as CPUs, GPUs and etc.) in the list must be kept |
| 30 | * the same regardless the number of calls to this method even if |
| 31 | * they go offline, if these devices exist on boot. The method |
| 32 | * always returns and never removes such temperatures. |
| 33 | * |
| 34 | */ |
Polina Bondarenko | 59d05eb | 2016-11-03 16:41:18 +0100 | [diff] [blame] | 35 | @callflow(next={"*"}) |
| 36 | @entry |
| 37 | @exit |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 38 | getTemperatures() |
| 39 | generates (ThermalStatus status, vec<Temperature> temperatures); |
| 40 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 41 | /** |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 42 | * Retrieves CPU usage information of each core: active and total times |
| 43 | * in ms since first boot. |
| 44 | * |
| 45 | * @return status Status of the operation. If status code is FAILURE, |
| 46 | * the status.debugMessage must be populated with the human-readable |
| 47 | * error message. |
| 48 | * @return cpuUsages If status code is SUCCESS, it's filled with the current |
| 49 | * CPU usages. The order and number of CPUs in the list must be kept |
| 50 | * the same regardless the number of calls to this method. |
| 51 | * |
| 52 | */ |
Polina Bondarenko | 59d05eb | 2016-11-03 16:41:18 +0100 | [diff] [blame] | 53 | @callflow(next={"*"}) |
| 54 | @entry |
| 55 | @exit |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 56 | getCpuUsages() generates (ThermalStatus status, vec<CpuUsage> cpuUsages); |
| 57 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 58 | /** |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 59 | * Retrieves the cooling devices information. |
| 60 | * |
| 61 | * @return status Status of the operation. If status code is FAILURE, |
| 62 | * the status.debugMessage must be populated with the human-readable |
| 63 | * error message. |
| 64 | * @return devices If status code is SUCCESS, it's filled with the current |
Polina Bondarenko | 3fbeb9f | 2016-10-18 19:02:40 +0200 | [diff] [blame] | 65 | * cooling device information. The order of built-in cooling |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 66 | * devices in the list must be kept the same regardless the number |
| 67 | * of calls to this method even if they go offline, if these devices |
| 68 | * exist on boot. The method always returns and never removes from |
Polina Bondarenko | 3fbeb9f | 2016-10-18 19:02:40 +0200 | [diff] [blame] | 69 | * the list such cooling devices. |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 70 | * |
| 71 | */ |
Polina Bondarenko | 59d05eb | 2016-11-03 16:41:18 +0100 | [diff] [blame] | 72 | @callflow(next={"*"}) |
| 73 | @entry |
| 74 | @exit |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 75 | getCoolingDevices() |
| 76 | generates (ThermalStatus status, vec<CoolingDevice> devices); |
| 77 | |
Polina Bondarenko | 254e2fe | 2016-10-11 16:39:23 +0200 | [diff] [blame] | 78 | }; |