Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2014 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 18 | |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 20 | import android.annotation.Nullable; |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 21 | import android.annotation.SystemApi; |
Tyler Gunn | 6c14a699 | 2019-02-04 15:12:06 -0800 | [diff] [blame] | 22 | import android.annotation.TestApi; |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 23 | import android.net.Uri; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 24 | import android.os.Bundle; |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 25 | import android.os.SystemClock; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 26 | import android.telecom.Connection.VideoProvider; |
Chen Xu | b6d1319 | 2019-10-02 00:20:43 -0700 | [diff] [blame] | 27 | import android.telephony.Annotation.RilRadioTechnology; |
Wei Huang | 7f7f72e | 2018-05-30 19:21:36 +0800 | [diff] [blame] | 28 | import android.telephony.ServiceState; |
| 29 | import android.telephony.TelephonyManager; |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 30 | import android.util.ArraySet; |
Evan Charlton | 0e094d9 | 2014-11-08 15:49:16 -0800 | [diff] [blame] | 31 | |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 32 | import java.util.ArrayList; |
Tyler Gunn | 071be6f | 2016-05-10 14:52:33 -0700 | [diff] [blame] | 33 | import java.util.Arrays; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 34 | import java.util.Collections; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 35 | import java.util.List; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 36 | import java.util.Locale; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 37 | import java.util.Set; |
| 38 | import java.util.concurrent.CopyOnWriteArrayList; |
| 39 | import java.util.concurrent.CopyOnWriteArraySet; |
| 40 | |
| 41 | /** |
| 42 | * Represents a conference call which can contain any number of {@link Connection} objects. |
| 43 | */ |
Yorke Lee | abfcfdc | 2015-05-13 18:55:18 -0700 | [diff] [blame] | 44 | public abstract class Conference extends Conferenceable { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 45 | |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 46 | /** |
| 47 | * Used to indicate that the conference connection time is not specified. If not specified, |
| 48 | * Telecom will set the connect time. |
| 49 | */ |
Jay Shrauner | 164a0ac | 2015-04-14 18:16:10 -0700 | [diff] [blame] | 50 | public static final long CONNECT_TIME_NOT_SPECIFIED = 0; |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 51 | |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 52 | /** @hide */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 53 | abstract static class Listener { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 54 | public void onStateChanged(Conference conference, int oldState, int newState) {} |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 55 | public void onDisconnected(Conference conference, DisconnectCause disconnectCause) {} |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 56 | public void onConnectionAdded(Conference conference, Connection connection) {} |
| 57 | public void onConnectionRemoved(Conference conference, Connection connection) {} |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 58 | public void onConferenceableConnectionsChanged( |
| 59 | Conference conference, List<Connection> conferenceableConnections) {} |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 60 | public void onDestroyed(Conference conference) {} |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 61 | public void onConnectionCapabilitiesChanged( |
| 62 | Conference conference, int connectionCapabilities) {} |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 63 | public void onConnectionPropertiesChanged( |
| 64 | Conference conference, int connectionProperties) {} |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 65 | public void onVideoStateChanged(Conference c, int videoState) { } |
| 66 | public void onVideoProviderChanged(Conference c, Connection.VideoProvider videoProvider) {} |
Andrew Lee | edc625f | 2015-04-14 13:38:12 -0700 | [diff] [blame] | 67 | public void onStatusHintsChanged(Conference conference, StatusHints statusHints) {} |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 68 | public void onExtrasChanged(Conference c, Bundle extras) {} |
| 69 | public void onExtrasRemoved(Conference c, List<String> keys) {} |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 70 | public void onConferenceStateChanged(Conference c, boolean isConference) {} |
| 71 | public void onAddressChanged(Conference c, Uri newAddress, int presentation) {} |
Hall Liu | c9bc1c6 | 2019-04-16 14:00:55 -0700 | [diff] [blame] | 72 | public void onConnectionEvent(Conference c, String event, Bundle extras) {} |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 73 | public void onCallerDisplayNameChanged( |
| 74 | Conference c, String callerDisplayName, int presentation) {} |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | private final Set<Listener> mListeners = new CopyOnWriteArraySet<>(); |
| 78 | private final List<Connection> mChildConnections = new CopyOnWriteArrayList<>(); |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 79 | private final List<Connection> mUnmodifiableChildConnections = |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 80 | Collections.unmodifiableList(mChildConnections); |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 81 | private final List<Connection> mConferenceableConnections = new ArrayList<>(); |
| 82 | private final List<Connection> mUnmodifiableConferenceableConnections = |
| 83 | Collections.unmodifiableList(mConferenceableConnections); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 84 | |
Jack Yu | 6714030 | 2015-12-10 12:27:58 -0800 | [diff] [blame] | 85 | private String mTelecomCallId; |
Jay Shrauner | 164a0ac | 2015-04-14 18:16:10 -0700 | [diff] [blame] | 86 | private PhoneAccountHandle mPhoneAccount; |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 87 | private CallAudioState mCallAudioState; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 88 | private int mState = Connection.STATE_NEW; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 89 | private DisconnectCause mDisconnectCause; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 90 | private int mConnectionCapabilities; |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 91 | private int mConnectionProperties; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 92 | private String mDisconnectMessage; |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 93 | private long mConnectTimeMillis = CONNECT_TIME_NOT_SPECIFIED; |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 94 | private long mConnectionStartElapsedRealTime = CONNECT_TIME_NOT_SPECIFIED; |
Andrew Lee | edc625f | 2015-04-14 13:38:12 -0700 | [diff] [blame] | 95 | private StatusHints mStatusHints; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 96 | private Bundle mExtras; |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 97 | private Set<String> mPreviousExtraKeys; |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 98 | private final Object mExtrasLock = new Object(); |
Tyler Gunn | ac60f95 | 2019-05-31 07:23:16 -0700 | [diff] [blame] | 99 | private Uri mAddress; |
| 100 | private int mAddressPresentation; |
| 101 | private String mCallerDisplayName; |
| 102 | private int mCallerDisplayNamePresentation; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 103 | |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 104 | private final Connection.Listener mConnectionDeathListener = new Connection.Listener() { |
| 105 | @Override |
| 106 | public void onDestroyed(Connection c) { |
| 107 | if (mConferenceableConnections.remove(c)) { |
| 108 | fireOnConferenceableConnectionsChanged(); |
| 109 | } |
| 110 | } |
| 111 | }; |
| 112 | |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 113 | /** |
| 114 | * Constructs a new Conference with a mandatory {@link PhoneAccountHandle} |
| 115 | * |
| 116 | * @param phoneAccount The {@code PhoneAccountHandle} associated with the conference. |
| 117 | */ |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 118 | public Conference(PhoneAccountHandle phoneAccount) { |
| 119 | mPhoneAccount = phoneAccount; |
| 120 | } |
| 121 | |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 122 | /** |
Jack Yu | 6714030 | 2015-12-10 12:27:58 -0800 | [diff] [blame] | 123 | * Returns the telecom internal call ID associated with this conference. |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 124 | * <p> |
| 125 | * Note: This is ONLY used for debugging purposes so that the Telephony stack can better |
| 126 | * associate logs in Telephony with those in Telecom. |
| 127 | * The ID returned should not be used for any other purpose. |
Jack Yu | 6714030 | 2015-12-10 12:27:58 -0800 | [diff] [blame] | 128 | * |
| 129 | * @return The telecom call ID. |
| 130 | * @hide |
| 131 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 132 | @SystemApi |
| 133 | @TestApi |
| 134 | public final @NonNull String getTelecomCallId() { |
Jack Yu | 6714030 | 2015-12-10 12:27:58 -0800 | [diff] [blame] | 135 | return mTelecomCallId; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Sets the telecom internal call ID associated with this conference. |
| 140 | * |
| 141 | * @param telecomCallId The telecom call ID. |
| 142 | * @hide |
| 143 | */ |
| 144 | public final void setTelecomCallId(String telecomCallId) { |
| 145 | mTelecomCallId = telecomCallId; |
| 146 | } |
| 147 | |
| 148 | /** |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 149 | * Returns the {@link PhoneAccountHandle} the conference call is being placed through. |
| 150 | * |
| 151 | * @return A {@code PhoneAccountHandle} object representing the PhoneAccount of the conference. |
| 152 | */ |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 153 | public final PhoneAccountHandle getPhoneAccountHandle() { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 154 | return mPhoneAccount; |
| 155 | } |
| 156 | |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 157 | /** |
| 158 | * Returns the list of connections currently associated with the conference call. |
| 159 | * |
| 160 | * @return A list of {@code Connection} objects which represent the children of the conference. |
| 161 | */ |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 162 | public final List<Connection> getConnections() { |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 163 | return mUnmodifiableChildConnections; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 166 | /** |
| 167 | * Gets the state of the conference call. See {@link Connection} for valid values. |
| 168 | * |
| 169 | * @return A constant representing the state the conference call is currently in. |
| 170 | */ |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 171 | public final int getState() { |
| 172 | return mState; |
| 173 | } |
| 174 | |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 175 | /** |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 176 | * Returns the capabilities of the conference. See {@code CAPABILITY_*} constants in class |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 177 | * {@link Connection} for valid values. |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 178 | * |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 179 | * @return A bitmask of the capabilities of the conference call. |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 180 | */ |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 181 | public final int getConnectionCapabilities() { |
| 182 | return mConnectionCapabilities; |
| 183 | } |
| 184 | |
| 185 | /** |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 186 | * Returns the properties of the conference. See {@code PROPERTY_*} constants in class |
| 187 | * {@link Connection} for valid values. |
| 188 | * |
| 189 | * @return A bitmask of the properties of the conference call. |
| 190 | */ |
| 191 | public final int getConnectionProperties() { |
| 192 | return mConnectionProperties; |
| 193 | } |
| 194 | |
| 195 | /** |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 196 | * @return The audio state of the conference, describing how its audio is currently |
| 197 | * being routed by the system. This is {@code null} if this Conference |
| 198 | * does not directly know about its audio state. |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 199 | * @deprecated Use {@link #getCallAudioState()} instead. |
| 200 | * @hide |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 201 | */ |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 202 | @Deprecated |
| 203 | @SystemApi |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 204 | public final AudioState getAudioState() { |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 205 | return new AudioState(mCallAudioState); |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * @return The audio state of the conference, describing how its audio is currently |
| 210 | * being routed by the system. This is {@code null} if this Conference |
| 211 | * does not directly know about its audio state. |
| 212 | */ |
| 213 | public final CallAudioState getCallAudioState() { |
| 214 | return mCallAudioState; |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | /** |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 218 | * Returns VideoProvider of the primary call. This can be null. |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 219 | */ |
| 220 | public VideoProvider getVideoProvider() { |
| 221 | return null; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Returns video state of the primary call. |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 226 | */ |
| 227 | public int getVideoState() { |
Tyler Gunn | 87b73f3 | 2015-06-03 10:09:59 -0700 | [diff] [blame] | 228 | return VideoProfile.STATE_AUDIO_ONLY; |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 232 | * Notifies the {@link Conference} when the Conference and all it's {@link Connection}s should |
| 233 | * be disconnected. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 234 | */ |
| 235 | public void onDisconnect() {} |
| 236 | |
| 237 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 238 | * Notifies the {@link Conference} when the specified {@link Connection} should be separated |
| 239 | * from the conference call. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 240 | * |
| 241 | * @param connection The connection to separate. |
| 242 | */ |
| 243 | public void onSeparate(Connection connection) {} |
| 244 | |
| 245 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 246 | * Notifies the {@link Conference} when the specified {@link Connection} should merged with the |
| 247 | * conference call. |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 248 | * |
| 249 | * @param connection The {@code Connection} to merge. |
| 250 | */ |
| 251 | public void onMerge(Connection connection) {} |
| 252 | |
| 253 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 254 | * Notifies the {@link Conference} when it should be put on hold. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 255 | */ |
| 256 | public void onHold() {} |
| 257 | |
| 258 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 259 | * Notifies the {@link Conference} when it should be moved from a held to active state. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 260 | */ |
| 261 | public void onUnhold() {} |
| 262 | |
| 263 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 264 | * Notifies the {@link Conference} when the child calls should be merged. Only invoked if the |
| 265 | * conference contains the capability {@link Connection#CAPABILITY_MERGE_CONFERENCE}. |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 266 | */ |
| 267 | public void onMerge() {} |
| 268 | |
| 269 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 270 | * Notifies the {@link Conference} when the child calls should be swapped. Only invoked if the |
| 271 | * conference contains the capability {@link Connection#CAPABILITY_SWAP_CONFERENCE}. |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 272 | */ |
| 273 | public void onSwap() {} |
| 274 | |
| 275 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 276 | * Notifies the {@link Conference} of a request to play a DTMF tone. |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 277 | * |
| 278 | * @param c A DTMF character. |
| 279 | */ |
| 280 | public void onPlayDtmfTone(char c) {} |
| 281 | |
| 282 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 283 | * Notifies the {@link Conference} of a request to stop any currently playing DTMF tones. |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 284 | */ |
| 285 | public void onStopDtmfTone() {} |
| 286 | |
| 287 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 288 | * Notifies the {@link Conference} that the {@link #getAudioState()} property has a new value. |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 289 | * |
| 290 | * @param state The new call audio state. |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 291 | * @deprecated Use {@link #onCallAudioStateChanged(CallAudioState)} instead. |
| 292 | * @hide |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 293 | */ |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 294 | @SystemApi |
| 295 | @Deprecated |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 296 | public void onAudioStateChanged(AudioState state) {} |
| 297 | |
| 298 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 299 | * Notifies the {@link Conference} that the {@link #getCallAudioState()} property has a new |
| 300 | * value. |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 301 | * |
| 302 | * @param state The new call audio state. |
| 303 | */ |
| 304 | public void onCallAudioStateChanged(CallAudioState state) {} |
| 305 | |
| 306 | /** |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 307 | * Notifies the {@link Conference} that a {@link Connection} has been added to it. |
Andrew Lee | 46f7f5d | 2014-11-06 17:00:25 -0800 | [diff] [blame] | 308 | * |
| 309 | * @param connection The newly added connection. |
| 310 | */ |
| 311 | public void onConnectionAdded(Connection connection) {} |
| 312 | |
| 313 | /** |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 314 | * Sets state to be on hold. |
| 315 | */ |
| 316 | public final void setOnHold() { |
| 317 | setState(Connection.STATE_HOLDING); |
| 318 | } |
| 319 | |
| 320 | /** |
Tyler Gunn | d46595a | 2015-06-01 14:29:11 -0700 | [diff] [blame] | 321 | * Sets state to be dialing. |
| 322 | */ |
| 323 | public final void setDialing() { |
| 324 | setState(Connection.STATE_DIALING); |
| 325 | } |
| 326 | |
| 327 | /** |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 328 | * Sets state to be active. |
| 329 | */ |
| 330 | public final void setActive() { |
| 331 | setState(Connection.STATE_ACTIVE); |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * Sets state to disconnected. |
| 336 | * |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 337 | * @param disconnectCause The reason for the disconnection, as described by |
| 338 | * {@link android.telecom.DisconnectCause}. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 339 | */ |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 340 | public final void setDisconnected(DisconnectCause disconnectCause) { |
| 341 | mDisconnectCause = disconnectCause;; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 342 | setState(Connection.STATE_DISCONNECTED); |
| 343 | for (Listener l : mListeners) { |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 344 | l.onDisconnected(this, mDisconnectCause); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 345 | } |
| 346 | } |
| 347 | |
| 348 | /** |
mike dooley | 1cf14ac | 2014-11-04 10:59:53 -0800 | [diff] [blame] | 349 | * @return The {@link DisconnectCause} for this connection. |
| 350 | */ |
| 351 | public final DisconnectCause getDisconnectCause() { |
| 352 | return mDisconnectCause; |
| 353 | } |
| 354 | |
| 355 | /** |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 356 | * Sets the capabilities of a conference. See {@code CAPABILITY_*} constants of class |
| 357 | * {@link Connection} for valid values. |
Nancy Chen | 56fc25d | 2014-09-09 12:24:51 -0700 | [diff] [blame] | 358 | * |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 359 | * @param connectionCapabilities A bitmask of the {@code Capabilities} of the conference call. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 360 | */ |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 361 | public final void setConnectionCapabilities(int connectionCapabilities) { |
| 362 | if (connectionCapabilities != mConnectionCapabilities) { |
| 363 | mConnectionCapabilities = connectionCapabilities; |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 364 | |
| 365 | for (Listener l : mListeners) { |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 366 | l.onConnectionCapabilitiesChanged(this, mConnectionCapabilities); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 367 | } |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | /** |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 372 | * Sets the properties of a conference. See {@code PROPERTY_*} constants of class |
| 373 | * {@link Connection} for valid values. |
| 374 | * |
| 375 | * @param connectionProperties A bitmask of the {@code Properties} of the conference call. |
| 376 | */ |
| 377 | public final void setConnectionProperties(int connectionProperties) { |
| 378 | if (connectionProperties != mConnectionProperties) { |
| 379 | mConnectionProperties = connectionProperties; |
| 380 | |
| 381 | for (Listener l : mListeners) { |
| 382 | l.onConnectionPropertiesChanged(this, mConnectionProperties); |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | /** |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 388 | * Adds the specified connection as a child of this conference. |
| 389 | * |
| 390 | * @param connection The connection to add. |
| 391 | * @return True if the connection was successfully added. |
| 392 | */ |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 393 | public final boolean addConnection(Connection connection) { |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 394 | Log.d(this, "Connection=%s, connection=", connection); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 395 | if (connection != null && !mChildConnections.contains(connection)) { |
| 396 | if (connection.setConference(this)) { |
| 397 | mChildConnections.add(connection); |
Andrew Lee | 46f7f5d | 2014-11-06 17:00:25 -0800 | [diff] [blame] | 398 | onConnectionAdded(connection); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 399 | for (Listener l : mListeners) { |
| 400 | l.onConnectionAdded(this, connection); |
| 401 | } |
| 402 | return true; |
| 403 | } |
| 404 | } |
| 405 | return false; |
| 406 | } |
| 407 | |
| 408 | /** |
| 409 | * Removes the specified connection as a child of this conference. |
| 410 | * |
| 411 | * @param connection The connection to remove. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 412 | */ |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 413 | public final void removeConnection(Connection connection) { |
Santos Cordon | 0159ac0 | 2014-08-21 14:28:11 -0700 | [diff] [blame] | 414 | Log.d(this, "removing %s from %s", connection, mChildConnections); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 415 | if (connection != null && mChildConnections.remove(connection)) { |
| 416 | connection.resetConference(); |
| 417 | for (Listener l : mListeners) { |
| 418 | l.onConnectionRemoved(this, connection); |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | /** |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 424 | * Sets the connections with which this connection can be conferenced. |
| 425 | * |
| 426 | * @param conferenceableConnections The set of connections this connection can conference with. |
| 427 | */ |
| 428 | public final void setConferenceableConnections(List<Connection> conferenceableConnections) { |
| 429 | clearConferenceableList(); |
| 430 | for (Connection c : conferenceableConnections) { |
| 431 | // If statement checks for duplicates in input. It makes it N^2 but we're dealing with a |
| 432 | // small amount of items here. |
| 433 | if (!mConferenceableConnections.contains(c)) { |
| 434 | c.addConnectionListener(mConnectionDeathListener); |
| 435 | mConferenceableConnections.add(c); |
| 436 | } |
| 437 | } |
| 438 | fireOnConferenceableConnectionsChanged(); |
| 439 | } |
| 440 | |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 441 | /** |
| 442 | * Set the video state for the conference. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame] | 443 | * Valid values: {@link VideoProfile#STATE_AUDIO_ONLY}, |
| 444 | * {@link VideoProfile#STATE_BIDIRECTIONAL}, |
| 445 | * {@link VideoProfile#STATE_TX_ENABLED}, |
| 446 | * {@link VideoProfile#STATE_RX_ENABLED}. |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 447 | * |
| 448 | * @param videoState The new video state. |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 449 | */ |
| 450 | public final void setVideoState(Connection c, int videoState) { |
| 451 | Log.d(this, "setVideoState Conference: %s Connection: %s VideoState: %s", |
| 452 | this, c, videoState); |
| 453 | for (Listener l : mListeners) { |
| 454 | l.onVideoStateChanged(this, videoState); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | /** |
| 459 | * Sets the video connection provider. |
| 460 | * |
| 461 | * @param videoProvider The video provider. |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 462 | */ |
| 463 | public final void setVideoProvider(Connection c, Connection.VideoProvider videoProvider) { |
| 464 | Log.d(this, "setVideoProvider Conference: %s Connection: %s VideoState: %s", |
| 465 | this, c, videoProvider); |
| 466 | for (Listener l : mListeners) { |
| 467 | l.onVideoProviderChanged(this, videoProvider); |
| 468 | } |
| 469 | } |
| 470 | |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 471 | private final void fireOnConferenceableConnectionsChanged() { |
| 472 | for (Listener l : mListeners) { |
| 473 | l.onConferenceableConnectionsChanged(this, getConferenceableConnections()); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * Returns the connections with which this connection can be conferenced. |
| 479 | */ |
| 480 | public final List<Connection> getConferenceableConnections() { |
| 481 | return mUnmodifiableConferenceableConnections; |
| 482 | } |
| 483 | |
| 484 | /** |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 485 | * Tears down the conference object and any of its current connections. |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 486 | */ |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 487 | public final void destroy() { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 488 | Log.d(this, "destroying conference : %s", this); |
| 489 | // Tear down the children. |
Santos Cordon | 0159ac0 | 2014-08-21 14:28:11 -0700 | [diff] [blame] | 490 | for (Connection connection : mChildConnections) { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 491 | Log.d(this, "removing connection %s", connection); |
| 492 | removeConnection(connection); |
| 493 | } |
| 494 | |
| 495 | // If not yet disconnected, set the conference call as disconnected first. |
| 496 | if (mState != Connection.STATE_DISCONNECTED) { |
| 497 | Log.d(this, "setting to disconnected"); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 498 | setDisconnected(new DisconnectCause(DisconnectCause.LOCAL)); |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | // ...and notify. |
| 502 | for (Listener l : mListeners) { |
| 503 | l.onDestroyed(this); |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Add a listener to be notified of a state change. |
| 509 | * |
| 510 | * @param listener The new listener. |
| 511 | * @return This conference. |
| 512 | * @hide |
| 513 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 514 | final Conference addListener(Listener listener) { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 515 | mListeners.add(listener); |
| 516 | return this; |
| 517 | } |
| 518 | |
| 519 | /** |
| 520 | * Removes the specified listener. |
| 521 | * |
| 522 | * @param listener The listener to remove. |
| 523 | * @return This conference. |
| 524 | * @hide |
| 525 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 526 | final Conference removeListener(Listener listener) { |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 527 | mListeners.remove(listener); |
| 528 | return this; |
| 529 | } |
| 530 | |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 531 | /** |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 532 | * Retrieves the primary connection associated with the conference. The primary connection is |
| 533 | * the connection from which the conference will retrieve its current state. |
| 534 | * |
| 535 | * @return The primary connection. |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 536 | * @hide |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 537 | */ |
Tyler Gunn | 6c14a699 | 2019-02-04 15:12:06 -0800 | [diff] [blame] | 538 | @TestApi |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 539 | @SystemApi |
Santos Cordon | 4055d64 | 2015-05-12 14:19:24 -0700 | [diff] [blame] | 540 | public Connection getPrimaryConnection() { |
Tyler Gunn | 4a57b9b | 2014-10-30 14:27:48 -0700 | [diff] [blame] | 541 | if (mUnmodifiableChildConnections == null || mUnmodifiableChildConnections.isEmpty()) { |
| 542 | return null; |
| 543 | } |
| 544 | return mUnmodifiableChildConnections.get(0); |
| 545 | } |
| 546 | |
| 547 | /** |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 548 | * @hide |
| 549 | * @deprecated Use {@link #setConnectionTime}. |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 550 | */ |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 551 | @Deprecated |
| 552 | @SystemApi |
| 553 | public final void setConnectTimeMillis(long connectTimeMillis) { |
| 554 | setConnectionTime(connectTimeMillis); |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 555 | } |
| 556 | |
| 557 | /** |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 558 | * Sets the connection start time of the {@code Conference}. This is used in the call log to |
| 559 | * indicate the date and time when the conference took place. |
| 560 | * <p> |
| 561 | * Should be specified in wall-clock time returned by {@link System#currentTimeMillis()}. |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 562 | * <p> |
| 563 | * When setting the connection time, you should always set the connection elapsed time via |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 564 | * {@link #setConnectionStartElapsedRealTime(long)} to ensure the duration is reflected. |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 565 | * |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 566 | * @param connectionTimeMillis The connection time, in milliseconds, as returned by |
| 567 | * {@link System#currentTimeMillis()}. |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 568 | */ |
| 569 | public final void setConnectionTime(long connectionTimeMillis) { |
| 570 | mConnectTimeMillis = connectionTimeMillis; |
| 571 | } |
| 572 | |
| 573 | /** |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 574 | * Sets the start time of the {@link Conference} which is the basis for the determining the |
| 575 | * duration of the {@link Conference}. |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 576 | * <p> |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 577 | * You should use a value returned by {@link SystemClock#elapsedRealtime()} to ensure that time |
| 578 | * zone changes do not impact the conference duration. |
| 579 | * <p> |
| 580 | * When setting this, you should also set the connection time via |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 581 | * {@link #setConnectionTime(long)}. |
| 582 | * |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 583 | * @param connectionStartElapsedRealTime The connection time, as measured by |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 584 | * {@link SystemClock#elapsedRealtime()}. |
| 585 | */ |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 586 | public final void setConnectionStartElapsedRealTime(long connectionStartElapsedRealTime) { |
| 587 | mConnectionStartElapsedRealTime = connectionStartElapsedRealTime; |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 588 | } |
| 589 | |
| 590 | /** |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 591 | * @hide |
| 592 | * @deprecated Use {@link #getConnectionTime}. |
| 593 | */ |
| 594 | @Deprecated |
| 595 | @SystemApi |
| 596 | public final long getConnectTimeMillis() { |
| 597 | return getConnectionTime(); |
| 598 | } |
| 599 | |
| 600 | /** |
| 601 | * Retrieves the connection start time of the {@code Conference}, if specified. A value of |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 602 | * {@link #CONNECT_TIME_NOT_SPECIFIED} indicates that Telecom should determine the start time |
| 603 | * of the conference. |
| 604 | * |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 605 | * @return The time at which the {@code Conference} was connected. |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 606 | */ |
Santos Cordon | 5d2e4f2 | 2015-05-12 12:32:51 -0700 | [diff] [blame] | 607 | public final long getConnectionTime() { |
Tyler Gunn | cd5d33c | 2015-01-12 09:02:01 -0800 | [diff] [blame] | 608 | return mConnectTimeMillis; |
| 609 | } |
| 610 | |
| 611 | /** |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 612 | * Retrieves the connection start time of the {@link Conference}, if specified. A value of |
| 613 | * {@link #CONNECT_TIME_NOT_SPECIFIED} indicates that Telecom should determine the start time |
| 614 | * of the conference. |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 615 | * <p> |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 616 | * This is based on the value of {@link SystemClock#elapsedRealtime()} to ensure that it is not |
| 617 | * impacted by wall clock changes (user initiated, network initiated, time zone change, etc). |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 618 | * <p> |
| 619 | * Note: This is only exposed for use by the Telephony framework which needs it to copy |
| 620 | * conference start times among conference participants. It is exposed as a system API since it |
| 621 | * has no general use other than to the Telephony framework. |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 622 | * |
| 623 | * @return The elapsed time at which the {@link Conference} was connected. |
| 624 | * @hide |
| 625 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 626 | @SystemApi |
| 627 | @TestApi |
Tyler Gunn | 1754139 | 2018-02-01 08:58:38 -0800 | [diff] [blame] | 628 | public final long getConnectionStartElapsedRealTime() { |
| 629 | return mConnectionStartElapsedRealTime; |
Tyler Gunn | 3fa819c | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 630 | } |
| 631 | |
| 632 | /** |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 633 | * Inform this Conference that the state of its audio output has been changed externally. |
| 634 | * |
| 635 | * @param state The new audio state. |
| 636 | * @hide |
| 637 | */ |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 638 | final void setCallAudioState(CallAudioState state) { |
| 639 | Log.d(this, "setCallAudioState %s", state); |
| 640 | mCallAudioState = state; |
| 641 | onAudioStateChanged(getAudioState()); |
| 642 | onCallAudioStateChanged(state); |
Yorke Lee | a0d3ca9 | 2014-09-15 19:18:13 -0700 | [diff] [blame] | 643 | } |
| 644 | |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 645 | private void setState(int newState) { |
| 646 | if (newState != Connection.STATE_ACTIVE && |
| 647 | newState != Connection.STATE_HOLDING && |
| 648 | newState != Connection.STATE_DISCONNECTED) { |
| 649 | Log.w(this, "Unsupported state transition for Conference call.", |
| 650 | Connection.stateToString(newState)); |
| 651 | return; |
| 652 | } |
| 653 | |
| 654 | if (mState != newState) { |
| 655 | int oldState = mState; |
| 656 | mState = newState; |
| 657 | for (Listener l : mListeners) { |
| 658 | l.onStateChanged(this, oldState, newState); |
| 659 | } |
| 660 | } |
| 661 | } |
Ihab Awad | 50e3506 | 2014-09-30 09:17:03 -0700 | [diff] [blame] | 662 | |
| 663 | private final void clearConferenceableList() { |
| 664 | for (Connection c : mConferenceableConnections) { |
| 665 | c.removeConnectionListener(mConnectionDeathListener); |
| 666 | } |
| 667 | mConferenceableConnections.clear(); |
| 668 | } |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 669 | |
| 670 | @Override |
| 671 | public String toString() { |
| 672 | return String.format(Locale.US, |
| 673 | "[State: %s,Capabilites: %s, VideoState: %s, VideoProvider: %s, ThisObject %s]", |
| 674 | Connection.stateToString(mState), |
| 675 | Call.Details.capabilitiesToString(mConnectionCapabilities), |
| 676 | getVideoState(), |
| 677 | getVideoProvider(), |
| 678 | super.toString()); |
| 679 | } |
Andrew Lee | 0f51da3 | 2015-04-16 13:11:55 -0700 | [diff] [blame] | 680 | |
Andrew Lee | edc625f | 2015-04-14 13:38:12 -0700 | [diff] [blame] | 681 | /** |
| 682 | * Sets the label and icon status to display in the InCall UI. |
| 683 | * |
| 684 | * @param statusHints The status label and icon to set. |
| 685 | */ |
| 686 | public final void setStatusHints(StatusHints statusHints) { |
| 687 | mStatusHints = statusHints; |
| 688 | for (Listener l : mListeners) { |
| 689 | l.onStatusHintsChanged(this, statusHints); |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | /** |
| 694 | * @return The status hints for this conference. |
| 695 | */ |
| 696 | public final StatusHints getStatusHints() { |
| 697 | return mStatusHints; |
| 698 | } |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 699 | |
| 700 | /** |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 701 | * Replaces all the extras associated with this {@code Conference}. |
| 702 | * <p> |
| 703 | * New or existing keys are replaced in the {@code Conference} extras. Keys which are no longer |
| 704 | * in the new extras, but were present the last time {@code setExtras} was called are removed. |
| 705 | * <p> |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 706 | * Alternatively you may use the {@link #putExtras(Bundle)}, and |
| 707 | * {@link #removeExtras(String...)} methods to modify the extras. |
| 708 | * <p> |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 709 | * No assumptions should be made as to how an In-Call UI or service will handle these extras. |
Tyler Gunn | 9c0eb0b | 2016-06-29 11:23:25 -0700 | [diff] [blame] | 710 | * Keys should be fully qualified (e.g., com.example.extras.MY_EXTRA) to avoid conflicts. |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 711 | * |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 712 | * @param extras The extras associated with this {@code Conference}. |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 713 | */ |
| 714 | public final void setExtras(@Nullable Bundle extras) { |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 715 | // Keeping putExtras and removeExtras in the same lock so that this operation happens as a |
| 716 | // block instead of letting other threads put/remove while this method is running. |
| 717 | synchronized (mExtrasLock) { |
| 718 | // Add/replace any new or changed extras values. |
| 719 | putExtras(extras); |
| 720 | // If we have used "setExtras" in the past, compare the key set from the last invocation |
| 721 | // to the current one and remove any keys that went away. |
| 722 | if (mPreviousExtraKeys != null) { |
| 723 | List<String> toRemove = new ArrayList<String>(); |
| 724 | for (String oldKey : mPreviousExtraKeys) { |
| 725 | if (extras == null || !extras.containsKey(oldKey)) { |
| 726 | toRemove.add(oldKey); |
| 727 | } |
| 728 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 729 | |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 730 | if (!toRemove.isEmpty()) { |
| 731 | removeExtras(toRemove); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 732 | } |
| 733 | } |
| 734 | |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 735 | // Track the keys the last time set called setExtras. This way, the next time setExtras |
| 736 | // is called we can see if the caller has removed any extras values. |
| 737 | if (mPreviousExtraKeys == null) { |
| 738 | mPreviousExtraKeys = new ArraySet<String>(); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 739 | } |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 740 | mPreviousExtraKeys.clear(); |
| 741 | if (extras != null) { |
| 742 | mPreviousExtraKeys.addAll(extras.keySet()); |
| 743 | } |
Tyler Gunn | a8fb8ab | 2016-03-29 10:24:22 -0700 | [diff] [blame] | 744 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 745 | } |
| 746 | |
| 747 | /** |
| 748 | * Adds some extras to this {@link Conference}. Existing keys are replaced and new ones are |
| 749 | * added. |
| 750 | * <p> |
| 751 | * No assumptions should be made as to how an In-Call UI or service will handle these extras. |
| 752 | * Keys should be fully qualified (e.g., com.example.MY_EXTRA) to avoid conflicts. |
| 753 | * |
| 754 | * @param extras The extras to add. |
| 755 | */ |
| 756 | public final void putExtras(@NonNull Bundle extras) { |
| 757 | if (extras == null) { |
| 758 | return; |
| 759 | } |
| 760 | |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 761 | // Creating a Bundle clone so we don't have to synchronize on mExtrasLock while calling |
| 762 | // onExtrasChanged. |
| 763 | Bundle listenersBundle; |
| 764 | synchronized (mExtrasLock) { |
| 765 | if (mExtras == null) { |
| 766 | mExtras = new Bundle(); |
| 767 | } |
| 768 | mExtras.putAll(extras); |
| 769 | listenersBundle = new Bundle(mExtras); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 770 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 771 | |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 772 | for (Listener l : mListeners) { |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 773 | l.onExtrasChanged(this, new Bundle(listenersBundle)); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 774 | } |
| 775 | } |
| 776 | |
| 777 | /** |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 778 | * Adds a boolean extra to this {@link Conference}. |
| 779 | * |
| 780 | * @param key The extra key. |
| 781 | * @param value The value. |
| 782 | * @hide |
| 783 | */ |
| 784 | public final void putExtra(String key, boolean value) { |
| 785 | Bundle newExtras = new Bundle(); |
| 786 | newExtras.putBoolean(key, value); |
| 787 | putExtras(newExtras); |
| 788 | } |
| 789 | |
| 790 | /** |
| 791 | * Adds an integer extra to this {@link Conference}. |
| 792 | * |
| 793 | * @param key The extra key. |
| 794 | * @param value The value. |
| 795 | * @hide |
| 796 | */ |
| 797 | public final void putExtra(String key, int value) { |
| 798 | Bundle newExtras = new Bundle(); |
| 799 | newExtras.putInt(key, value); |
| 800 | putExtras(newExtras); |
| 801 | } |
| 802 | |
| 803 | /** |
| 804 | * Adds a string extra to this {@link Conference}. |
| 805 | * |
| 806 | * @param key The extra key. |
| 807 | * @param value The value. |
| 808 | * @hide |
| 809 | */ |
| 810 | public final void putExtra(String key, String value) { |
| 811 | Bundle newExtras = new Bundle(); |
| 812 | newExtras.putString(key, value); |
| 813 | putExtras(newExtras); |
| 814 | } |
| 815 | |
| 816 | /** |
Tyler Gunn | 071be6f | 2016-05-10 14:52:33 -0700 | [diff] [blame] | 817 | * Removes extras from this {@link Conference}. |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 818 | * |
Tyler Gunn | 071be6f | 2016-05-10 14:52:33 -0700 | [diff] [blame] | 819 | * @param keys The keys of the extras to remove. |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 820 | */ |
| 821 | public final void removeExtras(List<String> keys) { |
| 822 | if (keys == null || keys.isEmpty()) { |
| 823 | return; |
| 824 | } |
| 825 | |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 826 | synchronized (mExtrasLock) { |
| 827 | if (mExtras != null) { |
| 828 | for (String key : keys) { |
| 829 | mExtras.remove(key); |
| 830 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 831 | } |
| 832 | } |
| 833 | |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 834 | List<String> unmodifiableKeys = Collections.unmodifiableList(keys); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 835 | for (Listener l : mListeners) { |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 836 | l.onExtrasRemoved(this, unmodifiableKeys); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 837 | } |
| 838 | } |
| 839 | |
| 840 | /** |
Tyler Gunn | 071be6f | 2016-05-10 14:52:33 -0700 | [diff] [blame] | 841 | * Removes extras from this {@link Conference}. |
| 842 | * |
| 843 | * @param keys The keys of the extras to remove. |
| 844 | */ |
| 845 | public final void removeExtras(String ... keys) { |
| 846 | removeExtras(Arrays.asList(keys)); |
| 847 | } |
| 848 | |
| 849 | /** |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 850 | * Returns the extras associated with this conference. |
Tyler Gunn | 2cbe2b5 | 2016-05-04 15:48:10 +0000 | [diff] [blame] | 851 | * <p> |
| 852 | * Extras should be updated using {@link #putExtras(Bundle)} and {@link #removeExtras(List)}. |
| 853 | * <p> |
| 854 | * Telecom or an {@link InCallService} can also update the extras via |
| 855 | * {@link android.telecom.Call#putExtras(Bundle)}, and |
| 856 | * {@link Call#removeExtras(List)}. |
| 857 | * <p> |
| 858 | * The conference is notified of changes to the extras made by Telecom or an |
| 859 | * {@link InCallService} by {@link #onExtrasChanged(Bundle)}. |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 860 | * |
| 861 | * @return The extras associated with this connection. |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 862 | */ |
| 863 | public final Bundle getExtras() { |
| 864 | return mExtras; |
| 865 | } |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 866 | |
| 867 | /** |
| 868 | * Notifies this {@link Conference} of a change to the extras made outside the |
| 869 | * {@link ConnectionService}. |
| 870 | * <p> |
| 871 | * These extras changes can originate from Telecom itself, or from an {@link InCallService} via |
| 872 | * {@link android.telecom.Call#putExtras(Bundle)}, and |
| 873 | * {@link Call#removeExtras(List)}. |
| 874 | * |
| 875 | * @param extras The new extras bundle. |
| 876 | */ |
| 877 | public void onExtrasChanged(Bundle extras) {} |
| 878 | |
| 879 | /** |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 880 | * Set whether Telecom should treat this {@link Conference} as a conference call or if it |
| 881 | * should treat it as a single-party call. |
| 882 | * This method is used as part of a workaround regarding IMS conference calls and user |
| 883 | * expectation. In IMS, once a conference is formed, the UE is connected to an IMS conference |
| 884 | * server. If all participants of the conference drop out of the conference except for one, the |
| 885 | * UE is still connected to the IMS conference server. At this point, the user logically |
| 886 | * assumes they're no longer in a conference, yet the underlying network actually is. |
| 887 | * To help provide a better user experiece, IMS conference calls can pretend to actually be a |
| 888 | * single-party call when the participant count drops to 1. Although the dialer/phone app |
| 889 | * could perform this trickery, it makes sense to do this in Telephony since a fix there will |
| 890 | * ensure that bluetooth head units, auto and wearable apps all behave consistently. |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 891 | * <p> |
| 892 | * This API is intended for use by the platform Telephony stack only. |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 893 | * |
| 894 | * @param isConference {@code true} if this {@link Conference} should be treated like a |
| 895 | * conference call, {@code false} if it should be treated like a single-party call. |
| 896 | * @hide |
| 897 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 898 | @SystemApi |
| 899 | @TestApi |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 900 | public void setConferenceState(boolean isConference) { |
| 901 | for (Listener l : mListeners) { |
| 902 | l.onConferenceStateChanged(this, isConference); |
| 903 | } |
| 904 | } |
| 905 | |
| 906 | /** |
| 907 | * Sets the address of this {@link Conference}. Used when {@link #setConferenceState(boolean)} |
| 908 | * is called to mark a conference temporarily as NOT a conference. |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 909 | * <p> |
| 910 | * Note: This is a Telephony-specific implementation detail related to IMS conferences. It is |
| 911 | * not intended for use outside of the Telephony stack. |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 912 | * |
| 913 | * @param address The new address. |
| 914 | * @param presentation The presentation requirements for the address. |
| 915 | * See {@link TelecomManager} for valid values. |
| 916 | * @hide |
| 917 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 918 | @SystemApi |
| 919 | @TestApi |
| 920 | public final void setAddress(@NonNull Uri address, |
| 921 | @TelecomManager.Presentation int presentation) { |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 922 | Log.d(this, "setAddress %s", address); |
Tyler Gunn | ac60f95 | 2019-05-31 07:23:16 -0700 | [diff] [blame] | 923 | mAddress = address; |
| 924 | mAddressPresentation = presentation; |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 925 | for (Listener l : mListeners) { |
| 926 | l.onAddressChanged(this, address, presentation); |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | /** |
Tyler Gunn | ac60f95 | 2019-05-31 07:23:16 -0700 | [diff] [blame] | 931 | * Returns the "address" associated with the conference. This is applicable in two cases: |
| 932 | * <ol> |
| 933 | * <li>When {@link #setConferenceState(boolean)} is used to mark a conference as |
| 934 | * temporarily "not a conference"; we need to present the correct address in the in-call |
| 935 | * UI.</li> |
| 936 | * <li>When the conference is not hosted on the current device, we need to know the address |
| 937 | * information for the purpose of showing the original address to the user, as well as for |
| 938 | * logging to the call log.</li> |
| 939 | * </ol> |
| 940 | * @return The address of the conference, or {@code null} if not applicable. |
| 941 | * @hide |
| 942 | */ |
| 943 | public final Uri getAddress() { |
| 944 | return mAddress; |
| 945 | } |
| 946 | |
| 947 | /** |
| 948 | * Returns the address presentation associated with the conference. |
| 949 | * <p> |
| 950 | * This is applicable in two cases: |
| 951 | * <ol> |
| 952 | * <li>When {@link #setConferenceState(boolean)} is used to mark a conference as |
| 953 | * temporarily "not a conference"; we need to present the correct address in the in-call |
| 954 | * UI.</li> |
| 955 | * <li>When the conference is not hosted on the current device, we need to know the address |
| 956 | * information for the purpose of showing the original address to the user, as well as for |
| 957 | * logging to the call log.</li> |
| 958 | * </ol> |
| 959 | * @return The address of the conference, or {@code null} if not applicable. |
| 960 | * @hide |
| 961 | */ |
| 962 | public final int getAddressPresentation() { |
| 963 | return mAddressPresentation; |
| 964 | } |
| 965 | |
| 966 | /** |
| 967 | * @return The caller display name (CNAP). |
| 968 | * @hide |
| 969 | */ |
| 970 | public final String getCallerDisplayName() { |
| 971 | return mCallerDisplayName; |
| 972 | } |
| 973 | |
| 974 | /** |
| 975 | * @return The presentation requirements for the handle. |
| 976 | * See {@link TelecomManager} for valid values. |
| 977 | * @hide |
| 978 | */ |
| 979 | public final int getCallerDisplayNamePresentation() { |
| 980 | return mCallerDisplayNamePresentation; |
| 981 | } |
| 982 | |
| 983 | /** |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 984 | * Sets the caller display name (CNAP) of this {@link Conference}. Used when |
| 985 | * {@link #setConferenceState(boolean)} is called to mark a conference temporarily as NOT a |
| 986 | * conference. |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 987 | * <p> |
| 988 | * Note: This is a Telephony-specific implementation detail related to IMS conferences. It is |
| 989 | * not intended for use outside of the Telephony stack. |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 990 | * |
| 991 | * @param callerDisplayName The new display name. |
| 992 | * @param presentation The presentation requirements for the handle. |
| 993 | * See {@link TelecomManager} for valid values. |
| 994 | * @hide |
| 995 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 996 | @SystemApi |
| 997 | @TestApi |
| 998 | public final void setCallerDisplayName(@NonNull String callerDisplayName, |
| 999 | @TelecomManager.Presentation int presentation) { |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 1000 | Log.d(this, "setCallerDisplayName %s", callerDisplayName); |
Tyler Gunn | ac60f95 | 2019-05-31 07:23:16 -0700 | [diff] [blame] | 1001 | mCallerDisplayName = callerDisplayName; |
| 1002 | mCallerDisplayNamePresentation = presentation; |
Tyler Gunn | 68a73a4 | 2018-10-03 15:38:57 -0700 | [diff] [blame] | 1003 | for (Listener l : mListeners) { |
| 1004 | l.onCallerDisplayNameChanged(this, callerDisplayName, presentation); |
| 1005 | } |
| 1006 | } |
| 1007 | |
| 1008 | /** |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 1009 | * Handles a change to extras received from Telecom. |
| 1010 | * |
| 1011 | * @param extras The new extras. |
| 1012 | * @hide |
| 1013 | */ |
| 1014 | final void handleExtrasChanged(Bundle extras) { |
Brad Ebinger | 4fa6a01 | 2016-06-14 17:04:01 -0700 | [diff] [blame] | 1015 | Bundle b = null; |
| 1016 | synchronized (mExtrasLock) { |
| 1017 | mExtras = extras; |
| 1018 | if (mExtras != null) { |
| 1019 | b = new Bundle(mExtras); |
| 1020 | } |
| 1021 | } |
| 1022 | onExtrasChanged(b); |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 1023 | } |
Hall Liu | c9bc1c6 | 2019-04-16 14:00:55 -0700 | [diff] [blame] | 1024 | |
| 1025 | /** |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 1026 | * Sends an event associated with this {@code Conference} with associated event extras to the |
| 1027 | * {@link InCallService} (note: this is identical in concept to |
| 1028 | * {@link Connection#sendConnectionEvent(String, Bundle)}). |
| 1029 | * @see Connection#sendConnectionEvent(String, Bundle) |
| 1030 | * |
| 1031 | * @param event The connection event. |
| 1032 | * @param extras Optional bundle containing extra information associated with the event. |
Hall Liu | c9bc1c6 | 2019-04-16 14:00:55 -0700 | [diff] [blame] | 1033 | */ |
Tyler Gunn | 5567d74 | 2019-10-31 13:04:37 -0700 | [diff] [blame] | 1034 | public void sendConferenceEvent(@NonNull String event, @Nullable Bundle extras) { |
Hall Liu | c9bc1c6 | 2019-04-16 14:00:55 -0700 | [diff] [blame] | 1035 | for (Listener l : mListeners) { |
| 1036 | l.onConnectionEvent(this, event, extras); |
| 1037 | } |
| 1038 | } |
Santos Cordon | 823fd3c | 2014-08-07 18:35:18 -0700 | [diff] [blame] | 1039 | } |