blob: 429f1f351a937f0a2510116da5aea2a332c41c40 [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 Wasilczyk436128f2018-01-08 16:46:09 -080020import android.hardware.radio.ProgramList;
Tomasz Wasilczyk8cfb0e82017-07-12 13:59:20 -070021import android.hardware.radio.ProgramSelector;
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -070022import android.hardware.radio.RadioManager;
23
24/** {@hide} */
25interface ITuner {
Tomasz Wasilczykd7c21d32017-04-17 17:02:06 -070026 void close();
27
Tomasz Wasilczyk468a53b2017-06-19 15:19:14 -070028 boolean isClosed();
29
Tomasz Wasilczyk8b6db4f2017-05-01 09:28:36 -070030 /**
31 * @throws IllegalArgumentException if config is not valid or null
32 */
33 void setConfiguration(in RadioManager.BandConfig config);
34
35 RadioManager.BandConfig getConfiguration();
36
Tomasz Wasilczyk9fa02872017-05-03 09:09:57 -070037 /**
38 * @throws IllegalStateException if tuner was opened without audio
39 */
40 void setMuted(boolean mute);
41
42 boolean isMuted();
Tomasz Wasilczyk23837932017-05-05 08:42:10 -070043
44 /**
45 * @throws IllegalStateException if called out of sequence
46 */
47 void step(boolean directionDown, boolean skipSubChannel);
48
49 /**
50 * @throws IllegalStateException if called out of sequence
51 */
52 void scan(boolean directionDown, boolean skipSubChannel);
53
54 /**
55 * @throws IllegalArgumentException if invalid arguments are passed
56 * @throws IllegalStateException if called out of sequence
57 */
Tomasz Wasilczyk8cfb0e82017-07-12 13:59:20 -070058 void tune(in ProgramSelector selector);
Tomasz Wasilczyk23837932017-05-05 08:42:10 -070059
60 /**
61 * @throws IllegalStateException if called out of sequence
62 */
63 void cancel();
Tomasz Wasilczyk37d986d2017-05-08 10:41:32 -070064
Tomasz Wasilczykc4cd8232017-07-14 10:46:15 -070065 void cancelAnnouncement();
66
Tomasz Wasilczyk4482b142017-07-17 13:57:12 -070067 Bitmap getImage(int id);
68
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070069 /**
Jeff Sharkey67f9d502017-08-05 13:49:13 -060070 * @return {@code true} if the scan was properly scheduled,
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070071 * {@code false} if the scan feature is unavailable
72 */
73 boolean startBackgroundScan();
74
Tomasz Wasilczyk436128f2018-01-08 16:46:09 -080075 void startProgramListUpdates(in ProgramList.Filter filter);
76 void stopProgramListUpdates();
Tomasz Wasilczykd3d53f62017-05-15 12:55:28 -070077
Tomasz Wasilczykce40fe92018-01-04 20:52:39 -080078 boolean isConfigFlagSupported(int flag);
79 boolean isConfigFlagSet(int flag);
80 void setConfigFlag(int flag, boolean value);
Tomasz Wasilczyk39ac2142017-05-17 14:55:17 -070081
Tomasz Wasilczyk8e932c62017-11-17 16:18:40 +000082 /**
83 * @param parameters Vendor-specific key-value pairs, must be Map<String, String>
84 * @return Vendor-specific key-value pairs, must be Map<String, String>
85 */
86 Map setParameters(in Map parameters);
87
88 /**
89 * @param keys Parameter keys to fetch
90 * @return Vendor-specific key-value pairs, must be Map<String, String>
91 */
92 Map getParameters(in List<String> keys);
Tomasz Wasilczyk347192e2017-04-04 11:13:44 -070093}