blob: 8bf5b7f120c213d8259a97368141f26f7f77ccb9 [file] [log] [blame]
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -08001/*
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
17package android.hardware.broadcastradio@1.1;
18
19import @1.0::ITunerCallback;
20
21/**
Tomasz Wasilczyk803301a2017-03-13 14:30:15 -070022 * 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 Wasilczyk213170b2017-02-07 17:38:21 -080026 */
27interface ITunerCallback extends @1.0::ITunerCallback {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070028 /**
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080029 * Method called by the HAL when a tuning operation completes
30 * following a step(), scan() or tune() command.
Tomasz Wasilczykf8866e72017-07-13 15:51:21 -070031 *
Tomasz Wasilczykb8a2afe2017-08-01 10:52:18 -070032 * 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 Wasilczykf8866e72017-07-13 15:51:21 -070035 *
Tomasz Wasilczykdd130662017-08-03 18:08:57 -070036 * In case of success, currentProgramInfoChanged must be called too.
37 * It means the success case may (or may not) be handled by the client in
38 * currentProgramInfoChanged, instead of here.
39 *
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080040 * @param result OK if tune succeeded or TIMEOUT in case of time out.
Tomasz Wasilczykf8866e72017-07-13 15:51:21 -070041 * @param selector A ProgramSelector structure describing the tuned station.
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080042 */
Tomasz Wasilczykf8866e72017-07-13 15:51:21 -070043 oneway tuneComplete_1_1(Result result, ProgramSelector selector);
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080044
Andreas Huber40d3a9b2017-03-28 16:19:16 -070045 /**
Tomasz Wasilczyk22e5f172017-03-27 15:18:58 -070046 * Called by the HAL when background scan feature becomes available or not.
47 *
48 * @param isAvailable true, if the tuner turned temporarily background-
49 * capable, false in the other case.
50 */
51 oneway backgroundScanAvailable(bool isAvailable);
52
53 /**
Tomasz Wasilczyk803301a2017-03-13 14:30:15 -070054 * Called by the HAL when background scan initiated by startBackgroundScan
55 * finishes. If the list was changed, programListChanged must be called too.
56 * @param result OK if the scan succeeded, client may retrieve the actual
57 * list with ITuner::getProgramList.
Tomasz Wasilczyk22e5f172017-03-27 15:18:58 -070058 * UNAVAILABLE if the scan was interrupted due to
Tomasz Wasilczyk803301a2017-03-13 14:30:15 -070059 * hardware becoming temporarily unavailable.
60 * NOT_INITIALIZED other error, ie. HW failure.
61 */
62 oneway backgroundScanComplete(ProgramListResult result);
63
64 /**
65 * Called each time the internally cached program list changes. HAL may not
66 * call it immediately, ie. it may wait for a short time to accumulate
67 * multiple list change notifications into a single event.
68 *
Tomasz Wasilczykb8a2afe2017-08-01 10:52:18 -070069 * This callback is only for notifying about insertions and deletions,
70 * not about metadata changes.
71 *
Tomasz Wasilczyk803301a2017-03-13 14:30:15 -070072 * It may be triggered either by an explicitly issued background scan,
73 * or a scan issued by the device internally.
74 *
75 * Client may retrieve the actual list with ITuner::getProgramList.
76 */
77 oneway programListChanged();
Tomasz Wasilczykf8866e72017-07-13 15:51:21 -070078
79 /**
80 * Method called by the HAL when current program information (including
81 * metadata) is updated.
82 *
83 * Client may retrieve the actual program info with
84 * ITuner::getProgramInformation_1_1.
85 *
86 * This may be called together with tuneComplete_1_1 or afSwitch_1_1.
87 *
Tomasz Wasilczykdd130662017-08-03 18:08:57 -070088 * This callback supersedes V1_0::newMetadata and V1_0::afSwitch;
89 * partly V1_0::tuneComplete.
Tomasz Wasilczykb8a2afe2017-08-01 10:52:18 -070090 * 1.0 callbacks must not be called when HAL implementation detects
91 * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
Tomasz Wasilczykdd130662017-08-03 18:08:57 -070092 *
93 * @param info current program information
Tomasz Wasilczykf8866e72017-07-13 15:51:21 -070094 */
Tomasz Wasilczykdd130662017-08-03 18:08:57 -070095 oneway currentProgramInfoChanged(ProgramInfo info);
Tomasz Wasilczyk213170b2017-02-07 17:38:21 -080096};