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