Add API support for multi-endpoint.

This CL includes changes required to support multi-endpoint (see the
design doc linked off the bug).

Main changes include:
- support for indicating if a call/connection is "external" to the device.
- support for indicating if an external call can be pulled from the
remote device to the local device.
- API used to initiate a pull of a call external to the current device to
the current device.
- Made the "connection event" API public (was previously @hide); this will
be used to support passing some error events involving pulling calls to
the incall ui.
- Added new InCallService metadata which will be used to determine if an
InCallService wants to be informed of external calls.
- New disconnect causes which will be used to expose the fact that a
multi-endpoint call was answered elsewhere and that a call ended because
it was pulled to another device.
- New call log call types to indicate if calls were answered elsewhere
or pulled to another device.

Bug: 27458894
Change-Id: I423f64ff965b5e50194635a51868c327782db2a1
This commit is contained in:
Tyler Gunn
2016-03-14 15:18:07 -07:00
parent 791a154648
commit 876dbfb476
20 changed files with 493 additions and 22 deletions

View File

@@ -94,6 +94,19 @@ public final class Call {
*/
public static final int STATE_DISCONNECTING = 10;
/**
* The state of an external call which is in the process of being pulled from a remote device to
* the local device.
* <p>
* A call can only be in this state if the {@link Details#PROPERTY_IS_EXTERNAL_CALL} property
* and {@link Details#CAPABILITY_CAN_PULL_CALL} capability are set on the call.
* <p>
* An {@link InCallService} will only see this state if it has the
* {@link TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS} metadata set to {@code true} in its
* manifest.
*/
public static final int STATE_PULLING_CALL = 11;
/**
* The key to retrieve the optional {@code PhoneAccount}s Telecom can bundle with its Call
* extras. Used to pass the phone accounts to display on the front end to the user in order to
@@ -226,8 +239,23 @@ public final class Call {
*/
public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 0x00400000;
/**
* When set for an external call, indicates that this {@code Call} can be pulled from a
* remote device to the current device.
* <p>
* Should only be set on a {@code Call} where {@link #PROPERTY_IS_EXTERNAL_CALL} is set.
* <p>
* An {@link InCallService} will only see calls with this capability if it has the
* {@link TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS} metadata set to {@code true}
* in its manifest.
* <p>
* See {@link Connection#CAPABILITY_CAN_PULL_CALL} and
* {@link Connection#CAPABILITY_IS_EXTERNAL_CALL}.
*/
public static final int CAPABILITY_CAN_PULL_CALL = 0x00800000;
//******************************************************************************************
// Next CAPABILITY value: 0x00800000
// Next CAPABILITY value: 0x01000000
//******************************************************************************************
/**
@@ -261,8 +289,25 @@ public final class Call {
*/
public static final int PROPERTY_WORK_CALL = 0x00000020;
/**
* When set, indicates that this {@code Call} does not actually exist locally for the
* {@link ConnectionService}.
* <p>
* Consider, for example, a scenario where a user has two phones with the same phone number.
* When a user places a call on one device, the telephony stack can represent that call on
* the other device by adding it to the {@link ConnectionService} with the
* {@link Connection#CAPABILITY_IS_EXTERNAL_CALL} capability set.
* <p>
* An {@link InCallService} will only see calls with this property if it has the
* {@link TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS} metadata set to {@code true}
* in its manifest.
* <p>
* See {@link Connection#CAPABILITY_IS_EXTERNAL_CALL}.
*/
public static final int PROPERTY_IS_EXTERNAL_CALL = 0x00000040;
//******************************************************************************************
// Next PROPERTY value: 0x00000040
// Next PROPERTY value: 0x00000100
//******************************************************************************************
private final String mTelecomCallId;
@@ -362,6 +407,9 @@ public final class Call {
if (can(capabilities, CAPABILITY_CAN_PAUSE_VIDEO)) {
builder.append(" CAPABILITY_CAN_PAUSE_VIDEO");
}
if (can(capabilities, CAPABILITY_CAN_PULL_CALL)) {
builder.append(" CAPABILITY_CAN_PULL_CALL");
}
builder.append("]");
return builder.toString();
}
@@ -411,6 +459,9 @@ public final class Call {
if (hasProperty(properties, PROPERTY_EMERGENCY_CALLBACK_MODE)) {
builder.append(" PROPERTY_EMERGENCY_CALLBACK_MODE");
}
if (hasProperty(properties, PROPERTY_IS_EXTERNAL_CALL)) {
builder.append(" PROPERTY_IS_EXTERNAL_CALL");
}
builder.append("]");
return builder.toString();
}
@@ -723,6 +774,17 @@ public final class Call {
* conferenced.
*/
public void onConferenceableCallsChanged(Call call, List<Call> conferenceableCalls) {}
/**
* Invoked when a call receives an event from its associated {@link Connection}.
* <p>
* See {@link Connection#sendConnectionEvent(String, Bundle)}.
*
* @param call The {@code Call} receiving the event.
* @param event The event.
* @param extras Extras associated with the connection event.
*/
public void onConnectionEvent(Call call, String event, Bundle extras) {}
}
/**
@@ -888,6 +950,43 @@ public final class Call {
mInCallAdapter.swapConference(mTelecomCallId);
}
/**
* Initiates a request to the {@link ConnectionService} to pull an external call to the local
* device.
* <p>
* Calls to this method are ignored if the call does not have the
* {@link Call.Details#PROPERTY_IS_EXTERNAL_CALL} property set.
* <p>
* An {@link InCallService} will only see calls which support this method if it has the
* {@link TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS} metadata set to {@code true}
* in its manifest.
*/
public void pullExternalCall() {
// If this isn't an external call, ignore the request.
if (!mDetails.hasProperty(Details.PROPERTY_IS_EXTERNAL_CALL)) {
return;
}
mInCallAdapter.pullExternalCall(mTelecomCallId);
}
/**
* Sends a {@code Call} event from this {@code Call} to the associated {@link Connection} in
* the {@link ConnectionService}.
* <p>
* Events are exposed to {@link ConnectionService} implementations via
* {@link android.telecom.Connection#onCallEvent(String, Bundle)}.
* <p>
* No assumptions should be made as to how a {@link ConnectionService} will handle these events.
* Events should be fully qualified (e.g., com.example.event.MY_EVENT) to avoid conflicts.
*
* @param event The connection event.
* @param extras Bundle containing extra information associated with the event.
*/
public void sendCallEvent(String event, Bundle extras) {
mInCallAdapter.sendCallEvent(mTelecomCallId, event, extras);
}
/**
* Obtains the parent of this {@code Call} in a conference, if any.
*
@@ -1211,6 +1310,11 @@ public final class Call {
}
}
/** {@hide} */
final void internalOnConnectionEvent(String event, Bundle extras) {
fireOnConnectionEvent(event, extras);
}
private void fireStateChanged(final int newState) {
for (CallbackRecord<Callback> record : mCallbackRecords) {
final Call call = this;
@@ -1357,6 +1461,27 @@ public final class Call {
}
}
/**
* Notifies listeners of an incoming connection event.
* <p>
* Connection events are issued via {@link Connection#sendConnectionEvent(String, Bundle)}.
*
* @param event
* @param extras
*/
private void fireOnConnectionEvent(final String event, final Bundle extras) {
for (CallbackRecord<Callback> record : mCallbackRecords) {
final Call call = this;
final Callback callback = record.getCallback();
record.getHandler().post(new Runnable() {
@Override
public void run() {
callback.onConnectionEvent(call, event, extras);
}
});
}
}
/**
* Determines if two bundles are equal.
*

View File

@@ -92,6 +92,15 @@ public abstract class Connection extends Conferenceable {
*/
public static final int STATE_DISCONNECTED = 6;
/**
* The state of an external connection which is in the process of being pulled from a remote
* device to the local device.
* <p>
* A connection can only be in this state if the {@link #CAPABILITY_IS_EXTERNAL_CALL} and
* {@link #CAPABILITY_CAN_PULL_CALL} capability bits are set on the connection.
*/
public static final int STATE_PULLING_CALL = 7;
/**
* Connection can currently be put on hold or unheld. This is distinct from
* {@link #CAPABILITY_SUPPORT_HOLD} in that although a connection may support 'hold' most times,
@@ -270,8 +279,33 @@ public abstract class Connection extends Conferenceable {
*/
public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 0x00800000;
/**
* When set, indicates that the {@code Connection} does not actually exist locally for the
* {@link ConnectionService}.
* <p>
* Consider, for example, a scenario where a user has two devices with the same phone number.
* When a user places a call on one devices, the telephony stack can represent that call on the
* other device by adding is to the {@link ConnectionService} with the
* {@code CAPABILITY_IS_EXTERNAL_CALL} capability set.
* <p>
* An {@link ConnectionService} should not assume that all {@link InCallService}s will handle
* external connections. Only those {@link InCallService}s which have the
* {@link TelecomManager#METADATA_INCLUDE_EXTERNAL_CALLS} metadata set to {@code true} in its
* manifest will see external connections.
*/
public static final int CAPABILITY_IS_EXTERNAL_CALL = 0x01000000;
/**
* When set for an external connection, indicates that this {@code Connection} can be pulled
* from a remote device to the current device.
* <p>
* Should only be set on a {@code Connection} where {@link #CAPABILITY_IS_EXTERNAL_CALL}
* is set.
*/
public static final int CAPABILITY_CAN_PULL_CALL = 0x02000000;
//**********************************************************************************************
// Next CAPABILITY value: 0x01000000
// Next CAPABILITY value: 0x04000000
//**********************************************************************************************
/**
@@ -315,6 +349,18 @@ public abstract class Connection extends Conferenceable {
public static final String EVENT_ON_HOLD_TONE_END =
"android.telecom.event.ON_HOLD_TONE_END";
/**
* Connection event used to inform {@link InCallService}s when pulling of an external call has
* failed. The user interface should inform the user of the error.
* <p>
* Expected to be used by the {@link ConnectionService} when the {@link Call#pullExternalCall()}
* API is called on a {@link Call} with the properties
* {@link Call.Details#PROPERTY_IS_EXTERNAL_CALL} and
* {@link Call.Details#CAPABILITY_CAN_PULL_CALL}, but the {@link ConnectionService} could not
* pull the external call due to an error condition.
*/
public static final String EVENT_CALL_PULL_FAILED = "android.telecom.event.CALL_PULL_FAILED";
// Flag controlling whether PII is emitted into the logs
private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG);
@@ -434,6 +480,12 @@ public abstract class Connection extends Conferenceable {
if (can(capabilities, CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
builder.append(" CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION");
}
if (can(capabilities, CAPABILITY_IS_EXTERNAL_CALL)) {
builder.append(" CAPABILITY_IS_EXTERNAL_CALL");
}
if (can(capabilities, CAPABILITY_CAN_PULL_CALL)) {
builder.append(" CAPABILITY_CAN_PULL_CALL");
}
builder.append("]");
return builder.toString();
@@ -465,8 +517,7 @@ public abstract class Connection extends Conferenceable {
public void onConferenceStarted() {}
public void onConferenceMergeFailed(Connection c) {}
public void onExtrasChanged(Connection c, Bundle extras) {}
/** @hide */
public void onConnectionEvent(Connection c, String event) {}
public void onConnectionEvent(Connection c, String event, Bundle extras) {}
}
/**
@@ -1854,6 +1905,31 @@ public abstract class Connection extends Conferenceable {
*/
public void onPostDialContinue(boolean proceed) {}
/**
* Notifies this Connection of a request to pull an external call to the local device.
* <p>
* The {@link InCallService} issues a request to pull an external call to the local device via
* {@link Call#pullExternalCall()}.
* <p>
* For a Connection to be pulled, both the {@link Connection#CAPABILITY_CAN_PULL_CALL} and
* {@link Connection#CAPABILITY_IS_EXTERNAL_CALL} capability bits must be set.
* <p>
* For more information on external calls, see {@link Connection#CAPABILITY_IS_EXTERNAL_CALL}.
*/
public void onPullExternalCall() {}
/**
* Notifies this Connection of a {@link Call} event initiated from an {@link InCallService}.
* <p>
* The {@link InCallService} issues a Call event via {@link Call#sendCallEvent(String, Bundle)}.
* <p>
* See also {@link Call#sendCallEvent(String, Bundle)}.
*
* @param event The call event.
* @param extras Extras associated with the call event.
*/
public void onCallEvent(String event, Bundle extras) {}
static String toLogSafePhoneNumber(String number) {
// For unknown number, log empty string.
if (number == null) {
@@ -2008,14 +2084,20 @@ public abstract class Connection extends Conferenceable {
}
/**
* Sends a connection event to Telecom.
* Sends an event associated with this {@code Connection}, with associated event extras.
*
* Events are exposed to {@link InCallService} implementations via the
* {@link Call.Callback#onConnectionEvent(Call, String, Bundle)} API.
*
* No assumptions should be made as to how an In-Call UI or service will handle these events.
* Events should be fully qualified (e.g., com.example.event.MY_EVENT) to avoid conflicts.
*
* @param event The connection event.
* @hide
* @param extras Bundle containing extra information associated with the event.
*/
protected void sendConnectionEvent(String event) {
public void sendConnectionEvent(String event, Bundle extras) {
for (Listener l : mListeners) {
l.onConnectionEvent(this, event);
l.onConnectionEvent(this, event, null);
}
}
}

View File

@@ -103,6 +103,8 @@ public abstract class ConnectionService extends Service {
private static final int MSG_SWAP_CONFERENCE = 19;
private static final int MSG_REJECT_WITH_MESSAGE = 20;
private static final int MSG_SILENCE = 21;
private static final int MSG_PULL_EXTERNAL_CALL = 22;
private static final int MSG_SEND_CALL_EVENT = 23;
private static Connection sNullConnection;
@@ -245,6 +247,20 @@ public abstract class ConnectionService extends Service {
args.argi1 = proceed ? 1 : 0;
mHandler.obtainMessage(MSG_ON_POST_DIAL_CONTINUE, args).sendToTarget();
}
@Override
public void pullExternalCall(String callId) {
mHandler.obtainMessage(MSG_PULL_EXTERNAL_CALL, callId).sendToTarget();
}
@Override
public void sendCallEvent(String callId, String event, Bundle extras) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
args.arg2 = event;
args.arg3 = extras;
mHandler.obtainMessage(MSG_SEND_CALL_EVENT, args).sendToTarget();
}
};
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@@ -382,6 +398,22 @@ public abstract class ConnectionService extends Service {
}
break;
}
case MSG_PULL_EXTERNAL_CALL: {
pullExternalCall((String) msg.obj);
break;
}
case MSG_SEND_CALL_EVENT: {
SomeArgs args = (SomeArgs) msg.obj;
try {
String callId = (String) args.arg1;
String event = (String) args.arg2;
Bundle extras = (Bundle) args.arg3;
sendCallEvent(callId, event, extras);
} finally {
args.recycle();
}
break;
}
default:
break;
}
@@ -615,10 +647,10 @@ public abstract class ConnectionService extends Service {
}
@Override
public void onConnectionEvent(Connection connection, String event) {
public void onConnectionEvent(Connection connection, String event, Bundle extras) {
String id = mIdByConnection.get(connection);
if (id != null) {
mAdapter.onConnectionEvent(id, event);
mAdapter.onConnectionEvent(id, event, extras);
}
}
};
@@ -864,6 +896,39 @@ public abstract class ConnectionService extends Service {
}
}
/**
* Notifies a {@link Connection} of a request to pull an external call.
*
* See {@link Call#pullExternalCall()}.
*
* @param callId The ID of the call to pull.
*/
private void pullExternalCall(String callId) {
Log.d(this, "pullExternalCall(%s)", callId);
Connection connection = findConnectionForAction(callId, "pullExternalCall");
if (connection != null) {
connection.onPullExternalCall();
}
}
/**
* Notifies a {@link Connection} of a call event.
*
* See {@link Call#sendCallEvent(String, Bundle)}.
*
* @param callId The ID of the call receiving the event.
* @param event The event.
* @param extras Extras associated with the event.
*/
private void sendCallEvent(String callId, String event, Bundle extras) {
Log.d(this, "sendCallEvent(%s, %s)", callId, event);
Connection connection = findConnectionForAction(callId, "sendCallEvent");
if (connection != null) {
connection.onCallEvent(event, extras);
}
}
private void onPostDialContinue(String callId, boolean proceed) {
Log.d(this, "onPostDialContinue(%s)", callId);
findConnectionForAction(callId, "stopDtmfTone").onPostDialContinue(proceed);

View File

@@ -418,12 +418,13 @@ final class ConnectionServiceAdapter implements DeathRecipient {
*
* @param callId The unique ID of the call.
* @param event The event.
* @param extras Extras associated with the event.
*/
void onConnectionEvent(String callId, String event) {
void onConnectionEvent(String callId, String event, Bundle extras) {
Log.v(this, "onConnectionEvent: %s", event);
for (IConnectionServiceAdapter adapter : mAdapters) {
try {
adapter.onConnectionEvent(callId, event);
adapter.onConnectionEvent(callId, event, extras);
} catch (RemoteException ignored) {
}
}

View File

@@ -245,7 +245,8 @@ final class ConnectionServiceAdapterServant {
case MSG_ON_CONNECTION_EVENT: {
SomeArgs args = (SomeArgs) msg.obj;
try {
mDelegate.onConnectionEvent((String) args.arg1, (String) args.arg2);
mDelegate.onConnectionEvent((String) args.arg1, (String) args.arg2,
(Bundle) args.arg3);
} finally {
args.recycle();
}
@@ -432,10 +433,11 @@ final class ConnectionServiceAdapterServant {
}
@Override
public final void onConnectionEvent(String connectionId, String event) {
public final void onConnectionEvent(String connectionId, String event, Bundle extras) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = connectionId;
args.arg2 = event;
args.arg3 = extras;
mHandler.obtainMessage(MSG_ON_CONNECTION_EVENT, args).sendToTarget();
}
};

View File

@@ -64,6 +64,17 @@ public final class DisconnectCause implements Parcelable {
*/
public static final int CONNECTION_MANAGER_NOT_SUPPORTED = 10;
/**
* Disconnected because the user did not locally answer the incoming call, but it was answered
* on another device where the call was ringing.
*/
public static final int ANSWERED_ELSEWHERE = 11;
/**
* Disconnected because the call was pulled from the current device to another device.
*/
public static final int CALL_PULLED = 12;
private int mDisconnectCode;
private CharSequence mDisconnectLabel;
private CharSequence mDisconnectDescription;

View File

@@ -16,6 +16,7 @@
package android.telecom;
import android.os.Bundle;
import android.os.RemoteException;
import com.android.internal.telecom.IInCallAdapter;
@@ -250,6 +251,32 @@ public final class InCallAdapter {
}
}
/**
* 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.
* @param extras Extras associated with the event.
*/
public void sendCallEvent(String callId, String event, Bundle extras) {
try {
mAdapter.sendCallEvent(callId, event, extras);
} catch (RemoteException ignored) {
}
}
/**
* Instructs Telecom to turn the proximity sensor on.
*/

View File

@@ -22,6 +22,7 @@ import android.app.Service;
import android.content.Intent;
import android.hardware.camera2.CameraManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -74,6 +75,7 @@ public abstract class InCallService extends Service {
private static final int MSG_BRING_TO_FOREGROUND = 6;
private static final int MSG_ON_CAN_ADD_CALL_CHANGED = 7;
private static final int MSG_SILENCE_RINGER = 8;
private static final int MSG_ON_CONNECTION_EVENT = 9;
/** Default Handler used to consolidate binder method calls onto a single thread. */
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@@ -118,6 +120,18 @@ public abstract class InCallService extends Service {
case MSG_SILENCE_RINGER:
mPhone.internalSilenceRinger();
break;
case MSG_ON_CONNECTION_EVENT: {
SomeArgs args = (SomeArgs) msg.obj;
try {
String callId = (String) args.arg1;
String event = (String) args.arg2;
Bundle extras = (Bundle) args.arg3;
mPhone.internalOnConnectionEvent(callId, event, extras);
} finally {
args.recycle();
}
break;
}
default:
break;
}
@@ -174,6 +188,15 @@ public abstract class InCallService extends Service {
public void silenceRinger() {
mHandler.obtainMessage(MSG_SILENCE_RINGER).sendToTarget();
}
@Override
public void onConnectionEvent(String callId, String event, Bundle extras) {
SomeArgs args = SomeArgs.obtain();
args.arg1 = callId;
args.arg2 = event;
args.arg3 = extras;
mHandler.obtainMessage(MSG_ON_CONNECTION_EVENT, args).sendToTarget();
}
}
private Phone.Listener mPhoneListener = new Phone.Listener() {
@@ -425,6 +448,19 @@ public abstract class InCallService extends Service {
public void onSilenceRinger() {
}
/**
* Called when a {@link Call} has received a connection event issued by the
* {@link ConnectionService}.
* <p>
* See {@link Connection#sendConnectionEvent(String, Bundle)}.
*
* @param call The call the event is associated with.
* @param event The event.
* @param extras Any associated extras.
*/
public void onConnectionEvent(Call call, String event, Bundle extras) {
}
/**
* Used to issue commands to the {@link Connection.VideoProvider} associated with a
* {@link Call}.

View File

@@ -17,6 +17,7 @@
package android.telecom;
import android.annotation.SystemApi;
import android.os.Bundle;
import android.util.ArrayMap;
import java.util.Collections;
@@ -190,6 +191,13 @@ public final class Phone {
fireSilenceRinger();
}
final void internalOnConnectionEvent(String telecomId, String event, Bundle extras) {
Call call = mCallByTelecomCallId.get(telecomId);
if (call != null) {
call.internalOnConnectionEvent(event, extras);
}
}
/**
* Called to destroy the phone and cleanup any lingering calls.
*/

View File

@@ -212,12 +212,14 @@ public final class RemoteConnection {
/**
* Handles a connection event propagated to this {@link RemoteConnection}.
* <p>
* Connection events originate from {@link Connection#sendConnectionEvent(String, Bundle)}.
*
* @param connection The {@code RemoteConnection} invoking this method.
* @param event The connection event.
* @hide
* @param extras Extras associated with the event.
*/
public void onConnectionEvent(RemoteConnection connection, String event) {}
public void onConnectionEvent(RemoteConnection connection, String event, Bundle extras) {}
}
/**
@@ -961,6 +963,20 @@ public final class RemoteConnection {
}
}
/**
* Instructs this {@link RemoteConnection} to pull itself to the local device.
* <p>
* See {@link Call#pullExternalCall()} for more information.
*/
public void pullExternalCall() {
try {
if (mConnected) {
mConnectionService.pullExternalCall(mConnectionId);
}
} catch (RemoteException ignored) {
}
}
/**
* Set the audio state of this {@code RemoteConnection}.
*
@@ -1301,14 +1317,14 @@ public final class RemoteConnection {
}
/** @hide */
void onConnectionEvent(final String event) {
void onConnectionEvent(final String event, final Bundle extras) {
for (CallbackRecord record : mCallbackRecords) {
final RemoteConnection connection = this;
final Callback callback = record.getCallback();
record.getHandler().post(new Runnable() {
@Override
public void run() {
callback.onConnectionEvent(connection, event);
callback.onConnectionEvent(connection, event, extras);
}
});
}

View File

@@ -332,9 +332,10 @@ final class RemoteConnectionService {
}
@Override
public void onConnectionEvent(String callId, String event) {
public void onConnectionEvent(String callId, String event, Bundle extras) {
if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "onConnectionEvent").onConnectionEvent(event);
findConnectionForAction(callId, "onConnectionEvent").onConnectionEvent(event,
extras);
}
}
};

View File

@@ -316,6 +316,18 @@ public class TelecomManager {
public static final String METADATA_IN_CALL_SERVICE_RINGING =
"android.telecom.IN_CALL_SERVICE_RINGING";
/**
* A boolean meta-data value indicating whether an {@link InCallService} wants to be informed of
* calls which have the {@link Call.Details#PROPERTY_IS_EXTERNAL_CALL} property. An external
* call is one which a {@link ConnectionService} knows about, but is not connected to directly.
* Dialer implementations (see {@link #getDefaultDialerPackage()}) which would like to be
* informed of external calls should set this meta-data to {@code true} in the manifest
* registration of their {@link InCallService}. By default, the {@link InCallService} will NOT
* be informed of external calls.
*/
public static final String METADATA_INCLUDE_EXTERNAL_CALLS =
"android.telecom.INCLUDE_EXTERNAL_CALLS";
/**
* The dual tone multi-frequency signaling character sent to indicate the dialing system should
* pause for a predefined period.

View File

@@ -75,4 +75,8 @@ oneway interface IConnectionService {
void swapConference(String conferenceCallId);
void onPostDialContinue(String callId, boolean proceed);
void pullExternalCall(String callId);
void sendCallEvent(String callId, String event, in Bundle extras);
}

View File

@@ -87,5 +87,5 @@ oneway interface IConnectionServiceAdapter {
void setExtras(String callId, in Bundle extras);
void onConnectionEvent(String callId, String event);
void onConnectionEvent(String callId, String event, in Bundle extras);
}

View File

@@ -16,6 +16,7 @@
package com.android.internal.telecom;
import android.os.Bundle;
import android.telecom.PhoneAccountHandle;
/**
@@ -60,4 +61,8 @@ oneway interface IInCallAdapter {
void turnOnProximitySensor();
void turnOffProximitySensor(boolean screenOnImmediately);
void pullExternalCall(String callId);
void sendCallEvent(String callId, String event, in Bundle extras);
}

View File

@@ -17,6 +17,7 @@
package com.android.internal.telecom;
import android.app.PendingIntent;
import android.os.Bundle;
import android.telecom.CallAudioState;
import android.telecom.ParcelableCall;
@@ -47,4 +48,6 @@ oneway interface IInCallService {
void onCanAddCallChanged(boolean canAddCall);
void silenceRinger();
void onConnectionEvent(String callId, String event, in Bundle extras);
}