Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 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 | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 18 | |
| 19 | import android.net.Uri; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 21 | import android.os.Parcel; |
| 22 | import android.os.Parcelable; |
| 23 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 24 | import com.android.internal.telecom.IVideoProvider; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 25 | |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 26 | import java.util.ArrayList; |
| 27 | import java.util.List; |
| 28 | |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 29 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 30 | * Information about a connection that is used between Telecom and the ConnectionService. |
| 31 | * This is used to send initial Connection information to Telecom when the connection is |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 32 | * first created. |
| 33 | * @hide |
| 34 | */ |
| 35 | public final class ParcelableConnection implements Parcelable { |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 36 | private final PhoneAccountHandle mPhoneAccount; |
| 37 | private final int mState; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 38 | private final int mConnectionCapabilities; |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 39 | private final int mConnectionProperties; |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 40 | private final int mSupportedAudioRoutes; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 41 | private final Uri mAddress; |
| 42 | private final int mAddressPresentation; |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 43 | private final String mCallerDisplayName; |
| 44 | private final int mCallerDisplayNamePresentation; |
| 45 | private final IVideoProvider mVideoProvider; |
| 46 | private final int mVideoState; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 47 | private final boolean mRingbackRequested; |
| 48 | private final boolean mIsVoipAudioMode; |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 49 | private final long mConnectTimeMillis; |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 50 | private final long mConnectElapsedTimeMillis; |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 51 | private final StatusHints mStatusHints; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 52 | private final DisconnectCause mDisconnectCause; |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 53 | private final List<String> mConferenceableConnectionIds; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 54 | private final Bundle mExtras; |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 55 | private String mParentCallId; |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 56 | private @Call.Details.CallDirection int mCallDirection; |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 57 | private @Connection.VerificationStatus int mCallerNumberVerificationStatus; |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 58 | |
| 59 | /** @hide */ |
| 60 | public ParcelableConnection( |
| 61 | PhoneAccountHandle phoneAccount, |
| 62 | int state, |
| 63 | int capabilities, |
| 64 | int properties, |
| 65 | int supportedAudioRoutes, |
| 66 | Uri address, |
| 67 | int addressPresentation, |
| 68 | String callerDisplayName, |
| 69 | int callerDisplayNamePresentation, |
| 70 | IVideoProvider videoProvider, |
| 71 | int videoState, |
| 72 | boolean ringbackRequested, |
| 73 | boolean isVoipAudioMode, |
| 74 | long connectTimeMillis, |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 75 | long connectElapsedTimeMillis, |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 76 | StatusHints statusHints, |
| 77 | DisconnectCause disconnectCause, |
| 78 | List<String> conferenceableConnectionIds, |
| 79 | Bundle extras, |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 80 | String parentCallId, |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 81 | @Call.Details.CallDirection int callDirection, |
| 82 | @Connection.VerificationStatus int callerNumberVerificationStatus) { |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 83 | this(phoneAccount, state, capabilities, properties, supportedAudioRoutes, address, |
| 84 | addressPresentation, callerDisplayName, callerDisplayNamePresentation, |
| 85 | videoProvider, videoState, ringbackRequested, isVoipAudioMode, connectTimeMillis, |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 86 | connectElapsedTimeMillis, statusHints, disconnectCause, conferenceableConnectionIds, |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 87 | extras, callerNumberVerificationStatus); |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 88 | mParentCallId = parentCallId; |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 89 | mCallDirection = callDirection; |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 90 | } |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 91 | |
| 92 | /** @hide */ |
| 93 | public ParcelableConnection( |
| 94 | PhoneAccountHandle phoneAccount, |
| 95 | int state, |
| 96 | int capabilities, |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 97 | int properties, |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 98 | int supportedAudioRoutes, |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 99 | Uri address, |
| 100 | int addressPresentation, |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 101 | String callerDisplayName, |
| 102 | int callerDisplayNamePresentation, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 103 | IVideoProvider videoProvider, |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 104 | int videoState, |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 105 | boolean ringbackRequested, |
| 106 | boolean isVoipAudioMode, |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 107 | long connectTimeMillis, |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 108 | long connectElapsedTimeMillis, |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 109 | StatusHints statusHints, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 110 | DisconnectCause disconnectCause, |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 111 | List<String> conferenceableConnectionIds, |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 112 | Bundle extras, |
| 113 | @Connection.VerificationStatus int callerNumberVerificationStatus) { |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 114 | mPhoneAccount = phoneAccount; |
| 115 | mState = state; |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 116 | mConnectionCapabilities = capabilities; |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 117 | mConnectionProperties = properties; |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 118 | mSupportedAudioRoutes = supportedAudioRoutes; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 119 | mAddress = address; |
| 120 | mAddressPresentation = addressPresentation; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 121 | mCallerDisplayName = callerDisplayName; |
| 122 | mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 123 | mVideoProvider = videoProvider; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 124 | mVideoState = videoState; |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 125 | mRingbackRequested = ringbackRequested; |
| 126 | mIsVoipAudioMode = isVoipAudioMode; |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 127 | mConnectTimeMillis = connectTimeMillis; |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 128 | mConnectElapsedTimeMillis = connectElapsedTimeMillis; |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 129 | mStatusHints = statusHints; |
Sailesh Nepal | cf7020b | 2014-08-20 10:07:19 -0700 | [diff] [blame] | 130 | mDisconnectCause = disconnectCause; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 131 | mConferenceableConnectionIds = conferenceableConnectionIds; |
| 132 | mExtras = extras; |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 133 | mParentCallId = null; |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 134 | mCallDirection = Call.Details.DIRECTION_UNKNOWN; |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 135 | mCallerNumberVerificationStatus = callerNumberVerificationStatus; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | public PhoneAccountHandle getPhoneAccount() { |
| 139 | return mPhoneAccount; |
| 140 | } |
| 141 | |
| 142 | public int getState() { |
| 143 | return mState; |
| 144 | } |
| 145 | |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 146 | /** |
| 147 | * Returns the current connection capabilities bit-mask. Connection capabilities are defined as |
| 148 | * {@code CAPABILITY_*} constants in {@link Connection}. |
| 149 | * |
| 150 | * @return Bit-mask containing capabilities of the connection. |
| 151 | */ |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 152 | public int getConnectionCapabilities() { |
| 153 | return mConnectionCapabilities; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 154 | } |
| 155 | |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 156 | /** |
| 157 | * Returns the current connection properties bit-mask. Connection properties are defined as |
| 158 | * {@code PROPERTY_*} constants in {@link Connection}. |
| 159 | * |
| 160 | * @return Bit-mask containing properties of the connection. |
| 161 | */ |
| 162 | public int getConnectionProperties() { |
| 163 | return mConnectionProperties; |
| 164 | } |
| 165 | |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 166 | public int getSupportedAudioRoutes() { |
| 167 | return mSupportedAudioRoutes; |
| 168 | } |
| 169 | |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 170 | public Uri getHandle() { |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 171 | return mAddress; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | public int getHandlePresentation() { |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 175 | return mAddressPresentation; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | public String getCallerDisplayName() { |
| 179 | return mCallerDisplayName; |
| 180 | } |
| 181 | |
| 182 | public int getCallerDisplayNamePresentation() { |
| 183 | return mCallerDisplayNamePresentation; |
| 184 | } |
| 185 | |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 186 | public IVideoProvider getVideoProvider() { |
| 187 | return mVideoProvider; |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | public int getVideoState() { |
| 191 | return mVideoState; |
| 192 | } |
| 193 | |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 194 | public boolean isRingbackRequested() { |
| 195 | return mRingbackRequested; |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 196 | } |
| 197 | |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 198 | public boolean getIsVoipAudioMode() { |
| 199 | return mIsVoipAudioMode; |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 200 | } |
| 201 | |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 202 | public long getConnectTimeMillis() { |
| 203 | return mConnectTimeMillis; |
| 204 | } |
| 205 | |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 206 | public long getConnectElapsedTimeMillis() { |
| 207 | return mConnectElapsedTimeMillis; |
| 208 | } |
| 209 | |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 210 | public final StatusHints getStatusHints() { |
| 211 | return mStatusHints; |
| 212 | } |
| 213 | |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 214 | public final DisconnectCause getDisconnectCause() { |
Sailesh Nepal | cf7020b | 2014-08-20 10:07:19 -0700 | [diff] [blame] | 215 | return mDisconnectCause; |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 216 | } |
| 217 | |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 218 | public final List<String> getConferenceableConnectionIds() { |
| 219 | return mConferenceableConnectionIds; |
| 220 | } |
| 221 | |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 222 | public final Bundle getExtras() { |
| 223 | return mExtras; |
| 224 | } |
| 225 | |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 226 | public final String getParentCallId() { |
| 227 | return mParentCallId; |
| 228 | } |
| 229 | |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 230 | public @Call.Details.CallDirection int getCallDirection() { |
| 231 | return mCallDirection; |
| 232 | } |
| 233 | |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 234 | public @Connection.VerificationStatus int getCallerNumberVerificationStatus() { |
| 235 | return mCallerNumberVerificationStatus; |
| 236 | } |
| 237 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 238 | @Override |
| 239 | public String toString() { |
| 240 | return new StringBuilder() |
| 241 | .append("ParcelableConnection [act:") |
| 242 | .append(mPhoneAccount) |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 243 | .append("], state:") |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 244 | .append(mState) |
| 245 | .append(", capabilities:") |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 246 | .append(Connection.capabilitiesToString(mConnectionCapabilities)) |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 247 | .append(", properties:") |
| 248 | .append(Connection.propertiesToString(mConnectionProperties)) |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 249 | .append(", extras:") |
| 250 | .append(mExtras) |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 251 | .append(", parent:") |
| 252 | .append(mParentCallId) |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 253 | .append(", callDirection:") |
| 254 | .append(mCallDirection) |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 255 | .toString(); |
| 256 | } |
| 257 | |
Jeff Sharkey | 9e8f83d | 2019-02-28 12:06:45 -0700 | [diff] [blame] | 258 | public static final @android.annotation.NonNull Parcelable.Creator<ParcelableConnection> CREATOR = |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 259 | new Parcelable.Creator<ParcelableConnection> () { |
| 260 | @Override |
| 261 | public ParcelableConnection createFromParcel(Parcel source) { |
| 262 | ClassLoader classLoader = ParcelableConnection.class.getClassLoader(); |
| 263 | |
| 264 | PhoneAccountHandle phoneAccount = source.readParcelable(classLoader); |
| 265 | int state = source.readInt(); |
| 266 | int capabilities = source.readInt(); |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 267 | Uri address = source.readParcelable(classLoader); |
| 268 | int addressPresentation = source.readInt(); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 269 | String callerDisplayName = source.readString(); |
| 270 | int callerDisplayNamePresentation = source.readInt(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 271 | IVideoProvider videoCallProvider = |
| 272 | IVideoProvider.Stub.asInterface(source.readStrongBinder()); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 273 | int videoState = source.readInt(); |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 274 | boolean ringbackRequested = source.readByte() == 1; |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 275 | boolean audioModeIsVoip = source.readByte() == 1; |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 276 | long connectTimeMillis = source.readLong(); |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 277 | StatusHints statusHints = source.readParcelable(classLoader); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 278 | DisconnectCause disconnectCause = source.readParcelable(classLoader); |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 279 | List<String> conferenceableConnectionIds = new ArrayList<>(); |
| 280 | source.readStringList(conferenceableConnectionIds); |
Jeff Sharkey | f0ec2e0 | 2016-03-21 12:37:54 -0600 | [diff] [blame] | 281 | Bundle extras = Bundle.setDefusable(source.readBundle(classLoader), true); |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 282 | int properties = source.readInt(); |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 283 | int supportedAudioRoutes = source.readInt(); |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 284 | String parentCallId = source.readString(); |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 285 | long connectElapsedTimeMillis = source.readLong(); |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 286 | int callDirection = source.readInt(); |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 287 | int callerNumberVerificationStatus = source.readInt(); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 288 | |
| 289 | return new ParcelableConnection( |
| 290 | phoneAccount, |
| 291 | state, |
| 292 | capabilities, |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 293 | properties, |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 294 | supportedAudioRoutes, |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 295 | address, |
| 296 | addressPresentation, |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 297 | callerDisplayName, |
| 298 | callerDisplayNamePresentation, |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 299 | videoCallProvider, |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 300 | videoState, |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 301 | ringbackRequested, |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 302 | audioModeIsVoip, |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 303 | connectTimeMillis, |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 304 | connectElapsedTimeMillis, |
Ihab Awad | 6107bab | 2014-08-18 09:23:25 -0700 | [diff] [blame] | 305 | statusHints, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 306 | disconnectCause, |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 307 | conferenceableConnectionIds, |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 308 | extras, |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 309 | parentCallId, |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 310 | callDirection, |
| 311 | callerNumberVerificationStatus); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | @Override |
| 315 | public ParcelableConnection[] newArray(int size) { |
| 316 | return new ParcelableConnection[size]; |
| 317 | } |
| 318 | }; |
| 319 | |
| 320 | /** {@inheritDoc} */ |
| 321 | @Override |
| 322 | public int describeContents() { |
| 323 | return 0; |
| 324 | } |
| 325 | |
| 326 | /** Writes ParcelableConnection object into a Parcel. */ |
| 327 | @Override |
| 328 | public void writeToParcel(Parcel destination, int flags) { |
| 329 | destination.writeParcelable(mPhoneAccount, 0); |
| 330 | destination.writeInt(mState); |
Ihab Awad | 5c9c86e | 2014-11-12 13:41:16 -0800 | [diff] [blame] | 331 | destination.writeInt(mConnectionCapabilities); |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 332 | destination.writeParcelable(mAddress, 0); |
| 333 | destination.writeInt(mAddressPresentation); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 334 | destination.writeString(mCallerDisplayName); |
| 335 | destination.writeInt(mCallerDisplayNamePresentation); |
| 336 | destination.writeStrongBinder( |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 337 | mVideoProvider != null ? mVideoProvider.asBinder() : null); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 338 | destination.writeInt(mVideoState); |
Andrew Lee | 100e293 | 2014-09-08 15:34:24 -0700 | [diff] [blame] | 339 | destination.writeByte((byte) (mRingbackRequested ? 1 : 0)); |
| 340 | destination.writeByte((byte) (mIsVoipAudioMode ? 1 : 0)); |
Roshan Pius | e927ec0 | 2015-07-15 15:47:21 -0700 | [diff] [blame] | 341 | destination.writeLong(mConnectTimeMillis); |
Sailesh Nepal | 8b9d3ca | 2014-08-14 17:39:34 -0700 | [diff] [blame] | 342 | destination.writeParcelable(mStatusHints, 0); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 343 | destination.writeParcelable(mDisconnectCause, 0); |
Ihab Awad | b8e85c7 | 2014-08-23 20:34:57 -0700 | [diff] [blame] | 344 | destination.writeStringList(mConferenceableConnectionIds); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 345 | destination.writeBundle(mExtras); |
Tyler Gunn | 720c664 | 2016-03-22 09:02:47 -0700 | [diff] [blame] | 346 | destination.writeInt(mConnectionProperties); |
Christine Hallstrom | 4e22d6d | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 347 | destination.writeInt(mSupportedAudioRoutes); |
Tyler Gunn | 78da781 | 2017-05-09 14:34:57 -0700 | [diff] [blame] | 348 | destination.writeString(mParentCallId); |
Tyler Gunn | b2f875b | 2017-08-04 09:27:26 -0700 | [diff] [blame] | 349 | destination.writeLong(mConnectElapsedTimeMillis); |
Tyler Gunn | 6986a63 | 2019-06-25 13:45:32 -0700 | [diff] [blame] | 350 | destination.writeInt(mCallDirection); |
Tyler Gunn | d57d76c | 2019-09-24 14:53:23 -0700 | [diff] [blame^] | 351 | destination.writeInt(mCallerNumberVerificationStatus); |
Santos Cordon | e8dc4be | 2014-07-21 01:28:28 -0700 | [diff] [blame] | 352 | } |
| 353 | } |