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