am 6cacf44e: Merge "Telecom API updates (1/6)" into lmp-mr1-dev

* commit '6cacf44e7ecfe50097adc99dab97c3fb9770a1af':
  Telecom API updates (1/6)
This commit is contained in:
Ihab Awad
2014-12-01 16:29:35 +00:00
committed by Android Git Automerger
15 changed files with 644 additions and 331 deletions

View File

@@ -54,25 +54,25 @@ public final class AudioState implements Parcelable {
public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET | public static final int ROUTE_ALL = ROUTE_EARPIECE | ROUTE_BLUETOOTH | ROUTE_WIRED_HEADSET |
ROUTE_SPEAKER; ROUTE_SPEAKER;
/** True if the call is muted, false otherwise. */ /** @hide */
public final boolean isMuted; @Deprecated public final boolean isMuted;
/** The current audio route being used. */ /** @hide */
public final int route; @Deprecated public final int route;
/** Bit mask of all routes supported by this call. */ /** @hide */
public final int supportedRouteMask; @Deprecated public final int supportedRouteMask;
public AudioState(boolean isMuted, int route, int supportedRouteMask) { public AudioState(boolean muted, int route, int supportedRouteMask) {
this.isMuted = isMuted; this.isMuted = muted;
this.route = route; this.route = route;
this.supportedRouteMask = supportedRouteMask; this.supportedRouteMask = supportedRouteMask;
} }
public AudioState(AudioState state) { public AudioState(AudioState state) {
isMuted = state.isMuted; isMuted = state.isMuted();
route = state.route; route = state.getRoute();
supportedRouteMask = state.supportedRouteMask; supportedRouteMask = state.getSupportedRouteMask();
} }
@Override @Override
@@ -84,15 +84,17 @@ public final class AudioState implements Parcelable {
return false; return false;
} }
AudioState state = (AudioState) obj; AudioState state = (AudioState) obj;
return isMuted == state.isMuted && route == state.route && return isMuted() == state.isMuted() && getRoute() == state.getRoute() &&
supportedRouteMask == state.supportedRouteMask; getSupportedRouteMask() == state.getSupportedRouteMask();
} }
@Override @Override
public String toString() { public String toString() {
return String.format(Locale.US, return String.format(Locale.US,
"[AudioState isMuted: %b, route; %s, supportedRouteMask: %s]", "[AudioState isMuted: %b, route; %s, supportedRouteMask: %s]",
isMuted, audioRouteToString(route), audioRouteToString(supportedRouteMask)); isMuted,
audioRouteToString(route),
audioRouteToString(supportedRouteMask));
} }
/** @hide */ /** @hide */
@@ -162,4 +164,25 @@ public final class AudioState implements Parcelable {
destination.writeInt(route); destination.writeInt(route);
destination.writeInt(supportedRouteMask); destination.writeInt(supportedRouteMask);
} }
/**
* @return {@code true} if the call is muted, false otherwise.
*/
public boolean isMuted() {
return isMuted;
}
/**
* @return The current audio route being used.
*/
public int getRoute() {
return route;
}
/**
* @return Bit mask of all routes supported by this call.
*/
public int getSupportedRouteMask() {
return supportedRouteMask;
}
} }

View File

