blob: ca380769954bc3bd02e4f40093a0de5ea6ea0ddd [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
Tomasz Wasilczyk4482b142017-07-17 13:57:12 -070019import android.graphics.Bitmap;
Tomasz Wasilczyk8cfb0e82017-07-12 13:59:20 -070020import android.hardware.radio.ProgramSelector;
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -070021import android.hardware.radio.RadioManager;
22
23/** {@hide} */
24interface ITuner {
Tomasz Wasilczykd7c21d32017-04-17 17:02:06 -070025 void close();
26
Tomasz Wasilczyk468a53b2017-06-19 15:19:14 -070027 boolean isClosed();
28
Tomasz Wasilczyk8b6db4f2017-05-01 09:28:36 -070029 /**
30 * @throws IllegalArgumentException if config is not valid or null
31 */
32 void setConfiguration(in RadioManager.BandConfig config);
33
34 RadioManager.BandConfig getConfiguration();
35
Tomasz Wasilczyk9fa02872017-05-03 09:09:57 -070036 /**
37 * @throws IllegalStateException if tuner was opened without audio
38 */
39 void setMuted(boolean mute);
40
41 boolean isMuted();
Tomasz Wasilczyk23837932017-05-05 08:42:10 -070042
43 /**
44 * @throws IllegalStateException if called out of sequence
45 */
46 void step(boolean directionDown, boolean skipSubChannel);
47
48 /**
49 * @throws IllegalStateException if called out of sequence
50 */
51 void scan(boolean directionDown, boolean skipSubChannel);
52
53 /**
54 * @throws IllegalArgumentException if invalid arguments are passed
55 * @throws IllegalStateException if called out of sequence
56 */
Tomasz Wasilczyk8cfb0e82017-07-12 13:59:20 -070057 void tune(in ProgramSelector selector);
Tomasz Wasilczyk23837932017-05-05 08:42:10 -070058
59 /**
60 * @throws IllegalStateException if called out of sequence
61 */
62 void cancel();
Tomasz Wasilczyk37d986d2017-05-08 10:41:32 -070063
Tomasz Wasilczykc4cd8232017-07-14 10:46:15 -070064 void cancelAnnouncement();
65
Tomasz Wasilczyk37d986d2017-05-08 10:41:32 -070066 RadioManager.ProgramInfo getProgramInformation();
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070067
Tomasz Wasilczyk4482b142017-07-17 13:57:12 -070068 Bitmap getImage(int id);
69
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070070 /**
Jeff Sharkey67f9d502017-08-05 13:49:13 -060071 * @return {@code true} if the scan was properly scheduled,
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070072 * {@code false} if the scan feature is unavailable
73 */
74 boolean startBackgroundScan();
75
76 /**
Tomasz Wasilczyk0f1776d2017-08-03 11:03:49 -070077 * @param vendorFilter Vendor-specific filter, must be Map<String, String>
Jeff Sharkey67f9d502017-08-05 13:49:13 -060078 * @return the list, or null if scan is in progress
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070079 * @throws IllegalArgumentException if invalid arguments are passed
80 * @throws IllegalStateException if the scan has not been started, client may
81 * call startBackgroundScan to fix this.
82 */
Tomasz Wasilczyk0f1776d2017-08-03 11:03:49 -070083 List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter);
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070084
Tomasz Wasilczykce40fe92018-01-04 20:52:39 -080085 boolean isConfigFlagSupported(int flag);
86 boolean isConfigFlagSet(int flag);
87 void setConfigFlag(int flag, boolean value);
Tomasz Wasilczyk39ac2142017-05-17 14:55:17 -070088
Tomasz Wasilczyk8e932c62017-11-17 16:18:40 +000089 /**
90 * @param parameters Vendor-specific key-value pairs, must be Map<String, String>
91 * @return Vendor-specific key-value pairs, must be Map<String, String>
92 */
93 Map setParameters(in Map parameters);
94
95 /**
96 * @param keys Parameter keys to fetch
97 * @return Vendor-specific key-value pairs, must be Map<String, String>
98 */
99 Map getParameters(in List<String> keys);
100
Tomasz Wasilczyk39ac2142017-05-17 14:55:17 -0700101 boolean isAntennaConnected();
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -0700102}