blob: af36b3e41eb22575f2343977da3e3fa13c8f0d5a [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;
Hall Liu0464b9b2016-01-12 15:32:58 -080020import android.telecom.ParcelableCallAnalytics;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070021import android.telecom.PhoneAccountHandle;
Nancy Chenb2299c12014-10-29 18:22:11 -070022import android.net.Uri;
Santos Cordon96efb482014-07-19 14:57:05 -070023import android.os.Bundle;
Tyler Gunnef9f6f92014-09-12 22:16:17 -070024import android.telecom.PhoneAccount;
Yorke Lee2e024702014-06-13 09:59:43 -070025
Santos Cordon3afed572014-05-21 15:22:12 -070026/**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070027 * Interface used to interact with Telecom. Mostly this is used by TelephonyManager for passing
Santos Cordon3afed572014-05-21 15:22:12 -070028 * commands that were previously handled by ITelephony.
29 * {@hide}
30 */
Tyler Gunnef9f6f92014-09-12 22:16:17 -070031interface ITelecomService {
Santos Cordon3534ede2014-05-29 13:07:10 -070032 /**
33 * Brings the in-call screen to the foreground if there is an active call.
34 *
35 * @param showDialpad if true, make the dialpad visible initially.
36 */
Svet Ganov16a16892015-04-16 10:32:04 -070037 void showInCallScreen(boolean showDialpad, String callingPackage);
Yorke Lee2e024702014-06-13 09:59:43 -070038
39 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070040 * @see TelecomServiceImpl#getDefaultOutgoingPhoneAccount
Ihab Awad94cf4bf2014-07-17 11:21:19 -070041 */
Svet Ganov16a16892015-04-16 10:32:04 -070042 PhoneAccountHandle getDefaultOutgoingPhoneAccount(in String uriScheme, String callingPackage);
Ihab Awad94cf4bf2014-07-17 11:21:19 -070043
44 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070045 * @see TelecomServiceImpl#getUserSelectedOutgoingPhoneAccount
Andrew Lee59cac3a2014-08-28 16:50:10 -070046 */
Andrew Leed4abbfb2014-09-03 14:58:27 -070047 PhoneAccountHandle getUserSelectedOutgoingPhoneAccount();
48
49 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070050 * @see TelecomServiceImpl#setUserSelectedOutgoingPhoneAccount
Andrew Leed4abbfb2014-09-03 14:58:27 -070051 */
52 void setUserSelectedOutgoingPhoneAccount(in PhoneAccountHandle account);
Andrew Lee59cac3a2014-08-28 16:50:10 -070053
54 /**
Nancy Chen210ef032014-09-15 17:58:42 -070055 * @see TelecomServiceImpl#getCallCapablePhoneAccounts
Ihab Awadc35ad022014-06-12 16:29:42 -070056 */
Santos Cordon91371dc2015-05-08 13:52:09 -070057 List<PhoneAccountHandle> getCallCapablePhoneAccounts(
58 boolean includeDisabledAccounts, String callingPackage);
Ihab Awadc35ad022014-06-12 16:29:42 -070059
60 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070061 * @see TelecomManager#getPhoneAccountsSupportingScheme
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070062 */
Svet Ganov16a16892015-04-16 10:32:04 -070063 List<PhoneAccountHandle> getPhoneAccountsSupportingScheme(in String uriScheme,
64 String callingPackage);
Tyler Gunnf5b29dc2014-09-03 09:09:12 -070065
66 /**
Nancy Chen513c8922014-09-17 14:47:20 -070067 * @see TelecomManager#getPhoneAccountsForPackage
68 */
69 List<PhoneAccountHandle> getPhoneAccountsForPackage(in String packageName);
70
71 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070072 * @see TelecomManager#getPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -070073 */
Evan Charlton8c8a0622014-07-20 12:31:00 -070074 PhoneAccount getPhoneAccount(in PhoneAccountHandle account);
Ihab Awadc35ad022014-06-12 16:29:42 -070075
76 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070077 * @see TelecomManager#getAllPhoneAccountsCount
Tyler Gunna1ed7d12014-09-08 09:52:22 -070078 */
79 int getAllPhoneAccountsCount();
80
81 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070082 * @see TelecomManager#getAllPhoneAccounts
Tyler Gunna1ed7d12014-09-08 09:52:22 -070083 */
84 List<PhoneAccount> getAllPhoneAccounts();
85
86 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070087 * @see TelecomManager#getAllPhoneAccountHandles
Tyler Gunna1ed7d12014-09-08 09:52:22 -070088 */
89 List<PhoneAccountHandle> getAllPhoneAccountHandles();
90
91 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070092 * @see TelecomServiceImpl#getSimCallManager
Andrew Lee59cac3a2014-08-28 16:50:10 -070093 */
94 PhoneAccountHandle getSimCallManager();
95
96 /**
Sailesh Nepalcf855622015-07-28 19:22:14 -070097 * @see TelecomServiceImpl#getSimCallManagerForUser
98 */
99 PhoneAccountHandle getSimCallManagerForUser(int userId);
100
101 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700102 * @see TelecomServiceImpl#registerPhoneAccount
Ihab Awadc35ad022014-06-12 16:29:42 -0700103 */
Evan Charlton8c8a0622014-07-20 12:31:00 -0700104 void registerPhoneAccount(in PhoneAccount metadata);
Santos Cordon6c7a3882014-06-25 15:30:08 -0700105
106 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700107 * @see TelecomServiceImpl#unregisterPhoneAccount
Ihab Awad807fe0a2014-07-09 12:30:52 -0700108 */
Evan Charlton6eb262c2014-07-19 18:18:19 -0700109 void unregisterPhoneAccount(in PhoneAccountHandle account);
Ihab Awad807fe0a2014-07-09 12:30:52 -0700110
111 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700112 * @see TelecomServiceImpl#clearAccounts
Ihab Awad807fe0a2014-07-09 12:30:52 -0700113 */
114 void clearAccounts(String packageName);
115
116 /**
Nancy Chen443e5012014-10-15 15:48:21 -0700117 * @see TelecomServiceImpl#isVoiceMailNumber
118 */
Svet Ganov16a16892015-04-16 10:32:04 -0700119 boolean isVoiceMailNumber(in PhoneAccountHandle accountHandle, String number,
120 String callingPackage);
Nancy Chen443e5012014-10-15 15:48:21 -0700121
122 /**
Yorke Lee49e2d462015-04-15 16:14:22 -0700123 * @see TelecomServiceImpl#getVoiceMailNumber
Nancy Chen8c066f72014-12-03 15:18:08 -0800124 */
Svet Ganov16a16892015-04-16 10:32:04 -0700125 String getVoiceMailNumber(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen8c066f72014-12-03 15:18:08 -0800126
127 /**
Nancy Chen5cf27842015-01-24 23:30:27 -0800128 * @see TelecomServiceImpl#getLine1Number
129 */
Svet Ganov16a16892015-04-16 10:32:04 -0700130 String getLine1Number(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chen5cf27842015-01-24 23:30:27 -0800131
132 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700133 * @see TelecomServiceImpl#getDefaultPhoneApp
Santos Cordon6c7a3882014-06-25 15:30:08 -0700134 */
135 ComponentName getDefaultPhoneApp();
Santos Cordon9eb45932014-06-27 12:28:43 -0700136
Yorke Lee1011f482015-04-23 15:58:27 -0700137 /**
138 * @see TelecomServiceImpl#getDefaultDialerPackage
139 */
140 String getDefaultDialerPackage();
141
142 /**
143 * @see TelecomServiceImpl#getSystemDialerPackage
144 */
145 String getSystemDialerPackage();
146
Hall Liu0464b9b2016-01-12 15:32:58 -0800147 /**
148 * @see TelecomServiceImpl#dumpCallAnalytics
149 */
150 List<ParcelableCallAnalytics> dumpCallAnalytics();
151
Santos Cordon9eb45932014-06-27 12:28:43 -0700152 //
153 // Internal system apis relating to call management.
154 //
155
156 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700157 * @see TelecomServiceImpl#silenceRinger
Santos Cordon9eb45932014-06-27 12:28:43 -0700158 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700159 void silenceRinger(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700160
161 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700162 * @see TelecomServiceImpl#isInCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700163 */
Svet Ganov16a16892015-04-16 10:32:04 -0700164 boolean isInCall(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700165
166 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700167 * @see TelecomServiceImpl#isRinging
Santos Cordon9eb45932014-06-27 12:28:43 -0700168 */
Svet Ganov16a16892015-04-16 10:32:04 -0700169 boolean isRinging(String callingPackage);
Santos Cordon9eb45932014-06-27 12:28:43 -0700170
171 /**
Yorke Lee2ae312e2014-09-12 17:58:48 -0700172 * @see TelecomServiceImpl#getCallState
173 */
174 int getCallState();
175
176 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700177 * @see TelecomServiceImpl#endCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700178 */
179 boolean endCall();
180
181 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700182 * @see TelecomServiceImpl#acceptRingingCall
Santos Cordon9eb45932014-06-27 12:28:43 -0700183 */
184 void acceptRingingCall();
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700185
186 /**
Tyler Gunn6676bb52015-10-23 14:39:49 -0700187 * @see TelecomServiceImpl#acceptRingingCallWithVideoState(int)
188 */
189 void acceptRingingCallWithVideoState(int videoState);
190
191 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700192 * @see TelecomServiceImpl#cancelMissedCallsNotification
Santos Cordon3c4ff9e2014-07-02 13:20:40 -0700193 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700194 void cancelMissedCallsNotification(String callingPackage);
Santos Cordon0bae09f2014-07-07 14:53:10 -0700195
196 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700197 * @see TelecomServiceImpl#handleMmi
Santos Cordon0bae09f2014-07-07 14:53:10 -0700198 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700199 boolean handlePinMmi(String dialString, String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700200
201 /**
Nancy Chen95e8a672014-10-16 18:38:21 -0700202 * @see TelecomServiceImpl#handleMmi
203 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700204 boolean handlePinMmiForPhoneAccount(in PhoneAccountHandle accountHandle, String dialString,
205 String callingPackage);
Nancy Chen95e8a672014-10-16 18:38:21 -0700206
207 /**
Nancy Chenb2299c12014-10-29 18:22:11 -0700208 * @see TelecomServiceImpl#getAdnUriForPhoneAccount
209 */
Yorke Leef1a349b2015-04-29 16:16:50 -0700210 Uri getAdnUriForPhoneAccount(in PhoneAccountHandle accountHandle, String callingPackage);
Nancy Chenb2299c12014-10-29 18:22:11 -0700211
212 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700213 * @see TelecomServiceImpl#isTtySupported
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700214 */
Svet Ganov16a16892015-04-16 10:32:04 -0700215 boolean isTtySupported(String callingPackage);
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700216
217 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700218 * @see TelecomServiceImpl#getCurrentTtyMode
Sailesh Nepal001bbbb2014-07-15 14:40:39 -0700219 */
Svet Ganov16a16892015-04-16 10:32:04 -0700220 int getCurrentTtyMode(String callingPackage);
Santos Cordon96efb482014-07-19 14:57:05 -0700221
222 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700223 * @see TelecomServiceImpl#addNewIncomingCall
Santos Cordon96efb482014-07-19 14:57:05 -0700224 */
225 void addNewIncomingCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Leec3cf9822014-10-02 09:38:39 -0700226
227 /**
228 * @see TelecomServiceImpl#addNewUnknownCall
229 */
230 void addNewUnknownCall(in PhoneAccountHandle phoneAccount, in Bundle extras);
Yorke Lee3e56ba12015-04-23 12:32:36 -0700231
232 /**
233 * @see TelecomServiceImpl#placeCall
234 */
235 void placeCall(in Uri handle, in Bundle extras, String callingPackage);
Santos Cordon91371dc2015-05-08 13:52:09 -0700236
237 /**
238 * @see TelecomServiceImpl#enablePhoneAccount
239 */
Yorke Leedb6da482015-06-02 13:55:25 -0700240 boolean enablePhoneAccount(in PhoneAccountHandle accountHandle, boolean isEnabled);
241
242 /**
243 * @see TelecomServiceImpl#setDefaultDialer
244 */
245 boolean setDefaultDialer(in String packageName);
Santos Cordon3afed572014-05-21 15:22:12 -0700246}