diff options
author | 2016-03-22 09:02:47 -0700 | |
---|---|---|
committer | 2016-03-24 20:20:11 -0700 | |
commit | 720c664401081ca00e56c7eef12641ae792da530 (patch) | |
tree | 3223364426b37927b9c34f7ab091d69878b65638 | |
parent | 2dc6cc9aa4ed44e6f337e8600856cd2e1d3e2f70 (diff) |
Add connection properties to Connections.
- Per suggestion of API council, moving properties of a Connection from
CAPABILITIES_* to PROPERTIES_*.
Bug: 27458894
Change-Id: Icce921b03cda514a991646ed39a26559c7e91230
-rw-r--r-- | api/current.txt | 13 | ||||
-rw-r--r-- | api/system-current.txt | 13 | ||||
-rw-r--r-- | api/test-current.txt | 13 | ||||
-rw-r--r-- | telecomm/java/android/telecom/Call.java | 8 | ||||
-rw-r--r-- | telecomm/java/android/telecom/Conference.java | 31 | ||||
-rw-r--r-- | telecomm/java/android/telecom/Connection.java | 148 | ||||
-rw-r--r-- | telecomm/java/android/telecom/ConnectionService.java | 26 | ||||
-rw-r--r-- | telecomm/java/android/telecom/ConnectionServiceAdapter.java | 9 | ||||
-rw-r--r-- | telecomm/java/android/telecom/ConnectionServiceAdapterServant.java | 11 | ||||
-rw-r--r-- | telecomm/java/android/telecom/ParcelableConference.java | 16 | ||||
-rw-r--r-- | telecomm/java/android/telecom/ParcelableConnection.java | 25 | ||||
-rw-r--r-- | telecomm/java/android/telecom/RemoteConference.java | 41 | ||||
-rw-r--r-- | telecomm/java/android/telecom/RemoteConnection.java | 40 | ||||
-rw-r--r-- | telecomm/java/android/telecom/RemoteConnectionService.java | 12 | ||||
-rw-r--r-- | telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl | 2 | ||||
-rw-r--r-- | telephony/java/com/android/ims/ImsCallProfile.java | 2 |
16 files changed, 352 insertions, 58 deletions
diff --git a/api/current.txt b/api/current.txt index 6a514a47b221..183030c250ce 100644 --- a/api/current.txt +++ b/api/current.txt @@ -36145,6 +36145,7 @@ package android.telecom { method public final android.telecom.CallAudioState getCallAudioState(); method public final java.util.List<android.telecom.Connection> getConferenceableConnections(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final long getConnectionTime(); method public final java.util.List<android.telecom.Connection> getConnections(); method public final android.telecom.DisconnectCause getDisconnectCause(); @@ -36172,6 +36173,7 @@ package android.telecom { method public final void setActive(); method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setConnectionTime(long); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); @@ -36201,6 +36203,7 @@ package android.telecom { method public final android.telecom.Conference getConference(); method public final java.util.List<android.telecom.Conferenceable> getConferenceables(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public final int getState(); @@ -36226,6 +36229,7 @@ package android.telecom { method public void onUnhold(); method public final void putExtras(android.os.Bundle); method public final void removeExtras(java.util.List<java.lang.String>); + method public static java.lang.String propertiesToString(int); method public void sendConnectionEvent(java.lang.String, android.os.Bundle); method public final void setActive(); method public final void setAddress(android.net.Uri, int); @@ -36234,6 +36238,7 @@ package android.telecom { method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final void setConferenceables(java.util.List<android.telecom.Conferenceable>); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); method public final deprecated void setExtras(android.os.Bundle); @@ -36250,12 +36255,11 @@ package android.telecom { method public static java.lang.String stateToString(int); field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 - field public static final int CAPABILITY_CAN_PULL_CALL = 33554432; // 0x2000000 field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000 + field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000 field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 field public static final int CAPABILITY_HOLD = 1; // 0x1 - field public static final int CAPABILITY_IS_EXTERNAL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 field public static final int CAPABILITY_MUTE = 64; // 0x40 @@ -36273,6 +36277,7 @@ package android.telecom { field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; field public static final java.lang.String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS"; field public static final java.lang.String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER"; + field public static final int PROPERTY_IS_EXTERNAL_CALL = 16; // 0x10 field public static final int STATE_ACTIVE = 4; // 0x4 field public static final int STATE_DIALING = 3; // 0x3 field public static final int STATE_DISCONNECTED = 6; // 0x6 @@ -36495,6 +36500,7 @@ package android.telecom { method public void disconnect(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final java.util.List<android.telecom.RemoteConnection> getConnections(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); @@ -36517,6 +36523,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConference, int); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConference, int); method public void onConnectionRemoved(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onDestroyed(android.telecom.RemoteConference); method public void onDisconnected(android.telecom.RemoteConference, android.telecom.DisconnectCause); @@ -36535,6 +36542,7 @@ package android.telecom { method public android.telecom.RemoteConference getConference(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public int getConnectionCapabilities(); + method public int getConnectionProperties(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public int getState(); @@ -36564,6 +36572,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConnection, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConnection, int); method public void onConnectionEvent(android.telecom.RemoteConnection, java.lang.String, android.os.Bundle); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConnection, int); method public void onDestroyed(android.telecom.RemoteConnection); method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause); method public void onExtrasChanged(android.telecom.RemoteConnection, android.os.Bundle); diff --git a/api/system-current.txt b/api/system-current.txt index 9477354616ca..4a9c9c7ff81c 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -38714,6 +38714,7 @@ package android.telecom { method public final java.util.List<android.telecom.Connection> getConferenceableConnections(); method public final deprecated long getConnectTimeMillis(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final long getConnectionTime(); method public final java.util.List<android.telecom.Connection> getConnections(); method public final android.telecom.DisconnectCause getDisconnectCause(); @@ -38744,6 +38745,7 @@ package android.telecom { method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final deprecated void setConnectTimeMillis(long); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setConnectionTime(long); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); @@ -38774,6 +38776,7 @@ package android.telecom { method public final android.telecom.Conference getConference(); method public final java.util.List<android.telecom.Conferenceable> getConferenceables(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public final int getState(); @@ -38800,6 +38803,7 @@ package android.telecom { method public void onUnhold(); method public final void putExtras(android.os.Bundle); method public final void removeExtras(java.util.List<java.lang.String>); + method public static java.lang.String propertiesToString(int); method public void sendConnectionEvent(java.lang.String, android.os.Bundle); method public final void setActive(); method public final void setAddress(android.net.Uri, int); @@ -38808,6 +38812,7 @@ package android.telecom { method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final void setConferenceables(java.util.List<android.telecom.Conferenceable>); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); method public final deprecated void setExtras(android.os.Bundle); @@ -38824,12 +38829,11 @@ package android.telecom { method public static java.lang.String stateToString(int); field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 - field public static final int CAPABILITY_CAN_PULL_CALL = 33554432; // 0x2000000 field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000 + field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000 field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 field public static final int CAPABILITY_HOLD = 1; // 0x1 - field public static final int CAPABILITY_IS_EXTERNAL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 field public static final int CAPABILITY_MUTE = 64; // 0x40 @@ -38847,6 +38851,7 @@ package android.telecom { field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; field public static final java.lang.String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS"; field public static final java.lang.String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER"; + field public static final int PROPERTY_IS_EXTERNAL_CALL = 16; // 0x10 field public static final int STATE_ACTIVE = 4; // 0x4 field public static final int STATE_DIALING = 3; // 0x3 field public static final int STATE_DISCONNECTED = 6; // 0x6 @@ -39124,6 +39129,7 @@ package android.telecom { method public void disconnect(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final java.util.List<android.telecom.RemoteConnection> getConnections(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); @@ -39147,6 +39153,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConference, int); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConference, int); method public void onConnectionRemoved(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onDestroyed(android.telecom.RemoteConference); method public void onDisconnected(android.telecom.RemoteConference, android.telecom.DisconnectCause); @@ -39165,6 +39172,7 @@ package android.telecom { method public android.telecom.RemoteConference getConference(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public int getConnectionCapabilities(); + method public int getConnectionProperties(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public int getState(); @@ -39195,6 +39203,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConnection, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConnection, int); method public void onConnectionEvent(android.telecom.RemoteConnection, java.lang.String, android.os.Bundle); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConnection, int); method public void onDestroyed(android.telecom.RemoteConnection); method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause); method public void onExtrasChanged(android.telecom.RemoteConnection, android.os.Bundle); diff --git a/api/test-current.txt b/api/test-current.txt index 1303212e2fe3..6487c524804b 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -36216,6 +36216,7 @@ package android.telecom { method public final android.telecom.CallAudioState getCallAudioState(); method public final java.util.List<android.telecom.Connection> getConferenceableConnections(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final long getConnectionTime(); method public final java.util.List<android.telecom.Connection> getConnections(); method public final android.telecom.DisconnectCause getDisconnectCause(); @@ -36243,6 +36244,7 @@ package android.telecom { method public final void setActive(); method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setConnectionTime(long); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); @@ -36272,6 +36274,7 @@ package android.telecom { method public final android.telecom.Conference getConference(); method public final java.util.List<android.telecom.Conferenceable> getConferenceables(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public final int getState(); @@ -36297,6 +36300,7 @@ package android.telecom { method public void onUnhold(); method public final void putExtras(android.os.Bundle); method public final void removeExtras(java.util.List<java.lang.String>); + method public static java.lang.String propertiesToString(int); method public void sendConnectionEvent(java.lang.String, android.os.Bundle); method public final void setActive(); method public final void setAddress(android.net.Uri, int); @@ -36305,6 +36309,7 @@ package android.telecom { method public final void setConferenceableConnections(java.util.List<android.telecom.Connection>); method public final void setConferenceables(java.util.List<android.telecom.Conferenceable>); method public final void setConnectionCapabilities(int); + method public final void setConnectionProperties(int); method public final void setDialing(); method public final void setDisconnected(android.telecom.DisconnectCause); method public final deprecated void setExtras(android.os.Bundle); @@ -36321,12 +36326,11 @@ package android.telecom { method public static java.lang.String stateToString(int); field public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 8388608; // 0x800000 field public static final int CAPABILITY_CAN_PAUSE_VIDEO = 1048576; // 0x100000 - field public static final int CAPABILITY_CAN_PULL_CALL = 33554432; // 0x2000000 field public static final int CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION = 4194304; // 0x400000 + field public static final int CAPABILITY_CAN_PULL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_CAN_UPGRADE_TO_VIDEO = 524288; // 0x80000 field public static final int CAPABILITY_DISCONNECT_FROM_CONFERENCE = 8192; // 0x2000 field public static final int CAPABILITY_HOLD = 1; // 0x1 - field public static final int CAPABILITY_IS_EXTERNAL_CALL = 16777216; // 0x1000000 field public static final int CAPABILITY_MANAGE_CONFERENCE = 128; // 0x80 field public static final int CAPABILITY_MERGE_CONFERENCE = 4; // 0x4 field public static final int CAPABILITY_MUTE = 64; // 0x40 @@ -36344,6 +36348,7 @@ package android.telecom { field public static final java.lang.String EXTRA_CALL_SUBJECT = "android.telecom.extra.CALL_SUBJECT"; field public static final java.lang.String EXTRA_CHILD_ADDRESS = "android.telecom.extra.CHILD_ADDRESS"; field public static final java.lang.String EXTRA_LAST_FORWARDED_NUMBER = "android.telecom.extra.LAST_FORWARDED_NUMBER"; + field public static final int PROPERTY_IS_EXTERNAL_CALL = 16; // 0x10 field public static final int STATE_ACTIVE = 4; // 0x4 field public static final int STATE_DIALING = 3; // 0x3 field public static final int STATE_DISCONNECTED = 6; // 0x6 @@ -36566,6 +36571,7 @@ package android.telecom { method public void disconnect(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public final int getConnectionCapabilities(); + method public final int getConnectionProperties(); method public final java.util.List<android.telecom.RemoteConnection> getConnections(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); @@ -36588,6 +36594,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConference, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionAdded(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConference, int); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConference, int); method public void onConnectionRemoved(android.telecom.RemoteConference, android.telecom.RemoteConnection); method public void onDestroyed(android.telecom.RemoteConference); method public void onDisconnected(android.telecom.RemoteConference, android.telecom.DisconnectCause); @@ -36606,6 +36613,7 @@ package android.telecom { method public android.telecom.RemoteConference getConference(); method public java.util.List<android.telecom.RemoteConnection> getConferenceableConnections(); method public int getConnectionCapabilities(); + method public int getConnectionProperties(); method public android.telecom.DisconnectCause getDisconnectCause(); method public final android.os.Bundle getExtras(); method public int getState(); @@ -36635,6 +36643,7 @@ package android.telecom { method public void onConferenceableConnectionsChanged(android.telecom.RemoteConnection, java.util.List<android.telecom.RemoteConnection>); method public void onConnectionCapabilitiesChanged(android.telecom.RemoteConnection, int); method public void onConnectionEvent(android.telecom.RemoteConnection, java.lang.String, android.os.Bundle); + method public void onConnectionPropertiesChanged(android.telecom.RemoteConnection, int); method public void onDestroyed(android.telecom.RemoteConnection); method public void onDisconnected(android.telecom.RemoteConnection, android.telecom.DisconnectCause); method public void onExtrasChanged(android.telecom.RemoteConnection, android.os.Bundle); diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java index e26e54b058f5..b4c6e6aefbce 100644 --- a/telecomm/java/android/telecom/Call.java +++ b/telecomm/java/android/telecom/Call.java @@ -250,7 +250,7 @@ public final class Call { * in its manifest. * <p> * See {@link Connection#CAPABILITY_CAN_PULL_CALL} and - * {@link Connection#CAPABILITY_IS_EXTERNAL_CALL}. + * {@link Connection#PROPERTY_IS_EXTERNAL_CALL}. */ public static final int CAPABILITY_CAN_PULL_CALL = 0x00800000; @@ -296,13 +296,13 @@ public final class Call { * 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. + * {@link Connection#PROPERTY_IS_EXTERNAL_CALL} property 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}. + * See {@link Connection#PROPERTY_IS_EXTERNAL_CALL}. */ public static final int PROPERTY_IS_EXTERNAL_CALL = 0x00000040; @@ -686,7 +686,7 @@ public final class Call { sb.append(", caps: "); sb.append(capabilitiesToString(mCallCapabilities)); sb.append(", props: "); - sb.append(mCallProperties); + sb.append(propertiesToString(mCallProperties)); sb.append("]"); return sb.toString(); } diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 00e07afda4b1..06851eeb7f20 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -53,6 +53,8 @@ public abstract class Conference extends Conferenceable { public void onDestroyed(Conference conference) {} public void onConnectionCapabilitiesChanged( Conference conference, int connectionCapabilities) {} + public void onConnectionPropertiesChanged( + Conference conference, int connectionProperties) {} public void onVideoStateChanged(Conference c, int videoState) { } public void onVideoProviderChanged(Conference c, Connection.VideoProvider videoProvider) {} public void onStatusHintsChanged(Conference conference, StatusHints statusHints) {} @@ -74,6 +76,7 @@ public abstract class Conference extends Conferenceable { private int mState = Connection.STATE_NEW; private DisconnectCause mDisconnectCause; private int mConnectionCapabilities; + private int mConnectionProperties; private String mDisconnectMessage; private long mConnectTimeMillis = CONNECT_TIME_NOT_SPECIFIED; private StatusHints mStatusHints; @@ -156,6 +159,16 @@ public abstract class Conference extends Conferenceable { } /** + * Returns the properties of the conference. See {@code PROPERTY_*} constants in class + * {@link Connection} for valid values. + * + * @return A bitmask of the properties of the conference call. + */ + public final int getConnectionProperties() { + return mConnectionProperties; + } + + /** * Whether the given capabilities support the specified capability. * * @param capabilities A capability bit field. @@ -364,7 +377,7 @@ public abstract class Conference extends Conferenceable { * Sets the capabilities of a conference. See {@code CAPABILITY_*} constants of class * {@link Connection} for valid values. * - * @param connectionCapabilities A bitmask of the {@code PhoneCapabilities} of the conference call. + * @param connectionCapabilities A bitmask of the {@code Capabilities} of the conference call. */ public final void setConnectionCapabilities(int connectionCapabilities) { if (connectionCapabilities != mConnectionCapabilities) { @@ -377,6 +390,22 @@ public abstract class Conference extends Conferenceable { } /** + * Sets the properties of a conference. See {@code PROPERTY_*} constants of class + * {@link Connection} for valid values. + * + * @param connectionProperties A bitmask of the {@code Properties} of the conference call. + */ + public final void setConnectionProperties(int connectionProperties) { + if (connectionProperties != mConnectionProperties) { + mConnectionProperties = connectionProperties; + + for (Listener l : mListeners) { + l.onConnectionPropertiesChanged(this, mConnectionProperties); + } + } + } + + /** * Adds the specified connection as a child of this conference. * * @param connection The connection to add. diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java index 3ea1c6a7663b..310c957c94fa 100644 --- a/telecomm/java/android/telecom/Connection.java +++ b/telecomm/java/android/telecom/Connection.java @@ -98,7 +98,7 @@ public abstract class Connection extends Conferenceable { * 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 + * A connection can only be in this state if the {@link #PROPERTY_IS_EXTERNAL_CALL} property and * {@link #CAPABILITY_CAN_PULL_CALL} capability bits are set on the connection. */ public static final int STATE_PULLING_CALL = 7; @@ -194,31 +194,28 @@ public abstract class Connection extends Conferenceable { 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). - * + * Un-used. * @hide */ - public static final int CAPABILITY_GENERIC_CONFERENCE = 0x00004000; + public static final int CAPABILITY_UNUSED_2 = 0x00004000; /** - * Connection is using high definition audio. + * Un-used. * @hide */ - public static final int CAPABILITY_HIGH_DEF_AUDIO = 0x00008000; + public static final int CAPABILITY_UNUSED_3 = 0x00008000; /** - * Connection is using WIFI. + * Un-used. * @hide */ - public static final int CAPABILITY_WIFI = 0x00010000; + public static final int CAPABILITY_UNUSED_4 = 0x00010000; /** - * Indicates that the current device callback number should be shown. - * + * Un-used. * @hide */ - public static final int CAPABILITY_SHOW_CALLBACK_NUMBER = 0x00020000; + public static final int CAPABILITY_UNUSED_5 = 0x00020000; /** * Speed up audio setup for MT call. @@ -281,32 +278,64 @@ public abstract class Connection extends Conferenceable { public static final int CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO = 0x00800000; /** + * 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 #PROPERTY_IS_EXTERNAL_CALL} + * is set. + */ + public static final int CAPABILITY_CAN_PULL_CALL = 0x01000000; + + //********************************************************************************************** + // Next CAPABILITY value: 0x02000000 + //********************************************************************************************** + + /** + * Indicates that the current device callback number should be shown. + * + * @hide + */ + public static final int PROPERTY_SHOW_CALLBACK_NUMBER = 1<<0; + + /** + * 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 PROPERTY_GENERIC_CONFERENCE = 1<<1; + + /** + * Connection is using high definition audio. + * @hide + */ + public static final int PROPERTY_HIGH_DEF_AUDIO = 1<<2; + + /** + * Connection is using WIFI. + * @hide + */ + public static final int PROPERTY_WIFI = 1<<3; + + /** * 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. + * {@link #PROPERTY_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; + public static final int PROPERTY_IS_EXTERNAL_CALL = 1<<4; - /** - * 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: 0x04000000 + // Next PROPERTY value: 1<<5 //********************************************************************************************** /** @@ -454,18 +483,6 @@ public abstract class Connection extends Conferenceable { if (can(capabilities, CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO)) { builder.append(" CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO"); } - if (can(capabilities, CAPABILITY_HIGH_DEF_AUDIO)) { - builder.append(" CAPABILITY_HIGH_DEF_AUDIO"); - } - if (can(capabilities, CAPABILITY_WIFI)) { - builder.append(" CAPABILITY_WIFI"); - } - if (can(capabilities, CAPABILITY_GENERIC_CONFERENCE)) { - builder.append(" CAPABILITY_GENERIC_CONFERENCE"); - } - if (can(capabilities, CAPABILITY_SHOW_CALLBACK_NUMBER)) { - builder.append(" CAPABILITY_SHOW_CALLBACK_NUMBER"); - } if (can(capabilities, CAPABILITY_SPEED_UP_MT_AUDIO)) { builder.append(" CAPABILITY_SPEED_UP_MT_AUDIO"); } @@ -481,9 +498,6 @@ 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"); } @@ -492,6 +506,34 @@ public abstract class Connection extends Conferenceable { return builder.toString(); } + public static String propertiesToString(int properties) { + StringBuilder builder = new StringBuilder(); + builder.append("[Properties:"); + + if (can(properties, PROPERTY_SHOW_CALLBACK_NUMBER)) { + builder.append(" PROPERTY_SHOW_CALLBACK_NUMBER"); + } + + if (can(properties, PROPERTY_HIGH_DEF_AUDIO)) { + builder.append(" PROPERTY_HIGH_DEF_AUDIO"); + } + + if (can(properties, PROPERTY_WIFI)) { + builder.append(" PROPERTY_WIFI"); + } + + if (can(properties, PROPERTY_GENERIC_CONFERENCE)) { + builder.append(" PROPERTY_GENERIC_CONFERENCE"); + } + + if (can(properties, PROPERTY_IS_EXTERNAL_CALL)) { + builder.append(" PROPERTY_IS_EXTERNAL_CALL"); + } + + builder.append("]"); + return builder.toString(); + } + /** @hide */ public abstract static class Listener { public void onStateChanged(Connection c, int state) {} @@ -505,6 +547,7 @@ public abstract class Connection extends Conferenceable { public void onRingbackRequested(Connection c, boolean ringback) {} public void onDestroyed(Connection c) {} public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {} + public void onConnectionPropertiesChanged(Connection c, int properties) {} public void onVideoProviderChanged( Connection c, VideoProvider videoProvider) {} public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {} @@ -1175,6 +1218,7 @@ public abstract class Connection extends Conferenceable { private int mCallerDisplayNamePresentation; private boolean mRingbackRequested = false; private int mConnectionCapabilities; + private int mConnectionProperties; private VideoProvider mVideoProvider; private boolean mAudioModeIsVoip; private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED; @@ -1439,6 +1483,13 @@ public abstract class Connection extends Conferenceable { } /** + * Returns the connection's properties, as a bit mask of the {@code PROPERTY_*} constants. + */ + public final int getConnectionProperties() { + return mConnectionProperties; + } + + /** * Sets the value of the {@link #getAddress()} property. * * @param address The new address. @@ -1635,6 +1686,21 @@ public abstract class Connection extends Conferenceable { } /** + * Sets the connection's properties as a bit mask of the {@code PROPERTY_*} constants. + * + * @param connectionProperties The new connection properties. + */ + public final void setConnectionProperties(int connectionProperties) { + checkImmutable(); + if (mConnectionProperties != connectionProperties) { + mConnectionProperties = connectionProperties; + for (Listener l : mListeners) { + l.onConnectionPropertiesChanged(this, mConnectionProperties); + } + } + } + + /** * Tears down the Connection object. */ public final void destroy() { @@ -2042,10 +2108,10 @@ public abstract class Connection extends Conferenceable { * 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. + * For a Connection to be pulled, both the {@link Connection#CAPABILITY_CAN_PULL_CALL} + * capability and {@link Connection#PROPERTY_IS_EXTERNAL_CALL} property bits must be set. * <p> - * For more information on external calls, see {@link Connection#CAPABILITY_IS_EXTERNAL_CALL}. + * For more information on external calls, see {@link Connection#PROPERTY_IS_EXTERNAL_CALL}. */ public void onPullExternalCall() {} diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index e092095eaed3..4cab7f06a0ff 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -495,6 +495,16 @@ public abstract class ConnectionService extends Service { } @Override + public void onConnectionPropertiesChanged( + Conference conference, + int connectionProperties) { + String id = mIdByConference.get(conference); + Log.d(this, "call capabilities: conference: %s", + Connection.propertiesToString(connectionProperties)); + mAdapter.setConnectionProperties(id, connectionProperties); + } + + @Override public void onVideoStateChanged(Conference c, int videoState) { String id = mIdByConference.get(c); Log.d(this, "onVideoStateChanged set video state %d", videoState); @@ -623,6 +633,14 @@ public abstract class ConnectionService extends Service { } @Override + public void onConnectionPropertiesChanged(Connection c, int properties) { + String id = mIdByConnection.get(c); + Log.d(this, "properties: parcelableconnection: %s", + Connection.propertiesToString(properties)); + mAdapter.setConnectionProperties(id, properties); + } + + @Override public void onVideoProviderChanged(Connection c, Connection.VideoProvider videoProvider) { String id = mIdByConnection.get(c); Log.d(this, "onVideoProviderChanged: Connection: %s, VideoProvider: %s", c, @@ -740,10 +758,11 @@ public abstract class ConnectionService extends Service { Uri address = connection.getAddress(); String number = address == null ? "null" : address.getSchemeSpecificPart(); - Log.v(this, "createConnection, number: %s, state: %s, capabilities: %s", + Log.v(this, "createConnection, number: %s, state: %s, capabilities: %s, properties: %s", Connection.toLogSafePhoneNumber(number), Connection.stateToString(connection.getState()), - Connection.capabilitiesToString(connection.getConnectionCapabilities())); + Connection.capabilitiesToString(connection.getConnectionCapabilities()), + Connection.propertiesToString(connection.getConnectionProperties())); Log.d(this, "createConnection, calling handleCreateConnectionSuccessful %s", callId); mAdapter.handleCreateConnectionComplete( @@ -753,6 +772,7 @@ public abstract class ConnectionService extends Service { request.getAccountHandle(), connection.getState(), connection.getConnectionCapabilities(), + connection.getConnectionProperties(), connection.getAddress(), connection.getAddressPresentation(), connection.getCallerDisplayName(), @@ -1110,6 +1130,7 @@ public abstract class ConnectionService extends Service { conference.getPhoneAccountHandle(), conference.getState(), conference.getConnectionCapabilities(), + conference.getConnectionProperties(), connectionIds, conference.getVideoProvider() == null ? null : conference.getVideoProvider().getInterface(), @@ -1150,6 +1171,7 @@ public abstract class ConnectionService extends Service { phoneAccountHandle, connection.getState(), connection.getConnectionCapabilities(), + connection.getConnectionProperties(), connection.getAddress(), connection.getAddressPresentation(), connection.getCallerDisplayName(), diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java index 81e4c2271c14..c8cd3c0486fb 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java @@ -196,6 +196,15 @@ final class ConnectionServiceAdapter implements DeathRecipient { } } + void setConnectionProperties(String callId, int properties) { + for (IConnectionServiceAdapter adapter : mAdapters) { + try { + adapter.setConnectionProperties(callId, properties); + } catch (RemoteException ignored) { + } + } + } + /** * Indicates whether or not the specified call is currently conferenced into the specified * conference call. diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java index 3e465577e2f3..bf28feb92d91 100644 --- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java @@ -64,6 +64,7 @@ final class ConnectionServiceAdapterServant { private static final int MSG_PUT_EXTRAS = 24; private static final int MSG_REMOVE_EXTRAS = 25; private static final int MSG_ON_CONNECTION_EVENT = 26; + private static final int MSG_SET_CONNECTION_PROPERTIES = 27; private final IConnectionServiceAdapter mDelegate; @@ -118,6 +119,9 @@ final class ConnectionServiceAdapterServant { case MSG_SET_CONNECTION_CAPABILITIES: mDelegate.setConnectionCapabilities((String) msg.obj, msg.arg1); break; + case MSG_SET_CONNECTION_PROPERTIES: + mDelegate.setConnectionProperties((String) msg.obj, msg.arg1); + break; case MSG_SET_IS_CONFERENCED: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -322,6 +326,13 @@ final class ConnectionServiceAdapterServant { } @Override + public void setConnectionProperties(String connectionId, int connectionProperties) { + mHandler.obtainMessage( + MSG_SET_CONNECTION_PROPERTIES, connectionProperties, 0, connectionId) + .sendToTarget(); + } + + @Override public void setConferenceMergeFailed(String callId) { SomeArgs args = SomeArgs.obtain(); args.arg1 = callId; diff --git a/telecomm/java/android/telecom/ParcelableConference.java b/telecomm/java/android/telecom/ParcelableConference.java index 870f5ee8a01c..f5689d882ba8 100644 --- a/telecomm/java/android/telecom/ParcelableConference.java +++ b/telecomm/java/android/telecom/ParcelableConference.java @@ -34,6 +34,7 @@ public final class ParcelableConference implements Parcelable { private PhoneAccountHandle mPhoneAccount; private int mState; private int mConnectionCapabilities; + private int mConnectionProperties; private List<String> mConnectionIds; private long mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED; private final IVideoProvider mVideoProvider; @@ -45,6 +46,7 @@ public final class ParcelableConference implements Parcelable { PhoneAccountHandle phoneAccount, int state, int connectionCapabilities, + int connectionProperties, List<String> connectionIds, IVideoProvider videoProvider, int videoState, @@ -54,6 +56,7 @@ public final class ParcelableConference implements Parcelable { mPhoneAccount = phoneAccount; mState = state; mConnectionCapabilities = connectionCapabilities; + mConnectionProperties = connectionProperties; mConnectionIds = connectionIds; mConnectTimeMillis = Conference.CONNECT_TIME_NOT_SPECIFIED; mVideoProvider = videoProvider; @@ -72,6 +75,8 @@ public final class ParcelableConference implements Parcelable { .append(Connection.stateToString(mState)) .append(", capabilities: ") .append(Connection.capabilitiesToString(mConnectionCapabilities)) + .append(", properties: ") + .append(Connection.propertiesToString(mConnectionProperties)) .append(", connectTime: ") .append(mConnectTimeMillis) .append(", children: ") @@ -95,6 +100,10 @@ public final class ParcelableConference implements Parcelable { return mConnectionCapabilities; } + public int getConnectionProperties() { + return mConnectionProperties; + } + public List<String> getConnectionIds() { return mConnectionIds; } @@ -134,9 +143,11 @@ public final class ParcelableConference implements Parcelable { int videoState = source.readInt(); StatusHints statusHints = source.readParcelable(classLoader); Bundle extras = source.readBundle(classLoader); + int properties = source.readInt(); - return new ParcelableConference(phoneAccount, state, capabilities, connectionIds, - videoCallProvider, videoState, connectTimeMillis, statusHints, extras); + return new ParcelableConference(phoneAccount, state, capabilities, properties, + connectionIds, videoCallProvider, videoState, connectTimeMillis, statusHints, + extras); } @Override @@ -164,5 +175,6 @@ public final class ParcelableConference implements Parcelable { destination.writeInt(mVideoState); destination.writeParcelable(mStatusHints, 0); destination.writeBundle(mExtras); + destination.writeInt(mConnectionProperties); } } diff --git a/telecomm/java/android/telecom/ParcelableConnection.java b/telecomm/java/android/telecom/ParcelableConnection.java index ce51c967e021..540f388384bb 100644 --- a/telecomm/java/android/telecom/ParcelableConnection.java +++ b/telecomm/java/android/telecom/ParcelableConnection.java @@ -36,6 +36,7 @@ public final class ParcelableConnection implements Parcelable { private final PhoneAccountHandle mPhoneAccount; private final int mState; private final int mConnectionCapabilities; + private final int mConnectionProperties; private final Uri mAddress; private final int mAddressPresentation; private final String mCallerDisplayName; @@ -55,6 +56,7 @@ public final class ParcelableConnection implements Parcelable { PhoneAccountHandle phoneAccount, int state, int capabilities, + int properties, Uri address, int addressPresentation, String callerDisplayName, @@ -71,6 +73,7 @@ public final class ParcelableConnection implements Parcelable { mPhoneAccount = phoneAccount; mState = state; mConnectionCapabilities = capabilities; + mConnectionProperties = properties; mAddress = address; mAddressPresentation = addressPresentation; mCallerDisplayName = callerDisplayName; @@ -94,11 +97,26 @@ public final class ParcelableConnection implements Parcelable { return mState; } - // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}. + /** + * Returns the current connection capabilities bit-mask. Connection capabilities are defined as + * {@code CAPABILITY_*} constants in {@link Connection}. + * + * @return Bit-mask containing capabilities of the connection. + */ public int getConnectionCapabilities() { return mConnectionCapabilities; } + /** + * Returns the current connection properties bit-mask. Connection properties are defined as + * {@code PROPERTY_*} constants in {@link Connection}. + * + * @return Bit-mask containing properties of the connection. + */ + public int getConnectionProperties() { + return mConnectionProperties; + } + public Uri getHandle() { return mAddress; } @@ -160,6 +178,8 @@ public final class ParcelableConnection implements Parcelable { .append(mState) .append(", capabilities:") .append(Connection.capabilitiesToString(mConnectionCapabilities)) + .append(", properties:") + .append(Connection.propertiesToString(mConnectionProperties)) .append(", extras:") .append(mExtras) .toString(); @@ -189,11 +209,13 @@ public final class ParcelableConnection implements Parcelable { List<String> conferenceableConnectionIds = new ArrayList<>(); source.readStringList(conferenceableConnectionIds); Bundle extras = Bundle.setDefusable(source.readBundle(classLoader), true); + int properties = source.readInt(); return new ParcelableConnection( phoneAccount, state, capabilities, + properties, address, addressPresentation, callerDisplayName, @@ -241,5 +263,6 @@ public final class ParcelableConnection implements Parcelable { destination.writeParcelable(mDisconnectCause, 0); destination.writeStringList(mConferenceableConnectionIds); destination.writeBundle(mExtras); + destination.writeInt(mConnectionProperties); } } diff --git a/telecomm/java/android/telecom/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java index b03cb51277b5..943da6d1a52e 100644 --- a/telecomm/java/android/telecom/RemoteConference.java +++ b/telecomm/java/android/telecom/RemoteConference.java @@ -92,6 +92,18 @@ public final class RemoteConference { int connectionCapabilities) {} /** + * Indicates that the call properties of this {@code RemoteConference} have changed. + * See {@link #getConnectionProperties()}. + * + * @param conference The {@code RemoteConference} invoking this method. + * @param connectionProperties The new properties of the {@code RemoteConference}. + */ + public void onConnectionPropertiesChanged( + RemoteConference conference, + int connectionProperties) {} + + + /** * Invoked when the set of {@link RemoteConnection}s which can be added to this conference * call have changed. * @@ -133,6 +145,7 @@ public final class RemoteConference { private int mState = Connection.STATE_NEW; private DisconnectCause mDisconnectCause; private int mConnectionCapabilities; + private int mConnectionProperties; private Bundle mExtras; /** @hide */ @@ -244,6 +257,24 @@ public final class RemoteConference { } /** @hide */ + void setConnectionProperties(final int connectionProperties) { + if (mConnectionProperties != connectionProperties) { + mConnectionProperties = connectionProperties; + for (CallbackRecord<Callback> record : mCallbackRecords) { + final RemoteConference conference = this; + final Callback callback = record.getCallback(); + record.getHandler().post(new Runnable() { + @Override + public void run() { + callback.onConnectionPropertiesChanged( + conference, mConnectionProperties); + } + }); + } + } + } + + /** @hide */ void setConferenceableConnections(List<RemoteConnection> conferenceableConnections) { mConferenceableConnections.clear(); mConferenceableConnections.addAll(conferenceableConnections); @@ -342,6 +373,16 @@ public final class RemoteConference { } /** + * Returns the properties of the conference. See {@code PROPERTY_*} constants in class + * {@link Connection} for valid values. + * + * @return A bitmask of the properties of the conference call. + */ + public final int getConnectionProperties() { + return mConnectionProperties; + } + + /** * Obtain the extras associated with this {@code RemoteConnection}. * * @return The extras for this connection. diff --git a/telecomm/java/android/telecom/RemoteConnection.java b/telecomm/java/android/telecom/RemoteConnection.java index 7df6678bd5d3..dc8eaf640537 100644 --- a/telecomm/java/android/telecom/RemoteConnection.java +++ b/telecomm/java/android/telecom/RemoteConnection.java @@ -90,6 +90,17 @@ public final class RemoteConnection { int connectionCapabilities) {} /** + * Indicates that the call properties of this {@code RemoteConnection} have changed. + * See {@link #getConnectionProperties()}. + * + * @param connection The {@code RemoteConnection} invoking this method. + * @param connectionProperties The new properties of the {@code RemoteConnection}. + */ + public void onConnectionPropertiesChanged( + RemoteConnection connection, + int connectionProperties) {} + + /** * Invoked when the post-dial sequence in the outgoing {@code Connection} has reached a * pause character. This causes the post-dial signals to stop pending user confirmation. An * implementation should present this choice to the user and invoke @@ -588,6 +599,7 @@ public final class RemoteConnection { private boolean mRingbackRequested; private boolean mConnected; private int mConnectionCapabilities; + private int mConnectionProperties; private int mVideoState; private VideoProvider mVideoProvider; private boolean mIsVoipAudioMode; @@ -624,6 +636,7 @@ public final class RemoteConnection { mDisconnectCause = connection.getDisconnectCause(); mRingbackRequested = connection.isRingbackRequested(); mConnectionCapabilities = connection.getConnectionCapabilities(); + mConnectionProperties = connection.getConnectionProperties(); mVideoState = connection.getVideoState(); mVideoProvider = new RemoteConnection.VideoProvider(connection.getVideoProvider()); mIsVoipAudioMode = connection.getIsVoipAudioMode(); @@ -719,6 +732,16 @@ public final class RemoteConnection { } /** + * Obtains the properties of this {@code RemoteConnection}. + * + * @return A bitmask of the properties of the {@code RemoteConnection}, as defined in the + * {@code PROPERTY_*} constants in class {@link Connection}. + */ + public int getConnectionProperties() { + return mConnectionProperties; + } + + /** * Determines if the audio mode of this {@code RemoteConnection} is VOIP. * * @return {@code true} if the {@code RemoteConnection}'s current audio mode is VOIP. @@ -1114,6 +1137,23 @@ public final class RemoteConnection { /** * @hide */ + void setConnectionProperties(final int connectionProperties) { + mConnectionProperties = connectionProperties; + for (CallbackRecord record : mCallbackRecords) { + final RemoteConnection connection = this; + final Callback callback = record.getCallback(); + record.getHandler().post(new Runnable() { + @Override + public void run() { + callback.onConnectionPropertiesChanged(connection, connectionProperties); + } + }); + } + } + + /** + * @hide + */ void setDestroyed() { if (!mCallbackRecords.isEmpty()) { // Make sure that the callbacks are notified that the call is destroyed first. diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index d88d007e532e..21a7706e5f55 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -61,6 +61,7 @@ final class RemoteConnectionService { mPendingConnections.remove(connection); // Unconditionally initialize the connection ... connection.setConnectionCapabilities(parcel.getConnectionCapabilities()); + connection.setConnectionProperties(parcel.getConnectionProperties()); if (parcel.getHandle() != null || parcel.getState() != Connection.STATE_DISCONNECTED) { connection.setAddress(parcel.getHandle(), parcel.getHandlePresentation()); @@ -156,6 +157,17 @@ final class RemoteConnectionService { } @Override + public void setConnectionProperties(String callId, int connectionProperties) { + if (mConnectionById.containsKey(callId)) { + findConnectionForAction(callId, "setConnectionProperties") + .setConnectionProperties(connectionProperties); + } else { + findConferenceForAction(callId, "setConnectionProperties") + .setConnectionProperties(connectionProperties); + } + } + + @Override public void setIsConferenced(String callId, String conferenceCallId) { // Note: callId should not be null; conferenceCallId may be null RemoteConnection connection = diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl index 680480500eea..9bc8ffe4ec6e 100644 --- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl @@ -55,6 +55,8 @@ oneway interface IConnectionServiceAdapter { void setConnectionCapabilities(String callId, int connectionCapabilities); + void setConnectionProperties(String callId, int connectionProperties); + void setIsConferenced(String callId, String conferenceCallId); void setConferenceMergeFailed(String callId); diff --git a/telephony/java/com/android/ims/ImsCallProfile.java b/telephony/java/com/android/ims/ImsCallProfile.java index 96c624345d5e..303746c7e54b 100644 --- a/telephony/java/com/android/ims/ImsCallProfile.java +++ b/telephony/java/com/android/ims/ImsCallProfile.java @@ -201,7 +201,7 @@ public class ImsCallProfile implements Parcelable { * "14" vs (int) 14). * Note: This is used by {@link com.android.internal.telephony.imsphone.ImsPhoneConnection# * updateWifiStateFromExtras(Bundle)} to determine whether to set the - * {@link android.telecom.Connection#CAPABILITY_WIFI} capability on a connection. + * {@link android.telecom.Connection#PROPERTY_WIFI} property on a connection. */ public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; |