@@ -97,6 +97,91 @@ public final class Call {
public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts";
public static class Details { public static class Details {
/** Call can currently be put on hold or unheld. */
public static final int CAPABILITY_HOLD = 0x00000001;
/** Call supports the hold feature. */
public static final int CAPABILITY_SUPPORT_HOLD = 0x00000002;
/**
* Calls within a conference can be merged. A {@link ConnectionService} has the option to
* add a {@link Conference} call before the child {@link Connection}s are merged. This is how
* CDMA-based {@link Connection}s are implemented. For these unmerged {@link Conference}s, this
* capability allows a merge button to be shown while the conference call is in the foreground
* of the in-call UI.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int CAPABILITY_MERGE_CONFERENCE = 0x00000004;
/**
* Calls within a conference can be swapped between foreground and background.
* See {@link #CAPABILITY_MERGE_CONFERENCE} for additional information.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int CAPABILITY_SWAP_CONFERENCE = 0x00000008;
/**
* @hide
*/
public static final int CAPABILITY_UNUSED = 0x00000010;
/** Call supports responding via text option. */
public static final int CAPABILITY_RESPOND_VIA_TEXT = 0x00000020;
/** Call can be muted. */
public static final int CAPABILITY_MUTE = 0x00000040;
/**
* Call supports conference call management. This capability only applies to {@link Conference}
* calls which can have {@link Connection}s as children.
*/
public static final int CAPABILITY_MANAGE_CONFERENCE = 0x00000080;
/**
* Local device supports video telephony.
* @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL = 0x00000100;
/**
* Remote device supports video telephony.
* @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE = 0x00000200;
/**
* Call is using voice over LTE.
* @hide
*/
public static final int CAPABILITY_VoLTE = 0x00000400;
/**
* Call is using voice over WIFI.
* @hide
*/
public static final int CAPABILITY_VoWIFI = 0x00000800;
/**
* Call is able to be separated from its parent {@code Conference}, if any.
*/
public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 0x00001000;
/**
* Call is able to be individually disconnected when in a {@code Conference}.
*/
public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 0x00002000;
/**
* Whether the call is a generic conference, where we do not know the precise state of
* participants in the conference (eg. on CDMA).
*
* @hide
*/
public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000;
private final Uri mHandle; private final Uri mHandle;
private final int mHandlePresentation; private final int mHandlePresentation;
private final String mCallerDisplayName; private final String mCallerDisplayName;
@@ -111,6 +196,78 @@ public final class Call {
private final StatusHints mStatusHints; private final StatusHints mStatusHints;
private final Bundle mExtras; private final Bundle mExtras;
/**
* Whether the supplied capabilities supports the specified capability.
*
* @param capabilities A bit field of capabilities.
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public static boolean can(int capabilities, int capability) {
return (capabilities & capability) != 0;
}
/**
* Whether the capabilities of this {@code Details} supports the specified capability.
*
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public boolean can(int capability) {
return can(mCallCapabilities, capability);
}
/**
* Render a set of capability bits ({@code CAPABILITY_*}) as a human readable string.
*
* @param capabilities A capability bit field.
* @return A human readable string representation.
*/
public static String capabilitiesToString(int capabilities) {
StringBuilder builder = new StringBuilder();
builder.append("[Capabilities:");
if (can(capabilities, CAPABILITY_HOLD)) {
builder.append(" CAPABILITY_HOLD");
}
if (can(capabilities, CAPABILITY_SUPPORT_HOLD)) {
builder.append(" CAPABILITY_SUPPORT_HOLD");
}
if (can(capabilities, CAPABILITY_MERGE_CONFERENCE)) {
builder.append(" CAPABILITY_MERGE_CONFERENCE");
}
if (can(capabilities, CAPABILITY_SWAP_CONFERENCE)) {
builder.append(" CAPABILITY_SWAP_CONFERENCE");
}
if (can(capabilities, CAPABILITY_RESPOND_VIA_TEXT)) {
builder.append(" CAPABILITY_RESPOND_VIA_TEXT");
}
if (can(capabilities, CAPABILITY_MUTE)) {
builder.append(" CAPABILITY_MUTE");
}
if (can(capabilities, CAPABILITY_MANAGE_CONFERENCE)) {
builder.append(" CAPABILITY_MANAGE_CONFERENCE");
}
if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) {
builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL");
}
if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) {
builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE");
}
if (can(capabilities, CAPABILITY_VoLTE)) {
builder.append(" CAPABILITY_VoLTE");
}
if (can(capabilities, CAPABILITY_VoWIFI)) {
builder.append(" CAPABILITY_VoWIFI");
}
if (can(capabilities, CAPABILITY_GENERIC_CONFERENCE)) {
builder.append(" CAPABILITY_GENERIC_CONFERENCE");
}
builder.append("]");
return builder.toString();
}
/** /**
* @return The handle (e.g., phone number) to which the {@code Call} is currently * @return The handle (e.g., phone number) to which the {@code Call} is currently
* connected. * connected.
@@ -151,8 +308,8 @@ public final class Call {
} }
/** /**
* @return A bitmask of the capabilities of the {@code Call}, as defined in * @return A bitmask of the capabilities of the {@code Call}, as defined by the various
* {@link PhoneCapabilities}. * {@code CAPABILITY_*} constants in this class.
*/ */
public int getCallCapabilities() { public int getCallCapabilities() {
return mCallCapabilities; return mCallCapabilities;
@@ -511,14 +668,14 @@ public final class Call {
} }
/** /**
* Merges the calls within this conference. See {@link PhoneCapabilities#MERGE_CONFERENCE}. * Merges the calls within this conference. See {@link Details#CAPABILITY_MERGE_CONFERENCE}.
*/ */
public void mergeConference() { public void mergeConference() {
mInCallAdapter.mergeConference(mTelecomCallId); mInCallAdapter.mergeConference(mTelecomCallId);
} }
/** /**
* Swaps the calls within this conference. See {@link PhoneCapabilities#SWAP_CONFERENCE}. * Swaps the calls within this conference. See {@link Details#CAPABILITY_SWAP_CONFERENCE}.
*/ */
public void swapConference() { public void swapConference() {
mInCallAdapter.swapConference(mTelecomCallId); mInCallAdapter.swapConference(mTelecomCallId);

View File

@@ -41,7 +41,8 @@ public abstract class Conference implements IConferenceable {
public void onConferenceableConnectionsChanged( public void onConferenceableConnectionsChanged(
Conference conference, List<Connection> conferenceableConnections) {} Conference conference, List<Connection> conferenceableConnections) {}
public void onDestroyed(Conference conference) {} public void onDestroyed(Conference conference) {}
public void onCapabilitiesChanged(Conference conference, int capabilities) {} public void onConnectionCapabilitiesChanged(
Conference conference, int connectionCapabilities) {}
} }
private final Set<Listener> mListeners = new CopyOnWriteArraySet<>(); private final Set<Listener> mListeners = new CopyOnWriteArraySet<>();
@@ -56,7 +57,7 @@ public abstract class Conference implements IConferenceable {
private AudioState mAudioState; private AudioState mAudioState;
private int mState = Connection.STATE_NEW; private int mState = Connection.STATE_NEW;
private DisconnectCause mDisconnectCause; private DisconnectCause mDisconnectCause;
private int mCapabilities; private int mConnectionCapabilities;
private String mDisconnectMessage; private String mDisconnectMessage;
private final Connection.Listener mConnectionDeathListener = new Connection.Listener() { private final Connection.Listener mConnectionDeathListener = new Connection.Listener() {
@@ -104,13 +105,62 @@ public abstract class Conference implements IConferenceable {
return mState; return mState;
} }
/** @hide */
@Deprecated public final int getCapabilities() {
return getConnectionCapabilities();
}
/** /**
* Returns the capabilities of a conference. See {@link PhoneCapabilities} for valid values. * Returns the capabilities of a conference. See {@code CAPABILITY_*} constants in class
* {@link Connection} for valid values.
* *
* @return A bitmask of the {@code PhoneCapabilities} of the conference call. * @return A bitmask of the capabilities of the conference call.
*/ */
public final int getCapabilities() { public final int getConnectionCapabilities() {
return mCapabilities; return mConnectionCapabilities;
}
/**
* Whether the given capabilities support the specified capability.
*
* @param capabilities A capability bit field.
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public static boolean can(int capabilities, int capability) {
return (capabilities & capability) != 0;
}
/**
* Whether the capabilities of this {@code Connection} supports the specified capability.
*
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public boolean can(int capability) {
return can(mConnectionCapabilities, capability);
}
/**
* Removes the specified capability from the set of capabilities of this {@code Conference}.
*
* @param capability The capability to remove from the set.
* @hide
*/
public void removeCapability(int capability) {
mConnectionCapabilities &= ~capability;
}
/**
* Adds the specified capability to the set of capabilities of this {@code Conference}.
*
* @param capability The capability to add to the set.
* @hide
*/
public void addCapability(int capability) {
mConnectionCapabilities |= capability;
} }
/** /**
@@ -153,13 +203,13 @@ public abstract class Conference implements IConferenceable {
/** /**
* Invoked when the child calls should be merged. Only invoked if the conference contains the * Invoked when the child calls should be merged. Only invoked if the conference contains the
* capability {@link PhoneCapabilities#MERGE_CONFERENCE}. * capability {@link Connection#CAPABILITY_MERGE_CONFERENCE}.
*/ */
public void onMerge() {} public void onMerge() {}
/** /**
* Invoked when the child calls should be swapped. Only invoked if the conference contains the * Invoked when the child calls should be swapped. Only invoked if the conference contains the
* capability {@link PhoneCapabilities#SWAP_CONFERENCE}. * capability {@link Connection#CAPABILITY_SWAP_CONFERENCE}.
*/ */
public void onSwap() {} public void onSwap() {}
@@ -224,17 +274,23 @@ public abstract class Conference implements IConferenceable {
return mDisconnectCause; return mDisconnectCause;
} }
/** @hide */
@Deprecated public final void setCapabilities(int connectionCapabilities) {
setConnectionCapabilities(connectionCapabilities);
}
/** /**
* Sets the capabilities of a conference. See {@link PhoneCapabilities} for valid values. * Sets the capabilities of a conference. See {@code CAPABILITY_*} constants of class
* {@link Connection} for valid values.
* *
* @param capabilities A bitmask of the {@code PhoneCapabilities} of the conference call. * @param connectionCapabilities A bitmask of the {@code PhoneCapabilities} of the conference call.
*/ */
public final void setCapabilities(int capabilities) { public final void setConnectionCapabilities(int connectionCapabilities) {
if (capabilities != mCapabilities) { if (connectionCapabilities != mConnectionCapabilities) {
mCapabilities = capabilities; mConnectionCapabilities = connectionCapabilities;
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onCapabilitiesChanged(this, mCapabilities); l.onConnectionCapabilitiesChanged(this, mConnectionCapabilities);
} }
} }
} }

View File

@@ -63,9 +63,180 @@ public abstract class Connection implements IConferenceable {
public static final int STATE_DISCONNECTED = 6; public static final int STATE_DISCONNECTED = 6;
/** Connection can currently be put on hold or unheld. */
public static final int CAPABILITY_HOLD = 0x00000001;
/** Connection supports the hold feature. */
public static final int CAPABILITY_SUPPORT_HOLD = 0x00000002;
/**
* Connections within a conference can be merged. A {@link ConnectionService} has the option to
* add a {@link Conference} before the child {@link Connection}s are merged. This is how
* CDMA-based {@link Connection}s are implemented. For these unmerged {@link Conference}s, this
* capability allows a merge button to be shown while the conference is in the foreground
* of the in-call UI.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int CAPABILITY_MERGE_CONFERENCE = 0x00000004;
/**
* Connections within a conference can be swapped between foreground and background.
* See {@link #CAPABILITY_MERGE_CONFERENCE} for additional information.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int CAPABILITY_SWAP_CONFERENCE = 0x00000008;
/**
* @hide
*/
public static final int CAPABILITY_UNUSED = 0x00000010;
/** Connection supports responding via text option. */
public static final int CAPABILITY_RESPOND_VIA_TEXT = 0x00000020;
/** Connection can be muted. */
public static final int CAPABILITY_MUTE = 0x00000040;
/**
* Connection supports conference management. This capability only applies to
* {@link Conference}s which can have {@link Connection}s as children.
*/
public static final int CAPABILITY_MANAGE_CONFERENCE = 0x00000080;
/**
* Local device supports video telephony.
* @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_LOCAL = 0x00000100;
/**
* Remote device supports video telephony.
* @hide
*/
public static final int CAPABILITY_SUPPORTS_VT_REMOTE = 0x00000200;
/**
* Connection is using voice over LTE.
* @hide
*/
public static final int CAPABILITY_VoLTE = 0x00000400;
/**
* Connection is using voice over WIFI.
* @hide
*/
public static final int CAPABILITY_VoWIFI = 0x00000800;
/**
* Connection is able to be separated from its parent {@code Conference}, if any.
*/
public static final int CAPABILITY_SEPARATE_FROM_CONFERENCE = 0x00001000;
/**
* Connection is able to be individually disconnected when in a {@code Conference}.
*/
public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 0x00002000;
/**
* Whether the call is a generic conference, where we do not know the precise state of
* participants in the conference (eg. on CDMA).
*
* @hide
*/
public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000;
// Flag controlling whether PII is emitted into the logs // Flag controlling whether PII is emitted into the logs
private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG); private static final boolean PII_DEBUG = Log.isLoggable(android.util.Log.DEBUG);
/**
* Whether the given capabilities support the specified capability.
*
* @param capabilities A capability bit field.
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public static boolean can(int capabilities, int capability) {
return (capabilities & capability) != 0;
}
/**
* Whether the capabilities of this {@code Connection} supports the specified capability.
*
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public boolean can(int capability) {
return can(mConnectionCapabilities, capability);
}
/**
* Removes the specified capability from the set of capabilities of this {@code Connection}.
*
* @param capability The capability to remove from the set.
* @hide
*/
public void removeCapability(int capability) {
mConnectionCapabilities &= ~capability;
}
/**
* Adds the specified capability to the set of capabilities of this {@code Connection}.
*
* @param capability The capability to add to the set.
* @hide
*/
public void addCapability(int capability) {
mConnectionCapabilities |= capability;
}
public static String capabilitiesToString(int capabilities) {
StringBuilder builder = new StringBuilder();
builder.append("[Capabilities:");
if (can(capabilities, CAPABILITY_HOLD)) {
builder.append(" CAPABILITY_HOLD");
}
if (can(capabilities, CAPABILITY_SUPPORT_HOLD)) {
builder.append(" CAPABILITY_SUPPORT_HOLD");
}
if (can(capabilities, CAPABILITY_MERGE_CONFERENCE)) {
builder.append(" CAPABILITY_MERGE_CONFERENCE");
}
if (can(capabilities, CAPABILITY_SWAP_CONFERENCE)) {
builder.append(" CAPABILITY_SWAP_CONFERENCE");
}
if (can(capabilities, CAPABILITY_RESPOND_VIA_TEXT)) {
builder.append(" CAPABILITY_RESPOND_VIA_TEXT");
}
if (can(capabilities, CAPABILITY_MUTE)) {
builder.append(" CAPABILITY_MUTE");
}
if (can(capabilities, CAPABILITY_MANAGE_CONFERENCE)) {
builder.append(" CAPABILITY_MANAGE_CONFERENCE");
}
if (can(capabilities, CAPABILITY_SUPPORTS_VT_LOCAL)) {
builder.append(" CAPABILITY_SUPPORTS_VT_LOCAL");
}
if (can(capabilities, CAPABILITY_SUPPORTS_VT_REMOTE)) {
builder.append(" CAPABILITY_SUPPORTS_VT_REMOTE");
}
if (can(capabilities, CAPABILITY_VoLTE)) {
builder.append(" CAPABILITY_VoLTE");
}
if (can(capabilities, CAPABILITY_VoWIFI)) {
builder.append(" CAPABILITY_VoWIFI");
}
if (can(capabilities, CAPABILITY_GENERIC_CONFERENCE)) {
builder.append(" CAPABILITY_GENERIC_CONFERENCE");
}
builder.append("]");
return builder.toString();
}
/** @hide */ /** @hide */
public abstract static class Listener { public abstract static class Listener {
public void onStateChanged(Connection c, int state) {} public void onStateChanged(Connection c, int state) {}
@@ -77,7 +248,7 @@ public abstract class Connection implements IConferenceable {
public void onPostDialWait(Connection c, String remaining) {} public void onPostDialWait(Connection c, String remaining) {}
public void onRingbackRequested(Connection c, boolean ringback) {} public void onRingbackRequested(Connection c, boolean ringback) {}
public void onDestroyed(Connection c) {} public void onDestroyed(Connection c) {}
public void onCallCapabilitiesChanged(Connection c, int callCapabilities) {} public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {}
public void onVideoProviderChanged( public void onVideoProviderChanged(
Connection c, VideoProvider videoProvider) {} Connection c, VideoProvider videoProvider) {}
public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {} public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {}
@@ -152,7 +323,7 @@ public abstract class Connection implements IConferenceable {
private static final int MSG_SEND_SESSION_MODIFY_REQUEST = 7; private static final int MSG_SEND_SESSION_MODIFY_REQUEST = 7;
private static final int MSG_SEND_SESSION_MODIFY_RESPONSE = 8; private static final int MSG_SEND_SESSION_MODIFY_RESPONSE = 8;
private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9; private static final int MSG_REQUEST_CAMERA_CAPABILITIES = 9;
private static final int MSG_REQUEST_CALL_DATA_USAGE = 10; private static final int MSG_REQUEST_CONNECTION_DATA_USAGE = 10;
private static final int MSG_SET_PAUSE_IMAGE = 11; private static final int MSG_SET_PAUSE_IMAGE = 11;
private final VideoProvider.VideoProviderHandler private final VideoProvider.VideoProviderHandler
@@ -194,8 +365,8 @@ public abstract class Connection implements IConferenceable {
case MSG_REQUEST_CAMERA_CAPABILITIES: case MSG_REQUEST_CAMERA_CAPABILITIES:
onRequestCameraCapabilities(); onRequestCameraCapabilities();
break; break;
case MSG_REQUEST_CALL_DATA_USAGE: case MSG_REQUEST_CONNECTION_DATA_USAGE:
onRequestCallDataUsage(); onRequestConnectionDataUsage();
break; break;
case MSG_SET_PAUSE_IMAGE: case MSG_SET_PAUSE_IMAGE:
onSetPauseImage((String) msg.obj); onSetPauseImage((String) msg.obj);
@@ -250,7 +421,7 @@ public abstract class Connection implements IConferenceable {
} }
public void requestCallDataUsage() { public void requestCallDataUsage() {
mMessageHandler.obtainMessage(MSG_REQUEST_CALL_DATA_USAGE).sendToTarget(); mMessageHandler.obtainMessage(MSG_REQUEST_CONNECTION_DATA_USAGE).sendToTarget();
} }
public void setPauseImage(String uri) { public void setPauseImage(String uri) {
@@ -271,7 +442,7 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* Sets the camera to be used for video recording in a video call. * Sets the camera to be used for video recording in a video connection.
* *
* @param cameraId The id of the camera. * @param cameraId The id of the camera.
*/ */
@@ -311,19 +482,19 @@ public abstract class Connection implements IConferenceable {
/** /**
* Issues a request to modify the properties of the current session. The request is * Issues a request to modify the properties of the current session. The request is
* sent to the remote device where it it handled by the In-Call UI. * sent to the remote device where it it handled by the In-Call UI.
* Some examples of session modification requests: upgrade call from audio to video, * Some examples of session modification requests: upgrade connection from audio to video,
* downgrade call from video to audio, pause video. * downgrade connection from video to audio, pause video.
* *
* @param requestProfile The requested call video properties. * @param requestProfile The requested connection video properties.
*/ */
public abstract void onSendSessionModifyRequest(VideoProfile requestProfile); public abstract void onSendSessionModifyRequest(VideoProfile requestProfile);
/**te /**te
* Provides a response to a request to change the current call session video * Provides a response to a request to change the current connection session video
* properties. * properties.
* This is in response to a request the InCall UI has received via the InCall UI. * This is in response to a request the InCall UI has received via the InCall UI.
* *
* @param responseProfile The response call video properties. * @param responseProfile The response connection video properties.
*/ */
public abstract void onSendSessionModifyResponse(VideoProfile responseProfile); public abstract void onSendSessionModifyResponse(VideoProfile responseProfile);
@@ -335,10 +506,10 @@ public abstract class Connection implements IConferenceable {
/** /**
* Issues a request to the video telephony framework to retrieve the cumulative data usage * Issues a request to the video telephony framework to retrieve the cumulative data usage
* for the current call. Data usage is reported back to the caller via the * for the current connection. Data usage is reported back to the caller via the
* InCall UI. * InCall UI.
*/ */
public abstract void onRequestCallDataUsage(); public abstract void onRequestConnectionDataUsage();
/** /**
* Provides the video telephony framework with the URI of an image to be displayed to remote * Provides the video telephony framework with the URI of an image to be displayed to remote
@@ -351,7 +522,7 @@ public abstract class Connection implements IConferenceable {
/** /**
* Invokes callback method defined in In-Call UI. * Invokes callback method defined in In-Call UI.
* *
* @param videoProfile The requested video call profile. * @param videoProfile The requested video connection profile.
*/ */
public void receiveSessionModifyRequest(VideoProfile videoProfile) { public void receiveSessionModifyRequest(VideoProfile videoProfile) {
if (mVideoCallback != null) { if (mVideoCallback != null) {
@@ -482,7 +653,7 @@ public abstract class Connection implements IConferenceable {
private String mCallerDisplayName; private String mCallerDisplayName;
private int mCallerDisplayNamePresentation; private int mCallerDisplayNamePresentation;
private boolean mRingbackRequested = false; private boolean mRingbackRequested = false;
private int mCallCapabilities; private int mConnectionCapabilities;
private VideoProvider mVideoProvider; private VideoProvider mVideoProvider;
private boolean mAudioModeIsVoip; private boolean mAudioModeIsVoip;
private StatusHints mStatusHints; private StatusHints mStatusHints;
@@ -534,13 +705,13 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* Returns the video state of the call. * Returns the video state of the connection.
* Valid values: {@link VideoProfile.VideoState#AUDIO_ONLY}, * Valid values: {@link VideoProfile.VideoState#AUDIO_ONLY},
* {@link VideoProfile.VideoState#BIDIRECTIONAL}, * {@link VideoProfile.VideoState#BIDIRECTIONAL},
* {@link VideoProfile.VideoState#TX_ENABLED}, * {@link VideoProfile.VideoState#TX_ENABLED},
* {@link VideoProfile.VideoState#RX_ENABLED}. * {@link VideoProfile.VideoState#RX_ENABLED}.
* *
* @return The video state of the call. * @return The video state of the connection.
* @hide * @hide
*/ */
public final int getVideoState() { public final int getVideoState() {
@@ -548,7 +719,7 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* @return The audio state of the call, describing how its audio is currently * @return The audio state of the connection, describing how its audio is currently
* being routed by the system. This is {@code null} if this Connection * being routed by the system. This is {@code null} if this Connection
* does not directly know about its audio state. * does not directly know about its audio state.
*/ */
@@ -628,6 +799,7 @@ public abstract class Connection implements IConferenceable {
* @hide * @hide
*/ */
final void setAudioState(AudioState state) { final void setAudioState(AudioState state) {
checkImmutable();
Log.d(this, "setAudioState %s", state); Log.d(this, "setAudioState %s", state);
mAudioState = state; mAudioState = state;
onAudioStateChanged(state); onAudioStateChanged(state);
@@ -660,10 +832,10 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* Returns the connection's {@link PhoneCapabilities} * Returns the connection's capabilities, as a bit mask of the {@code CAPABILITY_*} constants.
*/ */
public final int getCallCapabilities() { public final int getConnectionCapabilities() {
return mCallCapabilities; return mConnectionCapabilities;
} }
/** /**
@@ -674,6 +846,7 @@ public abstract class Connection implements IConferenceable {
* See {@link TelecomManager} for valid values. * See {@link TelecomManager} for valid values.
*/ */
public final void setAddress(Uri address, int presentation) { public final void setAddress(Uri address, int presentation) {
checkImmutable();
Log.d(this, "setAddress %s", address); Log.d(this, "setAddress %s", address);
mAddress = address; mAddress = address;
mAddressPresentation = presentation; mAddressPresentation = presentation;
@@ -690,6 +863,7 @@ public abstract class Connection implements IConferenceable {
* See {@link TelecomManager} for valid values. * See {@link TelecomManager} for valid values.
*/ */
public final void setCallerDisplayName(String callerDisplayName, int presentation) { public final void setCallerDisplayName(String callerDisplayName, int presentation) {
checkImmutable();
Log.d(this, "setCallerDisplayName %s", callerDisplayName); Log.d(this, "setCallerDisplayName %s", callerDisplayName);
mCallerDisplayName = callerDisplayName; mCallerDisplayName = callerDisplayName;
mCallerDisplayNamePresentation = presentation; mCallerDisplayNamePresentation = presentation;
@@ -709,6 +883,7 @@ public abstract class Connection implements IConferenceable {
* @hide * @hide
*/ */
public final void setVideoState(int videoState) { public final void setVideoState(int videoState) {
checkImmutable();
Log.d(this, "setVideoState %d", videoState); Log.d(this, "setVideoState %d", videoState);
mVideoState = videoState; mVideoState = videoState;
for (Listener l : mListeners) { for (Listener l : mListeners) {
@@ -717,18 +892,20 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* Sets state to active (e.g., an ongoing call where two or more parties can actively * Sets state to active (e.g., an ongoing connection where two or more parties can actively
* communicate). * communicate).
*/ */
public final void setActive() { public final void setActive() {
checkImmutable();
setRingbackRequested(false); setRingbackRequested(false);
setState(STATE_ACTIVE); setState(STATE_ACTIVE);
} }
/** /**
* Sets state to ringing (e.g., an inbound ringing call). * Sets state to ringing (e.g., an inbound ringing connection).
*/ */
public final void setRinging() { public final void setRinging() {
checkImmutable();
setState(STATE_RINGING); setState(STATE_RINGING);
} }
@@ -736,6 +913,7 @@ public abstract class Connection implements IConferenceable {
* Sets state to initializing (this Connection is not yet ready to be used). * Sets state to initializing (this Connection is not yet ready to be used).
*/ */
public final void setInitializing() { public final void setInitializing() {
checkImmutable();
setState(STATE_INITIALIZING); setState(STATE_INITIALIZING);
} }
@@ -743,13 +921,15 @@ public abstract class Connection implements IConferenceable {
* Sets state to initialized (the Connection has been set up and is now ready to be used). * Sets state to initialized (the Connection has been set up and is now ready to be used).
*/ */
public final void setInitialized() { public final void setInitialized() {
checkImmutable();
setState(STATE_NEW); setState(STATE_NEW);
} }
/** /**
* Sets state to dialing (e.g., dialing an outbound call). * Sets state to dialing (e.g., dialing an outbound connection).
*/ */
public final void setDialing() { public final void setDialing() {
checkImmutable();
setState(STATE_DIALING); setState(STATE_DIALING);
} }
@@ -757,15 +937,17 @@ public abstract class Connection implements IConferenceable {
* Sets state to be on hold. * Sets state to be on hold.
*/ */
public final void setOnHold() { public final void setOnHold() {
checkImmutable();
setState(STATE_HOLDING); setState(STATE_HOLDING);
} }
/** /**
* Sets the video call provider. * Sets the video connection provider.
* @param videoProvider The video provider. * @param videoProvider The video provider.
* @hide * @hide
*/ */
public final void setVideoProvider(VideoProvider videoProvider) { public final void setVideoProvider(VideoProvider videoProvider) {
checkImmutable();
mVideoProvider = videoProvider; mVideoProvider = videoProvider;
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onVideoProviderChanged(this, videoProvider); l.onVideoProviderChanged(this, videoProvider);
@@ -784,6 +966,7 @@ public abstract class Connection implements IConferenceable {
* {@link DisconnectCause}. * {@link DisconnectCause}.
*/ */
public final void setDisconnected(DisconnectCause disconnectCause) { public final void setDisconnected(DisconnectCause disconnectCause) {
checkImmutable();
mDisconnectCause = disconnectCause; mDisconnectCause = disconnectCause;
setState(STATE_DISCONNECTED); setState(STATE_DISCONNECTED);
Log.d(this, "Disconnected with cause %s", disconnectCause); Log.d(this, "Disconnected with cause %s", disconnectCause);
@@ -793,9 +976,17 @@ public abstract class Connection implements IConferenceable {
} }
/** /**
* TODO: Needs documentation. * Informs listeners that this {@code Connection} is in a post-dial wait state. This is done
* when (a) the {@code Connection} is issuing a DTMF sequence; (b) it has encountered a "wait"
* character; and (c) it wishes to inform the In-Call app that it is waiting for the end-user
* to send an {@link #onPostDialContinue(boolean)} signal.
*
* @param remaining The DTMF character sequence remaining to be emitted once the
* {@link #onPostDialContinue(boolean)} is received, including any "wait" characters
* that remaining sequence may contain.
*/ */
public final void setPostDialWait(String remaining) { public final void setPostDialWait(String remaining) {
checkImmutable();
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onPostDialWait(this, remaining); l.onPostDialWait(this, remaining);
} }
@@ -803,11 +994,12 @@ public abstract class Connection implements IConferenceable {
/** /**
* Requests that the framework play a ringback tone. This is to be invoked by implementations * Requests that the framework play a ringback tone. This is to be invoked by implementations
* that do not play a ringback tone themselves in the call's audio stream. * that do not play a ringback tone themselves in the connection's audio stream.
* *
* @param ringback Whether the ringback tone is to be played. * @param ringback Whether the ringback tone is to be played.
*/ */
public final void setRingbackRequested(boolean ringback) { public final void setRingbackRequested(boolean ringback) {
checkImmutable();
if (mRingbackRequested != ringback) { if (mRingbackRequested != ringback) {
mRingbackRequested = ringback; mRingbackRequested = ringback;
for (Listener l : mListeners) { for (Listener l : mListeners) {
@@ -816,16 +1008,22 @@ public abstract class Connection implements IConferenceable {
} }
} }
/** @hide */
@Deprecated public final void setCapabilities(int connectionCapabilities) {
setConnectionCapabilities(connectionCapabilities);
}
/** /**
* Sets the connection's {@link PhoneCapabilities}. * Sets the connection's capabilities as a bit mask of the {@code CAPABILITY_*} constants.
* *
* @param callCapabilities The new call capabilities. * @param connectionCapabilities The new connection capabilities.
*/ */
public final void setCallCapabilities(int callCapabilities) { public final void setConnectionCapabilities(int connectionCapabilities) {
if (mCallCapabilities != callCapabilities) { checkImmutable();
mCallCapabilities = callCapabilities; if (mConnectionCapabilities != connectionCapabilities) {
mConnectionCapabilities = connectionCapabilities;
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onCallCapabilitiesChanged(this, mCallCapabilities); l.onConnectionCapabilitiesChanged(this, mConnectionCapabilities);
} }
} }
} }
@@ -845,6 +1043,7 @@ public abstract class Connection implements IConferenceable {
* @param isVoip True if the audio mode is VOIP. * @param isVoip True if the audio mode is VOIP.
*/ */
public final void setAudioModeIsVoip(boolean isVoip) { public final void setAudioModeIsVoip(boolean isVoip) {
checkImmutable();
mAudioModeIsVoip = isVoip; mAudioModeIsVoip = isVoip;
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onAudioModeIsVoipChanged(this, isVoip); l.onAudioModeIsVoipChanged(this, isVoip);
@@ -857,6 +1056,7 @@ public abstract class Connection implements IConferenceable {
* @param statusHints The status label and icon to set. * @param statusHints The status label and icon to set.
*/ */
public final void setStatusHints(StatusHints statusHints) { public final void setStatusHints(StatusHints statusHints) {
checkImmutable();
mStatusHints = statusHints; mStatusHints = statusHints;
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onStatusHintsChanged(this, statusHints); l.onStatusHintsChanged(this, statusHints);
@@ -869,6 +1069,7 @@ public abstract class Connection implements IConferenceable {
* @param conferenceableConnections The set of connections this connection can conference with. * @param conferenceableConnections The set of connections this connection can conference with.
*/ */
public final void setConferenceableConnections(List<Connection> conferenceableConnections) { public final void setConferenceableConnections(List<Connection> conferenceableConnections) {
checkImmutable();
clearConferenceableList(); clearConferenceableList();
for (Connection c : conferenceableConnections) { for (Connection c : conferenceableConnections) {
// If statement checks for duplicates in input. It makes it N^2 but we're dealing with a // If statement checks for duplicates in input. It makes it N^2 but we're dealing with a
@@ -917,6 +1118,7 @@ public abstract class Connection implements IConferenceable {
* @hide * @hide
*/ */
public final void setConnectionService(ConnectionService connectionService) { public final void setConnectionService(ConnectionService connectionService) {
checkImmutable();
if (mConnectionService != null) { if (mConnectionService != null) {
Log.e(this, new Exception(), "Trying to set ConnectionService on a connection " + Log.e(this, new Exception(), "Trying to set ConnectionService on a connection " +
"which is already associated with another ConnectionService."); "which is already associated with another ConnectionService.");
@@ -946,13 +1148,14 @@ public abstract class Connection implements IConferenceable {
/** /**
* Sets the conference that this connection is a part of. This will fail if the connection is * Sets the conference that this connection is a part of. This will fail if the connection is
* already part of a conference call. {@link #resetConference} to un-set the conference first. * already part of a conference. {@link #resetConference} to un-set the conference first.
* *
* @param conference The conference. * @param conference The conference.
* @return {@code true} if the conference was successfully set. * @return {@code true} if the conference was successfully set.
* @hide * @hide
*/ */
public final boolean setConference(Conference conference) { public final boolean setConference(Conference conference) {
checkImmutable();
// We check to see if it is already part of another conference. // We check to see if it is already part of another conference.
if (mConference == null) { if (mConference == null) {
mConference = conference; mConference = conference;
@@ -979,7 +1182,7 @@ public abstract class Connection implements IConferenceable {
/** /**
* Notifies this Connection that the {@link #getAudioState()} property has a new value. * Notifies this Connection that the {@link #getAudioState()} property has a new value.
* *
* @param state The new call audio state. * @param state The new connection audio state.
*/ */
public void onAudioStateChanged(AudioState state) {} public void onAudioStateChanged(AudioState state) {}
@@ -1041,7 +1244,7 @@ public abstract class Connection implements IConferenceable {
* Notifies this Connection, which is in {@link #STATE_RINGING}, of * Notifies this Connection, which is in {@link #STATE_RINGING}, of
* a request to accept. * a request to accept.
* *
* @param videoState The video state in which to answer the call. * @param videoState The video state in which to answer the connection.
* @hide * @hide
*/ */
public void onAnswer(int videoState) {} public void onAnswer(int videoState) {}
@@ -1091,6 +1294,7 @@ public abstract class Connection implements IConferenceable {
} }
private void setState(int state) { private void setState(int state) {
checkImmutable();
if (mState == STATE_DISCONNECTED && mState != state) { if (mState == STATE_DISCONNECTED && mState != state) {
Log.d(this, "Connection already DISCONNECTED; cannot transition out of this state."); Log.d(this, "Connection already DISCONNECTED; cannot transition out of this state.");
return; return;
@@ -1109,6 +1313,10 @@ public abstract class Connection implements IConferenceable {
public FailureSignalingConnection(DisconnectCause disconnectCause) { public FailureSignalingConnection(DisconnectCause disconnectCause) {
setDisconnected(disconnectCause); setDisconnected(disconnectCause);
} }
public void checkImmutable() {
throw new UnsupportedOperationException("Connection is immutable");
}
} }
/** /**
@@ -1126,22 +1334,31 @@ public abstract class Connection implements IConferenceable {
return new FailureSignalingConnection(disconnectCause); return new FailureSignalingConnection(disconnectCause);
} }
/**
* Override to throw an {@link UnsupportedOperationException} if this {@code Connection} is
* not intended to be mutated, e.g., if it is a marker for failure. Only for framework use;
* this should never be un-@hide-den.
*
* @hide
*/
public void checkImmutable() {}
/** /**
* Return a {@code Connection} which represents a canceled connection attempt. The returned * Return a {@code Connection} which represents a canceled connection attempt. The returned
* {@code Connection} will have state {@link #STATE_DISCONNECTED}, and cannot be moved out of * {@code Connection} will have state {@link #STATE_DISCONNECTED}, and cannot be moved out of
* that state. This connection should not be used for anything, and no other * that state. This connection should not be used for anything, and no other
* {@code Connection}s should be attempted. * {@code Connection}s should be attempted.
* <p> * <p>
* The returned {@code Connection} can be assumed to {@link #destroy()} itself when appropriate,
* so users of this method need not maintain a reference to its return value to destroy it. * so users of this method need not maintain a reference to its return value to destroy it.
* *
* @return A {@code Connection} which indicates that the underlying call should be canceled. * @return A {@code Connection} which indicates that the underlying connection should
* be canceled.
*/ */
public static Connection createCanceledConnection() { public static Connection createCanceledConnection() {
return new FailureSignalingConnection(new DisconnectCause(DisconnectCause.CANCELED)); return new FailureSignalingConnection(new DisconnectCause(DisconnectCause.CANCELED));
} }
private final void fireOnConferenceableConnectionsChanged() { private final void fireOnConferenceableConnectionsChanged() {
for (Listener l : mListeners) { for (Listener l : mListeners) {
l.onConferenceablesChanged(this, getConferenceables()); l.onConferenceablesChanged(this, getConferenceables());
} }

View File

@@ -407,11 +407,13 @@ public abstract class ConnectionService extends Service {
} }
@Override @Override
public void onCapabilitiesChanged(Conference conference, int capabilities) { public void onConnectionCapabilitiesChanged(
Conference conference,
int connectionCapabilities) {
String id = mIdByConference.get(conference); String id = mIdByConference.get(conference);
Log.d(this, "call capabilities: conference: %s", Log.d(this, "call capabilities: conference: %s",
PhoneCapabilities.toString(capabilities)); Connection.capabilitiesToString(connectionCapabilities));
mAdapter.setCallCapabilities(id, capabilities); mAdapter.setConnectionCapabilities(id, connectionCapabilities);
} }
}; };
@@ -489,11 +491,11 @@ public abstract class ConnectionService extends Service {
} }
@Override @Override
public void onCallCapabilitiesChanged(Connection c, int capabilities) { public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {
String id = mIdByConnection.get(c); String id = mIdByConnection.get(c);
Log.d(this, "capabilities: parcelableconnection: %s", Log.d(this, "capabilities: parcelableconnection: %s",
PhoneCapabilities.toString(capabilities)); Connection.capabilitiesToString(capabilities));
mAdapter.setCallCapabilities(id, capabilities); mAdapter.setConnectionCapabilities(id, capabilities);
} }
@Override @Override
@@ -581,7 +583,7 @@ public abstract class ConnectionService extends Service {
Log.v(this, "createConnection, number: %s, state: %s, capabilities: %s", Log.v(this, "createConnection, number: %s, state: %s, capabilities: %s",
Connection.toLogSafePhoneNumber(number), Connection.toLogSafePhoneNumber(number),
Connection.stateToString(connection.getState()), Connection.stateToString(connection.getState()),
PhoneCapabilities.toString(connection.getCallCapabilities())); Connection.capabilitiesToString(connection.getConnectionCapabilities()));
Log.d(this, "createConnection, calling handleCreateConnectionSuccessful %s", callId); Log.d(this, "createConnection, calling handleCreateConnectionSuccessful %s", callId);
mAdapter.handleCreateConnectionComplete( mAdapter.handleCreateConnectionComplete(
@@ -590,7 +592,7 @@ public abstract class ConnectionService extends Service {
new ParcelableConnection( new ParcelableConnection(
request.getAccountHandle(), request.getAccountHandle(),
connection.getState(), connection.getState(),
connection.getCallCapabilities(), connection.getConnectionCapabilities(),
connection.getAddress(), connection.getAddress(),
connection.getAddressPresentation(), connection.getAddressPresentation(),
connection.getCallerDisplayName(), connection.getCallerDisplayName(),
@@ -873,7 +875,7 @@ public abstract class ConnectionService extends Service {
ParcelableConference parcelableConference = new ParcelableConference( ParcelableConference parcelableConference = new ParcelableConference(
conference.getPhoneAccountHandle(), conference.getPhoneAccountHandle(),
conference.getState(), conference.getState(),
conference.getCapabilities(), conference.getConnectionCapabilities(),
connectionIds); connectionIds);
mAdapter.addConferenceCall(id, parcelableConference); mAdapter.addConferenceCall(id, parcelableConference);
@@ -904,7 +906,7 @@ public abstract class ConnectionService extends Service {
ParcelableConnection parcelableConnection = new ParcelableConnection( ParcelableConnection parcelableConnection = new ParcelableConnection(
phoneAccountHandle, phoneAccountHandle,
connection.getState(), connection.getState(),
connection.getCallCapabilities(), connection.getConnectionCapabilities(),
connection.getAddress(), connection.getAddress(),
connection.getAddressPresentation(), connection.getAddressPresentation(),
connection.getCallerDisplayName(), connection.getCallerDisplayName(),

View File

@@ -175,10 +175,10 @@ final class ConnectionServiceAdapter implements DeathRecipient {
} }
} }
void setCallCapabilities(String callId, int capabilities) { void setConnectionCapabilities(String callId, int capabilities) {
for (IConnectionServiceAdapter adapter : mAdapters) { for (IConnectionServiceAdapter adapter : mAdapters) {
try { try {
adapter.setCallCapabilities(callId, capabilities); adapter.setConnectionCapabilities(callId, capabilities);
} catch (RemoteException ignored) { } catch (RemoteException ignored) {
} }
} }

View File

@@ -44,7 +44,7 @@ final class ConnectionServiceAdapterServant {
private static final int MSG_SET_DISCONNECTED = 5; private static final int MSG_SET_DISCONNECTED = 5;
private static final int MSG_SET_ON_HOLD = 6; private static final int MSG_SET_ON_HOLD = 6;
private static final int MSG_SET_RINGBACK_REQUESTED = 7; private static final int MSG_SET_RINGBACK_REQUESTED = 7;
private static final int MSG_SET_CALL_CAPABILITIES = 8; private static final int MSG_SET_CONNECTION_CAPABILITIES = 8;
private static final int MSG_SET_IS_CONFERENCED = 9; private static final int MSG_SET_IS_CONFERENCED = 9;
private static final int MSG_ADD_CONFERENCE_CALL = 10; private static final int MSG_ADD_CONFERENCE_CALL = 10;
private static final int MSG_REMOVE_CALL = 11; private static final int MSG_REMOVE_CALL = 11;
@@ -109,8 +109,8 @@ final class ConnectionServiceAdapterServant {
case MSG_SET_RINGBACK_REQUESTED: case MSG_SET_RINGBACK_REQUESTED:
mDelegate.setRingbackRequested((String) msg.obj, msg.arg1 == 1); mDelegate.setRingbackRequested((String) msg.obj, msg.arg1 == 1);
break; break;
case MSG_SET_CALL_CAPABILITIES: case MSG_SET_CONNECTION_CAPABILITIES:
mDelegate.setCallCapabilities((String) msg.obj, msg.arg1); mDelegate.setConnectionCapabilities((String) msg.obj, msg.arg1);
break; break;
case MSG_SET_IS_CONFERENCED: { case MSG_SET_IS_CONFERENCED: {
SomeArgs args = (SomeArgs) msg.obj; SomeArgs args = (SomeArgs) msg.obj;
@@ -263,8 +263,9 @@ final class ConnectionServiceAdapterServant {
} }
@Override @Override
public void setCallCapabilities(String connectionId, int callCapabilities) { public void setConnectionCapabilities(String connectionId, int connectionCapabilities) {
mHandler.obtainMessage(MSG_SET_CALL_CAPABILITIES, callCapabilities, 0, connectionId) mHandler.obtainMessage(
MSG_SET_CONNECTION_CAPABILITIES, connectionCapabilities, 0, connectionId)
.sendToTarget(); .sendToTarget();
} }

View File

@@ -30,17 +30,17 @@ public final class ParcelableConference implements Parcelable {
private PhoneAccountHandle mPhoneAccount; private PhoneAccountHandle mPhoneAccount;
private int mState; private int mState;
private int mCapabilities; private int mConnectionCapabilities;
private List<String> mConnectionIds; private List<String> mConnectionIds;
public ParcelableConference( public ParcelableConference(
PhoneAccountHandle phoneAccount, PhoneAccountHandle phoneAccount,
int state, int state,
int capabilities, int connectionCapabilities,
List<String> connectionIds) { List<String> connectionIds) {
mPhoneAccount = phoneAccount; mPhoneAccount = phoneAccount;
mState = state; mState = state;
mCapabilities = capabilities; mConnectionCapabilities = connectionCapabilities;
mConnectionIds = connectionIds; mConnectionIds = connectionIds;
} }
@@ -52,7 +52,7 @@ public final class ParcelableConference implements Parcelable {
.append(", state: ") .append(", state: ")
.append(Connection.stateToString(mState)) .append(Connection.stateToString(mState))
.append(", capabilities: ") .append(", capabilities: ")
.append(PhoneCapabilities.toString(mCapabilities)) .append(Connection.capabilitiesToString(mConnectionCapabilities))
.append(", children: ") .append(", children: ")
.append(mConnectionIds) .append(mConnectionIds)
.toString(); .toString();
@@ -66,8 +66,8 @@ public final class ParcelableConference implements Parcelable {
return mState; return mState;
} }
public int getCapabilities() { public int getConnectionCapabilities() {
return mCapabilities; return mConnectionCapabilities;
} }
public List<String> getConnectionIds() { public List<String> getConnectionIds() {
@@ -105,7 +105,7 @@ public final class ParcelableConference implements Parcelable {
public void writeToParcel(Parcel destination, int flags) { public void writeToParcel(Parcel destination, int flags) {
destination.writeParcelable(mPhoneAccount, 0); destination.writeParcelable(mPhoneAccount, 0);
destination.writeInt(mState); destination.writeInt(mState);
destination.writeInt(mCapabilities); destination.writeInt(mConnectionCapabilities);
destination.writeList(mConnectionIds); destination.writeList(mConnectionIds);
} }
} }

View File

@@ -34,7 +34,7 @@ import java.util.List;
public final class ParcelableConnection implements Parcelable { public final class ParcelableConnection implements Parcelable {
private final PhoneAccountHandle mPhoneAccount; private final PhoneAccountHandle mPhoneAccount;
private final int mState; private final int mState;
private final int mCapabilities; private final int mConnectionCapabilities;
private final Uri mAddress; private final Uri mAddress;
private final int mAddressPresentation; private final int mAddressPresentation;
private final String mCallerDisplayName; private final String mCallerDisplayName;
@@ -65,7 +65,7 @@ public final class ParcelableConnection implements Parcelable {
List<String> conferenceableConnectionIds) { List<String> conferenceableConnectionIds) {
mPhoneAccount = phoneAccount; mPhoneAccount = phoneAccount;
mState = state; mState = state;
mCapabilities = capabilities; mConnectionCapabilities = capabilities;
mAddress = address; mAddress = address;
mAddressPresentation = addressPresentation; mAddressPresentation = addressPresentation;
mCallerDisplayName = callerDisplayName; mCallerDisplayName = callerDisplayName;
@@ -88,8 +88,8 @@ public final class ParcelableConnection implements Parcelable {
} }
// Bit mask of actions a call supports, values are defined in {@link CallCapabilities}. // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}.
public int getCapabilities() { public int getConnectionCapabilities() {
return mCapabilities; return mConnectionCapabilities;
} }
public Uri getHandle() { public Uri getHandle() {
@@ -144,7 +144,7 @@ public final class ParcelableConnection implements Parcelable {
.append(", state:") .append(", state:")
.append(mState) .append(mState)
.append(", capabilities:") .append(", capabilities:")
.append(PhoneCapabilities.toString(mCapabilities)) .append(Connection.capabilitiesToString(mConnectionCapabilities))
.toString(); .toString();
} }
@@ -205,7 +205,7 @@ public final class ParcelableConnection implements Parcelable {
public void writeToParcel(Parcel destination, int flags) { public void writeToParcel(Parcel destination, int flags) {
destination.writeParcelable(mPhoneAccount, 0); destination.writeParcelable(mPhoneAccount, 0);
destination.writeInt(mState); destination.writeInt(mState);
destination.writeInt(mCapabilities); destination.writeInt(mConnectionCapabilities);
destination.writeParcelable(mAddress, 0); destination.writeParcelable(mAddress, 0);
destination.writeInt(mAddressPresentation); destination.writeInt(mAddressPresentation);
destination.writeString(mCallerDisplayName); destination.writeString(mCallerDisplayName);

View File

@@ -120,9 +120,14 @@ public class PhoneAccount implements Parcelable {
public static final String SCHEME_SIP = "sip"; public static final String SCHEME_SIP = "sip";
/** /**
* Indicating no color is set. * Indicating no icon tint is set.
*/ */
public static final int NO_COLOR = -1; public static final int NO_ICON_TINT = 0;
/**
* Indicating no hightlight color is set.
*/
public static final int NO_HIGHLIGHT_COLOR = 0;
/** /**
* Indicating no resource ID is set. * Indicating no resource ID is set.
@@ -153,8 +158,8 @@ public class PhoneAccount implements Parcelable {
private int mIconResId; private int mIconResId;
private String mIconPackageName; private String mIconPackageName;
private Bitmap mIconBitmap; private Bitmap mIconBitmap;
private int mIconTint = NO_COLOR; private int mIconTint = NO_ICON_TINT;
private int mHighlightColor = NO_COLOR; private int mHighlightColor = NO_HIGHLIGHT_COLOR;
private CharSequence mLabel; private CharSequence mLabel;
private CharSequence mShortDescription; private CharSequence mShortDescription;
private List<String> mSupportedUriSchemes = new ArrayList<String>(); private List<String> mSupportedUriSchemes = new ArrayList<String>();
@@ -240,7 +245,7 @@ public class PhoneAccount implements Parcelable {
* @return The builder. * @return The builder.
*/ */
public Builder setIcon(String iconPackageName, int iconResId) { public Builder setIcon(String iconPackageName, int iconResId) {
return setIcon(iconPackageName, iconResId, NO_COLOR); return setIcon(iconPackageName, iconResId, NO_ICON_TINT);
} }
/** /**
@@ -280,7 +285,7 @@ public class PhoneAccount implements Parcelable {
this.mIconBitmap = iconBitmap; this.mIconBitmap = iconBitmap;
this.mIconPackageName = null; this.mIconPackageName = null;
this.mIconResId = NO_RESOURCE_ID; this.mIconResId = NO_RESOURCE_ID;
this.mIconTint = NO_COLOR; this.mIconTint = NO_ICON_TINT;
return this; return this;
} }
@@ -589,7 +594,7 @@ public class PhoneAccount implements Parcelable {
Context packageContext = context.createPackageContext(mIconPackageName, 0); Context packageContext = context.createPackageContext(mIconPackageName, 0);
try { try {
Drawable iconDrawable = packageContext.getDrawable(mIconResId); Drawable iconDrawable = packageContext.getDrawable(mIconResId);
if (mIconTint != NO_COLOR) { if (mIconTint != NO_ICON_TINT) {
iconDrawable.setTint(mIconTint); iconDrawable.setTint(mIconTint);
} }
return iconDrawable; return iconDrawable;

View File

@@ -1,185 +0,0 @@
/*
* Copyright 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.
*/
package android.telecom;
import android.annotation.SystemApi;
/**
* Defines capabilities for {@link Connection}s and {@link Conference}s such as hold, swap, and
* merge.
* @hide
*/
@SystemApi
public final class PhoneCapabilities {
/** Call can currently be put on hold or unheld. */
public static final int HOLD = 0x00000001;
/** Call supports the hold feature. */
public static final int SUPPORT_HOLD = 0x00000002;
/**
* Calls within a conference can be merged. A {@link ConnectionService} has the option to
* add a {@link Conference} call before the child {@link Connection}s are merged. This is how
* CDMA-based {@link Connection}s are implemented. For these unmerged {@link Conference}s, this
* capability allows a merge button to be shown while the conference call is in the foreground
* of the in-call UI.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int MERGE_CONFERENCE = 0x00000004;
/**
* Calls within a conference can be swapped between foreground and background.
* See {@link #MERGE_CONFERENCE} for additional information.
* <p>
* This is only intended for use by a {@link Conference}.
*/
public static final int SWAP_CONFERENCE = 0x00000008;
/**
* @hide
*/
public static final int UNUSED = 0x00000010;
/** Call supports responding via text option. */
public static final int RESPOND_VIA_TEXT = 0x00000020;
/** Call can be muted. */
public static final int MUTE = 0x00000040;
/**
* Call supports conference call management. This capability only applies to {@link Conference}
* calls which can have {@link Connection}s as children.
*/
public static final int MANAGE_CONFERENCE = 0x00000080;
/**
* Local device supports video telephony.
* @hide
*/
public static final int SUPPORTS_VT_LOCAL = 0x00000100;
/**
* Remote device supports video telephony.
* @hide
*/
public static final int SUPPORTS_VT_REMOTE = 0x00000200;
/**
* Call is using voice over LTE.
* @hide
*/
public static final int VoLTE = 0x00000400;
/**
* Call is using voice over WIFI.
* @hide
*/
public static final int VoWIFI = 0x00000800;
/**
* Call is able to be separated from its parent {@code Conference}, if any.
*/
public static final int SEPARATE_FROM_CONFERENCE = 0x00001000;
/**
* Call is able to be individually disconnected when in a {@code Conference}.
*/
public static final int DISCONNECT_FROM_CONFERENCE = 0x00002000;
/**
* Whether the call is a generic conference, where we do not know the precise state of
* participants in the conference (eg. on CDMA).
*
* TODO: Move to CallProperties.
*
* @hide
*/
public static final int GENERIC_CONFERENCE = 0x00004000;
public static final int ALL = HOLD | SUPPORT_HOLD | MERGE_CONFERENCE | SWAP_CONFERENCE
| RESPOND_VIA_TEXT | MUTE | MANAGE_CONFERENCE | SEPARATE_FROM_CONFERENCE
| DISCONNECT_FROM_CONFERENCE;
/**
* Whether this set of capabilities supports the specified capability.
* @param capabilities The set of capabilities.
* @param capability The capability to check capabilities for.
* @return Whether the specified capability is supported.
* @hide
*/
public static boolean can(int capabilities, int capability) {
return (capabilities & capability) != 0;
}
/**
* Removes the specified capability from the set of capabilities and returns the new set.
* @param capabilities The set of capabilities.
* @param capability The capability to remove from the set.
* @return The set of capabilities, with the capability removed.
* @hide
*/
public static int remove(int capabilities, int capability) {
return capabilities & ~capability;
}
public static String toString(int capabilities) {
StringBuilder builder = new StringBuilder();
builder.append("[Capabilities:");
if (can(capabilities, HOLD)) {
builder.append(" HOLD");
}
if (can(capabilities, SUPPORT_HOLD)) {
builder.append(" SUPPORT_HOLD");
}
if (can(capabilities, MERGE_CONFERENCE)) {
builder.append(" MERGE_CONFERENCE");
}
if (can(capabilities, SWAP_CONFERENCE)) {
builder.append(" SWAP_CONFERENCE");
}
if (can(capabilities, RESPOND_VIA_TEXT)) {
builder.append(" RESPOND_VIA_TEXT");
}
if (can(capabilities, MUTE)) {
builder.append(" MUTE");
}
if (can(capabilities, MANAGE_CONFERENCE)) {
builder.append(" MANAGE_CONFERENCE");
}
if (can(capabilities, SUPPORTS_VT_LOCAL)) {
builder.append(" SUPPORTS_VT_LOCAL");
}
if (can(capabilities, SUPPORTS_VT_REMOTE)) {
builder.append(" SUPPORTS_VT_REMOTE");
}
if (can(capabilities, VoLTE)) {
builder.append(" VoLTE");
}
if (can(capabilities, VoWIFI)) {
builder.append(" VoWIFI");
}
if (can(capabilities, GENERIC_CONFERENCE)) {
builder.append(" GENERIC_CONFERENCE");
}
builder.append("]");
return builder.toString();
}
private PhoneCapabilities() {}
}

View File

@@ -40,7 +40,9 @@ public final class RemoteConference {
public void onDisconnected(RemoteConference conference, DisconnectCause disconnectCause) {} public void onDisconnected(RemoteConference conference, DisconnectCause disconnectCause) {}
public void onConnectionAdded(RemoteConference conference, RemoteConnection connection) {} public void onConnectionAdded(RemoteConference conference, RemoteConnection connection) {}
public void onConnectionRemoved(RemoteConference conference, RemoteConnection connection) {} public void onConnectionRemoved(RemoteConference conference, RemoteConnection connection) {}
public void onCapabilitiesChanged(RemoteConference conference, int capabilities) {} public void onConnectionCapabilitiesChanged(
RemoteConference conference,
int connectionCapabilities) {}
public void onConferenceableConnectionsChanged( public void onConferenceableConnectionsChanged(
RemoteConference conference, RemoteConference conference,
List<RemoteConnection> conferenceableConnections) {} List<RemoteConnection> conferenceableConnections) {}
@@ -60,7 +62,7 @@ public final class RemoteConference {
private int mState = Connection.STATE_NEW; private int mState = Connection.STATE_NEW;
private DisconnectCause mDisconnectCause; private DisconnectCause mDisconnectCause;
private int mCallCapabilities; private int mConnectionCapabilities;
/** {@hide} */ /** {@hide} */
RemoteConference(String id, IConnectionService connectionService) { RemoteConference(String id, IConnectionService connectionService) {
@@ -125,11 +127,11 @@ public final class RemoteConference {
} }
/** {@hide} */ /** {@hide} */
void setCallCapabilities(int capabilities) { void setConnectionCapabilities(int connectionCapabilities) {
if (mCallCapabilities != capabilities) { if (mConnectionCapabilities != connectionCapabilities) {
mCallCapabilities = capabilities; mConnectionCapabilities = connectionCapabilities;
for (Callback c : mCallbacks) { for (Callback c : mCallbacks) {
c.onCapabilitiesChanged(this, mCallCapabilities); c.onConnectionCapabilitiesChanged(this, mConnectionCapabilities);
} }
} }
} }
@@ -162,8 +164,13 @@ public final class RemoteConference {
return mState; return mState;
} }
public final int getCallCapabilities() { /** @hide */
return mCallCapabilities; @Deprecated public final int getCallCapabilities() {
return getConnectionCapabilities();
}
public final int getConnectionCapabilities() {
return mConnectionCapabilities;
} }
public void disconnect() { public void disconnect() {

View File

@@ -73,14 +73,21 @@ public final class RemoteConnection {
*/ */
public void onRingbackRequested(RemoteConnection connection, boolean ringback) {} public void onRingbackRequested(RemoteConnection connection, boolean ringback) {}
/** @hide */
@Deprecated public void onCallCapabilitiesChanged(
RemoteConnection connection,
int callCapabilities) {}
/** /**
* Indicates that the call capabilities of this {@code RemoteConnection} have changed. * Indicates that the call capabilities of this {@code RemoteConnection} have changed.
* See {@link #getCallCapabilities()}. * See {@link #getConnectionCapabilities()}.
* *
* @param connection The {@code RemoteConnection} invoking this method. * @param connection The {@code RemoteConnection} invoking this method.
* @param callCapabilities The new call capabilities of the {@code RemoteConnection}. * @param connectionCapabilities The new capabilities of the {@code RemoteConnection}.
*/ */
public void onCallCapabilitiesChanged(RemoteConnection connection, int callCapabilities) {} public void onConnectionCapabilitiesChanged(
RemoteConnection connection,
int connectionCapabilities) {}
/** /**
* Invoked when the post-dial sequence in the outgoing {@code Connection} has reached a * Invoked when the post-dial sequence in the outgoing {@code Connection} has reached a
@@ -385,7 +392,7 @@ public final class RemoteConnection {
private DisconnectCause mDisconnectCause; private DisconnectCause mDisconnectCause;
private boolean mRingbackRequested; private boolean mRingbackRequested;
private boolean mConnected; private boolean mConnected;
private int mCallCapabilities; private int mConnectionCapabilities;
private int mVideoState; private int mVideoState;
private VideoProvider mVideoProvider; private VideoProvider mVideoProvider;
private boolean mIsVoipAudioMode; private boolean mIsVoipAudioMode;
@@ -420,7 +427,7 @@ public final class RemoteConnection {
mState = connection.getState(); mState = connection.getState();
mDisconnectCause = connection.getDisconnectCause(); mDisconnectCause = connection.getDisconnectCause();
mRingbackRequested = connection.isRingbackRequested(); mRingbackRequested = connection.isRingbackRequested();
mCallCapabilities = connection.getCapabilities(); mConnectionCapabilities = connection.getConnectionCapabilities();
mVideoState = connection.getVideoState(); mVideoState = connection.getVideoState();
mVideoProvider = new RemoteConnection.VideoProvider(connection.getVideoProvider()); mVideoProvider = new RemoteConnection.VideoProvider(connection.getVideoProvider());
mIsVoipAudioMode = connection.getIsVoipAudioMode(); mIsVoipAudioMode = connection.getIsVoipAudioMode();
@@ -477,23 +484,29 @@ public final class RemoteConnection {
} }
/** /**
* Obtains the reason why this {@code RemoteConnection} may have been disconnected.
*
* @return For a {@link Connection#STATE_DISCONNECTED} {@code RemoteConnection}, the * @return For a {@link Connection#STATE_DISCONNECTED} {@code RemoteConnection}, the
* disconnect cause expressed as a code chosen from among those declared in * disconnect cause expressed as a code chosen from among those declared in
* {@link DisconnectCause}. * {@link DisconnectCause}.
*/ */
public DisconnectCause getDisconnectCause() { public DisconnectCause getDisconnectCause() {
return mDisconnectCause; return mDisconnectCause;
} }
/** /**
* Obtains the capabilities of this {@code RemoteConnection}.
*
* @return A bitmask of the capabilities of the {@code RemoteConnection}, as defined in * @return A bitmask of the capabilities of the {@code RemoteConnection}, as defined in
* {@link PhoneCapabilities}. * the {@code CAPABILITY_*} constants in class {@link Connection}.
*/ */
public int getCallCapabilities() { public int getConnectionCapabilities() {
return mCallCapabilities; return mConnectionCapabilities;
} }
/** /**
* Determines if the audio mode of this {@code RemoteConnection} is VOIP.
*
* @return {@code true} if the {@code RemoteConnection}'s current audio mode is VOIP. * @return {@code true} if the {@code RemoteConnection}'s current audio mode is VOIP.
*/ */
public boolean isVoipAudioMode() { public boolean isVoipAudioMode() {
@@ -501,30 +514,38 @@ public final class RemoteConnection {
} }
/** /**
* Obtains status hints pertaining to this {@code RemoteConnection}.
*
* @return The current {@link StatusHints} of this {@code RemoteConnection}, * @return The current {@link StatusHints} of this {@code RemoteConnection},
* or {@code null} if none have been set. * or {@code null} if none have been set.
*/ */
public StatusHints getStatusHints() { public StatusHints getStatusHints() {
return mStatusHints; return mStatusHints;
} }
/** /**
* @return The address (e.g., phone number) to which the {@code RemoteConnection} is currently * Obtains the address of this {@code RemoteConnection}.
* connected. *
* @return The address (e.g., phone number) to which the {@code RemoteConnection}
* is currently connected.
*/ */
public Uri getAddress() { public Uri getAddress() {
return mAddress; return mAddress;
} }
/** /**
* @return The presentation requirements for the address. See {@link TelecomManager} for valid * Obtains the presentation requirements for the address of this {@code RemoteConnection}.
* values. *
* @return The presentation requirements for the address. See
* {@link TelecomManager} for valid values.
*/ */
public int getAddressPresentation() { public int getAddressPresentation() {
return mAddressPresentation; return mAddressPresentation;
} }
/** /**
* Obtains the display name for this {@code RemoteConnection}'s caller.
*
* @return The display name for the caller. * @return The display name for the caller.
*/ */
public CharSequence getCallerDisplayName() { public CharSequence getCallerDisplayName() {
@@ -532,16 +553,20 @@ public final class RemoteConnection {
} }
/** /**
* Obtains the presentation requirements for this {@code RemoteConnection}'s
* caller's display name.
*
* @return The presentation requirements for the caller display name. See * @return The presentation requirements for the caller display name. See
* {@link TelecomManager} for valid values. * {@link TelecomManager} for valid values.
*/ */
public int getCallerDisplayNamePresentation() { public int getCallerDisplayNamePresentation() {
return mCallerDisplayNamePresentation; return mCallerDisplayNamePresentation;
} }
/** /**
* @return The video state of the {@code RemoteConnection}. See * Obtains the video state of this {@code RemoteConnection}.
* {@link VideoProfile.VideoState}. *
* @return The video state of the {@code RemoteConnection}. See {@link VideoProfile.VideoState}.
* @hide * @hide
*/ */
public int getVideoState() { public int getVideoState() {
@@ -549,6 +574,8 @@ public final class RemoteConnection {
} }
/** /**
* Obtains the video provider of this {@code RemoteConnection}.
*
* @return The video provider associated with this {@code RemoteConnection}. * @return The video provider associated with this {@code RemoteConnection}.
* @hide * @hide
*/ */
@@ -557,8 +584,10 @@ public final class RemoteConnection {
} }
/** /**
* Determines whether this {@code RemoteConnection} is requesting ringback.
*
* @return Whether the {@code RemoteConnection} is requesting that the framework play a * @return Whether the {@code RemoteConnection} is requesting that the framework play a
* ringback tone on its behalf. * ringback tone on its behalf.
*/ */
public boolean isRingbackRequested() { public boolean isRingbackRequested() {
return false; return false;
@@ -800,10 +829,11 @@ public final class RemoteConnection {
/** /**
* @hide * @hide
*/ */
void setCallCapabilities(int callCapabilities) { void setConnectionCapabilities(int connectionCapabilities) {
mCallCapabilities = callCapabilities; mConnectionCapabilities = connectionCapabilities;
for (Callback c : mCallbacks) { for (Callback c : mCallbacks) {
c.onCallCapabilitiesChanged(this, callCapabilities); c.onConnectionCapabilitiesChanged(this, connectionCapabilities);
c.onCallCapabilitiesChanged(this, connectionCapabilities);
} }
} }

View File

@@ -59,7 +59,7 @@ final class RemoteConnectionService {
if (connection != NULL_CONNECTION && mPendingConnections.contains(connection)) { if (connection != NULL_CONNECTION && mPendingConnections.contains(connection)) {
mPendingConnections.remove(connection); mPendingConnections.remove(connection);
// Unconditionally initialize the connection ... // Unconditionally initialize the connection ...
connection.setCallCapabilities(parcel.getCapabilities()); connection.setConnectionCapabilities(parcel.getConnectionCapabilities());
connection.setAddress( connection.setAddress(
parcel.getHandle(), parcel.getHandlePresentation()); parcel.getHandle(), parcel.getHandlePresentation());
connection.setCallerDisplayName( connection.setCallerDisplayName(
@@ -139,13 +139,13 @@ final class RemoteConnectionService {
} }
@Override @Override
public void setCallCapabilities(String callId, int callCapabilities) { public void setConnectionCapabilities(String callId, int connectionCapabilities) {
if (mConnectionById.containsKey(callId)) { if (mConnectionById.containsKey(callId)) {
findConnectionForAction(callId, "setCallCapabilities") findConnectionForAction(callId, "setConnectionCapabilities")
.setCallCapabilities(callCapabilities); .setConnectionCapabilities(connectionCapabilities);
} else { } else {
findConferenceForAction(callId, "setCallCapabilities") findConferenceForAction(callId, "setConnectionCapabilities")
.setCallCapabilities(callCapabilities); .setConnectionCapabilities(connectionCapabilities);
} }
} }
@@ -192,7 +192,7 @@ final class RemoteConnectionService {
} }
conference.setState(parcel.getState()); conference.setState(parcel.getState());
conference.setCallCapabilities(parcel.getCapabilities()); conference.setConnectionCapabilities(parcel.getConnectionCapabilities());
mConferenceById.put(callId, conference); mConferenceById.put(callId, conference);
conference.registerCallback(new RemoteConference.Callback() { conference.registerCallback(new RemoteConference.Callback() {
@Override @Override

View File

@@ -52,7 +52,7 @@ oneway interface IConnectionServiceAdapter {
void setRingbackRequested(String callId, boolean ringing); void setRingbackRequested(String callId, boolean ringing);
void setCallCapabilities(String callId, int callCapabilities); void setConnectionCapabilities(String callId, int connectionCapabilities);
void setIsConferenced(String callId, String conferenceCallId); void setIsConferenced(String callId, String conferenceCallId);