Tomasz Wasilczyk | 6e0e1ae | 2017-11-30 09:03:43 -0800 | [diff] [blame] | 1 | /* Copyright (C) 2017 The Android Open Source Project |
| 2 | * |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | package android.hardware.broadcastradio@2.0; |
| 17 | |
| 18 | interface ITunerCallback { |
| 19 | /** |
| 20 | * Method called by the HAL when a tuning operation fails |
| 21 | * following a step(), scan() or tune() command. |
| 22 | * |
| 23 | * @param result OK if tune succeeded; |
| 24 | * TIMEOUT in case of time out. |
| 25 | * @param selector A ProgramSelector structure passed from tune(), |
| 26 | * empty for step() and scan(). |
| 27 | */ |
| 28 | oneway onTuneFailed(Result result, ProgramSelector selector); |
| 29 | |
| 30 | /** |
| 31 | * Method called by the HAL when current program information (including |
| 32 | * metadata) is updated. |
| 33 | * |
| 34 | * This is also called when the radio tuned to the static (not a valid |
| 35 | * station), see the TUNED flag of ProgramInfoFlags. |
| 36 | * |
| 37 | * @param info Current program information. |
| 38 | */ |
| 39 | oneway onCurrentProgramInfoChanged(ProgramInfo info); |
| 40 | |
| 41 | /** |
Tomasz Wasilczyk | bceb885 | 2017-12-18 13:59:29 -0800 | [diff] [blame] | 42 | * A delta update of the program list, called whenever there's a change in |
| 43 | * the list. |
| 44 | * |
| 45 | * If there are frequent changes, HAL implementation must throttle the rate |
| 46 | * of the updates. |
| 47 | * |
| 48 | * There is a hard limit on binder transaction buffer, and the list must |
| 49 | * not exceed it. For large lists, HAL implementation must split them to |
| 50 | * multiple chunks, no larger than 500kiB each. |
| 51 | * |
| 52 | * @param chunk A chunk of the program list update. |
| 53 | */ |
| 54 | oneway onProgramListUpdated(ProgramListChunk chunk); |
| 55 | |
| 56 | /** |
Tomasz Wasilczyk | 6e0e1ae | 2017-11-30 09:03:43 -0800 | [diff] [blame] | 57 | * Method called by the HAL when the antenna gets connected or disconnected. |
| 58 | * |
| 59 | * For a new tuner session, client must assume the antenna is connected. |
| 60 | * If it's not, then antennaStateChange must be called within |
| 61 | * Constants::ANTENNA_DISCONNECTED_TIMEOUT_MS to indicate that. |
| 62 | * |
| 63 | * @param connected True if the antenna is now connected, false otherwise. |
| 64 | */ |
| 65 | oneway onAntennaStateChange(bool connected); |
| 66 | |
| 67 | /** |
| 68 | * Generic callback for passing updates to vendor-specific parameter values. |
| 69 | * The framework does not interpret the parameters, they are passed |
| 70 | * in an opaque manner between a vendor application and HAL. |
| 71 | * |
| 72 | * It's up to the HAL implementation if and how to implement this callback, |
| 73 | * as long as it obeys the prefix rule. In particular, only selected keys |
| 74 | * may be notified this way. However, setParameters must not trigger |
| 75 | * this callback, while an internal event can change parameters |
| 76 | * asynchronously. |
| 77 | * |
| 78 | * @param parameters Vendor-specific key-value pairs, |
| 79 | * opaque to Android framework. |
| 80 | */ |
| 81 | oneway onParametersUpdated(vec<VendorKeyValue> parameters); |
| 82 | }; |