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 | |
| 19 | import android.hardware.radio.RadioManager; |
| 20 | |
| 21 | /** {@hide} */ |
| 22 | interface ITuner { |
Tomasz Wasilczyk | d7c21d3 | 2017-04-17 17:02:06 -0700 | [diff] [blame] | 23 | void close(); |
| 24 | |
Tomasz Wasilczyk | 8b6db4f | 2017-05-01 09:28:36 -0700 | [diff] [blame] | 25 | /** |
| 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 Wasilczyk | 9fa0287 | 2017-05-03 09:09:57 -0700 | [diff] [blame] | 32 | /** |
| 33 | * @throws IllegalStateException if tuner was opened without audio |
| 34 | */ |
| 35 | void setMuted(boolean mute); |
| 36 | |
| 37 | boolean isMuted(); |
Tomasz Wasilczyk | 2383793 | 2017-05-05 08:42:10 -0700 | [diff] [blame] | 38 | |
| 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 Wasilczyk | 37d986d | 2017-05-08 10:41:32 -0700 | [diff] [blame] | 59 | |
| 60 | RadioManager.ProgramInfo getProgramInformation(); |
Tomasz Wasilczyk | d3d53f6 | 2017-05-15 12:55:28 -0700 | [diff] [blame] | 61 | |
| 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 Wasilczyk | 39ac214 | 2017-05-17 14:55:17 -0700 | [diff] [blame] | 87 | |
| 88 | boolean isAntennaConnected(); |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 89 | } |