blob: ea6a74aa6d90e4d93cdd9bc1e6e3fdad1a67b4bf [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 */
Santos Cordon91371dc2015-05-08 13:52:09 -070056 List<PhoneAccountHandle> getCallCapablePhoneAccounts(
57 boolean includeDisabledAccounts, String callingPackage);
Ihab Awadc35ad022014-06-12 16:29:42 -070058
59 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070060 * @see TelecomManager#getPhoneAccountsSupportingScheme
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070061 */
Svet Ganov16a16892015-04-16 10:32:04 -070062 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
63 String callingPackage);
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070064
65 /**
Nancy Chen513c8922014-09-17 14:47:20 -070066 * @see TelecomManager#getPhoneAccountsForPackage
67 */
68 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
69
70 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070071 * @see TelecomManager#getPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -070072 */
Evan Charlton8c8a0622014-07-20 12:31:00 -070073 PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
Ihab Awadc35ad022014-06-12 16:29:42 -070074
75 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070076 * @see TelecomManager#getAllPhoneAccountsCount
Tyler Gunna1ed7d12014-09-08 09:52:22 -070077 */
78 int getAllPhoneAccountsCount();
79
80 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070081 * @see TelecomManager#getAllPhoneAccounts
Tyler Gunna1ed7d12014-09-08 09:52:22 -070082 */
83 List<PhoneAccount> getAllPhoneAccounts();
84
85 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070086 * @see TelecomManager#getAllPhoneAccountHandles
Tyler Gunna1ed7d12014-09-08 09:52:22 -070087 */
88 List<PhoneAccountHandle> getAllPhoneAccountHandles();
89
90 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070091 * @see TelecomServiceImpl#getSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070092 */
93 PhoneAccountHandle getSimCallManager();
94
95 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070096 * @see TelecomServiceImpl#setSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070097 */
98 void setSimCallManager(in PhoneAccountHandle account);
99
100 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700101 * @see TelecomServiceImpl#getSimCallManagers
Andrew Lee59cac3a2014-08-28 16:50:10 -0700102 */
Svet Ganov16a16892015-04-16 10:32:04 -0700103 List<PhoneAccountHandle> getSimCallManagers(String callingPackage);
Andrew Lee59cac3a2014-08-28 16:50:10 -0700104
105 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700106 * @see TelecomServiceImpl#registerPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -0700107 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700108 void registerPhoneAccount(in PhoneAccount metadata);
Santos Cordon6c7a3882014-06-25 15:30:08 -0700109
110 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700111 * @see TelecomServiceImpl#unregisterPhoneAccount
Ihab Awad807fe0a2014-07-09 12:30:52 -0700112 */
Evan Charlton6eb262c2014-07-19 18:18:19 -0700113 void unregisterPhoneAccount(in PhoneAccountHandle account);
Ihab Awad807fe0a2014-07-09 12:30:52 -0700114
115 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700116 * @see TelecomServiceImpl#clearAccounts
Ihab Awad807fe0a2014-07-09 12:30:52 -0700117 */
118 void clearAccounts(String packageName);
119
120 /**
Nancy Chen443e5012014-10-15 15:48:21 -0700121 * @see TelecomServiceImpl#isVoiceMailNumber
122 */
Svet Ganov16a16892015-04-16 10:32:04 -0700123 boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
124 String callingPackage);
Nancy Chen443e5012014-10-15 15:48:21 -0700125
126 /**
Yorke Lee49e2d462015-04-15 16:14:22 -0700127 * @see TelecomServiceImpl#getVoiceMailNumber
Nancy Chen8c066f72014-12-03 15:18:08 -0800128 */
Svet Ganov16a16892015-04-16 10:32:04 -0700129 String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen8c066f72014-12-03 15:18:08 -0800130
131 /**
Nancy Chen5cf27842015-01-24 23:30:27 -0800132 * @see TelecomServiceImpl#getLine1Number
133 */
Svet Ganov16a16892015-04-16 10:32:04 -0700134 String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen5cf27842015-01-24 23:30:27 -0800135
136 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700137 * @see TelecomServiceImpl#getDefaultPhoneApp
Santos Cordon6c7a3882014-06-25 15:30:08 -0700138 */
139 ComponentName getDefaultPhoneApp();
Santos Cordon9eb45932014-06-27 12:28:43 -0700140
Yorke Lee1011f482015-04-23 15:58:27 -0700141 /**
142 * @see TelecomServiceImpl#getDefaultDialerPackage
143 */
144 String getDefaultDialerPackage();
145
146 /**
147 * @see TelecomServiceImpl#getSystemDialerPackage
148 */
149 String getSystemDialerPackage();
150
Santos Cordon9eb45932014-06-27 12:28:43 -0700151 //
152 // Internal system apis relating to call management.
153 //
154
155 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700156 * @see TelecomServiceImpl#silenceRinger
Santos Cordon9eb45932014-06-27 12:28:43 -0700157 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700158 void silenceRinger(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700159
160 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700161 * @see TelecomServiceImpl#isInCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700162 */
Svet Ganov16a16892015-04-16 10:32:04 -0700163 boolean isInCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700164
165 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700166 * @see TelecomServiceImpl#isRinging
Santos Cordon9eb45932014-06-27 12:28:43 -0700167 */
Svet Ganov16a16892015-04-16 10:32:04 -0700168 boolean isRinging(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700169
170 /**
Yorke Lee2ae312e2014-09-12 17:58:48 -0700171 * @see TelecomServiceImpl#getCallState
172 */
173 int getCallState();
174
175 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700176 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700177 */
178 boolean endCall();
179
180 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700181 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700182 */
183 void acceptRingingCall();
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700184
185 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700186 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700187 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700188 void cancelMissedCallsNotification(String callingPackage);
Santos Cordon0bae09f2014-07-07 14:53:10 -0700189
190 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700191 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700192 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700193 boolean handlePinMmi(String dialString, String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700194
195 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700196 * @see TelecomServiceImpl#handleMmi
197 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700198 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
199 String callingPackage);
Nancy Chen95e8a672014-10-16 18:38:21 -0700200
201 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700202 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
203 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700204 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chenb2299c12014-10-29 18:22:11 -0700205
206 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700207 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700208 */
Svet Ganov16a16892015-04-16 10:32:04 -0700209 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700210
211 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700212 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700213 */
Svet Ganov16a16892015-04-16 10:32:04 -0700214 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700215
216 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700217 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700218 */
219 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700220
221 /**
222 * @see TelecomServiceImpl#addNewUnknownCall
223 */
224 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700225
226 /**
227 * @see TelecomServiceImpl#placeCall
228 */
229 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon91371dc2015-05-08 13:52:09 -0700230
231 /**
232 * @see TelecomServiceImpl#enablePhoneAccount
233 */
Yorke Leedb6da482015-06-02 13:55:25 -0700234 boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
235
236 /**
237 * @see TelecomServiceImpl#setDefaultDialer
238 */
239 boolean setDefaultDialer(in String packageName);
Santos Cordon3afed572014-05-21 15:22:12 -0700240}