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