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