Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -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; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 18 | |
| 19 | import android.net.Uri; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 21 | import android.os.Parcel; |
| 22 | import android.os.Parcelable; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 23 | import android.os.RemoteException; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 24 | |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 25 | import java.util.ArrayList; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 26 | import java.util.Collections; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 27 | import java.util.List; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 28 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 29 | import com.android.internal.telecom.IVideoProvider; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 30 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 31 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 32 | * Information about a call that is used between InCallService and Telecom. |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 33 | * @hide |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 34 | */ |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 35 | public final class ParcelableCall implements Parcelable { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 36 | private final String mId; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 37 | private final int mState; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 38 | private final DisconnectCause mDisconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 39 | private final List<String> mCannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 40 | private final int mCapabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 41 | private final int mProperties; |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 42 | private final int mSupportedAudioRoutes; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 43 | private final long mConnectTimeMillis; |
| 44 | private final Uri mHandle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 45 | private final int mHandlePresentation; |
| 46 | private final String mCallerDisplayName; |
| 47 | private final int mCallerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 48 | private final GatewayInfo mGatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 49 | private final PhoneAccountHandle mAccountHandle; |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 50 | private final boolean mIsVideoCallProviderChanged; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 51 | private final IVideoProvider mVideoCallProvider; |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 52 | private VideoCallImpl mVideoCall; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 53 | private final boolean mIsRttCallChanged; |
| 54 | private final ParcelableRttCall mRttCall; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 55 | private final String mParentCallId; |
| 56 | private final List<String> mChildCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 57 | private final StatusHints mStatusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 58 | private final int mVideoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 59 | private final List<String> mConferenceableCallIds; |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 60 | private final Bundle mIntentExtras; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 61 | private final Bundle mExtras; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 62 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 63 | public ParcelableCall( |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 64 | String id, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 65 | int state, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 66 | DisconnectCause disconnectCause, |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 67 | List<String> cannedSmsResponses, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 68 | int capabilities, |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 69 | int properties, |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 70 | int supportedAudioRoutes, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 71 | long connectTimeMillis, |
| 72 | Uri handle, |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 73 | int handlePresentation, |
| 74 | String callerDisplayName, |
| 75 | int callerDisplayNamePresentation, |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 76 | GatewayInfo gatewayInfo, |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 77 | PhoneAccountHandle accountHandle, |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 78 | boolean isVideoCallProviderChanged, |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 79 | IVideoProvider videoCallProvider, |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 80 | boolean isRttCallChanged, |
| 81 | ParcelableRttCall rttCall, |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 82 | String parentCallId, |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 83 | List<String> childCallIds, |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 84 | StatusHints statusHints, |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 85 | int videoState, |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 86 | List<String> conferenceableCallIds, |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 87 | Bundle intentExtras, |
Jay Shrauner | 8f98843 | 2015-04-16 12:52:19 -0700 | [diff] [blame] | 88 | Bundle extras) { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 89 | mId = id; |
| 90 | mState = state; |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 91 | mDisconnectCause = disconnectCause; |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 92 | mCannedSmsResponses = cannedSmsResponses; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 93 | mCapabilities = capabilities; |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 94 | mProperties = properties; |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 95 | mSupportedAudioRoutes = supportedAudioRoutes; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 96 | mConnectTimeMillis = connectTimeMillis; |
| 97 | mHandle = handle; |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 98 | mHandlePresentation = handlePresentation; |
| 99 | mCallerDisplayName = callerDisplayName; |
| 100 | mCallerDisplayNamePresentation = callerDisplayNamePresentation; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 101 | mGatewayInfo = gatewayInfo; |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 102 | mAccountHandle = accountHandle; |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 103 | mIsVideoCallProviderChanged = isVideoCallProviderChanged; |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 104 | mVideoCallProvider = videoCallProvider; |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 105 | mIsRttCallChanged = isRttCallChanged; |
| 106 | mRttCall = rttCall; |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 107 | mParentCallId = parentCallId; |
| 108 | mChildCallIds = childCallIds; |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 109 | mStatusHints = statusHints; |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 110 | mVideoState = videoState; |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 111 | mConferenceableCallIds = Collections.unmodifiableList(conferenceableCallIds); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 112 | mIntentExtras = intentExtras; |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 113 | mExtras = extras; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | /** The unique ID of the call. */ |
| 117 | public String getId() { |
| 118 | return mId; |
| 119 | } |
| 120 | |
| 121 | /** The current state of the call. */ |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 122 | public int getState() { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 123 | return mState; |
| 124 | } |
| 125 | |
| 126 | /** |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 127 | * Reason for disconnection, as described by {@link android.telecomm.DisconnectCause}. Valid |
| 128 | * when call state is {@link CallState#DISCONNECTED}. |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 129 | */ |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 130 | public DisconnectCause getDisconnectCause() { |
| 131 | return mDisconnectCause; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 132 | } |
| 133 | |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 134 | /** |
| 135 | * The set of possible text message responses when this call is incoming. |
| 136 | */ |
| 137 | public List<String> getCannedSmsResponses() { |
| 138 | return mCannedSmsResponses; |
| 139 | } |
| 140 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 141 | // Bit mask of actions a call supports, values are defined in {@link CallCapabilities}. |
| 142 | public int getCapabilities() { |
| 143 | return mCapabilities; |
| 144 | } |
| 145 | |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 146 | /** Bitmask of properties of the call. */ |
| 147 | public int getProperties() { return mProperties; } |
| 148 | |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 149 | /** Bitmask of supported routes of the call */ |
| 150 | public int getSupportedAudioRoutes() { |
| 151 | return mSupportedAudioRoutes; |
| 152 | } |
| 153 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 154 | /** The time that the call switched to the active state. */ |
| 155 | public long getConnectTimeMillis() { |
| 156 | return mConnectTimeMillis; |
| 157 | } |
| 158 | |
| 159 | /** The endpoint to which the call is connected. */ |
| 160 | public Uri getHandle() { |
| 161 | return mHandle; |
| 162 | } |
| 163 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 164 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 165 | * The presentation requirements for the handle. See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 166 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 167 | public int getHandlePresentation() { |
| 168 | return mHandlePresentation; |
| 169 | } |
| 170 | |
| 171 | /** The endpoint to which the call is connected. */ |
| 172 | public String getCallerDisplayName() { |
| 173 | return mCallerDisplayName; |
| 174 | } |
| 175 | |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 176 | /** |
| 177 | * The presentation requirements for the caller display name. |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 178 | * See {@link TelecomManager} for valid values. |
Nancy Chen | 9d568c0 | 2014-09-08 14:17:59 -0700 | [diff] [blame] | 179 | */ |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 180 | public int getCallerDisplayNamePresentation() { |
| 181 | return mCallerDisplayNamePresentation; |
| 182 | } |
| 183 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 184 | /** Gateway information for the call. */ |
| 185 | public GatewayInfo getGatewayInfo() { |
| 186 | return mGatewayInfo; |
| 187 | } |
| 188 | |
Evan Charlton | 6eb262c | 2014-07-19 18:18:19 -0700 | [diff] [blame] | 189 | /** PhoneAccountHandle information for the call. */ |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 190 | public PhoneAccountHandle getAccountHandle() { |
| 191 | return mAccountHandle; |
Nancy Chen | 5ffbfcc | 2014-06-25 14:22:55 -0700 | [diff] [blame] | 192 | } |
| 193 | |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 194 | /** |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 195 | * Returns an object for remotely communicating through the video call provider's binder. |
Tyler Gunn | 584ba6c | 2015-12-08 10:53:41 -0800 | [diff] [blame] | 196 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 197 | * @return The video call. |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 198 | */ |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 199 | public VideoCallImpl getVideoCallImpl(String callingPackageName) { |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 200 | if (mVideoCall == null && mVideoCallProvider != null) { |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 201 | try { |
Tyler Gunn | bf9c6fd | 2016-11-09 10:19:23 -0800 | [diff] [blame] | 202 | mVideoCall = new VideoCallImpl(mVideoCallProvider, callingPackageName); |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 203 | } catch (RemoteException ignored) { |
| 204 | // Ignore RemoteException. |
| 205 | } |
| 206 | } |
| 207 | |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 208 | return mVideoCall; |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 209 | } |
| 210 | |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 211 | public boolean getIsRttCallChanged() { |
| 212 | return mIsRttCallChanged; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * RTT communication channel information |
| 217 | * @return The ParcelableRttCall |
| 218 | */ |
| 219 | public ParcelableRttCall getParcelableRttCall() { |
| 220 | return mRttCall; |
| 221 | } |
| 222 | |
Andrew Lee | 5dc3075 | 2014-06-27 17:02:19 -0700 | [diff] [blame] | 223 | /** |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 224 | * The conference call to which this call is conferenced. Null if not conferenced. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 225 | */ |
| 226 | public String getParentCallId() { |
| 227 | return mParentCallId; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * The child call-IDs if this call is a conference call. Returns an empty list if this is not |
| 232 | * a conference call or if the conference call contains no children. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 233 | */ |
| 234 | public List<String> getChildCallIds() { |
| 235 | return mChildCallIds; |
| 236 | } |
| 237 | |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 238 | public List<String> getConferenceableCallIds() { |
| 239 | return mConferenceableCallIds; |
| 240 | } |
| 241 | |
Tyler Gunn | 8d83fa9 | 2014-07-01 11:31:21 -0700 | [diff] [blame] | 242 | /** |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 243 | * The status label and icon. |
| 244 | * |
| 245 | * @return Status hints. |
| 246 | */ |
| 247 | public StatusHints getStatusHints() { |
| 248 | return mStatusHints; |
| 249 | } |
| 250 | |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 251 | /** |
| 252 | * The video state. |
| 253 | * @return The video state of the call. |
| 254 | */ |
| 255 | public int getVideoState() { |
| 256 | return mVideoState; |
| 257 | } |
| 258 | |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 259 | /** |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 260 | * Any extras associated with this call. |
Nancy Chen | 10798dc | 2014-08-08 14:00:25 -0700 | [diff] [blame] | 261 | * |
| 262 | * @return a bundle of extras |
| 263 | */ |
| 264 | public Bundle getExtras() { |
| 265 | return mExtras; |
| 266 | } |
| 267 | |
Rekha Kumar | 0736681 | 2015-03-24 16:42:31 -0700 | [diff] [blame] | 268 | /** |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 269 | * Extras passed in as part of the original call intent. |
| 270 | * |
| 271 | * @return The intent extras. |
| 272 | */ |
| 273 | public Bundle getIntentExtras() { |
| 274 | return mIntentExtras; |
| 275 | } |
| 276 | |
| 277 | /** |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 278 | * Indicates to the receiver of the {@link ParcelableCall} whether a change has occurred in the |
| 279 | * {@link android.telecom.InCallService.VideoCall} associated with this call. Since |
| 280 | * {@link #getVideoCall()} creates a new {@link VideoCallImpl}, it is useful to know whether |
| 281 | * the provider has changed (which can influence whether it is accessed). |
| 282 | * |
| 283 | * @return {@code true} if the video call changed, {@code false} otherwise. |
| 284 | */ |
| 285 | public boolean isVideoCallProviderChanged() { |
| 286 | return mIsVideoCallProviderChanged; |
| 287 | } |
| 288 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 289 | /** Responsible for creating ParcelableCall objects for deserialized Parcels. */ |
| 290 | public static final Parcelable.Creator<ParcelableCall> CREATOR = |
| 291 | new Parcelable.Creator<ParcelableCall> () { |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 292 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 293 | public ParcelableCall createFromParcel(Parcel source) { |
| 294 | ClassLoader classLoader = ParcelableCall.class.getClassLoader(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 295 | String id = source.readString(); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 296 | int state = source.readInt(); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 297 | DisconnectCause disconnectCause = source.readParcelable(classLoader); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 298 | List<String> cannedSmsResponses = new ArrayList<>(); |
| 299 | source.readList(cannedSmsResponses, classLoader); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 300 | int capabilities = source.readInt(); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 301 | int properties = source.readInt(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 302 | long connectTimeMillis = source.readLong(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 303 | Uri handle = source.readParcelable(classLoader); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 304 | int handlePresentation = source.readInt(); |
| 305 | String callerDisplayName = source.readString(); |
| 306 | int callerDisplayNamePresentation = source.readInt(); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 307 | GatewayInfo gatewayInfo = source.readParcelable(classLoader); |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 308 | PhoneAccountHandle accountHandle = source.readParcelable(classLoader); |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 309 | boolean isVideoCallProviderChanged = source.readByte() == 1; |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 310 | IVideoProvider videoCallProvider = |
| 311 | IVideoProvider.Stub.asInterface(source.readStrongBinder()); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 312 | String parentCallId = source.readString(); |
| 313 | List<String> childCallIds = new ArrayList<>(); |
| 314 | source.readList(childCallIds, classLoader); |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 315 | StatusHints statusHints = source.readParcelable(classLoader); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 316 | int videoState = source.readInt(); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 317 | List<String> conferenceableCallIds = new ArrayList<>(); |
| 318 | source.readList(conferenceableCallIds, classLoader); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 319 | Bundle intentExtras = source.readBundle(classLoader); |
| 320 | Bundle extras = source.readBundle(classLoader); |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 321 | int supportedAudioRoutes = source.readInt(); |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 322 | boolean isRttCallChanged = source.readByte() == 1; |
| 323 | ParcelableRttCall rttCall = source.readParcelable(classLoader); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 324 | return new ParcelableCall( |
| 325 | id, |
| 326 | state, |
| 327 | disconnectCause, |
| 328 | cannedSmsResponses, |
| 329 | capabilities, |
| 330 | properties, |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 331 | supportedAudioRoutes, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 332 | connectTimeMillis, |
| 333 | handle, |
| 334 | handlePresentation, |
| 335 | callerDisplayName, |
| 336 | callerDisplayNamePresentation, |
| 337 | gatewayInfo, |
| 338 | accountHandle, |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 339 | isVideoCallProviderChanged, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 340 | videoCallProvider, |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 341 | isRttCallChanged, |
| 342 | rttCall, |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 343 | parentCallId, |
| 344 | childCallIds, |
| 345 | statusHints, |
| 346 | videoState, |
| 347 | conferenceableCallIds, |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 348 | intentExtras, |
Jay Shrauner | 8f98843 | 2015-04-16 12:52:19 -0700 | [diff] [blame] | 349 | extras); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 350 | } |
| 351 | |
| 352 | @Override |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 353 | public ParcelableCall[] newArray(int size) { |
| 354 | return new ParcelableCall[size]; |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 355 | } |
| 356 | }; |
| 357 | |
| 358 | /** {@inheritDoc} */ |
| 359 | @Override |
| 360 | public int describeContents() { |
| 361 | return 0; |
| 362 | } |
| 363 | |
Santos Cordon | 88b771d | 2014-07-19 13:10:40 -0700 | [diff] [blame] | 364 | /** Writes ParcelableCall object into a Parcel. */ |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 365 | @Override |
| 366 | public void writeToParcel(Parcel destination, int flags) { |
| 367 | destination.writeString(mId); |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 368 | destination.writeInt(mState); |
Andrew Lee | 7f3d41f | 2014-09-11 17:33:16 -0700 | [diff] [blame] | 369 | destination.writeParcelable(mDisconnectCause, 0); |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 370 | destination.writeList(mCannedSmsResponses); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 371 | destination.writeInt(mCapabilities); |
Andrew Lee | 223ad14 | 2014-08-27 16:33:08 -0700 | [diff] [blame] | 372 | destination.writeInt(mProperties); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 373 | destination.writeLong(mConnectTimeMillis); |
| 374 | destination.writeParcelable(mHandle, 0); |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 375 | destination.writeInt(mHandlePresentation); |
| 376 | destination.writeString(mCallerDisplayName); |
| 377 | destination.writeInt(mCallerDisplayNamePresentation); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 378 | destination.writeParcelable(mGatewayInfo, 0); |
Evan Charlton | 8c8a062 | 2014-07-20 12:31:00 -0700 | [diff] [blame] | 379 | destination.writeParcelable(mAccountHandle, 0); |
Tyler Gunn | 7595842 | 2015-04-15 14:23:42 -0700 | [diff] [blame] | 380 | destination.writeByte((byte) (mIsVideoCallProviderChanged ? 1 : 0)); |
Tyler Gunn | 807de8a | 2014-06-30 14:22:57 -0700 | [diff] [blame] | 381 | destination.writeStrongBinder( |
Andrew Lee | 50aca23 | 2014-07-22 16:41:54 -0700 | [diff] [blame] | 382 | mVideoCallProvider != null ? mVideoCallProvider.asBinder() : null); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 383 | destination.writeString(mParentCallId); |
| 384 | destination.writeList(mChildCallIds); |
Sailesh Nepal | e7ef59a | 2014-07-08 21:48:22 -0700 | [diff] [blame] | 385 | destination.writeParcelable(mStatusHints, 0); |
Andrew Lee | 85f5d42 | 2014-07-11 17:22:03 -0700 | [diff] [blame] | 386 | destination.writeInt(mVideoState); |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 387 | destination.writeList(mConferenceableCallIds); |
Santos Cordon | 6b7f955 | 2015-05-27 17:21:45 -0700 | [diff] [blame] | 388 | destination.writeBundle(mIntentExtras); |
| 389 | destination.writeBundle(mExtras); |
Christine Hallstrom | 2830ce9 | 2016-11-30 16:06:42 -0800 | [diff] [blame] | 390 | destination.writeInt(mSupportedAudioRoutes); |
Hall Liu | 95d5587 | 2017-01-25 17:12:49 -0800 | [diff] [blame] | 391 | destination.writeByte((byte) (mIsRttCallChanged ? 1 : 0)); |
| 392 | destination.writeParcelable(mRttCall, 0); |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 393 | } |
Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 394 | |
| 395 | @Override |
| 396 | public String toString() { |
| 397 | return String.format("[%s, parent:%s, children:%s]", mId, mParentCallId, mChildCallIds); |
| 398 | } |
Sailesh Nepal | 6043793 | 2014-04-05 16:44:55 -0700 | [diff] [blame] | 399 | } |