blob: 34e9942a53c9bff4e3a0bfde6660f3059f4e358f [file] [log] [blame]
Santos Cordon8f3fd302014-01-27 08:46:21 -08001/*
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 android.telecom;
Santos Cordon8f3fd302014-01-27 08:46:21 -080018
Ravi Palurif4b38e72020-02-05 12:35:41 +053019import android.annotation.NonNull;
Hall Liua98f58b52017-11-07 17:59:28 -080020import android.bluetooth.BluetoothDevice;
Hall Liu6dfa2492019-10-01 17:20:39 -070021import android.net.Uri;
Tyler Gunn876dbfb2016-03-14 15:18:07 -070022import android.os.Bundle;
Sailesh Nepalab5d2822014-03-08 18:01:06 -080023import android.os.RemoteException;
24
Tyler Gunnef9f6f92014-09-12 22:16:17 -070025import com.android.internal.telecom.IInCallAdapter;
Sailesh Nepalab5d2822014-03-08 18:01:06 -080026
Tyler Gunndee56a82016-03-23 16:06:34 -070027import java.util.List;
28
Santos Cordon8f3fd302014-01-27 08:46:21 -080029/**
Sailesh Nepalab5d2822014-03-08 18:01:06 -080030 * Receives commands from {@link InCallService} implementations which should be executed by
Tyler Gunnef9f6f92014-09-12 22:16:17 -070031 * Telecom. When Telecom binds to a {@link InCallService}, an instance of this class is given to
Santos Cordon8f3fd302014-01-27 08:46:21 -080032 * the in-call service through which it can manipulate live (active, dialing, ringing) calls. When
Ihab Awade63fadb2014-07-09 21:52:04 -070033 * the in-call service is notified of new calls, it can use the
Santos Cordon8f3fd302014-01-27 08:46:21 -080034 * given call IDs to execute commands such as {@link #answerCall} for incoming calls or
35 * {@link #disconnectCall} for active calls the user would like to end. Some commands are only
36 * appropriate for calls in certain states; please consult each method for such limitations.
Ihab Awadb19a0bc2014-08-07 19:46:01 -070037 * <p>
38 * The adapter will stop functioning when there are no more calls.
39 *
Hall Liu95d55872017-01-25 17:12:49 -080040 * @hide
Santos Cordon8f3fd302014-01-27 08:46:21 -080041 */
Sailesh Nepalab5d2822014-03-08 18:01:06 -080042public final class InCallAdapter {
43 private final IInCallAdapter mAdapter;
44
45 /**
46 * {@hide}
47 */
48 public InCallAdapter(IInCallAdapter adapter) {
49 mAdapter = adapter;
50 }
51
Santos Cordon8f3fd302014-01-27 08:46:21 -080052 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070053 * Instructs Telecom to answer the specified call.
Santos Cordon8f3fd302014-01-27 08:46:21 -080054 *
55 * @param callId The identifier of the call to answer.
Andrew Lee8da4c3c2014-07-16 10:11:42 -070056 * @param videoState The video state in which to answer the call.
Santos Cordon8f3fd302014-01-27 08:46:21 -080057 */
Andrew Lee8da4c3c2014-07-16 10:11:42 -070058 public void answerCall(String callId, int videoState) {
Sailesh Nepalab5d2822014-03-08 18:01:06 -080059 try {
Andrew Lee8da4c3c2014-07-16 10:11:42 -070060 mAdapter.answerCall(callId, videoState);
Sailesh Nepalab5d2822014-03-08 18:01:06 -080061 } catch (RemoteException e) {
62 }
63 }
Santos Cordon8f3fd302014-01-27 08:46:21 -080064
65 /**
Pooja Jaind34698d2017-12-28 14:15:31 +053066 * Instructs Telecom to deflect the specified call.
67 *
68 * @param callId The identifier of the call to deflect.
69 * @param address The address to deflect.
70 */
71 public void deflectCall(String callId, Uri address) {
72 try {
73 mAdapter.deflectCall(callId, address);
74 } catch (RemoteException e) {
75 }
76 }
77
78 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -070079 * Instructs Telecom to reject the specified call.
Santos Cordon8f3fd302014-01-27 08:46:21 -080080 *
81 * @param callId The identifier of the call to reject.
Ihab Awadc0677542014-06-10 13:29:47 -070082 * @param rejectWithMessage Whether to reject with a text message.
83 * @param textMessage An optional text message with which to respond.
Santos Cordon8f3fd302014-01-27 08:46:21 -080084 */
Ihab Awadc0677542014-06-10 13:29:47 -070085 public void rejectCall(String callId, boolean rejectWithMessage, String textMessage) {
Sailesh Nepalab5d2822014-03-08 18:01:06 -080086 try {
Ihab Awadc0677542014-06-10 13:29:47 -070087 mAdapter.rejectCall(callId, rejectWithMessage, textMessage);
Sailesh Nepalab5d2822014-03-08 18:01:06 -080088 } catch (RemoteException e) {
89 }
90 }
Santos Cordon8f3fd302014-01-27 08:46:21 -080091
92 /**
Tyler Gunnfacfdee2020-01-23 13:10:37 -080093 * Instructs Telecom to reject the specified call.
94 *
95 * @param callId The identifier of the call to reject.
96 * @param rejectReason The reason the call was rejected.
97 */
98 public void rejectCall(String callId, @Call.RejectReason int rejectReason) {
99 try {
100 mAdapter.rejectCallWithReason(callId, rejectReason);
101 } catch (RemoteException e) {
102 }
103 }
104
105 /**
Ravi Palurif4b38e72020-02-05 12:35:41 +0530106 * Instructs Telecom to transfer the specified call.
107 *
108 * @param callId The identifier of the call to transfer.
109 * @param targetNumber The address to transfer to.
Tyler Gunn460360d2020-07-29 10:21:45 -0700110 * @param isConfirmationRequired if {@code true} it will initiate a confirmed transfer,
111 * if {@code false}, it will initiate unconfirmed transfer.
Ravi Palurif4b38e72020-02-05 12:35:41 +0530112 */
113 public void transferCall(@NonNull String callId, @NonNull Uri targetNumber,
114 boolean isConfirmationRequired) {
115 try {
116 mAdapter.transferCall(callId, targetNumber, isConfirmationRequired);
117 } catch (RemoteException e) {
118 }
119 }
120
121 /**
122 * Instructs Telecom to transfer the specified call to another ongoing call.
123 *
124 * @param callId The identifier of the call to transfer.
125 * @param otherCallId The identifier of the other call to which this will be transferred.
126 */
127 public void transferCall(@NonNull String callId, @NonNull String otherCallId) {
128 try {
129 mAdapter.consultativeTransfer(callId, otherCallId);
130 } catch (RemoteException e) {
131 }
132 }
133
134 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700135 * Instructs Telecom to disconnect the specified call.
Santos Cordon8f3fd302014-01-27 08:46:21 -0800136 *
137 * @param callId The identifier of the call to disconnect.
138 */
Sailesh Nepalab5d2822014-03-08 18:01:06 -0800139 public void disconnectCall(String callId) {
140 try {
141 mAdapter.disconnectCall(callId);
142 } catch (RemoteException e) {
143 }
144 }
Yorke Lee81ccaaa2014-03-12 18:33:19 -0700145
146 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700147 * Instructs Telecom to put the specified call on hold.
Yorke Lee81ccaaa2014-03-12 18:33:19 -0700148 *
149 * @param callId The identifier of the call to put on hold.
150 */
151 public void holdCall(String callId) {
152 try {
153 mAdapter.holdCall(callId);
154 } catch (RemoteException e) {
155 }
156 }
157
158 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700159 * Instructs Telecom to release the specified call from hold.
Yorke Lee81ccaaa2014-03-12 18:33:19 -0700160 *
161 * @param callId The identifier of the call to release from hold.
162 */
163 public void unholdCall(String callId) {
164 try {
165 mAdapter.unholdCall(callId);
166 } catch (RemoteException e) {
167 }
168 }
Sailesh Nepal4cff3922014-03-19 10:15:37 -0700169
170 /**
171 * Mute the microphone.
172 *
173 * @param shouldMute True if the microphone should be muted.
174 */
175 public void mute(boolean shouldMute) {
176 try {
177 mAdapter.mute(shouldMute);
178 } catch (RemoteException e) {
179 }
180 }
181
182 /**
Yorke Lee4af59352015-05-13 14:14:54 -0700183 * Sets the audio route (speaker, bluetooth, etc...). See {@link CallAudioState}.
Sailesh Nepal4cff3922014-03-19 10:15:37 -0700184 *
185 * @param route The audio route to use.
186 */
187 public void setAudioRoute(int route) {
188 try {
Hall Liua98f58b52017-11-07 17:59:28 -0800189 mAdapter.setAudioRoute(route, null);
190 } catch (RemoteException e) {
191 }
192 }
193
194 /**
Hall Liu6dfa2492019-10-01 17:20:39 -0700195 * @see Call#enterBackgroundAudioProcessing()
196 */
197 public void enterBackgroundAudioProcessing(String callId) {
198 try {
199 mAdapter.enterBackgroundAudioProcessing(callId);
200 } catch (RemoteException e) {
201 }
202 }
203
204 /**
205 * @see Call#exitBackgroundAudioProcessing(boolean)
206 */
207 public void exitBackgroundAudioProcessing(String callId, boolean shouldRing) {
208 try {
209 mAdapter.exitBackgroundAudioProcessing(callId, shouldRing);
210 } catch (RemoteException e) {
211 }
212 }
213
214 /**
Hall Liua98f58b52017-11-07 17:59:28 -0800215 * Request audio routing to a specific bluetooth device. Calling this method may result in
216 * the device routing audio to a different bluetooth device than the one specified. A list of
217 * available devices can be obtained via {@link CallAudioState#getSupportedBluetoothDevices()}
218 *
219 * @param bluetoothAddress The address of the bluetooth device to connect to, as returned by
220 * {@link BluetoothDevice#getAddress()}, or {@code null} if no device is preferred.
221 */
222 public void requestBluetoothAudio(String bluetoothAddress) {
223 try {
224 mAdapter.setAudioRoute(CallAudioState.ROUTE_BLUETOOTH, bluetoothAddress);
Sailesh Nepal4cff3922014-03-19 10:15:37 -0700225 } catch (RemoteException e) {
226 }
227 }
Ihab Awad2f236642014-03-10 15:33:45 -0700228
229 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700230 * Instructs Telecom to play a dual-tone multi-frequency signaling (DTMF) tone in a call.
Ihab Awad2f236642014-03-10 15:33:45 -0700231 *
232 * Any other currently playing DTMF tone in the specified call is immediately stopped.
233 *
234 * @param callId The unique ID of the call in which the tone will be played.
235 * @param digit A character representing the DTMF digit for which to play the tone. This
236 * value must be one of {@code '0'} through {@code '9'}, {@code '*'} or {@code '#'}.
237 */
238 public void playDtmfTone(String callId, char digit) {
239 try {
240 mAdapter.playDtmfTone(callId, digit);
241 } catch (RemoteException e) {
242 }
243 }
244
245 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700246 * Instructs Telecom to stop any dual-tone multi-frequency signaling (DTMF) tone currently
Ihab Awad2f236642014-03-10 15:33:45 -0700247 * playing.
248 *
249 * DTMF tones are played by calling {@link #playDtmfTone(String,char)}. If no DTMF tone is
250 * currently playing, this method will do nothing.
251 *
252 * @param callId The unique ID of the call in which any currently playing tone will be stopped.
253 */
254 public void stopDtmfTone(String callId) {
255 try {
256 mAdapter.stopDtmfTone(callId);
257 } catch (RemoteException e) {
258 }
259 }
260
261 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700262 * Instructs Telecom to continue playing a post-dial DTMF string.
Ihab Awad2f236642014-03-10 15:33:45 -0700263 *
264 * A post-dial DTMF string is a string of digits entered after a phone number, when dialed,
265 * that are immediately sent as DTMF tones to the recipient as soon as the connection is made.
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700266 * While these tones are playing, Telecom will notify the {@link InCallService} that the call
Ihab Awade63fadb2014-07-09 21:52:04 -0700267 * is in the post dial state.
Ihab Awad2f236642014-03-10 15:33:45 -0700268 *
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700269 * If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_PAUSE} symbol, Telecom
Evan Charlton8acdbb82014-04-01 13:50:07 -0700270 * will temporarily pause playing the tones for a pre-defined period of time.
Ihab Awad2f236642014-03-10 15:33:45 -0700271 *
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700272 * If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_WAIT} symbol, Telecom
Evan Charlton8acdbb82014-04-01 13:50:07 -0700273 * will pause playing the tones and notify the {@link InCallService} that the call is in the
Ihab Awade63fadb2014-07-09 21:52:04 -0700274 * post dial wait state. When the user decides to continue the postdial sequence, the
275 * {@link InCallService} should invoke the {@link #postDialContinue(String,boolean)} method.
Ihab Awad2f236642014-03-10 15:33:45 -0700276 *
277 * @param callId The unique ID of the call for which postdial string playing should continue.
Evan Charlton6dea4ac2014-06-03 14:07:13 -0700278 * @param proceed Whether or not to continue with the post-dial sequence.
Ihab Awad2f236642014-03-10 15:33:45 -0700279 */
Evan Charlton6dea4ac2014-06-03 14:07:13 -0700280 public void postDialContinue(String callId, boolean proceed) {
Ihab Awad2f236642014-03-10 15:33:45 -0700281 try {
Evan Charlton6dea4ac2014-06-03 14:07:13 -0700282 mAdapter.postDialContinue(callId, proceed);
Ihab Awad2f236642014-03-10 15:33:45 -0700283 } catch (RemoteException e) {
284 }
285 }
Sailesh Nepalb632e5b2014-04-03 12:54:33 -0700286
287 /**
Nancy Chen36c62f32014-10-21 18:36:39 -0700288 * Instructs Telecom to add a PhoneAccountHandle to the specified call.
Nancy Chen5da0fd52014-07-08 14:16:17 -0700289 *
Nancy Chen36c62f32014-10-21 18:36:39 -0700290 * @param callId The identifier of the call.
291 * @param accountHandle The PhoneAccountHandle through which to place the call.
292 * @param setDefault {@code True} if this account should be set as the default for calls.
Nancy Chen5da0fd52014-07-08 14:16:17 -0700293 */
Nancy Chen36c62f32014-10-21 18:36:39 -0700294 public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle,
295 boolean setDefault) {
Nancy Chen5da0fd52014-07-08 14:16:17 -0700296 try {
Nancy Chen36c62f32014-10-21 18:36:39 -0700297 mAdapter.phoneAccountSelected(callId, accountHandle, setDefault);
Nancy Chen5da0fd52014-07-08 14:16:17 -0700298 } catch (RemoteException e) {
299 }
300 }
301
302 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700303 * Instructs Telecom to conference the specified call.
Santos Cordon980acb92014-05-31 10:31:19 -0700304 *
305 * @param callId The unique ID of the call.
Santos Cordon980acb92014-05-31 10:31:19 -0700306 * @hide
307 */
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700308 public void conference(String callId, String otherCallId) {
Santos Cordon980acb92014-05-31 10:31:19 -0700309 try {
Santos Cordon7c7bc7f2014-07-28 18:15:48 -0700310 mAdapter.conference(callId, otherCallId);
Santos Cordon980acb92014-05-31 10:31:19 -0700311 } catch (RemoteException ignored) {
312 }
313 }
314
315 /**
Ravi Paluri404babb2020-01-23 19:02:44 +0530316 * Instructs Telecom to pull participants to existing call
317 *
318 * @param callId The unique ID of the call.
319 * @param participants participants to be pulled to existing call.
320 */
321 public void addConferenceParticipants(String callId, List<Uri> participants) {
322 try {
323 mAdapter.addConferenceParticipants(callId, participants);
324 } catch (RemoteException ignored) {
325 }
326 }
327
328
329 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700330 * Instructs Telecom to split the specified call from any conference call with which it may be
Santos Cordon980acb92014-05-31 10:31:19 -0700331 * connected.
332 *
333 * @param callId The unique ID of the call.
334 * @hide
335 */
Santos Cordonb6939982014-06-04 20:20:58 -0700336 public void splitFromConference(String callId) {
Santos Cordon980acb92014-05-31 10:31:19 -0700337 try {
338 mAdapter.splitFromConference(callId);
339 } catch (RemoteException ignored) {
340 }
341 }
Sailesh Nepal61203862014-07-11 14:50:13 -0700342
343 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700344 * Instructs Telecom to merge child calls of the specified conference call.
Santos Cordona4868042014-09-04 17:39:22 -0700345 */
346 public void mergeConference(String callId) {
347 try {
348 mAdapter.mergeConference(callId);
349 } catch (RemoteException ignored) {
350 }
351 }
352
353 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700354 * Instructs Telecom to swap the child calls of the specified conference call.
Santos Cordona4868042014-09-04 17:39:22 -0700355 */
356 public void swapConference(String callId) {
357 try {
358 mAdapter.swapConference(callId);
359 } catch (RemoteException ignored) {
360 }
361 }
362
363 /**
Tyler Gunn876dbfb2016-03-14 15:18:07 -0700364 * Instructs Telecom to pull an external call to the local device.
365 *
366 * @param callId The callId to pull.
367 */
368 public void pullExternalCall(String callId) {
369 try {
370 mAdapter.pullExternalCall(callId);
371 } catch (RemoteException ignored) {
372 }
373 }
374
375 /**
Grace Jiae086d082021-10-28 17:04:29 -0700376 * Instructs Telecom to push a call to the given endpoint.
377 *
378 * @param callId The callId to push.
379 * @param callEndpoint The endpoint to which the call will be pushed.
380 */
381 public void pushCall(String callId, CallEndpoint callEndpoint) {
382 try {
383 mAdapter.pushCall(callId, callEndpoint);
384 } catch (RemoteException ignored) {
385 }
386 }
387
388 /**
389 * Instructs Telecom to answer a call via the given endpoint.
390 *
391 * @param callId The callId to push.
392 * @param callEndpoint The endpoint on which the call will be answered.
393 * @param videoState The video state in which to answer the call.
394 */
395 public void answerCall(String callId, CallEndpoint callEndpoint,
396 @VideoProfile.VideoState int videoState) {
397 try {
398 mAdapter.answerCallViaEndpoint(callId, callEndpoint, videoState);
399 } catch (RemoteException ignored) {
400 }
401 }
402
403 /**
Tyler Gunn876dbfb2016-03-14 15:18:07 -0700404 * Intructs Telecom to send a call event.
405 *
406 * @param callId The callId to send the event for.
407 * @param event The event.
Sanket Padawef6a9e5b2018-01-05 14:26:16 -0800408 * @param targetSdkVer Target sdk version of the app calling this api
Tyler Gunn876dbfb2016-03-14 15:18:07 -0700409 * @param extras Extras associated with the event.
410 */
Sanket Padawef6a9e5b2018-01-05 14:26:16 -0800411 public void sendCallEvent(String callId, String event, int targetSdkVer, Bundle extras) {
Tyler Gunn876dbfb2016-03-14 15:18:07 -0700412 try {
Sanket Padawef6a9e5b2018-01-05 14:26:16 -0800413 mAdapter.sendCallEvent(callId, event, targetSdkVer, extras);
Tyler Gunn876dbfb2016-03-14 15:18:07 -0700414 } catch (RemoteException ignored) {
415 }
416 }
417
418 /**
Tyler Gunndee56a82016-03-23 16:06:34 -0700419 * Intructs Telecom to add extras to a call.
420 *
421 * @param callId The callId to add the extras to.
422 * @param extras The extras.
423 */
424 public void putExtras(String callId, Bundle extras) {
425 try {
426 mAdapter.putExtras(callId, extras);
427 } catch (RemoteException ignored) {
428 }
429 }
430
431 /**
432 * Intructs Telecom to add an extra to a call.
433 *
434 * @param callId The callId to add the extras to.
435 * @param key The extra key.
436 * @param value The extra value.
437 */
438 public void putExtra(String callId, String key, boolean value) {
439 try {
440 Bundle bundle = new Bundle();
441 bundle.putBoolean(key, value);
442 mAdapter.putExtras(callId, bundle);
443 } catch (RemoteException ignored) {
444 }
445 }
446
447 /**
448 * Intructs Telecom to add an extra to a call.
449 *
450 * @param callId The callId to add the extras to.
451 * @param key The extra key.
452 * @param value The extra value.
453 */
454 public void putExtra(String callId, String key, int value) {
455 try {
456 Bundle bundle = new Bundle();
457 bundle.putInt(key, value);
458 mAdapter.putExtras(callId, bundle);
459 } catch (RemoteException ignored) {
460 }
461 }
462
463 /**
464 * Intructs Telecom to add an extra to a call.
465 *
466 * @param callId The callId to add the extras to.
467 * @param key The extra key.
468 * @param value The extra value.
469 */
470 public void putExtra(String callId, String key, String value) {
471 try {
472 Bundle bundle = new Bundle();
473 bundle.putString(key, value);
474 mAdapter.putExtras(callId, bundle);
475 } catch (RemoteException ignored) {
476 }
477 }
478
479 /**
480 * Intructs Telecom to remove extras from a call.
481 * @param callId The callId to remove the extras from.
482 * @param keys The extra keys to remove.
483 */
484 public void removeExtras(String callId, List<String> keys) {
485 try {
486 mAdapter.removeExtras(callId, keys);
487 } catch (RemoteException ignored) {
488 }
489 }
490
491 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700492 * Instructs Telecom to turn the proximity sensor on.
Yorke Lee0d6ea712014-07-28 14:39:23 -0700493 */
494 public void turnProximitySensorOn() {
495 try {
496 mAdapter.turnOnProximitySensor();
497 } catch (RemoteException ignored) {
498 }
499 }
500
501 /**
Tyler Gunnef9f6f92014-09-12 22:16:17 -0700502 * Instructs Telecom to turn the proximity sensor off.
Yorke Lee0d6ea712014-07-28 14:39:23 -0700503 *
504 * @param screenOnImmediately If true, the screen will be turned on immediately if it was
505 * previously off. Otherwise, the screen will only be turned on after the proximity sensor
506 * is no longer triggered.
507 */
508 public void turnProximitySensorOff(boolean screenOnImmediately) {
509 try {
510 mAdapter.turnOffProximitySensor(screenOnImmediately);
511 } catch (RemoteException ignored) {
512 }
513 }
Hall Liu95d55872017-01-25 17:12:49 -0800514
515 /**
516 * Sends an RTT upgrade request to the remote end of the connection.
517 */
Hall Liu57006aa2017-02-06 10:49:48 -0800518 public void sendRttRequest(String callId) {
Hall Liu95d55872017-01-25 17:12:49 -0800519 try {
Hall Liu57006aa2017-02-06 10:49:48 -0800520 mAdapter.sendRttRequest(callId);
Hall Liu95d55872017-01-25 17:12:49 -0800521 } catch (RemoteException ignored) {
522 }
523 }
524
525 /**
526 * Responds to an RTT upgrade request initiated from the remote end.
527 *
528 * @param id the ID of the request as specified by Telecom
529 * @param accept Whether the request should be accepted.
530 */
Hall Liu57006aa2017-02-06 10:49:48 -0800531 public void respondToRttRequest(String callId, int id, boolean accept) {
Hall Liu95d55872017-01-25 17:12:49 -0800532 try {
Hall Liu57006aa2017-02-06 10:49:48 -0800533 mAdapter.respondToRttRequest(callId, id, accept);
Hall Liu95d55872017-01-25 17:12:49 -0800534 } catch (RemoteException ignored) {
535 }
536 }
537
538 /**
539 * Instructs Telecom to shut down the RTT communication channel.
540 */
Hall Liu57006aa2017-02-06 10:49:48 -0800541 public void stopRtt(String callId) {
Hall Liu95d55872017-01-25 17:12:49 -0800542 try {
Hall Liu57006aa2017-02-06 10:49:48 -0800543 mAdapter.stopRtt(callId);
Hall Liu95d55872017-01-25 17:12:49 -0800544 } catch (RemoteException ignored) {
545 }
546 }
547
548 /**
549 * Sets the RTT audio mode.
550 * @param mode the desired RTT audio mode
551 */
Hall Liu57006aa2017-02-06 10:49:48 -0800552 public void setRttMode(String callId, int mode) {
Hall Liu95d55872017-01-25 17:12:49 -0800553 try {
Hall Liu57006aa2017-02-06 10:49:48 -0800554 mAdapter.setRttMode(callId, mode);
Hall Liu95d55872017-01-25 17:12:49 -0800555 } catch (RemoteException ignored) {
556 }
557 }
Sanket Padawea8eddd42017-11-03 11:07:35 -0700558
559
560 /**
561 * Initiates a handover of this {@link Call} to the {@link ConnectionService} identified
562 * by destAcct.
563 * @param callId The callId of the Call which calls this function.
564 * @param destAcct ConnectionService to which the call should be handed over.
565 * @param videoState The video state desired after the handover.
566 * @param extras Extra information to be passed to ConnectionService
567 */
568 public void handoverTo(String callId, PhoneAccountHandle destAcct, int videoState,
569 Bundle extras) {
570 try {
571 mAdapter.handoverTo(callId, destAcct, videoState, extras);
572 } catch (RemoteException ignored) {
573 }
574 }
Santos Cordon8f3fd302014-01-27 08:46:21 -0800575}