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