Santos Cordon | 3afed57 | 2014-05-21 15:22:12 -0700 | [diff] [blame] | 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 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package com.android.internal.telecom; |
Santos Cordon | 3afed57 | 2014-05-21 15:22:12 -0700 | [diff] [blame] | 18 | |
Santos Cordon | 6c7a388 | 2014-06-25 15:30:08 -0700 | [diff] [blame] | 19 | import android.content.ComponentName; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 20 | import android.telecom.PhoneAccountHandle; |
Nancy Chen | b2299c1 | 2014-10-29 18:22:11 -0700 | [diff] [blame] | 21 | import android.net.Uri; |
Santos Cordon | 96efb48 | 2014-07-19 14:57:05 -0700 | [diff] [blame] | 22 | import android.os.Bundle; |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 23 | import android.telecom.PhoneAccount; |
Yorke Lee | 2e02470 | 2014-06-13 09:59:43 -0700 | [diff] [blame] | 24 | |
Santos Cordon | 3afed57 | 2014-05-21 15:22:12 -0700 | [diff] [blame] | 25 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 26 | * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing |
Santos Cordon | 3afed57 | 2014-05-21 15:22:12 -0700 | [diff] [blame] | 27 | * commands that were previously handled by ITelephony. |
| 28 | * {@hide} |
| 29 | */ |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 30 | interface ITelecomService { |
Santos Cordon | 3534ede | 2014-05-29 13:07:10 -0700 | [diff] [blame] | 31 | /** |
| 32 | * Brings the in-call screen to the foreground if there is an active call. |
| 33 | * |
| 34 | * @param showDialpad if true, make the dialpad visible initially. |
| 35 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 36 | void showInCallScreen(boolean showDialpad, String callingPackage); |
Yorke Lee | 2e02470 | 2014-06-13 09:59:43 -0700 | [diff] [blame] | 37 | |
| 38 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 39 | * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount |
Ihab Awad | 94cf4bf | 2014-07-17 11:21:19 -0700 | [diff] [blame] | 40 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 41 | PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage); |
Ihab Awad | 94cf4bf | 2014-07-17 11:21:19 -0700 | [diff] [blame] | 42 | |
| 43 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 44 | * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 45 | */ |
Andrew Lee | d4abbfb | 2014-09-03 14:58:27 -0700 | [diff] [blame] | 46 | PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(); |
| 47 | |
| 48 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 49 | * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount |
Andrew Lee | d4abbfb | 2014-09-03 14:58:27 -0700 | [diff] [blame] | 50 | */ |
| 51 | void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account); |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 52 | |
| 53 | /** |
Nancy Chen | 210ef03 | 2014-09-15 17:58:42 -0700 | [diff] [blame] | 54 | * @see TelecomServiceImpl#getCallCapablePhoneAccounts |
Ihab Awad | c35ad02 | 2014-06-12 16:29:42 -0700 | [diff] [blame] | 55 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 56 | List<PhoneAccountHandle> getCallCapablePhoneAccounts(String callingPackage); |
Ihab Awad | c35ad02 | 2014-06-12 16:29:42 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 59 | * @see TelecomManager#getPhoneAccountsSupportingScheme |
Tyler Gunn | f5b29dc | 2014-09-03 09:09:12 -0700 | [diff] [blame] | 60 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 61 | List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme, |
| 62 | String callingPackage); |
Tyler Gunn | f5b29dc | 2014-09-03 09:09:12 -0700 | [diff] [blame] | 63 | |
| 64 | /** |
Nancy Chen | 513c892 | 2014-09-17 14:47:20 -0700 | [diff] [blame] | 65 | * @see TelecomManager#getPhoneAccountsForPackage |
| 66 | */ |
| 67 | List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName); |
| 68 | |
| 69 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 70 | * @see TelecomManager#getPhoneAccount |
Ihab Awad | c35ad02 | 2014-06-12 16:29:42 -0700 | [diff] [blame] | 71 | */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 72 | PhoneAccount getPhoneAccount(in PhoneAccountHandle account); |
Ihab Awad | c35ad02 | 2014-06-12 16:29:42 -0700 | [diff] [blame] | 73 | |
| 74 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 75 | * @see TelecomManager#getAllPhoneAccountsCount |
Tyler Gunn | a1ed7d1 | 2014-09-08 09:52:22 -0700 | [diff] [blame] | 76 | */ |
| 77 | int getAllPhoneAccountsCount(); |
| 78 | |
| 79 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 80 | * @see TelecomManager#getAllPhoneAccounts |
Tyler Gunn | a1ed7d1 | 2014-09-08 09:52:22 -0700 | [diff] [blame] | 81 | */ |
| 82 | List<PhoneAccount> getAllPhoneAccounts(); |
| 83 | |
| 84 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 85 | * @see TelecomManager#getAllPhoneAccountHandles |
Tyler Gunn | a1ed7d1 | 2014-09-08 09:52:22 -0700 | [diff] [blame] | 86 | */ |
| 87 | List<PhoneAccountHandle> getAllPhoneAccountHandles(); |
| 88 | |
| 89 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 90 | * @see TelecomServiceImpl#getSimCallManager |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 91 | */ |
| 92 | PhoneAccountHandle getSimCallManager(); |
| 93 | |
| 94 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 95 | * @see TelecomServiceImpl#setSimCallManager |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 96 | */ |
| 97 | void setSimCallManager(in PhoneAccountHandle account); |
| 98 | |
| 99 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 100 | * @see TelecomServiceImpl#getSimCallManagers |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 101 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 102 | List<PhoneAccountHandle> getSimCallManagers(String callingPackage); |
Andrew Lee | 59cac3a | 2014-08-28 16:50:10 -0700 | [diff] [blame] | 103 | |
| 104 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 105 | * @see TelecomServiceImpl#registerPhoneAccount |
Ihab Awad | c35ad02 | 2014-06-12 16:29:42 -0700 | [diff] [blame] | 106 | */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 107 | void registerPhoneAccount(in PhoneAccount metadata); |
Santos Cordon | 6c7a388 | 2014-06-25 15:30:08 -0700 | [diff] [blame] | 108 | |
| 109 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 110 | * @see TelecomServiceImpl#unregisterPhoneAccount |
Ihab Awad | 807fe0a | 2014-07-09 12:30:52 -0700 | [diff] [blame] | 111 | */ |
Evan Charlton | 6eb262c | 2014-07-19 18:18:19 -0700 | [diff] [blame] | 112 | void unregisterPhoneAccount(in PhoneAccountHandle account); |
Ihab Awad | 807fe0a | 2014-07-09 12:30:52 -0700 | [diff] [blame] | 113 | |
| 114 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 115 | * @see TelecomServiceImpl#clearAccounts |
Ihab Awad | 807fe0a | 2014-07-09 12:30:52 -0700 | [diff] [blame] | 116 | */ |
| 117 | void clearAccounts(String packageName); |
| 118 | |
| 119 | /** |
Nancy Chen | 443e501 | 2014-10-15 15:48:21 -0700 | [diff] [blame] | 120 | * @see TelecomServiceImpl#isVoiceMailNumber |
| 121 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 122 | boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number, |
| 123 | String callingPackage); |
Nancy Chen | 443e501 | 2014-10-15 15:48:21 -0700 | [diff] [blame] | 124 | |
| 125 | /** |
Yorke Lee | 49e2d46 | 2015-04-15 16:14:22 -0700 | [diff] [blame] | 126 | * @see TelecomServiceImpl#getVoiceMailNumber |
Nancy Chen | 8c066f7 | 2014-12-03 15:18:08 -0800 | [diff] [blame] | 127 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 128 | String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage); |
Nancy Chen | 8c066f7 | 2014-12-03 15:18:08 -0800 | [diff] [blame] | 129 | |
| 130 | /** |
Nancy Chen | 5cf2784 | 2015-01-24 23:30:27 -0800 | [diff] [blame] | 131 | * @see TelecomServiceImpl#getLine1Number |
| 132 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 133 | String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage); |
Nancy Chen | 5cf2784 | 2015-01-24 23:30:27 -0800 | [diff] [blame] | 134 | |
| 135 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 136 | * @see TelecomServiceImpl#getDefaultPhoneApp |
Santos Cordon | 6c7a388 | 2014-06-25 15:30:08 -0700 | [diff] [blame] | 137 | */ |
| 138 | ComponentName getDefaultPhoneApp(); |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 139 | |
Yorke Lee | 1011f48 | 2015-04-23 15:58:27 -0700 | [diff] [blame^] | 140 | /** |
| 141 | * @see TelecomServiceImpl#getDefaultDialerPackage |
| 142 | */ |
| 143 | String getDefaultDialerPackage(); |
| 144 | |
| 145 | /** |
| 146 | * @see TelecomServiceImpl#getSystemDialerPackage |
| 147 | */ |
| 148 | String getSystemDialerPackage(); |
| 149 | |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 150 | // |
| 151 | // Internal system apis relating to call management. |
| 152 | // |
| 153 | |
| 154 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 155 | * @see TelecomServiceImpl#silenceRinger |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 156 | */ |
| 157 | void silenceRinger(); |
| 158 | |
| 159 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 160 | * @see TelecomServiceImpl#isInCall |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 161 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 162 | boolean isInCall(String callingPackage); |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 163 | |
| 164 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 165 | * @see TelecomServiceImpl#isRinging |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 166 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 167 | boolean isRinging(String callingPackage); |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 168 | |
| 169 | /** |
Yorke Lee | 2ae312e | 2014-09-12 17:58:48 -0700 | [diff] [blame] | 170 | * @see TelecomServiceImpl#getCallState |
| 171 | */ |
| 172 | int getCallState(); |
| 173 | |
| 174 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 175 | * @see TelecomServiceImpl#endCall |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 176 | */ |
| 177 | boolean endCall(); |
| 178 | |
| 179 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 180 | * @see TelecomServiceImpl#acceptRingingCall |
Santos Cordon | 9eb4593 | 2014-06-27 12:28:43 -0700 | [diff] [blame] | 181 | */ |
| 182 | void acceptRingingCall(); |
Santos Cordon | 3c4ff9e | 2014-07-02 13:20:40 -0700 | [diff] [blame] | 183 | |
| 184 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 185 | * @see TelecomServiceImpl#cancelMissedCallsNotification |
Santos Cordon | 3c4ff9e | 2014-07-02 13:20:40 -0700 | [diff] [blame] | 186 | */ |
| 187 | void cancelMissedCallsNotification(); |
Santos Cordon | 0bae09f | 2014-07-07 14:53:10 -0700 | [diff] [blame] | 188 | |
| 189 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 190 | * @see TelecomServiceImpl#handleMmi |
Santos Cordon | 0bae09f | 2014-07-07 14:53:10 -0700 | [diff] [blame] | 191 | */ |
| 192 | boolean handlePinMmi(String dialString); |
Sailesh Nepal | 001bbbb | 2014-07-15 14:40:39 -0700 | [diff] [blame] | 193 | |
| 194 | /** |
Nancy Chen | 95e8a67 | 2014-10-16 18:38:21 -0700 | [diff] [blame] | 195 | * @see TelecomServiceImpl#handleMmi |
| 196 | */ |
| 197 | boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString); |
| 198 | |
| 199 | /** |
Nancy Chen | b2299c1 | 2014-10-29 18:22:11 -0700 | [diff] [blame] | 200 | * @see TelecomServiceImpl#getAdnUriForPhoneAccount |
| 201 | */ |
| 202 | Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle); |
| 203 | |
| 204 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 205 | * @see TelecomServiceImpl#isTtySupported |
Sailesh Nepal | 001bbbb | 2014-07-15 14:40:39 -0700 | [diff] [blame] | 206 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 207 | boolean isTtySupported(String callingPackage); |
Sailesh Nepal | 001bbbb | 2014-07-15 14:40:39 -0700 | [diff] [blame] | 208 | |
| 209 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 210 | * @see TelecomServiceImpl#getCurrentTtyMode |
Sailesh Nepal | 001bbbb | 2014-07-15 14:40:39 -0700 | [diff] [blame] | 211 | */ |
Svet Ganov | 16a1689 | 2015-04-16 10:32:04 -0700 | [diff] [blame] | 212 | int getCurrentTtyMode(String callingPackage); |
Santos Cordon | 96efb48 | 2014-07-19 14:57:05 -0700 | [diff] [blame] | 213 | |
| 214 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 215 | * @see TelecomServiceImpl#addNewIncomingCall |
Santos Cordon | 96efb48 | 2014-07-19 14:57:05 -0700 | [diff] [blame] | 216 | */ |
| 217 | void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras); |
Yorke Lee | c3cf982 | 2014-10-02 09:38:39 -0700 | [diff] [blame] | 218 | |
| 219 | /** |
| 220 | * @see TelecomServiceImpl#addNewUnknownCall |
| 221 | */ |
| 222 | void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras); |
Yorke Lee | 3e56ba1 | 2015-04-23 12:32:36 -0700 | [diff] [blame] | 223 | |
| 224 | /** |
| 225 | * @see TelecomServiceImpl#placeCall |
| 226 | */ |
| 227 | void placeCall(in Uri handle, in Bundle extras, String callingPackage); |
Santos Cordon | 3afed57 | 2014-05-21 15:22:12 -0700 | [diff] [blame] | 228 | } |