blob: 1fc71e07cdb739f9b418c594154bb9003bffdaa8 [file] [log] [blame]
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -07001/**
2 * Copyright (C) 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.radio;
18
19import android.hardware.radio.RadioManager;
20
21/** {@hide} */
22interface ITuner {
Tomasz Wasilczykd7c21d32017-04-17 17:02:06 -070023 void close();
24
Tomasz Wasilczyk8b6db4f2017-05-01 09:28:36 -070025 /**
26 * @throws IllegalArgumentException if config is not valid or null
27 */
28 void setConfiguration(in RadioManager.BandConfig config);
29
30 RadioManager.BandConfig getConfiguration();
31
Tomasz Wasilczyk9fa02872017-05-03 09:09:57 -070032 /**
33 * @throws IllegalStateException if tuner was opened without audio
34 */
35 void setMuted(boolean mute);
36
37 boolean isMuted();
Tomasz Wasilczyk23837932017-05-05 08:42:10 -070038
39 /**
40 * @throws IllegalStateException if called out of sequence
41 */
42 void step(boolean directionDown, boolean skipSubChannel);
43
44 /**
45 * @throws IllegalStateException if called out of sequence
46 */
47 void scan(boolean directionDown, boolean skipSubChannel);
48
49 /**
50 * @throws IllegalArgumentException if invalid arguments are passed
51 * @throws IllegalStateException if called out of sequence
52 */
53 void tune(int channel, int subChannel);
54
55 /**
56 * @throws IllegalStateException if called out of sequence
57 */
58 void cancel();
Tomasz Wasilczyk37d986d2017-05-08 10:41:32 -070059
60 RadioManager.ProgramInfo getProgramInformation();
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070061
62 /**
63 * @returns {@code true} if the scan was properly scheduled,
64 * {@code false} if the scan feature is unavailable
65 */
66 boolean startBackgroundScan();
67
68 /**
69 * @returns the list, or null if scan is in progress
70 * @throws IllegalArgumentException if invalid arguments are passed
71 * @throws IllegalStateException if the scan has not been started, client may
72 * call startBackgroundScan to fix this.
73 */
74 List<RadioManager.ProgramInfo> getProgramList(String filter);
75
76 /**
77 * @throws IllegalStateException if the switch is not supported at current
78 * configuration.
79 */
80 boolean isAnalogForced();
81
82 /**
83 * @throws IllegalStateException if the switch is not supported at current
84 * configuration.
85 */
86 void setAnalogForced(boolean isForced);
Tomasz Wasilczyk39ac2142017-05-17 14:55:17 -070087
88 boolean isAntennaConnected();
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -070089}