blob: 93eea56f64909705df28229706b59cce02d71c13 [file] [log] [blame]
Santos Cordon3afed572014-05-21 15:22:12 -07001/*
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 Gunnef9f6f92014-09-12 22:16:17 -070017package com.android.internal.telecom;
Santos Cordon3afed572014-05-21 15:22:12 -070018
Santos Cordon6c7a3882014-06-25 15:30:08 -070019import android.content.ComponentName;
Abhijith Shastry1e6f8342016-02-29 11:17:52 -080020import android.content.Intent;
Hall Liu057def52016-05-05 17:17:07 -070021import android.telecom.TelecomAnalytics;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070022import android.telecom.PhoneAccountHandle;
Nancy Chenb2299c12014-10-29 18:22:11 -070023import android.net.Uri;
Santos Cordon96efb482014-07-19 14:57:05 -070024import android.os.Bundle;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070025import android.telecom.PhoneAccount;
Yorke Lee2e024702014-06-13 09:59:43 -070026
Santos Cordon3afed572014-05-21 15:22:12 -070027/**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070028 * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
Santos Cordon3afed572014-05-21 15:22:12 -070029 * commands that were previously handled by ITelephony.
30 * {@hide}
31 */
Tyler Gunnef9f6f92014-09-12 22:16:17 -070032interface ITelecomService {
Santos Cordon3534ede2014-05-29 13:07:10 -070033 /**
34 * Brings the in-call screen to the foreground if there is an active call.
35 *
36 * @param showDialpad if true, make the dialpad visible initially.
37 */
Svet Ganov16a16892015-04-16 10:32:04 -070038 void showInCallScreen(boolean showDialpad, String callingPackage);
Yorke Lee2e024702014-06-13 09:59:43 -070039
40 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070041 * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
Ihab Awad94cf4bf2014-07-17 11:21:19 -070042 */
Svet Ganov16a16892015-04-16 10:32:04 -070043 PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage);
Ihab Awad94cf4bf2014-07-17 11:21:19 -070044
45 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070046 * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount
Andrew Lee59cac3a2014-08-28 16:50:10 -070047 */
Tyler Gunn36c50ed2018-11-15 07:29:49 -080048 PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(String callingPackage);
Andrew Leed4abbfb2014-09-03 14:58:27 -070049
50 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070051 * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount
Andrew Leed4abbfb2014-09-03 14:58:27 -070052 */
53 void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
Andrew Lee59cac3a2014-08-28 16:50:10 -070054
55 /**
Nancy Chen210ef032014-09-15 17:58:42 -070056 * @see TelecomServiceImpl#getCallCapablePhoneAccounts
Ihab Awadc35ad022014-06-12 16:29:42 -070057 */
Santos Cordon91371dc2015-05-08 13:52:09 -070058 List<PhoneAccountHandle> getCallCapablePhoneAccounts(
59 boolean includeDisabledAccounts, String callingPackage);
Ihab Awadc35ad022014-06-12 16:29:42 -070060
61 /**
Tyler Gunn89317072017-04-07 14:57:37 -070062 * @see TelecomServiceImpl#getSelfManagedPhoneAccounts
63 */
64 List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage);
65
66 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070067 * @see TelecomManager#getPhoneAccountsSupportingScheme
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070068 */
Svet Ganov16a16892015-04-16 10:32:04 -070069 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
70 String callingPackage);
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070071
72 /**
Nancy Chen513c8922014-09-17 14:47:20 -070073 * @see TelecomManager#getPhoneAccountsForPackage
74 */
75 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
76
77 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070078 * @see TelecomManager#getPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -070079 */
Evan Charlton8c8a0622014-07-20 12:31:00 -070080 PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
Ihab Awadc35ad022014-06-12 16:29:42 -070081
82 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070083 * @see TelecomManager#getAllPhoneAccountsCount
Tyler Gunna1ed7d12014-09-08 09:52:22 -070084 */
85 int getAllPhoneAccountsCount();
86
87 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070088 * @see TelecomManager#getAllPhoneAccounts
Tyler Gunna1ed7d12014-09-08 09:52:22 -070089 */
90 List<PhoneAccount> getAllPhoneAccounts();
91
92 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070093 * @see TelecomManager#getAllPhoneAccountHandles
Tyler Gunna1ed7d12014-09-08 09:52:22 -070094 */
95 List<PhoneAccountHandle> getAllPhoneAccountHandles();
96
97 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070098 * @see TelecomServiceImpl#getSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070099 */
100 PhoneAccountHandle getSimCallManager();
101
102 /**
Sailesh Nepalcf855622015-07-28 19:22:14 -0700103 * @see TelecomServiceImpl#getSimCallManagerForUser
104 */
105 PhoneAccountHandle getSimCallManagerForUser(int userId);
106
107 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700108 * @see TelecomServiceImpl#registerPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -0700109 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700110 void registerPhoneAccount(in PhoneAccount metadata);
Santos Cordon6c7a3882014-06-25 15:30:08 -0700111
112 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700113 * @see TelecomServiceImpl#unregisterPhoneAccount
Ihab Awad807fe0a2014-07-09 12:30:52 -0700114 */
Evan Charlton6eb262c2014-07-19 18:18:19 -0700115 void unregisterPhoneAccount(in PhoneAccountHandle account);
Ihab Awad807fe0a2014-07-09 12:30:52 -0700116
117 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700118 * @see TelecomServiceImpl#clearAccounts
Ihab Awad807fe0a2014-07-09 12:30:52 -0700119 */
120 void clearAccounts(String packageName);
121
122 /**
Nancy Chen443e5012014-10-15 15:48:21 -0700123 * @see TelecomServiceImpl#isVoiceMailNumber
124 */
Svet Ganov16a16892015-04-16 10:32:04 -0700125 boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
126 String callingPackage);
Nancy Chen443e5012014-10-15 15:48:21 -0700127
128 /**
Yorke Lee49e2d462015-04-15 16:14:22 -0700129 * @see TelecomServiceImpl#getVoiceMailNumber
Nancy Chen8c066f72014-12-03 15:18:08 -0800130 */
Svet Ganov16a16892015-04-16 10:32:04 -0700131 String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen8c066f72014-12-03 15:18:08 -0800132
133 /**
Nancy Chen5cf27842015-01-24 23:30:27 -0800134 * @see TelecomServiceImpl#getLine1Number
135 */
Svet Ganov16a16892015-04-16 10:32:04 -0700136 String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen5cf27842015-01-24 23:30:27 -0800137
138 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700139 * @see TelecomServiceImpl#getDefaultPhoneApp
Santos Cordon6c7a3882014-06-25 15:30:08 -0700140 */
141 ComponentName getDefaultPhoneApp();
Santos Cordon9eb45932014-06-27 12:28:43 -0700142
Yorke Lee1011f482015-04-23 15:58:27 -0700143 /**
144 * @see TelecomServiceImpl#getDefaultDialerPackage
145 */
146 String getDefaultDialerPackage();
147
148 /**
149 * @see TelecomServiceImpl#getSystemDialerPackage
150 */
151 String getSystemDialerPackage();
152
Hall Liu0464b9b2016-01-12 15:32:58 -0800153 /**
154 * @see TelecomServiceImpl#dumpCallAnalytics
155 */
Hall Liu057def52016-05-05 17:17:07 -0700156 TelecomAnalytics dumpCallAnalytics();
Hall Liu0464b9b2016-01-12 15:32:58 -0800157
Santos Cordon9eb45932014-06-27 12:28:43 -0700158 //
159 // Internal system apis relating to call management.
160 //
161
162 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700163 * @see TelecomServiceImpl#silenceRinger
Santos Cordon9eb45932014-06-27 12:28:43 -0700164 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700165 void silenceRinger(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700166
167 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700168 * @see TelecomServiceImpl#isInCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700169 */
Svet Ganov16a16892015-04-16 10:32:04 -0700170 boolean isInCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700171
172 /**
Tyler Gunn24e18332017-02-10 09:42:49 -0800173 * @see TelecomServiceImpl#isInManagedCall
174 */
175 boolean isInManagedCall(String callingPackage);
176
177 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700178 * @see TelecomServiceImpl#isRinging
Santos Cordon9eb45932014-06-27 12:28:43 -0700179 */
Svet Ganov16a16892015-04-16 10:32:04 -0700180 boolean isRinging(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700181
182 /**
Yorke Lee2ae312e2014-09-12 17:58:48 -0700183 * @see TelecomServiceImpl#getCallState
184 */
Andrei Oneafa152f92019-02-27 15:58:05 +0000185 @UnsupportedAppUsage
Yorke Lee2ae312e2014-09-12 17:58:48 -0700186 int getCallState();
187
188 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700189 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700190 */
Tyler Gunnc8658812018-02-07 16:08:27 -0800191 boolean endCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700192
193 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700194 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700195 */
Eugene Suslacae3d3e2017-01-31 11:08:11 -0800196 void acceptRingingCall(String callingPackage);
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700197
198 /**
Tyler Gunn6676bb52015-10-23 14:39:49 -0700199 * @see TelecomServiceImpl#acceptRingingCallWithVideoState(int)
200 */
Eugene Suslacae3d3e2017-01-31 11:08:11 -0800201 void acceptRingingCallWithVideoState(String callingPackage, int videoState);
Tyler Gunn6676bb52015-10-23 14:39:49 -0700202
203 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700204 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700205 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700206 void cancelMissedCallsNotification(String callingPackage);
Santos Cordon0bae09f2014-07-07 14:53:10 -0700207
208 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700209 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700210 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700211 boolean handlePinMmi(String dialString, String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700212
213 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700214 * @see TelecomServiceImpl#handleMmi
215 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700216 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
217 String callingPackage);
Nancy Chen95e8a672014-10-16 18:38:21 -0700218
219 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700220 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
221 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700222 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chenb2299c12014-10-29 18:22:11 -0700223
224 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700225 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700226 */
Svet Ganov16a16892015-04-16 10:32:04 -0700227 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700228
229 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700230 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700231 */
Svet Ganov16a16892015-04-16 10:32:04 -0700232 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700233
234 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700235 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700236 */
237 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700238
239 /**
240 * @see TelecomServiceImpl#addNewUnknownCall
241 */
242 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700243
244 /**
245 * @see TelecomServiceImpl#placeCall
246 */
247 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon91371dc2015-05-08 13:52:09 -0700248
249 /**
250 * @see TelecomServiceImpl#enablePhoneAccount
251 */
Yorke Leedb6da482015-06-02 13:55:25 -0700252 boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
253
254 /**
255 * @see TelecomServiceImpl#setDefaultDialer
256 */
257 boolean setDefaultDialer(in String packageName);
Abhijith Shastry5fe34132016-02-01 16:39:38 -0800258
259 /**
Abhijith Shastry1e6f8342016-02-29 11:17:52 -0800260 * @see TelecomServiceImpl#createManageBlockedNumbersIntent
261 **/
262 Intent createManageBlockedNumbersIntent();
Tyler Gunnf5035432017-01-09 09:43:12 -0800263
264 /**
265 * @see TelecomServiceImpl#isIncomingCallPermitted
266 */
267 boolean isIncomingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
268
269 /**
270 * @see TelecomServiceImpl#isOutgoingCallPermitted
271 */
272 boolean isOutgoingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
Tyler Gunn18dfc362017-02-06 20:47:04 -0800273
274 /**
275 * @see TelecomServiceImpl#waitOnHandler
276 */
277 void waitOnHandlers();
Sanket Padawea8eddd42017-11-03 11:07:35 -0700278
279 /**
280 * @see TelecomServiceImpl#acceptHandover
281 */
282 void acceptHandover(in Uri srcAddr, int videoState, in PhoneAccountHandle destAcct);
Tyler Gunn5bd90852018-09-21 09:37:07 -0700283
284 /**
285 * @see TelecomServiceImpl#isInEmergencyCall
286 */
287 boolean isInEmergencyCall();
Tyler Gunnc37445c2018-09-28 16:16:20 -0700288
Tyler Gunn1965bb12019-01-16 10:42:14 -0800289 oneway void reportNuisanceCallStatus(in Uri address, boolean isNuisance, String callingPackage);
290
Tyler Gunnc37445c2018-09-28 16:16:20 -0700291 /**
292 * @see TelecomServiceImpl#handleCallIntent
293 */
294 void handleCallIntent(in Intent intent);
Tyler Gunn8b68d772018-11-21 15:11:36 -0800295
sqian6dcf8872018-12-07 19:35:02 -0800296 void setTestDefaultCallRedirectionApp(String packageName);
297
Hall Liuc47570d2018-12-06 17:53:25 -0800298 void setTestPhoneAcctSuggestionComponent(String flattenedComponentName);
299
Tyler Gunn8b68d772018-11-21 15:11:36 -0800300 void setTestDefaultCallScreeningApp(String packageName);
301
302 void addOrRemoveTestCallCompanionApp(String packageName, boolean isAdded);
303
304 void setTestAutoModeApp(String packageName);
Tyler Gunn1965bb12019-01-16 10:42:14 -0800305
Santos Cordon3afed572014-05-21 15:22:12 -0700306}