1/**
2 * Copyright 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::types;
20
21typedef @1.0::Result Result;
22
23enum ProgramListResult : Result {
24    NOT_READY,
25    NOT_STARTED,
26    TEMPORARILY_UNAVAILABLE,
27};
28
29/**
30 * Extra flags for program information.
31 */
32enum ProgramInfoFlags : uint32_t {
33    /**
34     * Set when the program is currently playing live stream.
35     * This may result in a slightly altered reception parameters,
36     * usually targetted at reduced latency.
37     */
38    LIVE = 1 << 0,
39
40    /**
41     * Radio stream is not playing, ie. due to bad reception conditions or
42     * buffering. In this state volume knob MAY be disabled to prevent user
43     * increasing volume too much.
44     */
45    MUTED = 1 << 1,
46};
47
48struct Properties {
49    @1.0::Properties base;
50
51    /**
52     * The hardware supports background scanning in general. At the given time
53     * it may not be available though, see startBackgroundScan.
54     */
55    bool supportsBackgroundScanning;
56};
57
58/**
59 * Radio program information. Returned by the HAL with event RADIO_EVENT_TUNED.
60 * Contains information on currently tuned channel.
61 */
62struct ProgramInfo {
63    @1.0::ProgramInfo base;
64    bitfield<ProgramInfoFlags> flags;
65
66    /**
67     * Vendors are allowed to define their own set of flags and store it in this
68     * field. They MUST verify vendor/product name from Properties struct
69     * (IBroadcastRadio::getProperties) before doing any interpretation
70     * of such values.
71     */
72    uint32_t vendorFlags;
73};
74