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