xref: /aosp_15_r20/hardware/interfaces/broadcastradio/1.1/ITunerCallback.hal (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker/*
2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2017 The Android Open Source Project
3*4d7e907cSAndroid Build Coastguard Worker *
4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*4d7e907cSAndroid Build Coastguard Worker *
8*4d7e907cSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*4d7e907cSAndroid Build Coastguard Worker *
10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License.
15*4d7e907cSAndroid Build Coastguard Worker */
16*4d7e907cSAndroid Build Coastguard Worker
17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected];
18*4d7e907cSAndroid Build Coastguard Worker
19*4d7e907cSAndroid Build Coastguard Workerimport @1.0::ITunerCallback;
20*4d7e907cSAndroid Build Coastguard Worker
21*4d7e907cSAndroid Build Coastguard Worker/**
22*4d7e907cSAndroid Build Coastguard Worker * Some methods of @1.1::ITunerCallback are updated versions of those from
23*4d7e907cSAndroid Build Coastguard Worker * @1.0:ITunerCallback. All 1.1 HAL implementations must call both
24*4d7e907cSAndroid Build Coastguard Worker * (eg. tuneComplete and tuneComplete_1_1), while 1.1 clients may ignore 1.0
25*4d7e907cSAndroid Build Coastguard Worker * ones, to avoid receiving a callback twice.
26*4d7e907cSAndroid Build Coastguard Worker */
27*4d7e907cSAndroid Build Coastguard Workerinterface ITunerCallback extends @1.0::ITunerCallback {
28*4d7e907cSAndroid Build Coastguard Worker    /**
29*4d7e907cSAndroid Build Coastguard Worker     * Method called by the HAL when a tuning operation completes
30*4d7e907cSAndroid Build Coastguard Worker     * following a step(), scan() or tune() command.
31*4d7e907cSAndroid Build Coastguard Worker     *
32*4d7e907cSAndroid Build Coastguard Worker     * This callback supersedes V1_0::tuneComplete.
33*4d7e907cSAndroid Build Coastguard Worker     * The 1.0 callback must not be called when HAL implementation detects
34*4d7e907cSAndroid Build Coastguard Worker     * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
35*4d7e907cSAndroid Build Coastguard Worker     *
36*4d7e907cSAndroid Build Coastguard Worker     * In case of success, currentProgramInfoChanged must be called too.
37*4d7e907cSAndroid Build Coastguard Worker     * It means the success case may (or may not) be handled by the client in
38*4d7e907cSAndroid Build Coastguard Worker     * currentProgramInfoChanged, instead of here.
39*4d7e907cSAndroid Build Coastguard Worker     *
40*4d7e907cSAndroid Build Coastguard Worker     * @param result OK if tune succeeded or TIMEOUT in case of time out.
41*4d7e907cSAndroid Build Coastguard Worker     * @param selector A ProgramSelector structure describing the tuned station.
42*4d7e907cSAndroid Build Coastguard Worker     */
43*4d7e907cSAndroid Build Coastguard Worker    oneway tuneComplete_1_1(Result result, ProgramSelector selector);
44*4d7e907cSAndroid Build Coastguard Worker
45*4d7e907cSAndroid Build Coastguard Worker    /**
46*4d7e907cSAndroid Build Coastguard Worker     * Called by the HAL when background scan feature becomes available or not.
47*4d7e907cSAndroid Build Coastguard Worker     *
48*4d7e907cSAndroid Build Coastguard Worker     * @param isAvailable true, if the tuner turned temporarily background-
49*4d7e907cSAndroid Build Coastguard Worker     *                    capable, false in the other case.
50*4d7e907cSAndroid Build Coastguard Worker     */
51*4d7e907cSAndroid Build Coastguard Worker    oneway backgroundScanAvailable(bool isAvailable);
52*4d7e907cSAndroid Build Coastguard Worker
53*4d7e907cSAndroid Build Coastguard Worker    /**
54*4d7e907cSAndroid Build Coastguard Worker     * Called by the HAL when background scan initiated by startBackgroundScan
55*4d7e907cSAndroid Build Coastguard Worker     * finishes. If the list was changed, programListChanged must be called too.
56*4d7e907cSAndroid Build Coastguard Worker     * @param result OK if the scan succeeded, client may retrieve the actual
57*4d7e907cSAndroid Build Coastguard Worker     *               list with ITuner::getProgramList.
58*4d7e907cSAndroid Build Coastguard Worker     *               UNAVAILABLE if the scan was interrupted due to
59*4d7e907cSAndroid Build Coastguard Worker     *               hardware becoming temporarily unavailable.
60*4d7e907cSAndroid Build Coastguard Worker     *               NOT_INITIALIZED other error, ie. HW failure.
61*4d7e907cSAndroid Build Coastguard Worker     */
62*4d7e907cSAndroid Build Coastguard Worker    oneway backgroundScanComplete(ProgramListResult result);
63*4d7e907cSAndroid Build Coastguard Worker
64*4d7e907cSAndroid Build Coastguard Worker    /**
65*4d7e907cSAndroid Build Coastguard Worker     * Called each time the internally cached program list changes. HAL may not
66*4d7e907cSAndroid Build Coastguard Worker     * call it immediately, ie. it may wait for a short time to accumulate
67*4d7e907cSAndroid Build Coastguard Worker     * multiple list change notifications into a single event.
68*4d7e907cSAndroid Build Coastguard Worker     *
69*4d7e907cSAndroid Build Coastguard Worker     * This callback is only for notifying about insertions and deletions,
70*4d7e907cSAndroid Build Coastguard Worker     * not about metadata changes.
71*4d7e907cSAndroid Build Coastguard Worker     *
72*4d7e907cSAndroid Build Coastguard Worker     * It may be triggered either by an explicitly issued background scan,
73*4d7e907cSAndroid Build Coastguard Worker     * or a scan issued by the device internally.
74*4d7e907cSAndroid Build Coastguard Worker     *
75*4d7e907cSAndroid Build Coastguard Worker     * Client may retrieve the actual list with ITuner::getProgramList.
76*4d7e907cSAndroid Build Coastguard Worker     */
77*4d7e907cSAndroid Build Coastguard Worker    oneway programListChanged();
78*4d7e907cSAndroid Build Coastguard Worker
79*4d7e907cSAndroid Build Coastguard Worker    /**
80*4d7e907cSAndroid Build Coastguard Worker     * Method called by the HAL when current program information (including
81*4d7e907cSAndroid Build Coastguard Worker     * metadata) is updated.
82*4d7e907cSAndroid Build Coastguard Worker     *
83*4d7e907cSAndroid Build Coastguard Worker     * Client may retrieve the actual program info with
84*4d7e907cSAndroid Build Coastguard Worker     * ITuner::getProgramInformation_1_1.
85*4d7e907cSAndroid Build Coastguard Worker     *
86*4d7e907cSAndroid Build Coastguard Worker     * This may be called together with tuneComplete_1_1 or afSwitch_1_1.
87*4d7e907cSAndroid Build Coastguard Worker     *
88*4d7e907cSAndroid Build Coastguard Worker     * This callback supersedes V1_0::newMetadata and V1_0::afSwitch;
89*4d7e907cSAndroid Build Coastguard Worker     * partly V1_0::tuneComplete.
90*4d7e907cSAndroid Build Coastguard Worker     * 1.0 callbacks must not be called when HAL implementation detects
91*4d7e907cSAndroid Build Coastguard Worker     * 1.1 client (by casting V1_0::ITunerCallback to V1_1::ITunerCallback).
92*4d7e907cSAndroid Build Coastguard Worker     *
93*4d7e907cSAndroid Build Coastguard Worker     * @param info current program information
94*4d7e907cSAndroid Build Coastguard Worker     */
95*4d7e907cSAndroid Build Coastguard Worker    oneway currentProgramInfoChanged(ProgramInfo info);
96*4d7e907cSAndroid Build Coastguard Worker};
97