Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -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; |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 18 | |
Hall Liu | ffa4a81 | 2017-03-02 16:11:00 -0800 | [diff] [blame] | 19 | import android.annotation.TestApi; |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 20 | import android.net.Uri; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 21 | import android.os.Bundle; |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 22 | import android.os.Parcel; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 23 | import android.os.ParcelFileDescriptor; |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 24 | import android.os.Parcelable; |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Simple data container encapsulating a request to some entity to |
| 28 | * create a new {@link Connection}. |
| 29 | */ |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 30 | public final class ConnectionRequest implements Parcelable { |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 31 | |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 32 | /** |
| 33 | * Builder class for {@link ConnectionRequest} |
| 34 | * @hide |
| 35 | */ |
| 36 | public static final class Builder { |
| 37 | private PhoneAccountHandle mAccountHandle; |
| 38 | private Uri mAddress; |
| 39 | private Bundle mExtras; |
| 40 | private int mVideoState = VideoProfile.STATE_AUDIO_ONLY; |
| 41 | private String mTelecomCallId; |
| 42 | private boolean mShouldShowIncomingCallUi = false; |
| 43 | private ParcelFileDescriptor mRttPipeToInCall; |
| 44 | private ParcelFileDescriptor mRttPipeFromInCall; |
| 45 | |
| 46 | public Builder() { } |
| 47 | |
| 48 | /** |
| 49 | * Sets the phone account handle for the resulting {@link ConnectionRequest} |
| 50 | * @param accountHandle The accountHandle which should be used to place the call. |
| 51 | */ |
| 52 | public Builder setAccountHandle(PhoneAccountHandle accountHandle) { |
| 53 | this.mAccountHandle = accountHandle; |
| 54 | return this; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Sets the address for the resulting {@link ConnectionRequest} |
| 59 | * @param address The address(e.g., phone number) to which the {@link Connection} is to |
| 60 | * connect. |
| 61 | */ |
| 62 | public Builder setAddress(Uri address) { |
| 63 | this.mAddress = address; |
| 64 | return this; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Sets the extras bundle for the resulting {@link ConnectionRequest} |
| 69 | * @param extras Application-specific extra data. |
| 70 | */ |
| 71 | public Builder setExtras(Bundle extras) { |
| 72 | this.mExtras = extras; |
| 73 | return this; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Sets the video state for the resulting {@link ConnectionRequest} |
| 78 | * @param videoState Determines the video state for the connection. |
| 79 | */ |
| 80 | public Builder setVideoState(int videoState) { |
| 81 | this.mVideoState = videoState; |
| 82 | return this; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Sets the Telecom call ID for the resulting {@link ConnectionRequest} |
| 87 | * @param telecomCallId The telecom call ID. |
| 88 | */ |
| 89 | public Builder setTelecomCallId(String telecomCallId) { |
| 90 | this.mTelecomCallId = telecomCallId; |
| 91 | return this; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Sets shouldShowIncomingUi for the resulting {@link ConnectionRequest} |
| 96 | * @param shouldShowIncomingCallUi For a self-managed {@link ConnectionService}, will be |
| 97 | * {@code true} if the {@link ConnectionService} should show |
| 98 | * its own incoming call UI for an incoming call. When |
| 99 | * {@code false}, Telecom shows the incoming call UI. |
| 100 | */ |
| 101 | public Builder setShouldShowIncomingCallUi(boolean shouldShowIncomingCallUi) { |
| 102 | this.mShouldShowIncomingCallUi = shouldShowIncomingCallUi; |
| 103 | return this; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Sets the RTT pipe for transferring text into the {@link ConnectionService} for the |
| 108 | * resulting {@link ConnectionRequest} |
| 109 | * @param rttPipeFromInCall The data pipe to read from. |
| 110 | */ |
| 111 | public Builder setRttPipeFromInCall(ParcelFileDescriptor rttPipeFromInCall) { |
| 112 | this.mRttPipeFromInCall = rttPipeFromInCall; |
| 113 | return this; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Sets the RTT pipe for transferring text out of {@link ConnectionService} for the |
| 118 | * resulting {@link ConnectionRequest} |
| 119 | * @param rttPipeToInCall The data pipe to write to. |
| 120 | */ |
| 121 | public Builder setRttPipeToInCall(ParcelFileDescriptor rttPipeToInCall) { |
| 122 | this.mRttPipeToInCall = rttPipeToInCall; |
| 123 | return this; |
| 124 | } |
| 125 | |
| 126 | public ConnectionRequest build() { |
| 127 | return new ConnectionRequest( |
| 128 | mAccountHandle, |
| 129 | mAddress, |
| 130 | mExtras, |
| 131 | mVideoState, |
| 132 | mTelecomCallId, |
| 133 | mShouldShowIncomingCallUi, |
| 134 | mRttPipeFromInCall, |
| 135 | mRttPipeToInCall); |
| 136 | } |
| 137 | } |
| 138 | |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 139 | private final PhoneAccountHandle mAccountHandle; |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 140 | private final Uri mAddress; |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 141 | private final Bundle mExtras; |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 142 | private final int mVideoState; |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 143 | private final String mTelecomCallId; |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 144 | private final boolean mShouldShowIncomingCallUi; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 145 | private final ParcelFileDescriptor mRttPipeToInCall; |
| 146 | private final ParcelFileDescriptor mRttPipeFromInCall; |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 147 | |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 148 | /** |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 149 | * @param accountHandle The accountHandle which should be used to place the call. |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 150 | * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect. |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 151 | * @param extras Application-specific extra data. |
Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 152 | */ |
| 153 | public ConnectionRequest( |
| 154 | PhoneAccountHandle accountHandle, |
| 155 | Uri handle, |
Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 156 | Bundle extras) { |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 157 | this(accountHandle, handle, extras, VideoProfile.STATE_AUDIO_ONLY, null, false, null, null); |
Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | /** |
| 161 | * @param accountHandle The accountHandle which should be used to place the call. |
| 162 | * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect. |
Tyler Gunn | be74de0 | 2014-08-29 14:51:48 -0700 | [diff] [blame] | 163 | * @param extras Application-specific extra data. |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 164 | * @param videoState Determines the video state for the connection. |
| 165 | */ |
| 166 | public ConnectionRequest( |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 167 | PhoneAccountHandle accountHandle, |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 168 | Uri handle, |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 169 | Bundle extras, |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 170 | int videoState) { |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 171 | this(accountHandle, handle, extras, videoState, null, false, null, null); |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | /** |
| 175 | * @param accountHandle The accountHandle which should be used to place the call. |
| 176 | * @param handle The handle (e.g., phone number) to which the {@link Connection} is to connect. |
| 177 | * @param extras Application-specific extra data. |
| 178 | * @param videoState Determines the video state for the connection. |
| 179 | * @param telecomCallId The telecom call ID. |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 180 | * @param shouldShowIncomingCallUi For a self-managed {@link ConnectionService}, will be |
| 181 | * {@code true} if the {@link ConnectionService} should show its |
| 182 | * own incoming call UI for an incoming call. When |
| 183 | * {@code false}, Telecom shows the incoming call UI. |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 184 | * @hide |
| 185 | */ |
| 186 | public ConnectionRequest( |
| 187 | PhoneAccountHandle accountHandle, |
| 188 | Uri handle, |
| 189 | Bundle extras, |
| 190 | int videoState, |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 191 | String telecomCallId, |
| 192 | boolean shouldShowIncomingCallUi) { |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 193 | this(accountHandle, handle, extras, videoState, telecomCallId, |
| 194 | shouldShowIncomingCallUi, null, null); |
| 195 | } |
| 196 | |
| 197 | private ConnectionRequest( |
| 198 | PhoneAccountHandle accountHandle, |
| 199 | Uri handle, |
| 200 | Bundle extras, |
| 201 | int videoState, |
| 202 | String telecomCallId, |
| 203 | boolean shouldShowIncomingCallUi, |
| 204 | ParcelFileDescriptor rttPipeFromInCall, |
| 205 | ParcelFileDescriptor rttPipeToInCall) { |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 206 | mAccountHandle = accountHandle; |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 207 | mAddress = handle; |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 208 | mExtras = extras; |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 209 | mVideoState = videoState; |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 210 | mTelecomCallId = telecomCallId; |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 211 | mShouldShowIncomingCallUi = shouldShowIncomingCallUi; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 212 | mRttPipeFromInCall = rttPipeFromInCall; |
| 213 | mRttPipeToInCall = rttPipeToInCall; |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 214 | } |
| 215 | |
Sailesh Nepal | c5b0157 | 2014-07-14 16:29:44 -0700 | [diff] [blame] | 216 | private ConnectionRequest(Parcel in) { |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 217 | mAccountHandle = in.readParcelable(getClass().getClassLoader()); |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 218 | mAddress = in.readParcelable(getClass().getClassLoader()); |
Sailesh Nepal | c5b0157 | 2014-07-14 16:29:44 -0700 | [diff] [blame] | 219 | mExtras = in.readParcelable(getClass().getClassLoader()); |
| 220 | mVideoState = in.readInt(); |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 221 | mTelecomCallId = in.readString(); |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 222 | mShouldShowIncomingCallUi = in.readInt() == 1; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 223 | mRttPipeFromInCall = in.readParcelable(getClass().getClassLoader()); |
| 224 | mRttPipeToInCall = in.readParcelable(getClass().getClassLoader()); |
Sailesh Nepal | c5b0157 | 2014-07-14 16:29:44 -0700 | [diff] [blame] | 225 | } |
| 226 | |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 227 | /** |
Ihab Awad | 9c3f188 | 2014-06-30 21:17:13 -0700 | [diff] [blame] | 228 | * The account which should be used to place the call. |
Santos Cordon | 52d8a15 | 2014-06-17 19:08:45 -0700 | [diff] [blame] | 229 | */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 230 | public PhoneAccountHandle getAccountHandle() { return mAccountHandle; } |
Santos Cordon | 52d8a15 | 2014-06-17 19:08:45 -0700 | [diff] [blame] | 231 | |
| 232 | /** |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 233 | * The handle (e.g., phone number) to which the {@link Connection} is to connect. |
| 234 | */ |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 235 | public Uri getAddress() { return mAddress; } |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 236 | |
| 237 | /** |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 238 | * Application-specific extra data. Used for passing back information from an incoming |
| 239 | * call {@code Intent}, and for any proprietary extensions arranged between a client |
| 240 | * and servant {@code ConnectionService} which agree on a vocabulary for such data. |
| 241 | */ |
| 242 | public Bundle getExtras() { return mExtras; } |
| 243 | |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 244 | /** |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 245 | * Describes the video states supported by the client requesting the connection. |
Yorke Lee | 32f2473 | 2015-05-12 16:18:03 -0700 | [diff] [blame] | 246 | * Valid values: {@link VideoProfile#STATE_AUDIO_ONLY}, |
| 247 | * {@link VideoProfile#STATE_BIDIRECTIONAL}, |
| 248 | * {@link VideoProfile#STATE_TX_ENABLED}, |
| 249 | * {@link VideoProfile#STATE_RX_ENABLED}. |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 250 | * |
| 251 | * @return The video state for the connection. |
| 252 | */ |
| 253 | public int getVideoState() { |
| 254 | return mVideoState; |
| 255 | } |
| 256 | |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 257 | /** |
| 258 | * Returns the internal Telecom ID associated with the connection request. |
| 259 | * |
| 260 | * @return The Telecom ID. |
| 261 | * @hide |
| 262 | */ |
| 263 | public String getTelecomCallId() { |
| 264 | return mTelecomCallId; |
| 265 | } |
| 266 | |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 267 | /** |
| 268 | * For a self-managed {@link ConnectionService}, indicates for an incoming call whether the |
| 269 | * {@link ConnectionService} should show its own incoming call UI for an incoming call. |
| 270 | * |
| 271 | * @return {@code true} if the {@link ConnectionService} should show its own incoming call UI. |
| 272 | * When {@code false}, Telecom shows the incoming call UI for the call. |
| 273 | * @hide |
| 274 | */ |
| 275 | public boolean shouldShowIncomingCallUi() { |
| 276 | return mShouldShowIncomingCallUi; |
| 277 | } |
| 278 | |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 279 | /** |
| 280 | * Gets the {@link ParcelFileDescriptor} that is used to send RTT text from the connection |
| 281 | * service to the in-call UI. In order to obtain an |
| 282 | * {@link java.io.InputStream} from this {@link ParcelFileDescriptor}, use |
| 283 | * {@link android.os.ParcelFileDescriptor.AutoCloseInputStream}. |
| 284 | * Only text data encoded using UTF-8 should be written into this {@link ParcelFileDescriptor}. |
| 285 | * @return The {@link ParcelFileDescriptor} that should be used for communication. |
| 286 | * Do not un-hide -- only for use by Telephony |
| 287 | * @hide |
| 288 | */ |
| 289 | public ParcelFileDescriptor getRttPipeToInCall() { |
| 290 | return mRttPipeToInCall; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Gets the {@link ParcelFileDescriptor} that is used to send RTT text from the in-call UI to |
| 295 | * the connection service. In order to obtain an |
| 296 | * {@link java.io.OutputStream} from this {@link ParcelFileDescriptor}, use |
| 297 | * {@link android.os.ParcelFileDescriptor.AutoCloseOutputStream}. |
| 298 | * The contents of this {@link ParcelFileDescriptor} will consist solely of text encoded in |
| 299 | * UTF-8. |
| 300 | * @return The {@link ParcelFileDescriptor} that should be used for communication |
| 301 | * Do not un-hide -- only for use by Telephony |
| 302 | * @hide |
| 303 | */ |
| 304 | public ParcelFileDescriptor getRttPipeFromInCall() { |
| 305 | return mRttPipeFromInCall; |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * Gets the {@link android.telecom.Connection.RttTextStream} object that should be used to |
| 310 | * send and receive RTT text to/from the in-call app. |
| 311 | * @return An instance of {@link android.telecom.Connection.RttTextStream}, or {@code null} |
| 312 | * if this connection request is not requesting an RTT session upon connection establishment. |
| 313 | * @hide |
| 314 | */ |
Hall Liu | ffa4a81 | 2017-03-02 16:11:00 -0800 | [diff] [blame] | 315 | @TestApi |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 316 | public Connection.RttTextStream getRttTextStream() { |
| 317 | if (isRequestingRtt()) { |
| 318 | return new Connection.RttTextStream(mRttPipeToInCall, mRttPipeFromInCall); |
| 319 | } else { |
| 320 | return null; |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Convenience method for determining whether the ConnectionRequest is requesting an RTT session |
| 326 | * @return {@code true} if RTT is requested, {@code false} otherwise. |
| 327 | * @hide |
| 328 | */ |
Hall Liu | ffa4a81 | 2017-03-02 16:11:00 -0800 | [diff] [blame] | 329 | @TestApi |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 330 | public boolean isRequestingRtt() { |
| 331 | return mRttPipeFromInCall != null && mRttPipeToInCall != null; |
| 332 | } |
| 333 | |
Evan Charlton | bf11f98 | 2014-07-20 22:06:28 -0700 | [diff] [blame] | 334 | @Override |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 335 | public String toString() { |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 336 | return String.format("ConnectionRequest %s %s", |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 337 | mAddress == null |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 338 | ? Uri.EMPTY |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 339 | : Connection.toLogSafePhoneNumber(mAddress.toString()), |
Ihab Awad | 542e0ea | 2014-05-16 10:22:16 -0700 | [diff] [blame] | 340 | mExtras == null ? "" : mExtras); |
| 341 | } |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 342 | |
Sailesh Nepal | c5b0157 | 2014-07-14 16:29:44 -0700 | [diff] [blame] | 343 | public static final Creator<ConnectionRequest> CREATOR = new Creator<ConnectionRequest> () { |
| 344 | @Override |
| 345 | public ConnectionRequest createFromParcel(Parcel source) { |
| 346 | return new ConnectionRequest(source); |
| 347 | } |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 348 | |
Sailesh Nepal | c5b0157 | 2014-07-14 16:29:44 -0700 | [diff] [blame] | 349 | @Override |
| 350 | public ConnectionRequest[] newArray(int size) { |
| 351 | return new ConnectionRequest[size]; |
| 352 | } |
| 353 | }; |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 354 | |
| 355 | /** |
| 356 | * {@inheritDoc} |
| 357 | */ |
| 358 | @Override |
| 359 | public int describeContents() { |
| 360 | return 0; |
| 361 | } |
| 362 | |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 363 | @Override |
| 364 | public void writeToParcel(Parcel destination, int flags) { |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 365 | destination.writeParcelable(mAccountHandle, 0); |
Nancy Chen | ea38cca | 2014-09-05 16:38:49 -0700 | [diff] [blame] | 366 | destination.writeParcelable(mAddress, 0); |
Ihab Awad | fbb092f | 2014-06-03 18:40:45 -0700 | [diff] [blame] | 367 | destination.writeParcelable(mExtras, 0); |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 368 | destination.writeInt(mVideoState); |
Tyler Gunn | f0500bd | 2015-09-01 10:59:48 -0700 | [diff] [blame] | 369 | destination.writeString(mTelecomCallId); |
Tyler Gunn | f503543 | 2017-01-09 09:43:12 -0800 | [diff] [blame] | 370 | destination.writeInt(mShouldShowIncomingCallUi ? 1 : 0); |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 371 | destination.writeParcelable(mRttPipeFromInCall, 0); |
| 372 | destination.writeParcelable(mRttPipeToInCall, 0); |
Tyler Gunn | 12013ad | 2014-07-08 14:04:58 -0700 | [diff] [blame] | 373 | } |
| 374 | } |