blob: 49f2aadbb0009ad0f70eba3a573ef8ae292f1021 [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;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070020import android.telecom.PhoneAccountHandle;
Nancy Chenb2299c12014-10-29 18:22:11 -070021import android.net.Uri;
Santos Cordon96efb482014-07-19 14:57:05 -070022import android.os.Bundle;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070023import android.telecom.PhoneAccount;
Yorke Lee2e024702014-06-13 09:59:43 -070024
Santos Cordon3afed572014-05-21 15:22:12 -070025/**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070026 * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
Santos Cordon3afed572014-05-21 15:22:12 -070027 * commands that were previously handled by ITelephony.
28 * {@hide}
29 */
Tyler Gunnef9f6f92014-09-12 22:16:17 -070030interface ITelecomService {
Santos Cordon3534ede2014-05-29 13:07:10 -070031 /**
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 */
Svet Ganov16a16892015-04-16 10:32:04 -070036 void showInCallScreen(boolean showDialpad, String callingPackage);
Yorke Lee2e024702014-06-13 09:59:43 -070037
38 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070039 * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
Ihab Awad94cf4bf2014-07-17 11:21:19 -070040 */
Svet Ganov16a16892015-04-16 10:32:04 -070041 PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage);
Ihab Awad94cf4bf2014-07-17 11:21:19 -070042
43 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070044 * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount
Andrew Lee59cac3a2014-08-28 16:50:10 -070045 */
Andrew Leed4abbfb2014-09-03 14:58:27 -070046 PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
47
48 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070049 * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount
Andrew Leed4abbfb2014-09-03 14:58:27 -070050 */
51 void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
Andrew Lee59cac3a2014-08-28 16:50:10 -070052
53 /**
Nancy Chen210ef032014-09-15 17:58:42 -070054 * @see TelecomServiceImpl#getCallCapablePhoneAccounts
Ihab Awadc35ad022014-06-12 16:29:42 -070055 */
Svet Ganov16a16892015-04-16 10:32:04 -070056 List<PhoneAccountHandle> getCallCapablePhoneAccounts(String callingPackage);
Ihab Awadc35ad022014-06-12 16:29:42 -070057
58 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070059 * @see TelecomManager#getPhoneAccountsSupportingScheme
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070060 */
Svet Ganov16a16892015-04-16 10:32:04 -070061 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
62 String callingPackage);
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070063
64 /**
Nancy Chen513c8922014-09-17 14:47:20 -070065 * @see TelecomManager#getPhoneAccountsForPackage
66 */
67 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
68
69 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070070 * @see TelecomManager#getPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -070071 */
Evan Charlton8c8a0622014-07-20 12:31:00 -070072 PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
Ihab Awadc35ad022014-06-12 16:29:42 -070073
74 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070075 * @see TelecomManager#getAllPhoneAccountsCount
Tyler Gunna1ed7d12014-09-08 09:52:22 -070076 */
77 int getAllPhoneAccountsCount();
78
79 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070080 * @see TelecomManager#getAllPhoneAccounts
Tyler Gunna1ed7d12014-09-08 09:52:22 -070081 */
82 List<PhoneAccount> getAllPhoneAccounts();
83
84 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070085 * @see TelecomManager#getAllPhoneAccountHandles
Tyler Gunna1ed7d12014-09-08 09:52:22 -070086 */
87 List<PhoneAccountHandle> getAllPhoneAccountHandles();
88
89 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070090 * @see TelecomServiceImpl#getSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070091 */
92 PhoneAccountHandle getSimCallManager();
93
94 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070095 * @see TelecomServiceImpl#setSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070096 */
97 void setSimCallManager(in PhoneAccountHandle account);
98
99 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700100 * @see TelecomServiceImpl#getSimCallManagers
Andrew Lee59cac3a2014-08-28 16:50:10 -0700101 */
Svet Ganov16a16892015-04-16 10:32:04 -0700102 List<PhoneAccountHandle> getSimCallManagers(String callingPackage);
Andrew Lee59cac3a2014-08-28 16:50:10 -0700103
104 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700105 * @see TelecomServiceImpl#registerPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -0700106 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700107 void registerPhoneAccount(in PhoneAccount metadata);
Santos Cordon6c7a3882014-06-25 15:30:08 -0700108
109 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700110 * @see TelecomServiceImpl#unregisterPhoneAccount
Ihab Awad807fe0a2014-07-09 12:30:52 -0700111 */
Evan Charlton6eb262c2014-07-19 18:18:19 -0700112 void unregisterPhoneAccount(in PhoneAccountHandle account);
Ihab Awad807fe0a2014-07-09 12:30:52 -0700113
114 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700115 * @see TelecomServiceImpl#clearAccounts
Ihab Awad807fe0a2014-07-09 12:30:52 -0700116 */
117 void clearAccounts(String packageName);
118
119 /**
Nancy Chen443e5012014-10-15 15:48:21 -0700120 * @see TelecomServiceImpl#isVoiceMailNumber
121 */
Svet Ganov16a16892015-04-16 10:32:04 -0700122 boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
123 String callingPackage);
Nancy Chen443e5012014-10-15 15:48:21 -0700124
125 /**
Yorke Lee49e2d462015-04-15 16:14:22 -0700126 * @see TelecomServiceImpl#getVoiceMailNumber
Nancy Chen8c066f72014-12-03 15:18:08 -0800127 */
Svet Ganov16a16892015-04-16 10:32:04 -0700128 String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen8c066f72014-12-03 15:18:08 -0800129
130 /**
Nancy Chen5cf27842015-01-24 23:30:27 -0800131 * @see TelecomServiceImpl#getLine1Number
132 */
Svet Ganov16a16892015-04-16 10:32:04 -0700133 String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen5cf27842015-01-24 23:30:27 -0800134
135 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700136 * @see TelecomServiceImpl#getDefaultPhoneApp
Santos Cordon6c7a3882014-06-25 15:30:08 -0700137 */
138 ComponentName getDefaultPhoneApp();
Santos Cordon9eb45932014-06-27 12:28:43 -0700139
Yorke Lee1011f482015-04-23 15:58:27 -0700140 /**
141 * @see TelecomServiceImpl#getDefaultDialerPackage
142 */
143 String getDefaultDialerPackage();
144
145 /**
146 * @see TelecomServiceImpl#getSystemDialerPackage
147 */
148 String getSystemDialerPackage();
149
Santos Cordon9eb45932014-06-27 12:28:43 -0700150 //
151 // Internal system apis relating to call management.
152 //
153
154 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700155 * @see TelecomServiceImpl#silenceRinger
Santos Cordon9eb45932014-06-27 12:28:43 -0700156 */
157 void silenceRinger();
158
159 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700160 * @see TelecomServiceImpl#isInCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700161 */
Svet Ganov16a16892015-04-16 10:32:04 -0700162 boolean isInCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700163
164 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700165 * @see TelecomServiceImpl#isRinging
Santos Cordon9eb45932014-06-27 12:28:43 -0700166 */
Svet Ganov16a16892015-04-16 10:32:04 -0700167 boolean isRinging(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700168
169 /**
Yorke Lee2ae312e2014-09-12 17:58:48 -0700170 * @see TelecomServiceImpl#getCallState
171 */
172 int getCallState();
173
174 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700175 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700176 */
177 boolean endCall();
178
179 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700180 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700181 */
182 void acceptRingingCall();
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700183
184 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700185 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700186 */
187 void cancelMissedCallsNotification();
Santos Cordon0bae09f2014-07-07 14:53:10 -0700188
189 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700190 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700191 */
192 boolean handlePinMmi(String dialString);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700193
194 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700195 * @see TelecomServiceImpl#handleMmi
196 */
197 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString);
198
199 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700200 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
201 */
202 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle);
203
204 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700205 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700206 */
Svet Ganov16a16892015-04-16 10:32:04 -0700207 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700208
209 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700210 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700211 */
Svet Ganov16a16892015-04-16 10:32:04 -0700212 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700213
214 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700215 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700216 */
217 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700218
219 /**
220 * @see TelecomServiceImpl#addNewUnknownCall
221 */
222 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700223
224 /**
225 * @see TelecomServiceImpl#placeCall
226 */
227 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon3afed572014-05-21 15:22:12 -0700228}