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.telecom.PhoneAccountHandle;
21 import android.net.Uri;
22 import android.os.Bundle;
23 import android.telecom.PhoneAccount;
24 
25 /**
26  * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
27  * commands that were previously handled by ITelephony.
28  * {@hide}
29  */
30 interface ITelecomService {
31     /**
32      * Brings the in-call screen to the foreground if there is an active call.
33      *
34      * @param showDialpad if true, make the dialpad visible initially.
35      */
showInCallScreen(boolean showDialpad)36     void showInCallScreen(boolean showDialpad);
37 
38     /**
39      * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
40      */
getDefaultOutgoingPhoneAccount(in String uriScheme)41     PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme);
42 
43     /**
44      * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount
45      */
getUserSelectedOutgoingPhoneAccount()46     PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
47 
48     /**
49      * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount
50      */
setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account)51     void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
52 
53     /**
54      * @see TelecomServiceImpl#getCallCapablePhoneAccounts
55      */
getCallCapablePhoneAccounts()56     List<PhoneAccountHandle> getCallCapablePhoneAccounts();
57 
58     /**
59      * @see TelecomManager#getPhoneAccountsSupportingScheme
60      */
getPhoneAccountsSupportingScheme(in String uriScheme)61     List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme);
62 
63     /**
64      * @see TelecomManager#getPhoneAccountsForPackage
65      */
getPhoneAccountsForPackage(in String packageName)66     List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
67 
68     /**
69      * @see TelecomManager#getPhoneAccount
70      */
getPhoneAccount(in PhoneAccountHandle account)71     PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
72 
73     /**
74      * @see TelecomManager#getAllPhoneAccountsCount
75      */
getAllPhoneAccountsCount()76     int getAllPhoneAccountsCount();
77 
78     /**
79      * @see TelecomManager#getAllPhoneAccounts
80      */
getAllPhoneAccounts()81     List<PhoneAccount> getAllPhoneAccounts();
82 
83     /**
84      * @see TelecomManager#getAllPhoneAccountHandles
85      */
getAllPhoneAccountHandles()86     List<PhoneAccountHandle> getAllPhoneAccountHandles();
87 
88     /**
89      * @see TelecomServiceImpl#getSimCallManager
90      */
getSimCallManager()91     PhoneAccountHandle getSimCallManager();
92 
93     /**
94      * @see TelecomServiceImpl#setSimCallManager
95      */
setSimCallManager(in PhoneAccountHandle account)96     void setSimCallManager(in PhoneAccountHandle account);
97 
98     /**
99      * @see TelecomServiceImpl#getSimCallManagers
100      */
getSimCallManagers()101     List<PhoneAccountHandle> getSimCallManagers();
102 
103     /**
104      * @see TelecomServiceImpl#registerPhoneAccount
105      */
registerPhoneAccount(in PhoneAccount metadata)106     void registerPhoneAccount(in PhoneAccount metadata);
107 
108     /**
109      * @see TelecomServiceImpl#unregisterPhoneAccount
110      */
unregisterPhoneAccount(in PhoneAccountHandle account)111     void unregisterPhoneAccount(in PhoneAccountHandle account);
112 
113     /**
114      * @see TelecomServiceImpl#clearAccounts
115      */
clearAccounts(String packageName)116     void clearAccounts(String packageName);
117 
118     /**
119      * @see TelecomServiceImpl#isVoiceMailNumber
120      */
isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number)121     boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number);
122 
123     /**
124      * @see TelecomServiceImpl#hasVoiceMailNumber
125      */
hasVoiceMailNumber(in PhoneAccountHandle accountHandle)126     boolean hasVoiceMailNumber(in PhoneAccountHandle accountHandle);
127 
128     /**
129      * @see TelecomServiceImpl#getLine1Number
130      */
getLine1Number(in PhoneAccountHandle accountHandle)131     String getLine1Number(in PhoneAccountHandle accountHandle);
132 
133     /**
134      * @see TelecomServiceImpl#getDefaultPhoneApp
135      */
getDefaultPhoneApp()136     ComponentName getDefaultPhoneApp();
137 
138     //
139     // Internal system apis relating to call management.
140     //
141 
142     /**
143      * @see TelecomServiceImpl#silenceRinger
144      */
silenceRinger()145     void silenceRinger();
146 
147     /**
148      * @see TelecomServiceImpl#isInCall
149      */
isInCall()150     boolean isInCall();
151 
152     /**
153      * @see TelecomServiceImpl#isRinging
154      */
isRinging()155     boolean isRinging();
156 
157     /**
158      * @see TelecomServiceImpl#getCallState
159      */
getCallState()160     int getCallState();
161 
162     /**
163      * @see TelecomServiceImpl#endCall
164      */
endCall()165     boolean endCall();
166 
167     /**
168      * @see TelecomServiceImpl#acceptRingingCall
169      */
acceptRingingCall()170     void acceptRingingCall();
171 
172     /**
173      * @see TelecomServiceImpl#cancelMissedCallsNotification
174      */
cancelMissedCallsNotification()175     void cancelMissedCallsNotification();
176 
177     /**
178      * @see TelecomServiceImpl#handleMmi
179      */
handlePinMmi(String dialString)180     boolean handlePinMmi(String dialString);
181 
182     /**
183      * @see TelecomServiceImpl#handleMmi
184      */
handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString)185     boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString);
186 
187     /**
188      * @see TelecomServiceImpl#getAdnUriForPhoneAccount
189      */
getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle)190     Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle);
191 
192     /**
193      * @see TelecomServiceImpl#isTtySupported
194      */
isTtySupported()195     boolean isTtySupported();
196 
197     /**
198      * @see TelecomServiceImpl#getCurrentTtyMode
199      */
getCurrentTtyMode()200     int getCurrentTtyMode();
201 
202     /**
203      * @see TelecomServiceImpl#addNewIncomingCall
204      */
addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras)205     void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
206 
207     /**
208      * @see TelecomServiceImpl#addNewUnknownCall
209      */
addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras)210     void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
211 }
212