diff options
author | Ihab Awad <ihab@google.com> | 2014-11-12 13:41:16 -0800 |
---|---|---|
committer | Ihab Awad <ihab@google.com> | 2014-11-28 15:54:35 -0800 |
commit | 5c9c86ec0f95d1f5e1aca212967f508fc736b895 (patch) | |
tree | 1706be6ac513145c4d0eab52649319509bd99d1e /telecomm/java/android/telecom/Conference.java | |
parent | 07b4a291319ec48a272451789ab0fbbf8d55a050 (diff) | |
download | frameworks_base-5c9c86ec0f95d1f5e1aca212967f508fc736b895.zip frameworks_base-5c9c86ec0f95d1f5e1aca212967f508fc736b895.tar.gz frameworks_base-5c9c86ec0f95d1f5e1aca212967f508fc736b895.tar.bz2 |
Telecom API updates (1/6)
Bug: 18292176
Change-Id: I060366234a5a60510c385dc837f2b7e79596eaf5
Diffstat (limited to 'telecomm/java/android/telecom/Conference.java')
-rw-r--r-- | telecomm/java/android/telecom/Conference.java | 84 |
1 files changed, 70 insertions, 14 deletions
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java index 6e404de..5371481 100644 --- a/telecomm/java/android/telecom/Conference.java +++ b/telecomm/java/android/telecom/Conference.java @@ -41,7 +41,8 @@ public abstract class Conference implements IConferenceable { public void onConferenceableConnectionsChanged( Conference conference, List<Connection> conferenceableConnections) {} 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<>(); @@ -56,7 +57,7 @@ public abstract class Conference implements IConferenceable { private AudioState mAudioState; private int mState = Connection.STATE_NEW; private DisconnectCause mDisconnectCause; - private int mCapabilities; + private int mConnectionCapabilities; private String mDisconnectMessage; private final Connection.Listener mConnectionDeathListener = new Connection.Listener() { @@ -104,13 +105,62 @@ public abstract class Conference implements IConferenceable { return mState; } + /** @hide */ + @Deprecated public final int getCapabilities() { + return getConnectionCapabilities(); + } + + /** + * Returns the capabilities of a conference. See {@code CAPABILITY_*} constants in class + * {@link Connection} for valid values. + * + * @return A bitmask of the capabilities of the conference call. + */ + public final int getConnectionCapabilities() { + 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); + } + /** - * Returns the capabilities of a conference. See {@link PhoneCapabilities} for valid values. + * Removes the specified capability from the set of capabilities of this {@code Conference}. * - * @return A bitmask of the {@code PhoneCapabilities} of the conference call. + * @param capability The capability to remove from the set. + * @hide */ - public final int getCapabilities() { - return mCapabilities; + 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 - * capability {@link PhoneCapabilities#MERGE_CONFERENCE}. + * capability {@link Connection#CAPABILITY_MERGE_CONFERENCE}. */ public void onMerge() {} /** * 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() {} @@ -224,17 +274,23 @@ public abstract class Conference implements IConferenceable { 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) { - if (capabilities != mCapabilities) { - mCapabilities = capabilities; + public final void setConnectionCapabilities(int connectionCapabilities) { + if (connectionCapabilities != mConnectionCapabilities) { + mConnectionCapabilities = connectionCapabilities; for (Listener l : mListeners) { - l.onCapabilitiesChanged(this, mCapabilities); + l.onConnectionCapabilitiesChanged(this, mConnectionCapabilities); } } } |