blob: b20a0b2d9ada8b5a54eebf2e0ffb9a4a49516598 [file] [log] [blame]
Tomasz Wasilczyk6e0e1ae2017-11-30 09:03:43 -08001/* 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
16package android.hardware.broadcastradio@2.0;
17
18interface ITunerCallback {
19 /**
Tomasz Wasilczyk674696f2018-03-27 10:12:18 -070020 * Method called by the HAL when a tuning operation fails asynchronously
Tomasz Wasilczyk6e0e1ae2017-11-30 09:03:43 -080021 * following a step(), scan() or tune() command.
22 *
Tomasz Wasilczyk674696f2018-03-27 10:12:18 -070023 * This callback is only called when the step(), scan() or tune() command
24 * returned OK at first.
25 *
26 * @param result TIMEOUT in case of time out.
27 * @param selector A ProgramSelector structure passed from tune() call;
Tomasz Wasilczyk6e0e1ae2017-11-30 09:03:43 -080028 * empty for step() and scan().
29 */
30 oneway onTuneFailed(Result result, ProgramSelector selector);
31
32 /**
33 * Method called by the HAL when current program information (including
34 * metadata) is updated.
35 *
36 * This is also called when the radio tuned to the static (not a valid
37 * station), see the TUNED flag of ProgramInfoFlags.
38 *
39 * @param info Current program information.
40 */
41 oneway onCurrentProgramInfoChanged(ProgramInfo info);
42
43 /**
Tomasz Wasilczykbceb8852017-12-18 13:59:29 -080044 * A delta update of the program list, called whenever there's a change in
45 * the list.
46 *
47 * If there are frequent changes, HAL implementation must throttle the rate
48 * of the updates.
49 *
50 * There is a hard limit on binder transaction buffer, and the list must
51 * not exceed it. For large lists, HAL implementation must split them to
52 * multiple chunks, no larger than 500kiB each.
53 *
54 * @param chunk A chunk of the program list update.
55 */
56 oneway onProgramListUpdated(ProgramListChunk chunk);
57
58 /**
Tomasz Wasilczyk6e0e1ae2017-11-30 09:03:43 -080059 * Method called by the HAL when the antenna gets connected or disconnected.
60 *
61 * For a new tuner session, client must assume the antenna is connected.
62 * If it's not, then antennaStateChange must be called within
63 * Constants::ANTENNA_DISCONNECTED_TIMEOUT_MS to indicate that.
64 *
65 * @param connected True if the antenna is now connected, false otherwise.
66 */
67 oneway onAntennaStateChange(bool connected);
68
69 /**
70 * Generic callback for passing updates to vendor-specific parameter values.
71 * The framework does not interpret the parameters, they are passed
72 * in an opaque manner between a vendor application and HAL.
73 *
74 * It's up to the HAL implementation if and how to implement this callback,
75 * as long as it obeys the prefix rule. In particular, only selected keys
76 * may be notified this way. However, setParameters must not trigger
77 * this callback, while an internal event can change parameters
78 * asynchronously.
79 *
80 * @param parameters Vendor-specific key-value pairs,
81 * opaque to Android framework.
82 */
83 oneway onParametersUpdated(vec<VendorKeyValue> parameters);
84};