blob: d9465dce49d29d8b0269262728f3028ceb8bbab4 [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 Gunnef9f6f92014-09-12 22:16:17 -070062 * @see TelecomManager#getPhoneAccountsSupportingScheme
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070063 */
Svet Ganov16a16892015-04-16 10:32:04 -070064 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
65 String callingPackage);
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070066
67 /**
Nancy Chen513c8922014-09-17 14:47:20 -070068 * @see TelecomManager#getPhoneAccountsForPackage
69 */
70 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
71
72 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070073 * @see TelecomManager#getPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -070074 */
Evan Charlton8c8a0622014-07-20 12:31:00 -070075 PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
Ihab Awadc35ad022014-06-12 16:29:42 -070076
77 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070078 * @see TelecomManager#getAllPhoneAccountsCount
Tyler Gunna1ed7d12014-09-08 09:52:22 -070079 */
80 int getAllPhoneAccountsCount();
81
82 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070083 * @see TelecomManager#getAllPhoneAccounts
Tyler Gunna1ed7d12014-09-08 09:52:22 -070084 */
85 List<PhoneAccount> getAllPhoneAccounts();
86
87 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070088 * @see TelecomManager#getAllPhoneAccountHandles
Tyler Gunna1ed7d12014-09-08 09:52:22 -070089 */
90 List<PhoneAccountHandle> getAllPhoneAccountHandles();
91
92 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070093 * @see TelecomServiceImpl#getSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070094 */
95 PhoneAccountHandle getSimCallManager();
96
97 /**
Sailesh Nepalcf855622015-07-28 19:22:14 -070098 * @see TelecomServiceImpl#getSimCallManagerForUser
99 */
100 PhoneAccountHandle getSimCallManagerForUser(int userId);
101
102 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700103 * @see TelecomServiceImpl#registerPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -0700104 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700105 void registerPhoneAccount(in PhoneAccount metadata);
Santos Cordon6c7a3882014-06-25 15:30:08 -0700106
107 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700108 * @see TelecomServiceImpl#unregisterPhoneAccount
Ihab Awad807fe0a2014-07-09 12:30:52 -0700109 */
Evan Charlton6eb262c2014-07-19 18:18:19 -0700110 void unregisterPhoneAccount(in PhoneAccountHandle account);
Ihab Awad807fe0a2014-07-09 12:30:52 -0700111
112 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700113 * @see TelecomServiceImpl#clearAccounts
Ihab Awad807fe0a2014-07-09 12:30:52 -0700114 */
115 void clearAccounts(String packageName);
116
117 /**
Nancy Chen443e5012014-10-15 15:48:21 -0700118 * @see TelecomServiceImpl#isVoiceMailNumber
119 */
Svet Ganov16a16892015-04-16 10:32:04 -0700120 boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
121 String callingPackage);
Nancy Chen443e5012014-10-15 15:48:21 -0700122
123 /**
Yorke Lee49e2d462015-04-15 16:14:22 -0700124 * @see TelecomServiceImpl#getVoiceMailNumber
Nancy Chen8c066f72014-12-03 15:18:08 -0800125 */
Svet Ganov16a16892015-04-16 10:32:04 -0700126 String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen8c066f72014-12-03 15:18:08 -0800127
128 /**
Nancy Chen5cf27842015-01-24 23:30:27 -0800129 * @see TelecomServiceImpl#getLine1Number
130 */
Svet Ganov16a16892015-04-16 10:32:04 -0700131 String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen5cf27842015-01-24 23:30:27 -0800132
133 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700134 * @see TelecomServiceImpl#getDefaultPhoneApp
Santos Cordon6c7a3882014-06-25 15:30:08 -0700135 */
136 ComponentName getDefaultPhoneApp();
Santos Cordon9eb45932014-06-27 12:28:43 -0700137
Yorke Lee1011f482015-04-23 15:58:27 -0700138 /**
139 * @see TelecomServiceImpl#getDefaultDialerPackage
140 */
141 String getDefaultDialerPackage();
142
143 /**
144 * @see TelecomServiceImpl#getSystemDialerPackage
145 */
146 String getSystemDialerPackage();
147
Hall Liu0464b9b2016-01-12 15:32:58 -0800148 /**
149 * @see TelecomServiceImpl#dumpCallAnalytics
150 */
Hall Liu057def52016-05-05 17:17:07 -0700151 TelecomAnalytics dumpCallAnalytics();
Hall Liu0464b9b2016-01-12 15:32:58 -0800152
Santos Cordon9eb45932014-06-27 12:28:43 -0700153 //
154 // Internal system apis relating to call management.
155 //
156
157 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700158 * @see TelecomServiceImpl#silenceRinger
Santos Cordon9eb45932014-06-27 12:28:43 -0700159 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700160 void silenceRinger(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700161
162 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700163 * @see TelecomServiceImpl#isInCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700164 */
Svet Ganov16a16892015-04-16 10:32:04 -0700165 boolean isInCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700166
167 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700168 * @see TelecomServiceImpl#isRinging
Santos Cordon9eb45932014-06-27 12:28:43 -0700169 */
Svet Ganov16a16892015-04-16 10:32:04 -0700170 boolean isRinging(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700171
172 /**
Yorke Lee2ae312e2014-09-12 17:58:48 -0700173 * @see TelecomServiceImpl#getCallState
174 */
175 int getCallState();
176
177 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700178 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700179 */
180 boolean endCall();
181
182 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700183 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700184 */
185 void acceptRingingCall();
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700186
187 /**
Tyler Gunn6676bb52015-10-23 14:39:49 -0700188 * @see TelecomServiceImpl#acceptRingingCallWithVideoState(int)
189 */
190 void acceptRingingCallWithVideoState(int videoState);
191
192 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700193 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700194 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700195 void cancelMissedCallsNotification(String callingPackage);
Santos Cordon0bae09f2014-07-07 14:53:10 -0700196
197 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700198 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700199 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700200 boolean handlePinMmi(String dialString, String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700201
202 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700203 * @see TelecomServiceImpl#handleMmi
204 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700205 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
206 String callingPackage);
Nancy Chen95e8a672014-10-16 18:38:21 -0700207
208 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700209 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
210 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700211 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chenb2299c12014-10-29 18:22:11 -0700212
213 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700214 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700215 */
Svet Ganov16a16892015-04-16 10:32:04 -0700216 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700217
218 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700219 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700220 */
Svet Ganov16a16892015-04-16 10:32:04 -0700221 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700222
223 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700224 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700225 */
226 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700227
228 /**
229 * @see TelecomServiceImpl#addNewUnknownCall
230 */
231 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700232
233 /**
234 * @see TelecomServiceImpl#placeCall
235 */
236 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon91371dc2015-05-08 13:52:09 -0700237
238 /**
239 * @see TelecomServiceImpl#enablePhoneAccount
240 */
Yorke Leedb6da482015-06-02 13:55:25 -0700241 boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
242
243 /**
244 * @see TelecomServiceImpl#setDefaultDialer
245 */
246 boolean setDefaultDialer(in String packageName);
Abhijith Shastry5fe34132016-02-01 16:39:38 -0800247
248 /**
Abhijith Shastry1e6f8342016-02-29 11:17:52 -0800249 * @see TelecomServiceImpl#createManageBlockedNumbersIntent
250 **/
251 Intent createManageBlockedNumbersIntent();
Tyler Gunnf5035432017-01-09 09:43:12 -0800252
253 /**
254 * @see TelecomServiceImpl#isIncomingCallPermitted
255 */
256 boolean isIncomingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
257
258 /**
259 * @see TelecomServiceImpl#isOutgoingCallPermitted
260 */
261 boolean isOutgoingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
Tyler Gunn18dfc362017-02-06 20:47:04 -0800262
263 /**
264 * @see TelecomServiceImpl#waitOnHandler
265 */
266 void waitOnHandlers();
Santos Cordon3afed572014-05-21 15:22:12 -0700267}