1/*
2 * Copyright (C) 2016 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.0;
18
19import ITunerCallback;
20import ITuner;
21
22interface IBroadcastRadio {
23
24    /**
25     * Retrieve implementation properties.
26     * @return result Operation completion status: OK in case of success,
27     *                NOT_INITIALIZED in case of initialization error.
28     * @return properties A Properties structure containing implementation
29     *                    description and capabilities.
30     */
31    getProperties() generates (Result result, Properties properties);
32
33    /**
34     * Open a tuner interface for the requested configuration.
35     * If no other tuner is opened, this will power on the radio hardware.
36     * The hardware must be powered down when all tuner interface are released.
37     * @param config A BandConfig struct containing the band configuration to apply
38     * @param audio True if this tuner must be used for live radio listening and
39     *              should be connected to the radio audio source.
40     * @param callback the callback interface
41     * @return result Operation completion status: OK in case of success,
42     *                INVALID_ARGUMENTS if configuration requested is invalid,
43     *                INVALID_STATE if called out of sequence
44     * @return tuner The interface to control the tuner
45     *
46     * Callback ITunerCallback.ConfigChanged MUST be called once the
47     * configuration is applied or a failure occurs or after a time out.
48     */
49    openTuner(BandConfig config, bool audio, ITunerCallback callback)
50                generates (Result result, ITuner tuner);
51};
52