2014-01-27 08:46:21 -08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2014-09-12 22:16:17 -07:00
|
|
|
package android.telecom;
|
2014-01-27 08:46:21 -08:00
|
|
|
|
2020-02-05 12:35:41 +05:30
|
|
|
import android.annotation.NonNull;
|
2017-11-07 17:59:28 -08:00
|
|
|
import android.bluetooth.BluetoothDevice;
|
2019-10-01 17:20:39 -07:00
|
|
|
import android.net.Uri;
|
2016-03-14 15:18:07 -07:00
|
|
|
import android.os.Bundle;
|
2014-03-08 18:01:06 -08:00
|
|
|
import android.os.RemoteException;
|
|
|
|
|
2014-09-12 22:16:17 -07:00
|
|
|
import com.android.internal.telecom.IInCallAdapter;
|
2014-03-08 18:01:06 -08:00
|
|
|
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
import java.util.List;
|
|
|
|
|
2014-01-27 08:46:21 -08:00
|
|
|
/**
|
2014-03-08 18:01:06 -08:00
|
|
|
* Receives commands from {@link InCallService} implementations which should be executed by
|
2014-09-12 22:16:17 -07:00
|
|
|
* Telecom. When Telecom binds to a {@link InCallService}, an instance of this class is given to
|
2014-01-27 08:46:21 -08:00
|
|
|
* the in-call service through which it can manipulate live (active, dialing, ringing) calls. When
|
2014-07-09 21:52:04 -07:00
|
|
|
* the in-call service is notified of new calls, it can use the
|
2014-01-27 08:46:21 -08:00
|
|
|
* given call IDs to execute commands such as {@link #answerCall} for incoming calls or
|
|
|
|
* {@link #disconnectCall} for active calls the user would like to end. Some commands are only
|
|
|
|
* appropriate for calls in certain states; please consult each method for such limitations.
|
2014-08-07 19:46:01 -07:00
|
|
|
* <p>
|
|
|
|
* The adapter will stop functioning when there are no more calls.
|
|
|
|
*
|
2017-01-25 17:12:49 -08:00
|
|
|
* @hide
|
2014-01-27 08:46:21 -08:00
|
|
|
*/
|
2014-03-08 18:01:06 -08:00
|
|
|
public final class InCallAdapter {
|
|
|
|
private final IInCallAdapter mAdapter;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@hide}
|
|
|
|
*/
|
|
|
|
public InCallAdapter(IInCallAdapter adapter) {
|
|
|
|
mAdapter = adapter;
|
|
|
|
}
|
|
|
|
|
2014-01-27 08:46:21 -08:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to answer the specified call.
|
2014-01-27 08:46:21 -08:00
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to answer.
|
2014-07-16 10:11:42 -07:00
|
|
|
* @param videoState The video state in which to answer the call.
|
2014-01-27 08:46:21 -08:00
|
|
|
*/
|
2014-07-16 10:11:42 -07:00
|
|
|
public void answerCall(String callId, int videoState) {
|
2014-03-08 18:01:06 -08:00
|
|
|
try {
|
2014-07-16 10:11:42 -07:00
|
|
|
mAdapter.answerCall(callId, videoState);
|
2014-03-08 18:01:06 -08:00
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-01-27 08:46:21 -08:00
|
|
|
|
2017-12-28 14:15:31 +05:30
|
|
|
/**
|
|
|
|
* Instructs Telecom to deflect the specified call.
|
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to deflect.
|
|
|
|
* @param address The address to deflect.
|
|
|
|
*/
|
|
|
|
public void deflectCall(String callId, Uri address) {
|
|
|
|
try {
|
|
|
|
mAdapter.deflectCall(callId, address);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-27 08:46:21 -08:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to reject the specified call.
|
2014-01-27 08:46:21 -08:00
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to reject.
|
2014-06-10 13:29:47 -07:00
|
|
|
* @param rejectWithMessage Whether to reject with a text message.
|
|
|
|
* @param textMessage An optional text message with which to respond.
|
2014-01-27 08:46:21 -08:00
|
|
|
*/
|
2014-06-10 13:29:47 -07:00
|
|
|
public void rejectCall(String callId, boolean rejectWithMessage, String textMessage) {
|
2014-03-08 18:01:06 -08:00
|
|
|
try {
|
2014-06-10 13:29:47 -07:00
|
|
|
mAdapter.rejectCall(callId, rejectWithMessage, textMessage);
|
2014-03-08 18:01:06 -08:00
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-01-27 08:46:21 -08:00
|
|
|
|
2020-01-23 13:10:37 -08:00
|
|
|
/**
|
|
|
|
* Instructs Telecom to reject the specified call.
|
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to reject.
|
|
|
|
* @param rejectReason The reason the call was rejected.
|
|
|
|
*/
|
|
|
|
public void rejectCall(String callId, @Call.RejectReason int rejectReason) {
|
|
|
|
try {
|
|
|
|
mAdapter.rejectCallWithReason(callId, rejectReason);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-05 12:35:41 +05:30
|
|
|
/**
|
|
|
|
* Instructs Telecom to transfer the specified call.
|
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to transfer.
|
|
|
|
* @param targetNumber The address to transfer to.
|
2020-07-29 10:21:45 -07:00
|
|
|
* @param isConfirmationRequired if {@code true} it will initiate a confirmed transfer,
|
|
|
|
* if {@code false}, it will initiate unconfirmed transfer.
|
2020-02-05 12:35:41 +05:30
|
|
|
*/
|
|
|
|
public void transferCall(@NonNull String callId, @NonNull Uri targetNumber,
|
|
|
|
boolean isConfirmationRequired) {
|
|
|
|
try {
|
|
|
|
mAdapter.transferCall(callId, targetNumber, isConfirmationRequired);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instructs Telecom to transfer the specified call to another ongoing call.
|
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to transfer.
|
|
|
|
* @param otherCallId The identifier of the other call to which this will be transferred.
|
|
|
|
*/
|
|
|
|
public void transferCall(@NonNull String callId, @NonNull String otherCallId) {
|
|
|
|
try {
|
|
|
|
mAdapter.consultativeTransfer(callId, otherCallId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-27 08:46:21 -08:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to disconnect the specified call.
|
2014-01-27 08:46:21 -08:00
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to disconnect.
|
|
|
|
*/
|
2014-03-08 18:01:06 -08:00
|
|
|
public void disconnectCall(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.disconnectCall(callId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-03-12 18:33:19 -07:00
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to put the specified call on hold.
|
2014-03-12 18:33:19 -07:00
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to put on hold.
|
|
|
|
*/
|
|
|
|
public void holdCall(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.holdCall(callId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to release the specified call from hold.
|
2014-03-12 18:33:19 -07:00
|
|
|
*
|
|
|
|
* @param callId The identifier of the call to release from hold.
|
|
|
|
*/
|
|
|
|
public void unholdCall(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.unholdCall(callId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-03-19 10:15:37 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mute the microphone.
|
|
|
|
*
|
|
|
|
* @param shouldMute True if the microphone should be muted.
|
|
|
|
*/
|
|
|
|
public void mute(boolean shouldMute) {
|
|
|
|
try {
|
|
|
|
mAdapter.mute(shouldMute);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-05-13 14:14:54 -07:00
|
|
|
* Sets the audio route (speaker, bluetooth, etc...). See {@link CallAudioState}.
|
2014-03-19 10:15:37 -07:00
|
|
|
*
|
|
|
|
* @param route The audio route to use.
|
|
|
|
*/
|
|
|
|
public void setAudioRoute(int route) {
|
|
|
|
try {
|
2017-11-07 17:59:28 -08:00
|
|
|
mAdapter.setAudioRoute(route, null);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-01 17:20:39 -07:00
|
|
|
/**
|
|
|
|
* @see Call#enterBackgroundAudioProcessing()
|
|
|
|
*/
|
|
|
|
public void enterBackgroundAudioProcessing(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.enterBackgroundAudioProcessing(callId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see Call#exitBackgroundAudioProcessing(boolean)
|
|
|
|
*/
|
|
|
|
public void exitBackgroundAudioProcessing(String callId, boolean shouldRing) {
|
|
|
|
try {
|
|
|
|
mAdapter.exitBackgroundAudioProcessing(callId, shouldRing);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-07 17:59:28 -08:00
|
|
|
/**
|
|
|
|
* Request audio routing to a specific bluetooth device. Calling this method may result in
|
|
|
|
* the device routing audio to a different bluetooth device than the one specified. A list of
|
|
|
|
* available devices can be obtained via {@link CallAudioState#getSupportedBluetoothDevices()}
|
|
|
|
*
|
|
|
|
* @param bluetoothAddress The address of the bluetooth device to connect to, as returned by
|
|
|
|
* {@link BluetoothDevice#getAddress()}, or {@code null} if no device is preferred.
|
|
|
|
*/
|
|
|
|
public void requestBluetoothAudio(String bluetoothAddress) {
|
|
|
|
try {
|
|
|
|
mAdapter.setAudioRoute(CallAudioState.ROUTE_BLUETOOTH, bluetoothAddress);
|
2014-03-19 10:15:37 -07:00
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-03-10 15:33:45 -07:00
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to play a dual-tone multi-frequency signaling (DTMF) tone in a call.
|
2014-03-10 15:33:45 -07:00
|
|
|
*
|
|
|
|
* Any other currently playing DTMF tone in the specified call is immediately stopped.
|
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call in which the tone will be played.
|
|
|
|
* @param digit A character representing the DTMF digit for which to play the tone. This
|
|
|
|
* value must be one of {@code '0'} through {@code '9'}, {@code '*'} or {@code '#'}.
|
|
|
|
*/
|
|
|
|
public void playDtmfTone(String callId, char digit) {
|
|
|
|
try {
|
|
|
|
mAdapter.playDtmfTone(callId, digit);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to stop any dual-tone multi-frequency signaling (DTMF) tone currently
|
2014-03-10 15:33:45 -07:00
|
|
|
* playing.
|
|
|
|
*
|
|
|
|
* DTMF tones are played by calling {@link #playDtmfTone(String,char)}. If no DTMF tone is
|
|
|
|
* currently playing, this method will do nothing.
|
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call in which any currently playing tone will be stopped.
|
|
|
|
*/
|
|
|
|
public void stopDtmfTone(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.stopDtmfTone(callId);
|
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to continue playing a post-dial DTMF string.
|
2014-03-10 15:33:45 -07:00
|
|
|
*
|
|
|
|
* A post-dial DTMF string is a string of digits entered after a phone number, when dialed,
|
|
|
|
* that are immediately sent as DTMF tones to the recipient as soon as the connection is made.
|
2014-09-12 22:16:17 -07:00
|
|
|
* While these tones are playing, Telecom will notify the {@link InCallService} that the call
|
2014-07-09 21:52:04 -07:00
|
|
|
* is in the post dial state.
|
2014-03-10 15:33:45 -07:00
|
|
|
*
|
2014-09-12 22:16:17 -07:00
|
|
|
* If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_PAUSE} symbol, Telecom
|
2014-04-01 13:50:07 -07:00
|
|
|
* will temporarily pause playing the tones for a pre-defined period of time.
|
2014-03-10 15:33:45 -07:00
|
|
|
*
|
2014-09-12 22:16:17 -07:00
|
|
|
* If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_WAIT} symbol, Telecom
|
2014-04-01 13:50:07 -07:00
|
|
|
* will pause playing the tones and notify the {@link InCallService} that the call is in the
|
2014-07-09 21:52:04 -07:00
|
|
|
* post dial wait state. When the user decides to continue the postdial sequence, the
|
|
|
|
* {@link InCallService} should invoke the {@link #postDialContinue(String,boolean)} method.
|
2014-03-10 15:33:45 -07:00
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call for which postdial string playing should continue.
|
2014-06-03 14:07:13 -07:00
|
|
|
* @param proceed Whether or not to continue with the post-dial sequence.
|
2014-03-10 15:33:45 -07:00
|
|
|
*/
|
2014-06-03 14:07:13 -07:00
|
|
|
public void postDialContinue(String callId, boolean proceed) {
|
2014-03-10 15:33:45 -07:00
|
|
|
try {
|
2014-06-03 14:07:13 -07:00
|
|
|
mAdapter.postDialContinue(callId, proceed);
|
2014-03-10 15:33:45 -07:00
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
2014-04-03 12:54:33 -07:00
|
|
|
|
2014-07-08 14:16:17 -07:00
|
|
|
/**
|
2014-10-21 18:36:39 -07:00
|
|
|
* Instructs Telecom to add a PhoneAccountHandle to the specified call.
|
2014-07-08 14:16:17 -07:00
|
|
|
*
|
2014-10-21 18:36:39 -07:00
|
|
|
* @param callId The identifier of the call.
|
|
|
|
* @param accountHandle The PhoneAccountHandle through which to place the call.
|
|
|
|
* @param setDefault {@code True} if this account should be set as the default for calls.
|
2014-07-08 14:16:17 -07:00
|
|
|
*/
|
2014-10-21 18:36:39 -07:00
|
|
|
public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle,
|
|
|
|
boolean setDefault) {
|
2014-07-08 14:16:17 -07:00
|
|
|
try {
|
2014-10-21 18:36:39 -07:00
|
|
|
mAdapter.phoneAccountSelected(callId, accountHandle, setDefault);
|
2014-07-08 14:16:17 -07:00
|
|
|
} catch (RemoteException e) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-31 10:31:19 -07:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to conference the specified call.
|
2014-05-31 10:31:19 -07:00
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call.
|
|
|
|
* @hide
|
|
|
|
*/
|
2014-07-28 18:15:48 -07:00
|
|
|
public void conference(String callId, String otherCallId) {
|
2014-05-31 10:31:19 -07:00
|
|
|
try {
|
2014-07-28 18:15:48 -07:00
|
|
|
mAdapter.conference(callId, otherCallId);
|
2014-05-31 10:31:19 -07:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-23 19:02:44 +05:30
|
|
|
/**
|
|
|
|
* Instructs Telecom to pull participants to existing call
|
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call.
|
|
|
|
* @param participants participants to be pulled to existing call.
|
|
|
|
*/
|
|
|
|
public void addConferenceParticipants(String callId, List<Uri> participants) {
|
|
|
|
try {
|
|
|
|
mAdapter.addConferenceParticipants(callId, participants);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-31 10:31:19 -07:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to split the specified call from any conference call with which it may be
|
2014-05-31 10:31:19 -07:00
|
|
|
* connected.
|
|
|
|
*
|
|
|
|
* @param callId The unique ID of the call.
|
|
|
|
* @hide
|
|
|
|
*/
|
2014-06-04 20:20:58 -07:00
|
|
|
public void splitFromConference(String callId) {
|
2014-05-31 10:31:19 -07:00
|
|
|
try {
|
|
|
|
mAdapter.splitFromConference(callId);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2014-07-11 14:50:13 -07:00
|
|
|
|
2014-09-04 17:39:22 -07:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to merge child calls of the specified conference call.
|
2014-09-04 17:39:22 -07:00
|
|
|
*/
|
|
|
|
public void mergeConference(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.mergeConference(callId);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to swap the child calls of the specified conference call.
|
2014-09-04 17:39:22 -07:00
|
|
|
*/
|
|
|
|
public void swapConference(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.swapConference(callId);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-14 15:18:07 -07:00
|
|
|
/**
|
|
|
|
* Instructs Telecom to pull an external call to the local device.
|
|
|
|
*
|
|
|
|
* @param callId The callId to pull.
|
|
|
|
*/
|
|
|
|
public void pullExternalCall(String callId) {
|
|
|
|
try {
|
|
|
|
mAdapter.pullExternalCall(callId);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Intructs Telecom to send a call event.
|
|
|
|
*
|
|
|
|
* @param callId The callId to send the event for.
|
|
|
|
* @param event The event.
|
2018-01-05 14:26:16 -08:00
|
|
|
* @param targetSdkVer Target sdk version of the app calling this api
|
2016-03-14 15:18:07 -07:00
|
|
|
* @param extras Extras associated with the event.
|
|
|
|
*/
|
2018-01-05 14:26:16 -08:00
|
|
|
public void sendCallEvent(String callId, String event, int targetSdkVer, Bundle extras) {
|
2016-03-14 15:18:07 -07:00
|
|
|
try {
|
2018-01-05 14:26:16 -08:00
|
|
|
mAdapter.sendCallEvent(callId, event, targetSdkVer, extras);
|
2016-03-14 15:18:07 -07:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Expand call/connection extras API.
Currently, connection extras are propagated up to Telecom as an
entire bundle. This is not ideal, as any time a change is made to
the extras, the bundle needs to be fetched, changed, and then re-set on
the connection, where it is parceled to Telecom as a whole.
Using how extras on an Intent as inspiration, this CL adds separate
putExtras, putExtra, and removeExtra methods to allow manipulation of
the extras bundle without operating on it in its entirety.
This Cl also adds support for Calls modifying the extras bundle, with
changes propagated back down to ConnectionServices.
Bug: 27458894
Change-Id: I152340a3bca2dc03f170b06b172a6823410fb961
2016-03-23 16:06:34 -07:00
|
|
|
/**
|
|
|
|
* Intructs Telecom to add extras to a call.
|
|
|
|
*
|
|
|
|
* @param callId The callId to add the extras to.
|
|
|
|
* @param extras The extras.
|
|
|
|
*/
|
|
|
|
public void putExtras(String callId, Bundle extras) {
|
|
|
|
try {
|
|
|
|
mAdapter.putExtras(callId, extras);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Intructs Telecom to add an extra to a call.
|
|
|
|
*
|
|
|
|
* @param callId The callId to add the extras to.
|
|
|
|
* @param key The extra key.
|
|
|
|
* @param value The extra value.
|
|
|
|
*/
|
|
|
|
public void putExtra(String callId, String key, boolean value) {
|
|
|
|
try {
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putBoolean(key, value);
|
|
|
|
mAdapter.putExtras(callId, bundle);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Intructs Telecom to add an extra to a call.
|
|
|
|
*
|
|
|
|
* @param callId The callId to add the extras to.
|
|
|
|
* @param key The extra key.
|
|
|
|
* @param value The extra value.
|
|
|
|
*/
|
|
|
|
public void putExtra(String callId, String key, int value) {
|
|
|
|
try {
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putInt(key, value);
|
|
|
|
mAdapter.putExtras(callId, bundle);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Intructs Telecom to add an extra to a call.
|
|
|
|
*
|
|
|
|
* @param callId The callId to add the extras to.
|
|
|
|
* @param key The extra key.
|
|
|
|
* @param value The extra value.
|
|
|
|
*/
|
|
|
|
public void putExtra(String callId, String key, String value) {
|
|
|
|
try {
|
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putString(key, value);
|
|
|
|
mAdapter.putExtras(callId, bundle);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Intructs Telecom to remove extras from a call.
|
|
|
|
* @param callId The callId to remove the extras from.
|
|
|
|
* @param keys The extra keys to remove.
|
|
|
|
*/
|
|
|
|
public void removeExtras(String callId, List<String> keys) {
|
|
|
|
try {
|
|
|
|
mAdapter.removeExtras(callId, keys);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-28 14:39:23 -07:00
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to turn the proximity sensor on.
|
2014-07-28 14:39:23 -07:00
|
|
|
*/
|
|
|
|
public void turnProximitySensorOn() {
|
|
|
|
try {
|
|
|
|
mAdapter.turnOnProximitySensor();
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-12 22:16:17 -07:00
|
|
|
* Instructs Telecom to turn the proximity sensor off.
|
2014-07-28 14:39:23 -07:00
|
|
|
*
|
|
|
|
* @param screenOnImmediately If true, the screen will be turned on immediately if it was
|
|
|
|
* previously off. Otherwise, the screen will only be turned on after the proximity sensor
|
|
|
|
* is no longer triggered.
|
|
|
|
*/
|
|
|
|
public void turnProximitySensorOff(boolean screenOnImmediately) {
|
|
|
|
try {
|
|
|
|
mAdapter.turnOffProximitySensor(screenOnImmediately);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2017-01-25 17:12:49 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends an RTT upgrade request to the remote end of the connection.
|
|
|
|
*/
|
2017-02-06 10:49:48 -08:00
|
|
|
public void sendRttRequest(String callId) {
|
2017-01-25 17:12:49 -08:00
|
|
|
try {
|
2017-02-06 10:49:48 -08:00
|
|
|
mAdapter.sendRttRequest(callId);
|
2017-01-25 17:12:49 -08:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Responds to an RTT upgrade request initiated from the remote end.
|
|
|
|
*
|
|
|
|
* @param id the ID of the request as specified by Telecom
|
|
|
|
* @param accept Whether the request should be accepted.
|
|
|
|
*/
|
2017-02-06 10:49:48 -08:00
|
|
|
public void respondToRttRequest(String callId, int id, boolean accept) {
|
2017-01-25 17:12:49 -08:00
|
|
|
try {
|
2017-02-06 10:49:48 -08:00
|
|
|
mAdapter.respondToRttRequest(callId, id, accept);
|
2017-01-25 17:12:49 -08:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Instructs Telecom to shut down the RTT communication channel.
|
|
|
|
*/
|
2017-02-06 10:49:48 -08:00
|
|
|
public void stopRtt(String callId) {
|
2017-01-25 17:12:49 -08:00
|
|
|
try {
|
2017-02-06 10:49:48 -08:00
|
|
|
mAdapter.stopRtt(callId);
|
2017-01-25 17:12:49 -08:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the RTT audio mode.
|
|
|
|
* @param mode the desired RTT audio mode
|
|
|
|
*/
|
2017-02-06 10:49:48 -08:00
|
|
|
public void setRttMode(String callId, int mode) {
|
2017-01-25 17:12:49 -08:00
|
|
|
try {
|
2017-02-06 10:49:48 -08:00
|
|
|
mAdapter.setRttMode(callId, mode);
|
2017-01-25 17:12:49 -08:00
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2017-11-03 11:07:35 -07:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiates a handover of this {@link Call} to the {@link ConnectionService} identified
|
|
|
|
* by destAcct.
|
|
|
|
* @param callId The callId of the Call which calls this function.
|
|
|
|
* @param destAcct ConnectionService to which the call should be handed over.
|
|
|
|
* @param videoState The video state desired after the handover.
|
|
|
|
* @param extras Extra information to be passed to ConnectionService
|
|
|
|
*/
|
|
|
|
public void handoverTo(String callId, PhoneAccountHandle destAcct, int videoState,
|
|
|
|
Bundle extras) {
|
|
|
|
try {
|
|
|
|
mAdapter.handoverTo(callId, destAcct, videoState, extras);
|
|
|
|
} catch (RemoteException ignored) {
|
|
|
|
}
|
|
|
|
}
|
2014-01-27 08:46:21 -08:00
|
|
|
}
|