Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.os; |
| 18 | |
Wei Wang | 38e5bd7 | 2019-04-03 14:58:42 -0700 | [diff] [blame^] | 19 | import android.os.CoolingDevice; |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 20 | import android.os.IThermalEventListener; |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 21 | import android.os.IThermalStatusListener; |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 22 | import android.os.Temperature; |
| 23 | |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 24 | import java.util.List; |
| 25 | |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 26 | /** |
| 27 | * {@hide} |
| 28 | */ |
| 29 | interface IThermalService { |
| 30 | /** |
| 31 | * Register a listener for thermal events. |
| 32 | * @param listener the IThermalEventListener to be notified. |
| 33 | * {@hide} |
| 34 | */ |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 35 | boolean registerThermalEventListener(in IThermalEventListener listener); |
| 36 | |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 37 | /** |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 38 | * 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 Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 41 | * @return true if registered successfully. |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 42 | * {@hide} |
| 43 | */ |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 44 | boolean registerThermalEventListenerWithType(in IThermalEventListener listener, in int type); |
| 45 | |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 46 | /** |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 47 | * Unregister a previously-registered listener for thermal events. |
| 48 | * @param listener the IThermalEventListener to no longer be notified. |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 49 | * @return true if unregistered successfully. |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 50 | * {@hide} |
| 51 | */ |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 52 | boolean unregisterThermalEventListener(in IThermalEventListener listener); |
| 53 | |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 54 | /** |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 55 | * Get current temperature with its throttling status. |
Wei Wang | 38e5bd7 | 2019-04-03 14:58:42 -0700 | [diff] [blame^] | 56 | * @return list of {@link android.os.Temperature}. |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 57 | * {@hide} |
| 58 | */ |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 59 | List<Temperature> getCurrentTemperatures(); |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 60 | |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 61 | /** |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 62 | * Get current temperature with its throttling status on given temperature type. |
| 63 | * @param type the temperature type to query. |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 64 | * @return list of {@link android.os.Temperature}. |
Todd Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 65 | * {@hide} |
| 66 | */ |
Wei Wang | bad7c20 | 2018-11-01 11:57:39 -0700 | [diff] [blame] | 67 | List<Temperature> getCurrentTemperaturesWithType(in int type); |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 68 | |
| 69 | /** |
| 70 | * Register a listener for thermal status change. |
Wei Wang | cc91361 | 2018-11-28 23:34:43 -0800 | [diff] [blame] | 71 | * @param listener the {@link android.os.IThermalStatusListener} to be notified. |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 72 | * @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 Wang | cc91361 | 2018-11-28 23:34:43 -0800 | [diff] [blame] | 79 | * @param listener the {@link android.os.IThermalStatusListener} to no longer be notified. |
Wei Wang | 37b1754 | 2018-11-12 11:02:09 -0800 | [diff] [blame] | 80 | * @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 Wang | cc91361 | 2018-11-28 23:34:43 -0800 | [diff] [blame] | 90 | int getCurrentThermalStatus(); |
Wei Wang | 38e5bd7 | 2019-04-03 14:58:42 -0700 | [diff] [blame^] | 91 | |
| 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 Poynor | dd05582 | 2017-05-25 17:53:21 -0700 | [diff] [blame] | 106 | } |