Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 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.hardware.broadcastradio@1.1; |
| 18 | |
| 19 | import @1.0::ITunerCallback; |
| 20 | |
| 21 | /** |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 22 | * Some methods of @1.1::ITunerCallback are updated versions of those from |
| 23 | * @1.0:ITunerCallback. All 1.1 HAL implementations must call both |
| 24 | * (eg. tuneComplete and tuneComplete_1_1), while 1.1 clients may ignore 1.0 |
| 25 | * ones, to avoid receiving a callback twice. |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 26 | */ |
| 27 | interface ITunerCallback extends @1.0::ITunerCallback { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 28 | /** |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 29 | * Method called by the HAL when a tuning operation completes |
| 30 | * following a step(), scan() or tune() command. |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 31 | * |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 32 | * This callback supersedes V1_0::tuneComplete. |
| 33 | * The 1.0 callback must not be called when HAL implementation detects |
| 34 | * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback). |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 35 | * |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 36 | * @param result OK if tune succeeded or TIMEOUT in case of time out. |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 37 | * @param selector A ProgramSelector structure describing the tuned station. |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 38 | */ |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 39 | oneway tuneComplete_1_1(Result result, ProgramSelector selector); |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 40 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 41 | /** |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 42 | * Method called by the HAL when a frequency switch occurs. |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 43 | * |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 44 | * This callback supersedes V1_0::afSwitch. |
| 45 | * The 1.0 callback must not be called when HAL implementation detects |
| 46 | * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback). |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 47 | * |
| 48 | * @param selector A ProgramSelector structure describing the tuned station. |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 49 | */ |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 50 | oneway afSwitch_1_1(ProgramSelector selector); |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 51 | |
| 52 | /** |
Tomasz Wasilczyk | 22e5f17 | 2017-03-27 15:18:58 -0700 | [diff] [blame] | 53 | * Called by the HAL when background scan feature becomes available or not. |
| 54 | * |
| 55 | * @param isAvailable true, if the tuner turned temporarily background- |
| 56 | * capable, false in the other case. |
| 57 | */ |
| 58 | oneway backgroundScanAvailable(bool isAvailable); |
| 59 | |
| 60 | /** |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 61 | * Called by the HAL when background scan initiated by startBackgroundScan |
| 62 | * finishes. If the list was changed, programListChanged must be called too. |
| 63 | * @param result OK if the scan succeeded, client may retrieve the actual |
| 64 | * list with ITuner::getProgramList. |
Tomasz Wasilczyk | 22e5f17 | 2017-03-27 15:18:58 -0700 | [diff] [blame] | 65 | * UNAVAILABLE if the scan was interrupted due to |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 66 | * hardware becoming temporarily unavailable. |
| 67 | * NOT_INITIALIZED other error, ie. HW failure. |
| 68 | */ |
| 69 | oneway backgroundScanComplete(ProgramListResult result); |
| 70 | |
| 71 | /** |
| 72 | * Called each time the internally cached program list changes. HAL may not |
| 73 | * call it immediately, ie. it may wait for a short time to accumulate |
| 74 | * multiple list change notifications into a single event. |
| 75 | * |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 76 | * This callback is only for notifying about insertions and deletions, |
| 77 | * not about metadata changes. |
| 78 | * |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 79 | * It may be triggered either by an explicitly issued background scan, |
| 80 | * or a scan issued by the device internally. |
| 81 | * |
| 82 | * Client may retrieve the actual list with ITuner::getProgramList. |
| 83 | */ |
| 84 | oneway programListChanged(); |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Method called by the HAL when current program information (including |
| 88 | * metadata) is updated. |
| 89 | * |
| 90 | * Client may retrieve the actual program info with |
| 91 | * ITuner::getProgramInformation_1_1. |
| 92 | * |
| 93 | * This may be called together with tuneComplete_1_1 or afSwitch_1_1. |
| 94 | * |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 95 | * This callback supersedes V1_0::newMetadata and partly V1_0::tuneComplete |
| 96 | * and V1_0::afSwitch. |
| 97 | * 1.0 callbacks must not be called when HAL implementation detects |
| 98 | * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback). |
Tomasz Wasilczyk | f8866e7 | 2017-07-13 15:51:21 -0700 | [diff] [blame] | 99 | */ |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 100 | oneway currentProgramInfoChanged(); |
Tomasz Wasilczyk | 213170b | 2017-02-07 17:38:21 -0800 | [diff] [blame] | 101 | }; |