1 /* 2 * Copyright (C) 2014 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 com.android.internal.telecom; 18 19 import android.content.ComponentName; 20 import android.telecom.PhoneAccountHandle; 21 import android.os.Bundle; 22 import android.telecom.PhoneAccount; 23 24 /** 25 * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing 26 * commands that were previously handled by ITelephony. 27 * {@hide} 28 */ 29 interface ITelecomService { 30 /** 31 * Brings the in-call screen to the foreground if there is an active call. 32 * 33 * @param showDialpad if true, make the dialpad visible initially. 34 */ 35 void showInCallScreen(boolean showDialpad); 36 37 /** 38 * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount 39 */ 40 PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme); 41 42 /** 43 * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount 44 */ 45 PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(); 46 47 /** 48 * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount 49 */ 50 void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account); 51 52 /** 53 * @see TelecomServiceImpl#getCallCapablePhoneAccounts 54 */ 55 List<PhoneAccountHandle> getCallCapablePhoneAccounts(); 56 57 /** 58 * @see TelecomManager#getPhoneAccountsSupportingScheme 59 */ 60 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme); 61 62 /** 63 * @see TelecomManager#getPhoneAccountsForPackage 64 */ 65 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName); 66 67 /** 68 * @see TelecomManager#getPhoneAccount 69 */ 70 PhoneAccount getPhoneAccount(in PhoneAccountHandle account); 71 72 /** 73 * @see TelecomManager#getAllPhoneAccountsCount 74 */ 75 int getAllPhoneAccountsCount(); 76 77 /** 78 * @see TelecomManager#getAllPhoneAccounts 79 */ 80 List<PhoneAccount> getAllPhoneAccounts(); 81 82 /** 83 * @see TelecomManager#getAllPhoneAccountHandles 84 */ 85 List<PhoneAccountHandle> getAllPhoneAccountHandles(); 86 87 /** 88 * @see TelecomServiceImpl#getSimCallManager 89 */ 90 PhoneAccountHandle getSimCallManager(); 91 92 /** 93 * @see TelecomServiceImpl#setSimCallManager 94 */ 95 void setSimCallManager(in PhoneAccountHandle account); 96 97 /** 98 * @see TelecomServiceImpl#getSimCallManagers 99 */ 100 List<PhoneAccountHandle> getSimCallManagers(); 101 102 /** 103 * @see TelecomServiceImpl#registerPhoneAccount 104 */ 105 void registerPhoneAccount(in PhoneAccount metadata); 106 107 /** 108 * @see TelecomServiceImpl#unregisterPhoneAccount 109 */ 110 void unregisterPhoneAccount(in PhoneAccountHandle account); 111 112 /** 113 * @see TelecomServiceImpl#clearAccounts 114 */ 115 void clearAccounts(String packageName); 116 117 /** 118 * @see TelecomServiceImpl#getDefaultPhoneApp 119 */ 120 ComponentName getDefaultPhoneApp(); 121 122 // 123 // Internal system apis relating to call management. 124 // 125 126 /** 127 * @see TelecomServiceImpl#silenceRinger 128 */ 129 void silenceRinger(); 130 131 /** 132 * @see TelecomServiceImpl#isInCall 133 */ 134 boolean isInCall(); 135 136 /** 137 * @see TelecomServiceImpl#isRinging 138 */ 139 boolean isRinging(); 140 141 /** 142 * @see TelecomServiceImpl#getCallState 143 */ 144 int getCallState(); 145 146 /** 147 * @see TelecomServiceImpl#endCall 148 */ 149 boolean endCall(); 150 151 /** 152 * @see TelecomServiceImpl#acceptRingingCall 153 */ 154 void acceptRingingCall(); 155 156 /** 157 * @see TelecomServiceImpl#cancelMissedCallsNotification 158 */ 159 void cancelMissedCallsNotification(); 160 161 /** 162 * @see TelecomServiceImpl#handleMmi 163 */ 164 boolean handlePinMmi(String dialString); 165 166 /** 167 * @see TelecomServiceImpl#isTtySupported 168 */ 169 boolean isTtySupported(); 170 171 /** 172 * @see TelecomServiceImpl#getCurrentTtyMode 173 */ 174 int getCurrentTtyMode(); 175 176 /** 177 * @see TelecomServiceImpl#addNewIncomingCall 178 */ 179 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras); 180 181 /** 182 * @see TelecomServiceImpl#addNewUnknownCall 183 */ 184 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras); 185 } 186