blob: 8ebac2c6273a76d83d85eb09fe5a7d939fca7262 [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 */
Andrew Leed4abbfb2014-09-03 14:58:27 -070048 PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
49
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 */
185 int getCallState();
186
187 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700188 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700189 */
190 boolean endCall();
191
192 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700193 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700194 */
Eugene Suslacae3d3e2017-01-31 11:08:11 -0800195 void acceptRingingCall(String callingPackage);
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700196
197 /**
Tyler Gunn6676bb52015-10-23 14:39:49 -0700198 * @see TelecomServiceImpl#acceptRingingCallWithVideoState(int)
199 */
Eugene Suslacae3d3e2017-01-31 11:08:11 -0800200 void acceptRingingCallWithVideoState(String callingPackage, int videoState);
Tyler Gunn6676bb52015-10-23 14:39:49 -0700201
202 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700203 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700204 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700205 void cancelMissedCallsNotification(String callingPackage);
Santos Cordon0bae09f2014-07-07 14:53:10 -0700206
207 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700208 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700209 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700210 boolean handlePinMmi(String dialString, String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700211
212 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700213 * @see TelecomServiceImpl#handleMmi
214 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700215 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
216 String callingPackage);
Nancy Chen95e8a672014-10-16 18:38:21 -0700217
218 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700219 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
220 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700221 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chenb2299c12014-10-29 18:22:11 -0700222
223 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700224 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700225 */
Svet Ganov16a16892015-04-16 10:32:04 -0700226 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700227
228 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700229 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700230 */
Svet Ganov16a16892015-04-16 10:32:04 -0700231 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700232
233 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700234 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700235 */
236 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700237
238 /**
239 * @see TelecomServiceImpl#addNewUnknownCall
240 */
241 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700242
243 /**
244 * @see TelecomServiceImpl#placeCall
245 */
246 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon91371dc2015-05-08 13:52:09 -0700247
248 /**
249 * @see TelecomServiceImpl#enablePhoneAccount
250 */
Yorke Leedb6da482015-06-02 13:55:25 -0700251 boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
252
253 /**
254 * @see TelecomServiceImpl#setDefaultDialer
255 */
256 boolean setDefaultDialer(in String packageName);
Abhijith Shastry5fe34132016-02-01 16:39:38 -0800257
258 /**
Abhijith Shastry1e6f8342016-02-29 11:17:52 -0800259 * @see TelecomServiceImpl#createManageBlockedNumbersIntent
260 **/
261 Intent createManageBlockedNumbersIntent();
Tyler Gunnf5035432017-01-09 09:43:12 -0800262
263 /**
264 * @see TelecomServiceImpl#isIncomingCallPermitted
265 */
266 boolean isIncomingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
267
268 /**
269 * @see TelecomServiceImpl#isOutgoingCallPermitted
270 */
271 boolean isOutgoingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
Tyler Gunn18dfc362017-02-06 20:47:04 -0800272
273 /**
274 * @see TelecomServiceImpl#waitOnHandler
275 */
276 void waitOnHandlers();
Santos Cordon3afed572014-05-21 15:22:12 -0700277}