Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 1 | /** |
| 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 | |
| 17 | package android.hardware.radio; |
| 18 | |
Tomasz Wasilczyk | 4482b14 | 2017-07-17 13:57:12 -0700 | [diff] [blame] | 19 | import android.graphics.Bitmap; |
Tomasz Wasilczyk | 8cfb0e8 | 2017-07-12 13:59:20 -0700 | [diff] [blame] | 20 | import android.hardware.radio.ProgramSelector; |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 21 | import android.hardware.radio.RadioManager; |
| 22 | |
| 23 | /** {@hide} */ |
| 24 | interface ITuner { |
Tomasz Wasilczyk | d7c21d3 | 2017-04-17 17:02:06 -0700 | [diff] [blame] | 25 | void close(); |
| 26 | |
Tomasz Wasilczyk | 468a53b | 2017-06-19 15:19:14 -0700 | [diff] [blame] | 27 | boolean isClosed(); |
| 28 | |
Tomasz Wasilczyk | 8b6db4f | 2017-05-01 09:28:36 -0700 | [diff] [blame] | 29 | /** |
| 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 Wasilczyk | 9fa0287 | 2017-05-03 09:09:57 -0700 | [diff] [blame] | 36 | /** |
| 37 | * @throws IllegalStateException if tuner was opened without audio |
| 38 | */ |
| 39 | void setMuted(boolean mute); |
| 40 | |
| 41 | boolean isMuted(); |
Tomasz Wasilczyk | 2383793 | 2017-05-05 08:42:10 -0700 | [diff] [blame] | 42 | |
| 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 Wasilczyk | 8cfb0e8 | 2017-07-12 13:59:20 -0700 | [diff] [blame] | 57 | void tune(in ProgramSelector selector); |
Tomasz Wasilczyk | 2383793 | 2017-05-05 08:42:10 -0700 | [diff] [blame] | 58 | |
| 59 | /** |
| 60 | * @throws IllegalStateException if called out of sequence |
| 61 | */ |
| 62 | void cancel(); |
Tomasz Wasilczyk | 37d986d | 2017-05-08 10:41:32 -0700 | [diff] [blame] | 63 | |
Tomasz Wasilczyk | c4cd823 | 2017-07-14 10:46:15 -0700 | [diff] [blame] | 64 | void cancelAnnouncement(); |
| 65 | |
Tomasz Wasilczyk | 37d986d | 2017-05-08 10:41:32 -0700 | [diff] [blame] | 66 | RadioManager.ProgramInfo getProgramInformation(); |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 67 | |
Tomasz Wasilczyk | 4482b14 | 2017-07-17 13:57:12 -0700 | [diff] [blame] | 68 | Bitmap getImage(int id); |
| 69 | |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 70 | /** |
Jeff Sharkey | 67f9d50 | 2017-08-05 13:49:13 -0600 | [diff] [blame] | 71 | * @return {@code true} if the scan was properly scheduled, |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 72 | * {@code false} if the scan feature is unavailable |
| 73 | */ |
| 74 | boolean startBackgroundScan(); |
| 75 | |
| 76 | /** |
Tomasz Wasilczyk | 0f1776d | 2017-08-03 11:03:49 -0700 | [diff] [blame] | 77 | * @param vendorFilter Vendor-specific filter, must be Map<String, String> |
Jeff Sharkey | 67f9d50 | 2017-08-05 13:49:13 -0600 | [diff] [blame] | 78 | * @return the list, or null if scan is in progress |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 79 | * @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 Wasilczyk | 0f1776d | 2017-08-03 11:03:49 -0700 | [diff] [blame] | 83 | List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter); |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 84 | |
Tomasz Wasilczyk | ce40fe9 | 2018-01-04 20:52:39 -0800 | [diff] [blame] | 85 | boolean isConfigFlagSupported(int flag); |
| 86 | boolean isConfigFlagSet(int flag); |
| 87 | void setConfigFlag(int flag, boolean value); |
Tomasz Wasilczyk | 39ac214 | 2017-05-17 14:55:17 -0700 | [diff] [blame] | 88 | |
Tomasz Wasilczyk | 8e932c6 | 2017-11-17 16:18:40 +0000 | [diff] [blame] | 89 | /** |
| 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 Wasilczyk | 39ac214 | 2017-05-17 14:55:17 -0700 | [diff] [blame] | 101 | boolean isAntennaConnected(); |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 102 | } |