| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | |
| 17 | package com.android.ims; |
| 18 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | |
| 22 | /** |
| 23 | * This class enables an application to get details on why a method call failed. |
| 24 | * |
| 25 | * @hide |
| 26 | */ |
| 27 | public class ImsReasonInfo implements Parcelable { |
| Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame^] | 28 | |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 29 | /** |
| 30 | * Specific code of each types |
| 31 | */ |
| 32 | public static final int CODE_UNSPECIFIED = 0; |
| 33 | |
| 34 | /** |
| 35 | * LOCAL |
| 36 | */ |
| 37 | // IMS -> Telephony |
| 38 | // The passed argument is an invalid |
| 39 | public static final int CODE_LOCAL_ILLEGAL_ARGUMENT = 101; |
| 40 | // The operation is invoked in invalid call state |
| 41 | public static final int CODE_LOCAL_ILLEGAL_STATE = 102; |
| 42 | // IMS service internal error |
| 43 | public static final int CODE_LOCAL_INTERNAL_ERROR = 103; |
| 44 | // IMS service goes down (service connection is lost) |
| 45 | public static final int CODE_LOCAL_IMS_SERVICE_DOWN = 106; |
| 46 | // No pending incoming call exists |
| 47 | public static final int CODE_LOCAL_NO_PENDING_CALL = 107; |
| 48 | |
| 49 | // IMS -> Telephony |
| 50 | // Service unavailable; by power off |
| 51 | public static final int CODE_LOCAL_POWER_OFF = 111; |
| 52 | // Service unavailable; by low battery |
| 53 | public static final int CODE_LOCAL_LOW_BATTERY = 112; |
| 54 | // Service unavailable; by out of service (data service state) |
| 55 | public static final int CODE_LOCAL_NETWORK_NO_SERVICE = 121; |
| 56 | // Service unavailable; by no LTE coverage |
| 57 | // (VoLTE is not supported even though IMS is registered) |
| 58 | public static final int CODE_LOCAL_NETWORK_NO_LTE_COVERAGE = 122; |
| 59 | // Service unavailable; by located in roaming area |
| 60 | public static final int CODE_LOCAL_NETWORK_ROAMING = 123; |
| 61 | // Service unavailable; by IP changed |
| 62 | public static final int CODE_LOCAL_NETWORK_IP_CHANGED = 124; |
| 63 | // Service unavailable; other |
| 64 | public static final int CODE_LOCAL_SERVICE_UNAVAILABLE = 131; |
| 65 | // Service unavailable; IMS connection is lost (IMS is not registered) |
| 66 | public static final int CODE_LOCAL_NOT_REGISTERED = 132; |
| 67 | |
| 68 | // IMS <-> Telephony |
| 69 | // Max call exceeded |
| 70 | public static final int CODE_LOCAL_CALL_EXCEEDED = 141; |
| 71 | // IMS <- Telephony |
| 72 | // Call busy |
| 73 | public static final int CODE_LOCAL_CALL_BUSY = 142; |
| 74 | // Call decline |
| 75 | public static final int CODE_LOCAL_CALL_DECLINE = 143; |
| 76 | // IMS -> Telephony |
| 77 | // SRVCC is in progress |
| 78 | public static final int CODE_LOCAL_CALL_VCC_ON_PROGRESSING = 144; |
| 79 | // Resource reservation is failed (QoS precondition) |
| 80 | public static final int CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED = 145; |
| 81 | // Retry CS call; VoLTE service can't be provided by the network or remote end |
| 82 | // Resolve the extra code(EXTRA_CODE_CALL_RETRY_*) if the below code is set |
| 83 | public static final int CODE_LOCAL_CALL_CS_RETRY_REQUIRED = 146; |
| 84 | // Retry VoLTE call; VoLTE service can't be provided by the network temporarily |
| 85 | public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147; |
| 86 | // IMS call is already terminated (in TERMINATED state) |
| 87 | public static final int CODE_LOCAL_CALL_TERMINATED = 148; |
| Omkar Kolangade | 66742f2 | 2016-01-28 16:52:47 -0800 | [diff] [blame] | 88 | // Handover not feasible |
| 89 | public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 90 | |
| 91 | /** |
| 92 | * TIMEOUT (IMS -> Telephony) |
| 93 | */ |
| 94 | // 1xx waiting timer is expired after sending INVITE request (MO only) |
| 95 | public static final int CODE_TIMEOUT_1XX_WAITING = 201; |
| 96 | // User no answer during call setup operation (MO/MT) |
| 97 | // MO : 200 OK to INVITE request is not received, |
| 98 | // MT : No action from user after alerting the call |
| 99 | public static final int CODE_TIMEOUT_NO_ANSWER = 202; |
| 100 | // User no answer during call update operation (MO/MT) |
| 101 | // MO : 200 OK to re-INVITE request is not received, |
| 102 | // MT : No action from user after alerting the call |
| 103 | public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203; |
| 104 | |
| Shriram Ganesh | ddf570e | 2015-05-31 09:18:48 -0700 | [diff] [blame] | 105 | //Call failures for FDN |
| 106 | public static final int CODE_FDN_BLOCKED = 241; |
| 107 | |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 108 | /** |
| 109 | * STATUSCODE (SIP response code) (IMS -> Telephony) |
| 110 | */ |
| 111 | // 3xx responses |
| 112 | // SIP request is redirected |
| 113 | public static final int CODE_SIP_REDIRECTED = 321; |
| 114 | // 4xx responses |
| 115 | // 400 : Bad Request |
| 116 | public static final int CODE_SIP_BAD_REQUEST = 331; |
| 117 | // 403 : Forbidden |
| 118 | public static final int CODE_SIP_FORBIDDEN = 332; |
| 119 | // 404 : Not Found |
| 120 | public static final int CODE_SIP_NOT_FOUND = 333; |
| 121 | // 415 : Unsupported Media Type |
| 122 | // 416 : Unsupported URI Scheme |
| 123 | // 420 : Bad Extension |
| 124 | public static final int CODE_SIP_NOT_SUPPORTED = 334; |
| 125 | // 408 : Request Timeout |
| 126 | public static final int CODE_SIP_REQUEST_TIMEOUT = 335; |
| 127 | // 480 : Temporarily Unavailable |
| 128 | public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336; |
| 129 | // 484 : Address Incomplete |
| 130 | public static final int CODE_SIP_BAD_ADDRESS = 337; |
| 131 | // 486 : Busy Here |
| 132 | // 600 : Busy Everywhere |
| 133 | public static final int CODE_SIP_BUSY = 338; |
| 134 | // 487 : Request Terminated |
| 135 | public static final int CODE_SIP_REQUEST_CANCELLED = 339; |
| 136 | // 406 : Not Acceptable |
| 137 | // 488 : Not Acceptable Here |
| 138 | // 606 : Not Acceptable |
| 139 | public static final int CODE_SIP_NOT_ACCEPTABLE = 340; |
| 140 | // 410 : Gone |
| 141 | // 604 : Does Not Exist Anywhere |
| 142 | public static final int CODE_SIP_NOT_REACHABLE = 341; |
| 143 | // Others |
| 144 | public static final int CODE_SIP_CLIENT_ERROR = 342; |
| 145 | // 5xx responses |
| 146 | // 501 : Server Internal Error |
| 147 | public static final int CODE_SIP_SERVER_INTERNAL_ERROR = 351; |
| 148 | // 503 : Service Unavailable |
| 149 | public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352; |
| 150 | // 504 : Server Time-out |
| 151 | public static final int CODE_SIP_SERVER_TIMEOUT = 353; |
| 152 | // Others |
| 153 | public static final int CODE_SIP_SERVER_ERROR = 354; |
| 154 | // 6xx responses |
| 155 | // 603 : Decline |
| 156 | public static final int CODE_SIP_USER_REJECTED = 361; |
| 157 | // Others |
| 158 | public static final int CODE_SIP_GLOBAL_ERROR = 362; |
| Omkar Kolangade | 66742f2 | 2016-01-28 16:52:47 -0800 | [diff] [blame] | 159 | // Emergency failure |
| 160 | public static final int CODE_EMERGENCY_TEMP_FAILURE = 363; |
| 161 | public static final int CODE_EMERGENCY_PERM_FAILURE = 364; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 162 | |
| 163 | /** |
| 164 | * MEDIA (IMS -> Telephony) |
| 165 | */ |
| 166 | // Media resource initialization failed |
| 167 | public static final int CODE_MEDIA_INIT_FAILED = 401; |
| 168 | // RTP timeout (no audio / video traffic in the session) |
| 169 | public static final int CODE_MEDIA_NO_DATA = 402; |
| 170 | // Media is not supported; so dropped the call |
| 171 | public static final int CODE_MEDIA_NOT_ACCEPTABLE = 403; |
| 172 | // Unknown media related errors |
| 173 | public static final int CODE_MEDIA_UNSPECIFIED = 404; |
| 174 | |
| 175 | /** |
| 176 | * USER |
| 177 | */ |
| 178 | // Telephony -> IMS |
| 179 | // User triggers the call end |
| 180 | public static final int CODE_USER_TERMINATED = 501; |
| 181 | // No action while an incoming call is ringing |
| 182 | public static final int CODE_USER_NOANSWER = 502; |
| 183 | // User ignores an incoming call |
| 184 | public static final int CODE_USER_IGNORE = 503; |
| 185 | // User declines an incoming call |
| 186 | public static final int CODE_USER_DECLINE = 504; |
| Omkar Kolangade | 93c33d7 | 2014-12-01 16:23:25 -0800 | [diff] [blame] | 187 | // Device declines/ends a call due to low battery |
| 188 | public static final int CODE_LOW_BATTERY = 505; |
| 189 | // Device declines call due to blacklisted call ID |
| 190 | public static final int CODE_BLACKLISTED_CALL_ID = 506; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 191 | // IMS -> Telephony |
| 192 | // The call is terminated by the network or remote user |
| 193 | public static final int CODE_USER_TERMINATED_BY_REMOTE = 510; |
| 194 | |
| 195 | /** |
| 196 | * Extra codes for the specific code value |
| 197 | * This value can be referred when the code is CODE_LOCAL_CALL_CS_RETRY_REQUIRED. |
| 198 | */ |
| 199 | // Try to connect CS call; normal |
| 200 | public static final int EXTRA_CODE_CALL_RETRY_NORMAL = 1; |
| 201 | // Try to connect CS call without the notification to user |
| 202 | public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2; |
| 203 | // Try to connect CS call by the settings of the menu |
| 204 | public static final int EXTRA_CODE_CALL_RETRY_BY_SETTINGS = 3; |
| 205 | |
| 206 | /** |
| 207 | * UT |
| 208 | */ |
| 209 | public static final int CODE_UT_NOT_SUPPORTED = 801; |
| 210 | public static final int CODE_UT_SERVICE_UNAVAILABLE = 802; |
| 211 | public static final int CODE_UT_OPERATION_NOT_ALLOWED = 803; |
| Shriram Ganesh | 61aac3a | 2014-07-08 18:48:35 -0700 | [diff] [blame] | 212 | public static final int CODE_UT_NETWORK_ERROR = 804; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 213 | public static final int CODE_UT_CB_PASSWORD_MISMATCH = 821; |
| 214 | |
| Uma Maheswari Ramalingam | 1c18285 | 2014-07-31 15:54:52 -0700 | [diff] [blame] | 215 | /** |
| 216 | * ECBM |
| 217 | */ |
| 218 | public static final int CODE_ECBM_NOT_SUPPORTED = 901; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 219 | |
| Omkar Kolangade | 827fcb7 | 2014-12-03 18:35:10 -0800 | [diff] [blame] | 220 | /** |
| Tyler Gunn | 9eb7851 | 2016-04-12 16:13:44 -0700 | [diff] [blame] | 221 | * Fail code used to indicate that Multi-endpoint is not supported by the Ims framework. |
| 222 | */ |
| 223 | public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902; |
| 224 | |
| 225 | /** |
| Rekha Kumar | b54d218 | 2015-02-24 11:45:36 -0800 | [diff] [blame] | 226 | * Ims Registration error code |
| 227 | */ |
| 228 | public static final int CODE_REGISTRATION_ERROR = 1000; |
| 229 | |
| 230 | /** |
| 231 | * CALL DROP error codes (Call could drop because of many reasons like Network not available, |
| 232 | * handover, failed, etc) |
| 233 | */ |
| 234 | |
| 235 | /** |
| 236 | * CALL DROP error code for the case when a device is ePDG capable and when the user is on an |
| 237 | * active wifi call and at the edge of coverage and there is no qualified LTE network available |
| 238 | * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error |
| 239 | * code is received as part of the handover message. |
| 240 | */ |
| 241 | public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100; |
| 242 | |
| 243 | /** |
| Shriram Ganesh | ddf570e | 2015-05-31 09:18:48 -0700 | [diff] [blame] | 244 | * MT call has ended due to a release from the network |
| 245 | * because the call was answered elsewhere |
| 246 | */ |
| 247 | public static final int CODE_ANSWERED_ELSEWHERE = 1014; |
| 248 | |
| 249 | /** |
| Anju Mathapati | f604fc3 | 2016-03-10 12:57:21 -0800 | [diff] [blame] | 250 | * For MultiEndpoint - Call Pull request has failed |
| Omkar Kolangade | f38780b | 2016-02-24 11:53:06 -0800 | [diff] [blame] | 251 | */ |
| 252 | public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015; |
| 253 | |
| 254 | /** |
| Anju Mathapati | f604fc3 | 2016-03-10 12:57:21 -0800 | [diff] [blame] | 255 | * For MultiEndpoint - Call has been pulled from primary to secondary |
| Omkar Kolangade | f38780b | 2016-02-24 11:53:06 -0800 | [diff] [blame] | 256 | */ |
| 257 | public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016; |
| 258 | |
| 259 | /** |
| Omkar Kolangade | 66742f2 | 2016-01-28 16:52:47 -0800 | [diff] [blame] | 260 | * Supplementary services (HOLD/RESUME) failure error codes. |
| 261 | * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision. |
| 262 | */ |
| 263 | public static final int CODE_SUPP_SVC_FAILED = 1201; |
| 264 | public static final int CODE_SUPP_SVC_CANCELLED = 1202; |
| 265 | public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203; |
| 266 | |
| 267 | /** |
| Nathan Harold | 4b6d389 | 2016-02-23 13:25:12 -0800 | [diff] [blame] | 268 | * DPD Procedure received no response or send failed |
| 269 | */ |
| 270 | public static final int CODE_IWLAN_DPD_FAILURE = 1300; |
| 271 | |
| 272 | /** |
| 273 | * Establishment of the ePDG Tunnel Failed |
| 274 | */ |
| 275 | public static final int CODE_EPDG_TUNNEL_ESTABLISH_FAILURE = 1400; |
| 276 | |
| 277 | /** |
| 278 | * Re-keying of the ePDG Tunnel Failed; may not always result in teardown |
| 279 | */ |
| 280 | public static final int CODE_EPDG_TUNNEL_REKEY_FAILURE = 1401; |
| 281 | |
| 282 | /** |
| 283 | * Connection to the packet gateway is lost |
| 284 | */ |
| 285 | public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402; |
| 286 | |
| 287 | /** |
| Tyler Gunn | c96b5e0 | 2016-07-07 22:53:57 -0700 | [diff] [blame^] | 288 | * The maximum number of calls allowed has been reached. Used in a multi-endpoint scenario |
| 289 | * where the number of calls across all connected devices has reached the maximum. |
| 290 | */ |
| 291 | public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403; |
| 292 | |
| 293 | /** |
| 294 | * Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has |
| 295 | * declined the call. Used in a multi-endpoint scenario where a remote device declined an |
| 296 | * incoming call. |
| 297 | */ |
| 298 | public static final int CODE_REMOTE_CALL_DECLINE = 1404; |
| 299 | |
| 300 | /** |
| Omkar Kolangade | 827fcb7 | 2014-12-03 18:35:10 -0800 | [diff] [blame] | 301 | * Network string error messages. |
| 302 | * mExtraMessage may have these values. |
| 303 | */ |
| 304 | public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED |
| 305 | = "Forbidden. Not Authorized for Service"; |
| 306 | |
| Nathan Harold | 4b6d389 | 2016-02-23 13:25:12 -0800 | [diff] [blame] | 307 | |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 308 | // For main reason code |
| 309 | public int mCode; |
| 310 | // For the extra code value; it depends on the code value. |
| 311 | public int mExtraCode; |
| 312 | // For the additional message of the reason info. |
| 313 | public String mExtraMessage; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 314 | public ImsReasonInfo() { |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 315 | mCode = CODE_UNSPECIFIED; |
| 316 | mExtraCode = CODE_UNSPECIFIED; |
| 317 | mExtraMessage = null; |
| 318 | } |
| 319 | |
| 320 | public ImsReasonInfo(Parcel in) { |
| 321 | readFromParcel(in); |
| 322 | } |
| 323 | |
| 324 | public ImsReasonInfo(int code, int extraCode) { |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 325 | mCode = code; |
| 326 | mExtraCode = extraCode; |
| 327 | mExtraMessage = null; |
| 328 | } |
| 329 | |
| 330 | public ImsReasonInfo(int code, int extraCode, String extraMessage) { |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 331 | mCode = code; |
| 332 | mExtraCode = extraCode; |
| 333 | mExtraMessage = extraMessage; |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * |
| 338 | */ |
| 339 | public int getCode() { |
| 340 | return mCode; |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * |
| 345 | */ |
| 346 | public int getExtraCode() { |
| 347 | return mExtraCode; |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * |
| 352 | */ |
| 353 | public String getExtraMessage() { |
| 354 | return mExtraMessage; |
| 355 | } |
| 356 | |
| 357 | /** |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 358 | * Returns the string format of {@link ImsReasonInfo} |
| 359 | * |
| 360 | * @return the string format of {@link ImsReasonInfo} |
| 361 | */ |
| 362 | public String toString() { |
| Rekha Kumar | b54d218 | 2015-02-24 11:45:36 -0800 | [diff] [blame] | 363 | return "ImsReasonInfo :: {" + mCode + ", " + mExtraCode + ", " + mExtraMessage + "}"; |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 364 | } |
| 365 | |
| 366 | @Override |
| 367 | public int describeContents() { |
| 368 | return 0; |
| 369 | } |
| 370 | |
| 371 | @Override |
| 372 | public void writeToParcel(Parcel out, int flags) { |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 373 | out.writeInt(mCode); |
| 374 | out.writeInt(mExtraCode); |
| 375 | out.writeString(mExtraMessage); |
| 376 | } |
| 377 | |
| 378 | private void readFromParcel(Parcel in) { |
| Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 379 | mCode = in.readInt(); |
| 380 | mExtraCode = in.readInt(); |
| 381 | mExtraMessage = in.readString(); |
| 382 | } |
| 383 | |
| 384 | public static final Creator<ImsReasonInfo> CREATOR = new Creator<ImsReasonInfo>() { |
| 385 | @Override |
| 386 | public ImsReasonInfo createFromParcel(Parcel in) { |
| 387 | return new ImsReasonInfo(in); |
| 388 | } |
| 389 | |
| 390 | @Override |
| 391 | public ImsReasonInfo[] newArray(int size) { |
| 392 | return new ImsReasonInfo[size]; |
| 393 | } |
| 394 | }; |
| 395 | } |