• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package com.android.internal.telecom;
18 
19 import android.content.ComponentName;
20 import android.content.Intent;
21 import android.telecom.TelecomAnalytics;
22 import android.telecom.PhoneAccountHandle;
23 import android.net.Uri;
24 import android.os.Bundle;
25 import android.telecom.PhoneAccount;
26 
27 /**
28  * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
29  * commands that were previously handled by ITelephony.
30  * {@hide}
31  */
32 interface ITelecomService {
33     /**
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      */
showInCallScreen(boolean showDialpad, String callingPackage, String callingFeatureId)38     void showInCallScreen(boolean showDialpad, String callingPackage, String callingFeatureId);
39 
40     /**
41      * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
42      */
getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage, String callingFeatureId)43     PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage,
44             String callingFeatureId);
45 
46     /**
47      * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount
48      */
getUserSelectedOutgoingPhoneAccount(String callingPackage)49     PhoneAccountHandle getUserSelectedOutgoingPhoneAccount(String callingPackage);
50 
51     /**
52      * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount
53      */
setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account)54     void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
55 
56     /**
57      * @see TelecomServiceImpl#getCallCapablePhoneAccounts
58      */
getCallCapablePhoneAccounts( boolean includeDisabledAccounts, String callingPackage, String callingFeatureId)59     List<PhoneAccountHandle> getCallCapablePhoneAccounts(
60             boolean includeDisabledAccounts, String callingPackage, String callingFeatureId);
61 
62     /**
63      * @see TelecomServiceImpl#getSelfManagedPhoneAccounts
64      */
getSelfManagedPhoneAccounts(String callingPackage, String callingFeatureId)65     List<PhoneAccountHandle> getSelfManagedPhoneAccounts(String callingPackage,
66             String callingFeatureId);
67 
68     /**
69      * @see TelecomManager#getPhoneAccountsSupportingScheme
70      */
getPhoneAccountsSupportingScheme(in String uriScheme, String callingPackage)71     List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
72             String callingPackage);
73 
74     /**
75      * @see TelecomManager#getPhoneAccountsForPackage
76      */
getPhoneAccountsForPackage(in String packageName)77     List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
78 
79     /**
80      * @see TelecomManager#getPhoneAccount
81      */
getPhoneAccount(in PhoneAccountHandle account)82     PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
83 
84     /**
85      * @see TelecomManager#getAllPhoneAccountsCount
86      */
getAllPhoneAccountsCount()87     int getAllPhoneAccountsCount();
88 
89     /**
90      * @see TelecomManager#getAllPhoneAccounts
91      */
getAllPhoneAccounts()92     List<PhoneAccount> getAllPhoneAccounts();
93 
94     /**
95      * @see TelecomManager#getAllPhoneAccountHandles
96      */
getAllPhoneAccountHandles()97     List<PhoneAccountHandle> getAllPhoneAccountHandles();
98 
99     /**
100      * @see TelecomServiceImpl#getSimCallManager
101      */
getSimCallManager(int subId)102     PhoneAccountHandle getSimCallManager(int subId);
103 
104     /**
105      * @see TelecomServiceImpl#getSimCallManagerForUser
106      */
getSimCallManagerForUser(int userId)107     PhoneAccountHandle getSimCallManagerForUser(int userId);
108 
109     /**
110      * @see TelecomServiceImpl#registerPhoneAccount
111      */
registerPhoneAccount(in PhoneAccount metadata)112     void registerPhoneAccount(in PhoneAccount metadata);
113 
114     /**
115      * @see TelecomServiceImpl#unregisterPhoneAccount
116      */
unregisterPhoneAccount(in PhoneAccountHandle account)117     void unregisterPhoneAccount(in PhoneAccountHandle account);
118 
119     /**
120      * @see TelecomServiceImpl#clearAccounts
121      */
clearAccounts(String packageName)122     void clearAccounts(String packageName);
123 
124     /**
125      * @see TelecomServiceImpl#isVoiceMailNumber
126      */
isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number, String callingPackage, String callingFeatureId)127     boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
128             String callingPackage, String callingFeatureId);
129 
130     /**
131      * @see TelecomServiceImpl#getVoiceMailNumber
132      */
getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage, String callingFeatureId)133     String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage,
134             String callingFeatureId);
135 
136     /**
137      * @see TelecomServiceImpl#getLine1Number
138      */
getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage, String callingFeatureId)139     String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage,
140             String callingFeatureId);
141 
142     /**
143      * @see TelecomServiceImpl#getDefaultPhoneApp
144      */
getDefaultPhoneApp()145     ComponentName getDefaultPhoneApp();
146 
147     /**
148      * @see TelecomServiceImpl#getDefaultDialerPackage
149      */
getDefaultDialerPackage()150     String getDefaultDialerPackage();
151 
152     /**
153      * @see TelecomServiceImpl#getDefaultDialerPackage
154      */
getDefaultDialerPackageForUser(int userId)155     String getDefaultDialerPackageForUser(int userId);
156 
157     /**
158      * @see TelecomServiceImpl#getSystemDialerPackage
159      */
getSystemDialerPackage()160     String getSystemDialerPackage();
161 
162     /**
163     * @see TelecomServiceImpl#dumpCallAnalytics
164     */
dumpCallAnalytics()165     TelecomAnalytics dumpCallAnalytics();
166 
167     //
168     // Internal system apis relating to call management.
169     //
170 
171     /**
172      * @see TelecomServiceImpl#silenceRinger
173      */
silenceRinger(String callingPackage)174     void silenceRinger(String callingPackage);
175 
176     /**
177      * @see TelecomServiceImpl#isInCall
178      */
isInCall(String callingPackage, String callingFeatureId)179     boolean isInCall(String callingPackage, String callingFeatureId);
180 
181     /**
182      * @see TelecomServiceImpl#isInManagedCall
183      */
isInManagedCall(String callingPackage, String callingFeatureId)184     boolean isInManagedCall(String callingPackage, String callingFeatureId);
185 
186     /**
187      * @see TelecomServiceImpl#isRinging
188      */
isRinging(String callingPackage)189     boolean isRinging(String callingPackage);
190 
191     /**
192      * @see TelecomServiceImpl#getCallState
193      */
194     @UnsupportedAppUsage
getCallState()195     int getCallState();
196 
197     /**
198      * @see TelecomServiceImpl#endCall
199      */
endCall(String callingPackage)200     boolean endCall(String callingPackage);
201 
202     /**
203      * @see TelecomServiceImpl#acceptRingingCall
204      */
acceptRingingCall(String callingPackage)205     void acceptRingingCall(String callingPackage);
206 
207     /**
208      * @see TelecomServiceImpl#acceptRingingCallWithVideoState(int)
209      */
acceptRingingCallWithVideoState(String callingPackage, int videoState)210     void acceptRingingCallWithVideoState(String callingPackage, int videoState);
211 
212     /**
213      * @see TelecomServiceImpl#cancelMissedCallsNotification
214      */
cancelMissedCallsNotification(String callingPackage)215     void cancelMissedCallsNotification(String callingPackage);
216 
217     /**
218      * @see TelecomServiceImpl#handleMmi
219      */
handlePinMmi(String dialString, String callingPackage)220     boolean handlePinMmi(String dialString, String callingPackage);
221 
222     /**
223      * @see TelecomServiceImpl#handleMmi
224      */
handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString, String callingPackage)225     boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
226             String callingPackage);
227 
228     /**
229      * @see TelecomServiceImpl#getAdnUriForPhoneAccount
230      */
getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage)231     Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
232 
233     /**
234      * @see TelecomServiceImpl#isTtySupported
235      */
isTtySupported(String callingPackage, String callingFeatureId)236     boolean isTtySupported(String callingPackage, String callingFeatureId);
237 
238     /**
239      * @see TelecomServiceImpl#getCurrentTtyMode
240      */
getCurrentTtyMode(String callingPackage, String callingFeatureId)241     int getCurrentTtyMode(String callingPackage, String callingFeatureId);
242 
243     /**
244      * @see TelecomServiceImpl#addNewIncomingCall
245      */
addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras)246     void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
247 
248     /**
249      * @see TelecomServiceImpl#addNewIncomingConference
250      */
addNewIncomingConference(in PhoneAccountHandle phoneAccount, in Bundle extras)251     void addNewIncomingConference(in PhoneAccountHandle phoneAccount, in Bundle extras);
252 
253     /**
254      * @see TelecomServiceImpl#addNewUnknownCall
255      */
addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras)256     void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
257 
258     /**
259      * @see TelecomServiceImpl#startConference
260      */
startConference(in List<Uri> participants, in Bundle extras, String callingPackage)261     void startConference(in List<Uri> participants, in Bundle extras,
262             String callingPackage);
263 
264     /**
265      * @see TelecomServiceImpl#placeCall
266      */
placeCall(in Uri handle, in Bundle extras, String callingPackage, String callingFeatureId)267     void placeCall(in Uri handle, in Bundle extras, String callingPackage, String callingFeatureId);
268 
269     /**
270      * @see TelecomServiceImpl#enablePhoneAccount
271      */
enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled)272     boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
273 
274     /**
275      * @see TelecomServiceImpl#setDefaultDialer
276      */
setDefaultDialer(in String packageName)277     boolean setDefaultDialer(in String packageName);
278 
279     /**
280      * Stop suppressing blocked numbers after a call to emergency services. Shell only.
281      */
stopBlockSuppression()282     void stopBlockSuppression();
283 
284     /**
285     * @see TelecomServiceImpl#createManageBlockedNumbersIntent
286     **/
createManageBlockedNumbersIntent()287     Intent createManageBlockedNumbersIntent();
288 
289    /**
290     * @see TelecomServiceImpl#createLaunchEmergencyDialerIntent
291     */
createLaunchEmergencyDialerIntent(in String number)292     Intent createLaunchEmergencyDialerIntent(in String number);
293 
294     /**
295      * @see TelecomServiceImpl#isIncomingCallPermitted
296      */
isIncomingCallPermitted(in PhoneAccountHandle phoneAccountHandle)297     boolean isIncomingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
298 
299     /**
300      * @see TelecomServiceImpl#isOutgoingCallPermitted
301      */
isOutgoingCallPermitted(in PhoneAccountHandle phoneAccountHandle)302     boolean isOutgoingCallPermitted(in PhoneAccountHandle phoneAccountHandle);
303 
304     /**
305      * @see TelecomServiceImpl#waitOnHandler
306      */
waitOnHandlers()307     void waitOnHandlers();
308 
309     /**
310      * @see TelecomServiceImpl#acceptHandover
311      */
acceptHandover(in Uri srcAddr, int videoState, in PhoneAccountHandle destAcct)312     void acceptHandover(in Uri srcAddr, int videoState, in PhoneAccountHandle destAcct);
313 
314     /**
315      * @see TelecomServiceImpl#setTestEmergencyPhoneAccountPackageNameFilter
316      */
setTestEmergencyPhoneAccountPackageNameFilter(String packageName)317     void setTestEmergencyPhoneAccountPackageNameFilter(String packageName);
318 
319     /**
320      * @see TelecomServiceImpl#isInEmergencyCall
321      */
isInEmergencyCall()322     boolean isInEmergencyCall();
323 
324     /**
325      * @see TelecomServiceImpl#handleCallIntent
326      */
handleCallIntent(in Intent intent, in String callingPackageProxy)327     void handleCallIntent(in Intent intent, in String callingPackageProxy);
328 
setTestDefaultCallRedirectionApp(String packageName)329     void setTestDefaultCallRedirectionApp(String packageName);
330 
setTestPhoneAcctSuggestionComponent(String flattenedComponentName)331     void setTestPhoneAcctSuggestionComponent(String flattenedComponentName);
332 
setTestDefaultCallScreeningApp(String packageName)333     void setTestDefaultCallScreeningApp(String packageName);
334 
addOrRemoveTestCallCompanionApp(String packageName, boolean isAdded)335     void addOrRemoveTestCallCompanionApp(String packageName, boolean isAdded);
336 
337     /**
338      * @see TelecomServiceImpl#setSystemDialer
339      */
setSystemDialer(in ComponentName testComponentName)340     void setSystemDialer(in ComponentName testComponentName);
341 
342     /**
343      * @see TelecomServiceImpl#setTestDefaultDialer
344      */
setTestDefaultDialer(in String packageName)345     void setTestDefaultDialer(in String packageName);
346 
347 }
348