1 /** 2 * Copyright (c) 2021, 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.media.tv.tuner; 18 19 import android.hardware.tv.tuner.DemuxCapabilities; 20 import android.hardware.tv.tuner.FrontendInfo; 21 import android.hardware.tv.tuner.FrontendType; 22 import android.media.tv.tuner.ITunerDemux; 23 import android.media.tv.tuner.ITunerDescrambler; 24 import android.media.tv.tuner.ITunerFilter; 25 import android.media.tv.tuner.ITunerFilterCallback; 26 import android.media.tv.tuner.ITunerFrontend; 27 import android.media.tv.tuner.ITunerLnb; 28 29 /** 30 * TunerService interface handles tuner related operations. 31 * 32 * {@hide} 33 */ 34 //@VintfStability 35 @SuppressWarnings(value={"out-array"}) 36 interface ITunerService { 37 /** 38 * Gets frontend IDs. 39 */ getFrontendIds(out int[] ids)40 void getFrontendIds(out int[] ids); 41 42 /** 43 * Retrieve the frontend's information. 44 * 45 * @param frontendId the ID of the frontend. 46 * @return the information of the frontend. 47 */ getFrontendInfo(in int frontendId)48 FrontendInfo getFrontendInfo(in int frontendId); 49 50 /** 51 * Open a Tuner Frontend interface. 52 * 53 * @param frontendHandle the handle of the frontend granted by TRM. 54 * @return the aidl interface of the frontend. 55 */ openFrontend(in int frontendHandle)56 ITunerFrontend openFrontend(in int frontendHandle); 57 58 /** 59 * Open a new interface of ITunerLnb given a lnbHandle. 60 * 61 * @param lnbHandle the handle of the LNB granted by TRM. 62 * @return a newly created ITunerLnb interface. 63 */ openLnb(in int lnbHandle)64 ITunerLnb openLnb(in int lnbHandle); 65 66 /** 67 * Open a new interface of ITunerLnb given a LNB name. 68 * 69 * @param lnbName the name for an external LNB to be opened. 70 * @return a newly created ITunerLnb interface. 71 */ openLnbByName(in String lnbName)72 ITunerLnb openLnbByName(in String lnbName); 73 74 /** 75 * Create a new instance of Demux. 76 */ openDemux(in int demuxHandle)77 ITunerDemux openDemux(in int demuxHandle); 78 79 /** 80 * Retrieve the Tuner Demux capabilities. 81 * 82 * @return the demux’s capabilities. 83 */ getDemuxCaps()84 DemuxCapabilities getDemuxCaps(); 85 86 /* Open a new interface of ITunerDescrambler given a descramblerHandle. 87 * 88 * @param descramblerHandle the handle of the descrambler granted by TRM. 89 * @return a newly created ITunerDescrambler interface. 90 */ openDescrambler(in int descramblerHandle)91 ITunerDescrambler openDescrambler(in int descramblerHandle); 92 93 /** 94 * Get an integer that carries the Tuner HIDL version. The high 16 bits are the 95 * major version number while the low 16 bits are the minor version. Default 96 * value is unknown version 0. 97 */ getTunerHalVersion()98 int getTunerHalVersion(); 99 100 /** 101 * Open a new SharedFilter instance of ITunerFilter. 102 * 103 * @param filterToken the SharedFilter token created by ITunerFilter. 104 * @param cb the ITunerFilterCallback used to receive callback events 105 * @return a newly created ITunerFilter interface. 106 */ openSharedFilter(in String filterToken, in ITunerFilterCallback cb)107 ITunerFilter openSharedFilter(in String filterToken, in ITunerFilterCallback cb); 108 109 /** 110 * Enable or Disable Low Noise Amplifier (LNA). 111 * 112 * @param bEnable enable Lna or not. 113 */ setLna(in boolean bEnable)114 void setLna(in boolean bEnable); 115 116 /** 117 * Set the maximum usable frontends number of a given frontend type. It's used by client 118 * to enable or disable frontends when cable connection status is changed by user. 119 * 120 * @param frontendType the frontend type which the maximum usable number will be set. 121 * @param maxNumber the new maximum usable number. 122 */ setMaxNumberOfFrontends(in FrontendType frontendType, in int maxNumber)123 void setMaxNumberOfFrontends(in FrontendType frontendType, in int maxNumber); 124 125 /** 126 * Get the maximum usable frontends number of a given frontend type. 127 * 128 * @param frontendType the frontend type which the maximum usable number will be queried. 129 * 130 * @return the maximum usable number of the queried frontend type. 131 */ getMaxNumberOfFrontends(in FrontendType frontendType)132 int getMaxNumberOfFrontends(in FrontendType frontendType); 133 } 134