Home | History | Annotate | Download | only in radio
      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.graphics.Bitmap;
     20 import android.hardware.radio.ProgramSelector;
     21 import android.hardware.radio.RadioManager;
     22 
     23 /** {@hide} */
     24 interface ITuner {
     25     void close();
     26 
     27     boolean isClosed();
     28 
     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 
     36     /**
     37      * @throws IllegalStateException if tuner was opened without audio
     38      */
     39     void setMuted(boolean mute);
     40 
     41     boolean isMuted();
     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      */
     57     void tune(in ProgramSelector selector);
     58 
     59     /**
     60      * @throws IllegalStateException if called out of sequence
     61      */
     62     void cancel();
     63 
     64     void cancelAnnouncement();
     65 
     66     RadioManager.ProgramInfo getProgramInformation();
     67 
     68     Bitmap getImage(int id);
     69 
     70     /**
     71      * @return {@code true} if the scan was properly scheduled,
     72      *          {@code false} if the scan feature is unavailable
     73      */
     74     boolean startBackgroundScan();
     75 
     76     /**
     77      * @param vendorFilter Vendor-specific filter, must be Map<String, String>
     78      * @return the list, or null if scan is in progress
     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      */
     83     List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter);
     84 
     85     /**
     86      * @throws IllegalStateException if the switch is not supported at current
     87      *         configuration.
     88      */
     89     boolean isAnalogForced();
     90 
     91     /**
     92      * @throws IllegalStateException if the switch is not supported at current
     93      *         configuration.
     94      */
     95     void setAnalogForced(boolean isForced);
     96 
     97     boolean isAntennaConnected();
     98 }
     99