blob: 1aefc4eb58e04567f026159cdcbcca7e0b8b8937 [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 /**
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 /**
42 * Method called by the HAL when the antenna gets connected or disconnected.
43 *
44 * For a new tuner session, client must assume the antenna is connected.
45 * If it's not, then antennaStateChange must be called within
46 * Constants::ANTENNA_DISCONNECTED_TIMEOUT_MS to indicate that.
47 *
48 * @param connected True if the antenna is now connected, false otherwise.
49 */
50 oneway onAntennaStateChange(bool connected);
51
52 /**
53 * Generic callback for passing updates to vendor-specific parameter values.
54 * The framework does not interpret the parameters, they are passed
55 * in an opaque manner between a vendor application and HAL.
56 *
57 * It's up to the HAL implementation if and how to implement this callback,
58 * as long as it obeys the prefix rule. In particular, only selected keys
59 * may be notified this way. However, setParameters must not trigger
60 * this callback, while an internal event can change parameters
61 * asynchronously.
62 *
63 * @param parameters Vendor-specific key-value pairs,
64 * opaque to Android framework.
65 */
66 oneway onParametersUpdated(vec<VendorKeyValue> parameters);
67};