blob: 83d9bd94013e6704560e789e91993fa7d6a01f50 [file] [log] [blame]
Wink Savillef8458ff2014-06-25 16:08:02 -07001/*
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
17package com.android.ims;
18
19import android.os.Parcel;
20import android.os.Parcelable;
21
22/**
23 * This class enables an application to get details on why a method call failed.
24 *
25 * @hide
26 */
27public class ImsReasonInfo implements Parcelable {
Tyler Gunnc96b5e02016-07-07 22:53:57 -070028
Wink Savillef8458ff2014-06-25 16:08:02 -070029 /**
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;
Jayachandran C666a12f2017-05-11 11:32:05 -070048 // IMS Call ended during conference merge process
49 public static final int CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE = 108;
Wink Savillef8458ff2014-06-25 16:08:02 -070050
51 // IMS -> Telephony
52 // Service unavailable; by power off
53 public static final int CODE_LOCAL_POWER_OFF = 111;
54 // Service unavailable; by low battery
55 public static final int CODE_LOCAL_LOW_BATTERY = 112;
56 // Service unavailable; by out of service (data service state)
57 public static final int CODE_LOCAL_NETWORK_NO_SERVICE = 121;
58 // Service unavailable; by no LTE coverage
59 // (VoLTE is not supported even though IMS is registered)
60 public static final int CODE_LOCAL_NETWORK_NO_LTE_COVERAGE = 122;
61 // Service unavailable; by located in roaming area
62 public static final int CODE_LOCAL_NETWORK_ROAMING = 123;
63 // Service unavailable; by IP changed
64 public static final int CODE_LOCAL_NETWORK_IP_CHANGED = 124;
65 // Service unavailable; other
66 public static final int CODE_LOCAL_SERVICE_UNAVAILABLE = 131;
67 // Service unavailable; IMS connection is lost (IMS is not registered)
68 public static final int CODE_LOCAL_NOT_REGISTERED = 132;
69
70 // IMS <-> Telephony
71 // Max call exceeded
72 public static final int CODE_LOCAL_CALL_EXCEEDED = 141;
73 // IMS <- Telephony
74 // Call busy
75 public static final int CODE_LOCAL_CALL_BUSY = 142;
76 // Call decline
77 public static final int CODE_LOCAL_CALL_DECLINE = 143;
78 // IMS -> Telephony
79 // SRVCC is in progress
80 public static final int CODE_LOCAL_CALL_VCC_ON_PROGRESSING = 144;
81 // Resource reservation is failed (QoS precondition)
82 public static final int CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED = 145;
83 // Retry CS call; VoLTE service can't be provided by the network or remote end
84 // Resolve the extra code(EXTRA_CODE_CALL_RETRY_*) if the below code is set
85 public static final int CODE_LOCAL_CALL_CS_RETRY_REQUIRED = 146;
86 // Retry VoLTE call; VoLTE service can't be provided by the network temporarily
87 public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147;
88 // IMS call is already terminated (in TERMINATED state)
89 public static final int CODE_LOCAL_CALL_TERMINATED = 148;
Omkar Kolangade66742f22016-01-28 16:52:47 -080090 // Handover not feasible
91 public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149;
Wink Savillef8458ff2014-06-25 16:08:02 -070092
93 /**
94 * TIMEOUT (IMS -> Telephony)
95 */
96 // 1xx waiting timer is expired after sending INVITE request (MO only)
97 public static final int CODE_TIMEOUT_1XX_WAITING = 201;
98 // User no answer during call setup operation (MO/MT)
99 // MO : 200 OK to INVITE request is not received,
100 // MT : No action from user after alerting the call
101 public static final int CODE_TIMEOUT_NO_ANSWER = 202;
102 // User no answer during call update operation (MO/MT)
103 // MO : 200 OK to re-INVITE request is not received,
104 // MT : No action from user after alerting the call
105 public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203;
106
kouji.x.nakamura1dfbf432015-02-05 14:51:55 +0900107 //Call was blocked by call barring
108 public static final int CODE_CALL_BARRED = 240;
109
Shriram Ganeshddf570e2015-05-31 09:18:48 -0700110 //Call failures for FDN
111 public static final int CODE_FDN_BLOCKED = 241;
112
Toshiya Ikenaga46415772017-03-15 14:56:16 +0900113 // Network does not accept the emergency call request because IMEI was used as identification
114 // and this capability is not supported by the network.
115 public static final int CODE_IMEI_NOT_ACCEPTED = 243;
116
Suresh Koleti0c22fef2017-07-29 10:16:43 +0530117 //STK CC errors
118 public static final int CODE_DIAL_MODIFIED_TO_USSD = 244;
119 public static final int CODE_DIAL_MODIFIED_TO_SS = 245;
120 public static final int CODE_DIAL_MODIFIED_TO_DIAL = 246;
121 public static final int CODE_DIAL_MODIFIED_TO_DIAL_VIDEO = 247;
122 public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL = 248;
123 public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO = 249;
124 public static final int CODE_DIAL_VIDEO_MODIFIED_TO_SS = 250;
125 public static final int CODE_DIAL_VIDEO_MODIFIED_TO_USSD = 251;
126
Wink Savillef8458ff2014-06-25 16:08:02 -0700127 /**
128 * STATUSCODE (SIP response code) (IMS -> Telephony)
129 */
130 // 3xx responses
131 // SIP request is redirected
132 public static final int CODE_SIP_REDIRECTED = 321;
133 // 4xx responses
134 // 400 : Bad Request
135 public static final int CODE_SIP_BAD_REQUEST = 331;
136 // 403 : Forbidden
137 public static final int CODE_SIP_FORBIDDEN = 332;
138 // 404 : Not Found
139 public static final int CODE_SIP_NOT_FOUND = 333;
140 // 415 : Unsupported Media Type
141 // 416 : Unsupported URI Scheme
142 // 420 : Bad Extension
143 public static final int CODE_SIP_NOT_SUPPORTED = 334;
144 // 408 : Request Timeout
145 public static final int CODE_SIP_REQUEST_TIMEOUT = 335;
146 // 480 : Temporarily Unavailable
147 public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336;
148 // 484 : Address Incomplete
149 public static final int CODE_SIP_BAD_ADDRESS = 337;
150 // 486 : Busy Here
151 // 600 : Busy Everywhere
152 public static final int CODE_SIP_BUSY = 338;
153 // 487 : Request Terminated
154 public static final int CODE_SIP_REQUEST_CANCELLED = 339;
155 // 406 : Not Acceptable
156 // 488 : Not Acceptable Here
157 // 606 : Not Acceptable
158 public static final int CODE_SIP_NOT_ACCEPTABLE = 340;
159 // 410 : Gone
160 // 604 : Does Not Exist Anywhere
161 public static final int CODE_SIP_NOT_REACHABLE = 341;
162 // Others
163 public static final int CODE_SIP_CLIENT_ERROR = 342;
164 // 5xx responses
165 // 501 : Server Internal Error
166 public static final int CODE_SIP_SERVER_INTERNAL_ERROR = 351;
167 // 503 : Service Unavailable
168 public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352;
169 // 504 : Server Time-out
170 public static final int CODE_SIP_SERVER_TIMEOUT = 353;
171 // Others
172 public static final int CODE_SIP_SERVER_ERROR = 354;
173 // 6xx responses
174 // 603 : Decline
175 public static final int CODE_SIP_USER_REJECTED = 361;
176 // Others
177 public static final int CODE_SIP_GLOBAL_ERROR = 362;
Omkar Kolangade66742f22016-01-28 16:52:47 -0800178 // Emergency failure
179 public static final int CODE_EMERGENCY_TEMP_FAILURE = 363;
180 public static final int CODE_EMERGENCY_PERM_FAILURE = 364;
Wink Savillef8458ff2014-06-25 16:08:02 -0700181
182 /**
183 * MEDIA (IMS -> Telephony)
184 */
185 // Media resource initialization failed
186 public static final int CODE_MEDIA_INIT_FAILED = 401;
187 // RTP timeout (no audio / video traffic in the session)
188 public static final int CODE_MEDIA_NO_DATA = 402;
189 // Media is not supported; so dropped the call
190 public static final int CODE_MEDIA_NOT_ACCEPTABLE = 403;
191 // Unknown media related errors
192 public static final int CODE_MEDIA_UNSPECIFIED = 404;
193
194 /**
195 * USER
196 */
197 // Telephony -> IMS
198 // User triggers the call end
199 public static final int CODE_USER_TERMINATED = 501;
200 // No action while an incoming call is ringing
201 public static final int CODE_USER_NOANSWER = 502;
202 // User ignores an incoming call
203 public static final int CODE_USER_IGNORE = 503;
204 // User declines an incoming call
205 public static final int CODE_USER_DECLINE = 504;
Omkar Kolangade93c33d72014-12-01 16:23:25 -0800206 // Device declines/ends a call due to low battery
207 public static final int CODE_LOW_BATTERY = 505;
208 // Device declines call due to blacklisted call ID
209 public static final int CODE_BLACKLISTED_CALL_ID = 506;
Wink Savillef8458ff2014-06-25 16:08:02 -0700210 // IMS -> Telephony
211 // The call is terminated by the network or remote user
212 public static final int CODE_USER_TERMINATED_BY_REMOTE = 510;
213
214 /**
215 * Extra codes for the specific code value
216 * This value can be referred when the code is CODE_LOCAL_CALL_CS_RETRY_REQUIRED.
217 */
218 // Try to connect CS call; normal
219 public static final int EXTRA_CODE_CALL_RETRY_NORMAL = 1;
220 // Try to connect CS call without the notification to user
221 public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2;
222 // Try to connect CS call by the settings of the menu
223 public static final int EXTRA_CODE_CALL_RETRY_BY_SETTINGS = 3;
224
225 /**
226 * UT
227 */
228 public static final int CODE_UT_NOT_SUPPORTED = 801;
229 public static final int CODE_UT_SERVICE_UNAVAILABLE = 802;
230 public static final int CODE_UT_OPERATION_NOT_ALLOWED = 803;
Shriram Ganesh61aac3a2014-07-08 18:48:35 -0700231 public static final int CODE_UT_NETWORK_ERROR = 804;
Wink Savillef8458ff2014-06-25 16:08:02 -0700232 public static final int CODE_UT_CB_PASSWORD_MISMATCH = 821;
Suresh Koleti0c22fef2017-07-29 10:16:43 +0530233 //STK CC errors
234 public static final int CODE_UT_SS_MODIFIED_TO_DIAL = 822;
235 public static final int CODE_UT_SS_MODIFIED_TO_USSD = 823;
236 public static final int CODE_UT_SS_MODIFIED_TO_SS = 824;
237 public static final int CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO = 825;
Wink Savillef8458ff2014-06-25 16:08:02 -0700238
Uma Maheswari Ramalingam1c182852014-07-31 15:54:52 -0700239 /**
240 * ECBM
241 */
242 public static final int CODE_ECBM_NOT_SUPPORTED = 901;
Wink Savillef8458ff2014-06-25 16:08:02 -0700243
Omkar Kolangade827fcb72014-12-03 18:35:10 -0800244 /**
Tyler Gunn9eb78512016-04-12 16:13:44 -0700245 * Fail code used to indicate that Multi-endpoint is not supported by the Ims framework.
246 */
247 public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902;
248
249 /**
Rekha Kumarb54d2182015-02-24 11:45:36 -0800250 * Ims Registration error code
251 */
252 public static final int CODE_REGISTRATION_ERROR = 1000;
253
254 /**
255 * CALL DROP error codes (Call could drop because of many reasons like Network not available,
256 * handover, failed, etc)
257 */
258
259 /**
260 * CALL DROP error code for the case when a device is ePDG capable and when the user is on an
261 * active wifi call and at the edge of coverage and there is no qualified LTE network available
262 * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error
263 * code is received as part of the handover message.
264 */
265 public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100;
266
267 /**
Shriram Ganeshddf570e2015-05-31 09:18:48 -0700268 * MT call has ended due to a release from the network
269 * because the call was answered elsewhere
270 */
271 public static final int CODE_ANSWERED_ELSEWHERE = 1014;
272
273 /**
Anju Mathapatif604fc32016-03-10 12:57:21 -0800274 * For MultiEndpoint - Call Pull request has failed
Omkar Kolangadef38780b2016-02-24 11:53:06 -0800275 */
276 public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015;
277
278 /**
Anju Mathapatif604fc32016-03-10 12:57:21 -0800279 * For MultiEndpoint - Call has been pulled from primary to secondary
Omkar Kolangadef38780b2016-02-24 11:53:06 -0800280 */
281 public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016;
282
283 /**
Omkar Kolangade66742f22016-01-28 16:52:47 -0800284 * Supplementary services (HOLD/RESUME) failure error codes.
285 * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision.
286 */
287 public static final int CODE_SUPP_SVC_FAILED = 1201;
288 public static final int CODE_SUPP_SVC_CANCELLED = 1202;
289 public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203;
290
291 /**
Nathan Harold4b6d3892016-02-23 13:25:12 -0800292 * DPD Procedure received no response or send failed
293 */
294 public static final int CODE_IWLAN_DPD_FAILURE = 1300;
295
296 /**
297 * Establishment of the ePDG Tunnel Failed
298 */
299 public static final int CODE_EPDG_TUNNEL_ESTABLISH_FAILURE = 1400;
300
301 /**
302 * Re-keying of the ePDG Tunnel Failed; may not always result in teardown
303 */
304 public static final int CODE_EPDG_TUNNEL_REKEY_FAILURE = 1401;
305
306 /**
307 * Connection to the packet gateway is lost
308 */
309 public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402;
310
311 /**
Tyler Gunnc96b5e02016-07-07 22:53:57 -0700312 * The maximum number of calls allowed has been reached. Used in a multi-endpoint scenario
313 * where the number of calls across all connected devices has reached the maximum.
314 */
315 public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403;
316
317 /**
318 * Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has
319 * declined the call. Used in a multi-endpoint scenario where a remote device declined an
320 * incoming call.
321 */
322 public static final int CODE_REMOTE_CALL_DECLINE = 1404;
323
324 /**
Tyler Gunned21e8f2016-08-11 13:13:51 -0700325 * Indicates the call was disconnected due to the user reaching their data limit.
326 */
327 public static final int CODE_DATA_LIMIT_REACHED = 1405;
328
329 /**
330 * Indicates the call was disconnected due to the user disabling cellular data.
331 */
332 public static final int CODE_DATA_DISABLED = 1406;
333
334 /**
Tyler Gunn87f208b2017-01-30 09:52:55 -0800335 * Indicates a call was disconnected due to loss of wifi signal.
336 */
337 public static final int CODE_WIFI_LOST = 1407;
338
339 /**
Abhishek Adappa2134e142017-01-10 17:36:06 -0800340 * Indicates the registration attempt on IWLAN failed due to IKEv2 authetication failure
341 * during tunnel establishment.
342 */
343 public static final int CODE_IKEV2_AUTH_FAILURE = 1408;
344
Jayachandran C5cbaddd2017-03-07 23:59:15 -0800345 /** The call cannot be established because RADIO is OFF */
346 public static final int CODE_RADIO_OFF = 1500;
347
348 /** The call cannot be established because of no valid SIM */
349 public static final int CODE_NO_VALID_SIM = 1501;
350
351 /** The failure is due internal error at modem */
352 public static final int CODE_RADIO_INTERNAL_ERROR = 1502;
353
354 /** The failure is due to UE timer expired while waiting for a response from network */
355 public static final int CODE_NETWORK_RESP_TIMEOUT = 1503;
356
357 /** The failure is due to explicit reject from network */
358 public static final int CODE_NETWORK_REJECT = 1504;
359
360 /** The failure is due to radio access failure. ex. RACH failure */
361 public static final int CODE_RADIO_ACCESS_FAILURE = 1505;
362
363 /** Call/IMS registration failed/dropped because of a RLF */
364 public static final int CODE_RADIO_LINK_FAILURE = 1506;
365
366 /** Call/IMS registration failed/dropped because of radio link lost */
367 public static final int CODE_RADIO_LINK_LOST = 1507;
368
369 /** The call Call/IMS registration failed because of a radio uplink issue */
370 public static final int CODE_RADIO_UPLINK_FAILURE = 1508;
371
372 /** Call failed because of a RRC connection setup failure */
373 public static final int CODE_RADIO_SETUP_FAILURE = 1509;
374
375 /** Call failed/dropped because of RRC connection release from NW */
376 public static final int CODE_RADIO_RELEASE_NORMAL = 1510;
377
378 /** Call failed/dropped because of RRC abnormally released by modem/network */
379 public static final int CODE_RADIO_RELEASE_ABNORMAL = 1511;
380
381 /** Call failed because of access class barring */
382 public static final int CODE_ACCESS_CLASS_BLOCKED = 1512;
383
384 /** Call/IMS registration is failed/dropped because of a network detach */
385 public static final int CODE_NETWORK_DETACH = 1513;
386
Tyler Gunnf7808372017-12-15 09:09:14 -0800387 /**
388 * Call failed due to SIP code 380 (Alternative Service response) while dialing an "undetected
389 * emergency number". This scenario is important in some regions where the carrier network will
390 * identify other non-emergency help numbers (e.g. mountain rescue) when attempting to dial.
391 */
392 public static final int CODE_SIP_ALTERNATE_EMERGENCY_CALL = 1514;
393
Jayachandran C5cbaddd2017-03-07 23:59:15 -0800394 /* OEM specific error codes. To be used by OEMs when they don't want to
395 reveal error code which would be replaced by ERROR_UNSPECIFIED */
396 public static final int CODE_OEM_CAUSE_1 = 0xf001;
397 public static final int CODE_OEM_CAUSE_2 = 0xf002;
398 public static final int CODE_OEM_CAUSE_3 = 0xf003;
399 public static final int CODE_OEM_CAUSE_4 = 0xf004;
400 public static final int CODE_OEM_CAUSE_5 = 0xf005;
401 public static final int CODE_OEM_CAUSE_6 = 0xf006;
402 public static final int CODE_OEM_CAUSE_7 = 0xf007;
403 public static final int CODE_OEM_CAUSE_8 = 0xf008;
404 public static final int CODE_OEM_CAUSE_9 = 0xf009;
405 public static final int CODE_OEM_CAUSE_10 = 0xf00a;
406 public static final int CODE_OEM_CAUSE_11 = 0xf00b;
407 public static final int CODE_OEM_CAUSE_12 = 0xf00c;
408 public static final int CODE_OEM_CAUSE_13 = 0xf00d;
409 public static final int CODE_OEM_CAUSE_14 = 0xf00e;
410 public static final int CODE_OEM_CAUSE_15 = 0xf00f;
411
Abhishek Adappa2134e142017-01-10 17:36:06 -0800412 /**
Omkar Kolangade827fcb72014-12-03 18:35:10 -0800413 * Network string error messages.
414 * mExtraMessage may have these values.
415 */
416 public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED
417 = "Forbidden. Not Authorized for Service";
418
Nathan Harold4b6d3892016-02-23 13:25:12 -0800419
Wink Savillef8458ff2014-06-25 16:08:02 -0700420 // For main reason code
421 public int mCode;
422 // For the extra code value; it depends on the code value.
423 public int mExtraCode;
424 // For the additional message of the reason info.
425 public String mExtraMessage;
Wink Savillef8458ff2014-06-25 16:08:02 -0700426 public ImsReasonInfo() {
Wink Savillef8458ff2014-06-25 16:08:02 -0700427 mCode = CODE_UNSPECIFIED;
428 mExtraCode = CODE_UNSPECIFIED;
429 mExtraMessage = null;
430 }
431
432 public ImsReasonInfo(Parcel in) {
433 readFromParcel(in);
434 }
435
436 public ImsReasonInfo(int code, int extraCode) {
Wink Savillef8458ff2014-06-25 16:08:02 -0700437 mCode = code;
438 mExtraCode = extraCode;
439 mExtraMessage = null;
440 }
441
442 public ImsReasonInfo(int code, int extraCode, String extraMessage) {
Wink Savillef8458ff2014-06-25 16:08:02 -0700443 mCode = code;
444 mExtraCode = extraCode;
445 mExtraMessage = extraMessage;
446 }
447
448 /**
449 *
450 */
451 public int getCode() {
452 return mCode;
453 }
454
455 /**
456 *
457 */
458 public int getExtraCode() {
459 return mExtraCode;
460 }
461
462 /**
463 *
464 */
465 public String getExtraMessage() {
466 return mExtraMessage;
467 }
468
469 /**
Wink Savillef8458ff2014-06-25 16:08:02 -0700470 * Returns the string format of {@link ImsReasonInfo}
471 *
472 * @return the string format of {@link ImsReasonInfo}
473 */
474 public String toString() {
Rekha Kumarb54d2182015-02-24 11:45:36 -0800475 return "ImsReasonInfo :: {" + mCode + ", " + mExtraCode + ", " + mExtraMessage + "}";
Wink Savillef8458ff2014-06-25 16:08:02 -0700476 }
477
478 @Override
479 public int describeContents() {
480 return 0;
481 }
482
483 @Override
484 public void writeToParcel(Parcel out, int flags) {
Wink Savillef8458ff2014-06-25 16:08:02 -0700485 out.writeInt(mCode);
486 out.writeInt(mExtraCode);
487 out.writeString(mExtraMessage);
488 }
489
490 private void readFromParcel(Parcel in) {
Wink Savillef8458ff2014-06-25 16:08:02 -0700491 mCode = in.readInt();
492 mExtraCode = in.readInt();
493 mExtraMessage = in.readString();
494 }
495
496 public static final Creator<ImsReasonInfo> CREATOR = new Creator<ImsReasonInfo>() {
497 @Override
498 public ImsReasonInfo createFromParcel(Parcel in) {
499 return new ImsReasonInfo(in);
500 }
501
502 @Override
503 public ImsReasonInfo[] newArray(int size) {
504 return new ImsReasonInfo[size];
505 }
506 };
507}