1 /*
2  * Copyright (C) 2018 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 android.telephony.ims;
18 
19 import android.annotation.IntDef;
20 import android.annotation.NonNull;
21 import android.annotation.Nullable;
22 import android.annotation.SystemApi;
23 import android.compat.annotation.UnsupportedAppUsage;
24 import android.os.Build;
25 import android.os.Parcel;
26 import android.os.Parcelable;
27 
28 import java.lang.annotation.Retention;
29 import java.lang.annotation.RetentionPolicy;
30 import java.util.HashMap;
31 import java.util.Map;
32 /**
33  * Provides details on why an IMS call failed. Applications can use the methods in this class to
34  * get local or network fault behind an IMS services failure. For example, if the code is
35  * CODE_CALL_BARRED, then the call was blocked by network call barring configuration and it is not
36  * the device's bug and the user can retry the call when network lift the barring.
37  * Typical use case includes call backs when IMS call state changed with this class as a param
38  * containing details on why IMS call changed state/failed.
39  */
40 public final class ImsReasonInfo implements Parcelable {
41 
42     /**
43      * The Reason is unspecified.
44      */
45     public static final int CODE_UNSPECIFIED = 0;
46 
47 
48     // LOCAL
49 
50     // IMS -> Telephony
51     /**
52      * The passed argument is invalid.
53      */
54     public static final int CODE_LOCAL_ILLEGAL_ARGUMENT = 101;
55     /**
56      * The operation was invoked while in an invalid call state.
57      */
58     public static final int CODE_LOCAL_ILLEGAL_STATE = 102;
59     /**
60      * IMS service internal error
61      */
62     public static final int CODE_LOCAL_INTERNAL_ERROR = 103;
63     /**
64      * ImsService has crashed (service connection is lost).
65      */
66     public static final int CODE_LOCAL_IMS_SERVICE_DOWN = 106;
67     /**
68      * No pending incoming call exists
69      */
70     public static final int CODE_LOCAL_NO_PENDING_CALL = 107;
71     /**
72      * IMS Call ended during conference merge process
73      */
74     public static final int CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE = 108;
75 
76     // IMS -> Telephony
77     /**
78      * Service unavailable; radio power off
79      */
80     public static final int CODE_LOCAL_POWER_OFF = 111;
81     /**
82      * Service unavailable; low battery
83      */
84     public static final int CODE_LOCAL_LOW_BATTERY = 112;
85     /**
86      * Service unavailable; out of service (data service state)
87      */
88     public static final int CODE_LOCAL_NETWORK_NO_SERVICE = 121;
89     /**
90      * Service unavailable; no LTE coverage
91      * (VoLTE is not supported even though IMS is registered)
92      */
93     public static final int CODE_LOCAL_NETWORK_NO_LTE_COVERAGE = 122;
94     /**
95      * Service unavailable; located in roaming area
96      */
97     public static final int CODE_LOCAL_NETWORK_ROAMING = 123;
98     /**
99      * Service unavailable; IP changed
100      */
101     public static final int CODE_LOCAL_NETWORK_IP_CHANGED = 124;
102     /**
103      * Service unavailable; for an unspecified reason
104      */
105     public static final int CODE_LOCAL_SERVICE_UNAVAILABLE = 131;
106     /**
107      * Service unavailable; IMS is not registered
108      */
109     public static final int CODE_LOCAL_NOT_REGISTERED = 132;
110 
111     // IMS <-> Telephony
112     /**
113      * Maximum number of simultaneous calls exceeded
114      */
115     public static final int CODE_LOCAL_CALL_EXCEEDED = 141;
116     // IMS <- Telephony
117     /**
118      * The call is busy.
119      */
120     public static final int CODE_LOCAL_CALL_BUSY = 142;
121     /**
122      * The Call has been declined locally on this device.
123      */
124     public static final int CODE_LOCAL_CALL_DECLINE = 143;
125     // IMS -> Telephony
126     /**
127      * Can not complete call; an SRVCC is in progress.
128      */
129     public static final int CODE_LOCAL_CALL_VCC_ON_PROGRESSING = 144;
130     /**
131      * Can not complete call; resource reservation is failed (QoS precondition)
132      */
133     public static final int CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED = 145;
134     /**
135      * VoLTE service can't be provided by the network or remote end, retry the call.
136      * Resolve the extra code provided in (EXTRA_CODE_CALL_RETRY_*) if the below code is set
137      */
138     public static final int CODE_LOCAL_CALL_CS_RETRY_REQUIRED = 146;
139     /**
140      * VoLTE service can't be provided by the network temporarily, retry the call.
141      */
142     public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147;
143     /**
144      * IMS call is already terminated (in TERMINATED state).
145      */
146     public static final int CODE_LOCAL_CALL_TERMINATED = 148;
147     /**
148      * Call was disconnected because a handover is not feasible due to network conditions.
149      */
150     public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149;
151     /**
152      * This device does not support IMS.
153      * @hide
154      */
155     public static final int CODE_LOCAL_IMS_NOT_SUPPORTED_ON_DEVICE = 150;
156 
157     /*
158      * TIMEOUT (IMS -> Telephony)
159      */
160     /**
161      * 1xx waiting timer is expired after sending INVITE request (MO calls only)
162      */
163     public static final int CODE_TIMEOUT_1XX_WAITING = 201;
164     /**
165      * User didn't answer during call setup operation (MO/MT)
166      * MO : 200 OK to INVITE request is not received,
167      * MT : No action from user after alerting the call
168      */
169     public static final int CODE_TIMEOUT_NO_ANSWER = 202;
170     /**
171      * User no answer during call update operation (MO/MT)
172      * MO : 200 OK to re-INVITE request is not received,
173      * MT : No action from user after alerting the call
174      */
175     public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203;
176 
177     /**
178      * The call was blocked by call barring configuration.
179      */
180     public static final int CODE_CALL_BARRED = 240;
181 
182     /**
183      * The operation is restricted to fixed dialing numbers only.
184      */
185     public static final int CODE_FDN_BLOCKED = 241;
186 
187     /**
188      * Network rejected the emergency call request because IMEI was used as identification
189      * and this capability is not supported by the network.
190      */
191     public static final int CODE_IMEI_NOT_ACCEPTED = 243;
192 
193     //STK CC errors
194     /**
195      * Stk Call Control modified DIAL request to USSD request.
196      */
197     public static final int CODE_DIAL_MODIFIED_TO_USSD = 244;
198     /**
199      * Stk Call Control modified DIAL request to SS request.
200      */
201     public static final int CODE_DIAL_MODIFIED_TO_SS = 245;
202     /**
203      * Stk Call Control modified DIAL request to DIAL with modified data.
204      */
205     public static final int CODE_DIAL_MODIFIED_TO_DIAL = 246;
206     /**
207      * Stk Call Control modified DIAL request to Video DIAL request.
208      */
209     public static final int CODE_DIAL_MODIFIED_TO_DIAL_VIDEO = 247;
210     /**
211      * Stk Call Control modified Video DIAL request to DIAL request.
212      */
213     public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL = 248;
214     /**
215      * Stk Call Control modified Video DIAL request to Video DIAL request.
216      */
217     public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO = 249;
218     /**
219      * Stk Call Control modified Video DIAL request to SS request.
220      */
221     public static final int CODE_DIAL_VIDEO_MODIFIED_TO_SS = 250;
222     /**
223      * Stk Call Control modified Video DIAL request to USSD request.
224      */
225     public static final int CODE_DIAL_VIDEO_MODIFIED_TO_USSD = 251;
226 
227     /*
228      * STATUSCODE (SIP response code) (IMS -> Telephony)
229      */
230     // 3xx responses
231     /**
232      * SIP 3xx response: SIP request is redirected
233      */
234     public static final int CODE_SIP_REDIRECTED = 321;
235     // 4xx responses
236     /**
237      * Sip 400 response : Bad Request
238      */
239     public static final int CODE_SIP_BAD_REQUEST = 331;
240     /**
241      * Sip 403 response : Forbidden
242      */
243     public static final int CODE_SIP_FORBIDDEN = 332;
244     /**
245      * Sip 404 response : Not Found
246      */
247     public static final int CODE_SIP_NOT_FOUND = 333;
248     /**
249      * Not supported, because of one of the following:
250      * SIP response 415 : Unsupported Media Type,
251      * SIP response 416 : Unsupported URI Scheme,
252      * SIP response 420 : Bad Extension
253      */
254     public static final int CODE_SIP_NOT_SUPPORTED = 334;
255     /**
256      * SIP response 408 : Request Timeout.
257      */
258     public static final int CODE_SIP_REQUEST_TIMEOUT = 335;
259     /**
260      * SIP response 480 : Temporarily Unavailable
261      */
262     public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336;
263     /**
264      * SIP response 484 : Address Incomplete
265      */
266     public static final int CODE_SIP_BAD_ADDRESS = 337;
267     /**
268      * Returned a busy response, may be one of the following:
269      * SIP response 486 : Busy Here,
270      * SIP response 600 : Busy Everywhere
271      */
272     public static final int CODE_SIP_BUSY = 338;
273     /**
274      * SIP response 487 : Request Terminated
275      */
276     public static final int CODE_SIP_REQUEST_CANCELLED = 339;
277     /**
278      * Received a not acceptable response, will be one of the following:
279      * SIP response 406 : Not Acceptable
280      * SIP response 488 : Not Acceptable Here
281      * SIP response 606 : Not Acceptable
282      */
283     public static final int CODE_SIP_NOT_ACCEPTABLE = 340;
284     /**
285      * Received a not acceptable response, will be one of the following:
286      * SIP response 410 : Gone
287      * SIP response 604 : Does Not Exist Anywhere
288      */
289     public static final int CODE_SIP_NOT_REACHABLE = 341;
290     /**
291      * Received another unspecified error SIP response from the client.
292      */
293     public static final int CODE_SIP_CLIENT_ERROR = 342;
294     /**
295      * SIP response 481: Transaction Does Not Exist
296      */
297     public static final int CODE_SIP_TRANSACTION_DOES_NOT_EXIST = 343;
298     // 5xx responses
299     /**
300      * SIP response 501 : Server Internal Error
301      */
302     public static final int CODE_SIP_SERVER_INTERNAL_ERROR = 351;
303     /**
304      * SIP response 503 : Service Unavailable
305      */
306     public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352;
307     /**
308      * SIP response 504 : Server Time-out
309      */
310     public static final int CODE_SIP_SERVER_TIMEOUT = 353;
311     /**
312      * Received an unspecified SIP server error response.
313      */
314     public static final int CODE_SIP_SERVER_ERROR = 354;
315     // 6xx responses
316     /**
317      * 603 : Decline
318      */
319     public static final int CODE_SIP_USER_REJECTED = 361;
320     /**
321      * Unspecified 6xx error.
322      */
323     public static final int CODE_SIP_GLOBAL_ERROR = 362;
324 
325     /**
326      * Emergency call failed in the modem with a temporary fail cause and should be redialed on this
327      * slot.
328      */
329     public static final int CODE_EMERGENCY_TEMP_FAILURE = 363;
330     /**
331      * Emergency call failed in the modem with a permanent fail cause and should not be redialed on
332      * this slot. If there are any other slots available for emergency calling, try those.
333      */
334     public static final int CODE_EMERGENCY_PERM_FAILURE = 364;
335 
336     /**
337      * Call failure code during hangup/reject if user marked the call as unwanted.
338      *
339      * Android Telephony will receive information whether ROBO call feature is supported by the
340      * network from modem and propagate the same to AOSP as new ImsCallProfile members. OEMs can
341      * check this information and provide an option to the user to mark the call as unwanted.
342      */
343     public static final int CODE_SIP_USER_MARKED_UNWANTED = 365;
344 
345     /**
346      * SIP Response : 405
347      * Method not allowed for the address in the Request URI
348      */
349     public static final int CODE_SIP_METHOD_NOT_ALLOWED = 366;
350 
351     /**
352      * SIP Response : 407
353      * The request requires user authentication
354      */
355     public static final int CODE_SIP_PROXY_AUTHENTICATION_REQUIRED = 367;
356 
357     /**
358      * SIP Response : 413
359      * Request body too large
360      */
361     public static final int CODE_SIP_REQUEST_ENTITY_TOO_LARGE = 368;
362 
363     /**
364      * SIP Response : 414
365      * Request-URI too large
366      */
367     public static final int CODE_SIP_REQUEST_URI_TOO_LARGE = 369;
368 
369     /**
370      * SIP Response : 421
371      * Specific extension is required, which is not present in the HEADER
372      */
373     public static final int CODE_SIP_EXTENSION_REQUIRED = 370;
374 
375     /**
376      * SIP Response : 422
377      * The session expiration field too small
378      */
379     public static final int CODE_SIP_INTERVAL_TOO_BRIEF = 371;
380 
381     /**
382      * SIP Response : 481
383      * Request received by the server does not match any dialog or transaction
384      */
385     public static final int CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST = 372;
386 
387     /**
388      * SIP Response : 482
389      * Server has detected a loop
390      */
391     public static final int CODE_SIP_LOOP_DETECTED = 373;
392 
393     /**
394      * SIP Response : 483
395      * Max-Forwards value reached
396      */
397     public static final int CODE_SIP_TOO_MANY_HOPS = 374;
398 
399     /**
400      * SIP Response : 485
401      * Request-URI is ambiguous
402      *
403      */
404     public static final int CODE_SIP_AMBIGUOUS = 376;
405 
406     /**
407      * SIP Response : 491
408      * Server has pending request for same dialog
409      */
410     public static final int CODE_SIP_REQUEST_PENDING = 377;
411 
412     /**
413      * SIP Response : 493
414      * The request cannot be decrypted by recipient
415      */
416     public static final int CODE_SIP_UNDECIPHERABLE = 378;
417 
418     /**
419      * MEDIA (IMS -> Telephony)
420      */
421     /**
422      * Media resource initialization failed
423      */
424     public static final int CODE_MEDIA_INIT_FAILED = 401;
425     /**
426      * RTP timeout (no audio / video traffic in the session)
427      */
428     public static final int CODE_MEDIA_NO_DATA = 402;
429     /**
430      * Media is not supported; so dropped the call
431      */
432     public static final int CODE_MEDIA_NOT_ACCEPTABLE = 403;
433     /**
434      * Unspecified media related error.
435      */
436     public static final int CODE_MEDIA_UNSPECIFIED = 404;
437 
438     /*
439      * USER
440      */
441     // Telephony -> IMS
442     /**
443      * User triggers the call to be terminated.
444      */
445     public static final int CODE_USER_TERMINATED = 501;
446     /**
447      * No action was taken while an incoming call was ringing.
448      */
449     public static final int CODE_USER_NOANSWER = 502;
450     /**
451      * User ignored an incoming call.
452      */
453     public static final int CODE_USER_IGNORE = 503;
454     /**
455      * User declined an incoming call.
456      */
457     public static final int CODE_USER_DECLINE = 504;
458     /**
459      * Device declined/ended a call due to a low battery condition.
460      */
461     public static final int CODE_LOW_BATTERY = 505;
462     /**
463      * Device declined a call due to a blacklisted caller ID.
464      */
465     public static final int CODE_BLACKLISTED_CALL_ID = 506;
466     // IMS -> Telephony
467     /**
468      * The call has been terminated by the network or remote user.
469      */
470     public static final int CODE_USER_TERMINATED_BY_REMOTE = 510;
471     /**
472     * Upgrade Downgrade request rejected by
473     * Remote user if the request is MO initiated
474     * Local user if the request is MT initiated
475     */
476     public static final int CODE_USER_REJECTED_SESSION_MODIFICATION = 511;
477 
478     /**
479     * Upgrade Downgrade request cancelled by the user who initiated it
480     */
481     public static final int CODE_USER_CANCELLED_SESSION_MODIFICATION = 512;
482 
483     /**
484      * UPGRADE DOWNGRADE operation failed
485      * This can happen due to failure from SIP/RTP/SDP generation or a Call end is
486      * triggered/received while Reinvite is in progress.
487      */
488     public static final int CODE_SESSION_MODIFICATION_FAILED = 1517;
489 
490     /*
491      * UT
492      */
493     /**
494      * UT is currently not supported on this device.
495      */
496     public static final int CODE_UT_NOT_SUPPORTED = 801;
497     /**
498      * UT services are currently not available on this device.
499      */
500     public static final int CODE_UT_SERVICE_UNAVAILABLE = 802;
501     /**
502      * The requested UT operation is not allowed.
503      */
504     public static final int CODE_UT_OPERATION_NOT_ALLOWED = 803;
505     /**
506      * The UT request resulted in a network error.
507      */
508     public static final int CODE_UT_NETWORK_ERROR = 804;
509     /**
510      * The password entered for UT operations does not match the stored password.
511      */
512     public static final int CODE_UT_CB_PASSWORD_MISMATCH = 821;
513     //STK CC errors
514     /**
515      * Sim Toolkit Call Control modified the UT operation to a dial command.
516      */
517     public static final int CODE_UT_SS_MODIFIED_TO_DIAL = 822;
518     /**
519      * Sim Toolkit Call Control modified the UT operation to a USSD command.
520      */
521     public static final int CODE_UT_SS_MODIFIED_TO_USSD = 823;
522     /**
523      * Sim Toolkit Call Control modified the UT operation to another supplementary service command.
524      */
525     public static final int CODE_UT_SS_MODIFIED_TO_SS = 824;
526     /**
527      * Sim Toolkit Call Control modified the UT operation to a video call dial command.
528      */
529     public static final int CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO = 825;
530 
531     /**@hide*/
532     @IntDef(value = {
533             CODE_UT_NOT_SUPPORTED,
534             CODE_UT_SERVICE_UNAVAILABLE,
535             CODE_UT_OPERATION_NOT_ALLOWED,
536             CODE_UT_NETWORK_ERROR,
537             CODE_UT_CB_PASSWORD_MISMATCH,
538             CODE_UT_SS_MODIFIED_TO_DIAL,
539             CODE_UT_SS_MODIFIED_TO_USSD,
540             CODE_UT_SS_MODIFIED_TO_SS,
541             CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO
542     }, prefix = "CODE_UT_")
543     @Retention(RetentionPolicy.SOURCE)
544     public @interface UtReason {}
545 
546     /**
547      * Emergency callback mode is not supported.
548      */
549     public static final int CODE_ECBM_NOT_SUPPORTED = 901;
550 
551     /**
552      * Fail code used to indicate that Multi-endpoint is not supported by the IMS framework.
553      */
554     public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902;
555 
556     /**
557      * IMS Registration error code
558      */
559     public static final int CODE_REGISTRATION_ERROR = 1000;
560 
561     /*
562      * CALL DROP error codes (Call could drop because of many reasons like Network not available,
563      *  handover, failed, etc)
564      */
565     /**
566      * MT call has ended due to a release from the network because the call was answered elsewhere.
567      */
568     public static final int CODE_ANSWERED_ELSEWHERE = 1014;
569 
570     /**
571      * For MultiEndpoint - Call Pull request has failed.
572      */
573     public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015;
574 
575     /**
576      * For MultiEndpoint - Call has been pulled from primary to secondary.
577      */
578     public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016;
579 
580     /**
581      * CALL DROP error code for the case when a device is ePDG capable and when the user is on an
582      * active wifi call and at the edge of coverage and there is no qualified LTE network available
583      * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error
584      * code is received as part of the handover message.
585      */
586     public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100;
587 
588     /**
589      * For MultiEndPoint - Call was rejected elsewhere
590      */
591     public static final int CODE_REJECTED_ELSEWHERE = 1017;
592 
593     /**
594      * Supplementary services (HOLD/RESUME) failure error codes.
595      * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision.
596      */
597 
598     /**
599      * Supplementary Services (HOLD/RESUME) - the command failed.
600      */
601     public static final int CODE_SUPP_SVC_FAILED = 1201;
602     /**
603      * Supplementary Services (HOLD/RESUME) - the command was cancelled.
604      */
605     public static final int CODE_SUPP_SVC_CANCELLED = 1202;
606     /**
607      * Supplementary Services (HOLD/RESUME) - the command resulted in a re-invite collision.
608      */
609     public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203;
610 
611     /**
612      * DPD Procedure received no response or send failed.
613      */
614     public static final int CODE_IWLAN_DPD_FAILURE = 1300;
615 
616     /**
617      * Establishment of the ePDG Tunnel Failed.
618      */
619     public static final int CODE_EPDG_TUNNEL_ESTABLISH_FAILURE = 1400;
620 
621     /**
622      * Re-keying of the ePDG Tunnel Failed; may not always result in teardown.
623      */
624     public static final int CODE_EPDG_TUNNEL_REKEY_FAILURE = 1401;
625 
626     /**
627      * Connection to the packet gateway is lost.
628      */
629     public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402;
630 
631     /**
632      * The maximum number of calls allowed has been reached.  Used in a multi-endpoint scenario
633      * where the number of calls across all connected devices has reached the maximum.
634      */
635     public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403;
636 
637     /**
638      * Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has
639      * declined the call.  Used in a multi-endpoint scenario where a remote device declined an
640      * incoming call.
641      */
642     public static final int CODE_REMOTE_CALL_DECLINE = 1404;
643 
644     /**
645      * Indicates the call was disconnected due to the user reaching their data limit.
646      */
647     public static final int CODE_DATA_LIMIT_REACHED = 1405;
648 
649     /**
650      * Indicates the call was disconnected due to the user disabling cellular data.
651      */
652     public static final int CODE_DATA_DISABLED = 1406;
653 
654     /**
655      * Indicates a call was disconnected due to loss of wifi signal.
656      */
657     public static final int CODE_WIFI_LOST = 1407;
658 
659     /**
660      * Indicates the registration attempt on IWLAN failed due to IKEv2 authetication failure
661      * during tunnel establishment.
662      */
663     public static final int CODE_IKEV2_AUTH_FAILURE = 1408;
664 
665     /** The call cannot be established because RADIO is OFF */
666     public static final int CODE_RADIO_OFF = 1500;
667 
668     /** The call cannot be established because of no valid SIM */
669     public static final int CODE_NO_VALID_SIM = 1501;
670 
671     /** The failure is due internal error at modem */
672     public static final int CODE_RADIO_INTERNAL_ERROR = 1502;
673 
674     /** The failure is due to UE timer expired while waiting for a response from network */
675     public static final int CODE_NETWORK_RESP_TIMEOUT = 1503;
676 
677     /** The failure is due to explicit reject from network */
678     public static final int CODE_NETWORK_REJECT = 1504;
679 
680     /** The failure is due to radio access failure. ex. RACH failure */
681     public static final int CODE_RADIO_ACCESS_FAILURE = 1505;
682 
683     /** Call/IMS registration failed/dropped because of a RLF */
684     public static final int CODE_RADIO_LINK_FAILURE = 1506;
685 
686     /** Call/IMS registration failed/dropped because of radio link lost */
687     public static final int CODE_RADIO_LINK_LOST = 1507;
688 
689     /** The call Call/IMS registration failed because of a radio uplink issue */
690     public static final int CODE_RADIO_UPLINK_FAILURE = 1508;
691 
692     /** Call failed because of a RRC connection setup failure */
693     public static final int CODE_RADIO_SETUP_FAILURE = 1509;
694 
695     /** Call failed/dropped because of RRC connection release from NW */
696     public static final int CODE_RADIO_RELEASE_NORMAL = 1510;
697 
698     /** Call failed/dropped because of RRC abnormally released by modem/network */
699     public static final int CODE_RADIO_RELEASE_ABNORMAL = 1511;
700 
701     /** Call failed because of access class barring */
702     public static final int CODE_ACCESS_CLASS_BLOCKED = 1512;
703 
704     /** Call/IMS registration is failed/dropped because of a network detach */
705     public static final int CODE_NETWORK_DETACH = 1513;
706 
707     /**
708      * Call failed due to SIP code 380 (Alternative Service response) while dialing an "undetected
709      * emergency number".  This scenario is important in some regions where the carrier network will
710      * identify other non-emergency help numbers (e.g. mountain rescue) when attempting to dial.
711      */
712     public static final int CODE_SIP_ALTERNATE_EMERGENCY_CALL = 1514;
713 
714     /**
715      * Call failed because of unobtainable number
716      * @hide
717      */
718     public static final int CODE_UNOBTAINABLE_NUMBER = 1515;
719 
720     /**
721      * Call failed because WiFi call could not complete and circuit switch silent redial
722      * is not allowed while roaming on another network.
723      */
724     public static final int CODE_NO_CSFB_IN_CS_ROAM = 1516;
725 
726     /**
727      * The rejection cause is not known.
728      * <p>
729      * Used with implicit call rejection.
730      */
731     public static final int CODE_REJECT_UNKNOWN = 1600;
732 
733     /**
734      * Ongoing call, and call waiting is disabled.
735      * <p>
736      * Used with implicit call rejection.
737      */
738     public static final int CODE_REJECT_ONGOING_CALL_WAITING_DISABLED = 1601;
739 
740     /**
741      * A call is ongoing on another sub.
742      * <p>
743      * Used with implicit call rejection.
744      */
745     public static final int CODE_REJECT_CALL_ON_OTHER_SUB = 1602;
746 
747     /**
748      * CDMA call collision.
749      * <p>
750      * Used with implicit call rejection.
751      */
752     public static final int CODE_REJECT_1X_COLLISION = 1603;
753 
754     /**
755      * IMS is not registered for service yet.
756      * <p>
757      * Used with implicit call rejection.
758      */
759     public static final int CODE_REJECT_SERVICE_NOT_REGISTERED = 1604;
760 
761     /**
762      * The call type is not allowed on the current RAT.
763      * <p>
764      * Used with implicit call rejection.
765      */
766     public static final int CODE_REJECT_CALL_TYPE_NOT_ALLOWED = 1605;
767 
768     /**
769      * And emergency call is ongoing.
770      * <p>
771      * Used with implicit call rejection.
772      */
773     public static final int CODE_REJECT_ONGOING_E911_CALL = 1606;
774 
775     /**
776      * Another call is in the process of being establilshed.
777      * <p>
778      * Used with implicit call rejection.
779      */
780     public static final int CODE_REJECT_ONGOING_CALL_SETUP = 1607;
781 
782     /**
783      * Maximum number of allowed calls are already in progress.
784      * <p>
785      * Used with implicit call rejection.
786      */
787     public static final int CODE_REJECT_MAX_CALL_LIMIT_REACHED = 1608;
788 
789     /**
790      * Invalid/unsupported SIP headers received.
791      * <p>
792      * Used with implicit call rejection.
793      */
794     public static final int CODE_REJECT_UNSUPPORTED_SIP_HEADERS = 1609;
795 
796     /**
797      * Invalid/unsupported SDP headers received.
798      * <p>
799      * Used with implicit call rejection.
800      */
801     public static final int CODE_REJECT_UNSUPPORTED_SDP_HEADERS = 1610;
802 
803     /**
804      * A call transfer is in progress.
805      * <p>
806      * Used with implicit call rejection.
807      */
808     public static final int CODE_REJECT_ONGOING_CALL_TRANSFER = 1611;
809 
810     /**
811      * An internal error occured while processing the call.
812      * <p>
813      * Used with implicit call rejection.
814      */
815     public static final int CODE_REJECT_INTERNAL_ERROR = 1612;
816 
817     /**
818      * Call failure due to lack of dedicated bearer.
819      * <p>
820      * Used with implicit call rejection.
821      */
822     public static final int CODE_REJECT_QOS_FAILURE = 1613;
823 
824     /**
825      * A call handover is in progress.
826      * <p>
827      * Used with implicit call rejection.
828      */
829     public static final int CODE_REJECT_ONGOING_HANDOVER = 1614;
830 
831     /**
832      * Video calling not supported with TTY.
833      * <p>
834      * Used with implicit call rejection.
835      */
836     public static final int CODE_REJECT_VT_TTY_NOT_ALLOWED = 1615;
837 
838     /**
839      * A call upgrade is in progress.
840      * <p>
841      * Used with implicit call rejection.
842      */
843     public static final int CODE_REJECT_ONGOING_CALL_UPGRADE = 1616;
844 
845     /**
846      * Call from conference server, when TTY mode is ON.
847      * <p>
848      * Used with implicit call rejection.
849      */
850     public static final int CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED = 1617;
851 
852     /**
853      * A conference call is ongoing.
854      * <p>
855      * Used with implicit call rejection.
856      */
857     public static final int CODE_REJECT_ONGOING_CONFERENCE_CALL = 1618;
858 
859     /**
860      * A video call with AVPF is not supported.
861      * <p>
862      * Used with implicit call rejection.
863      */
864     public static final int CODE_REJECT_VT_AVPF_NOT_ALLOWED = 1619;
865 
866     /**
867      * And encrypted call is ongoing; other calls not supported.
868      * <p>
869      * Used with implicit call rejection.
870      */
871     public static final int CODE_REJECT_ONGOING_ENCRYPTED_CALL = 1620;
872 
873     /**
874      * A CS call is ongoing.
875      * <p>
876      * Used with implicit call rejection.
877      */
878     public static final int CODE_REJECT_ONGOING_CS_CALL = 1621;
879 
880     /**
881      * An attempt was made to place an emergency call over WFC when emergency services is not
882      * currently available in the current location.
883      * @hide
884      */
885     public static final int CODE_EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE = 1622;
886 
887     /**
888      * Indicates that WiFi calling service is not available in the current location.
889      * @hide
890      */
891     public static final int CODE_WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION = 1623;
892 
893     /**
894      * The dialed RTT call should be retried without RTT
895      * @hide
896      */
897     public static final int CODE_RETRY_ON_IMS_WITHOUT_RTT = 3001;
898 
899     /*
900      * OEM specific error codes. To be used by OEMs when they don't want to reveal error code which
901      * would be replaced by ERROR_UNSPECIFIED.
902      */
903     public static final int CODE_OEM_CAUSE_1 = 0xf001;
904     public static final int CODE_OEM_CAUSE_2 = 0xf002;
905     public static final int CODE_OEM_CAUSE_3 = 0xf003;
906     public static final int CODE_OEM_CAUSE_4 = 0xf004;
907     public static final int CODE_OEM_CAUSE_5 = 0xf005;
908     public static final int CODE_OEM_CAUSE_6 = 0xf006;
909     public static final int CODE_OEM_CAUSE_7 = 0xf007;
910     public static final int CODE_OEM_CAUSE_8 = 0xf008;
911     public static final int CODE_OEM_CAUSE_9 = 0xf009;
912     public static final int CODE_OEM_CAUSE_10 = 0xf00a;
913     public static final int CODE_OEM_CAUSE_11 = 0xf00b;
914     public static final int CODE_OEM_CAUSE_12 = 0xf00c;
915     public static final int CODE_OEM_CAUSE_13 = 0xf00d;
916     public static final int CODE_OEM_CAUSE_14 = 0xf00e;
917     public static final int CODE_OEM_CAUSE_15 = 0xf00f;
918 
919     /**
920      * @hide
921      */
922     @IntDef(value = {
923             CODE_UNSPECIFIED,
924             CODE_LOCAL_ILLEGAL_ARGUMENT,
925             CODE_LOCAL_ILLEGAL_STATE,
926             CODE_LOCAL_INTERNAL_ERROR,
927             CODE_LOCAL_IMS_SERVICE_DOWN,
928             CODE_LOCAL_NO_PENDING_CALL,
929             CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE,
930             CODE_LOCAL_POWER_OFF,
931             CODE_LOCAL_LOW_BATTERY,
932             CODE_LOCAL_NETWORK_NO_SERVICE,
933             CODE_LOCAL_NETWORK_NO_LTE_COVERAGE,
934             CODE_LOCAL_NETWORK_ROAMING,
935             CODE_LOCAL_NETWORK_IP_CHANGED,
936             CODE_LOCAL_SERVICE_UNAVAILABLE,
937             CODE_LOCAL_NOT_REGISTERED,
938             CODE_LOCAL_CALL_EXCEEDED,
939             CODE_LOCAL_CALL_BUSY,
940             CODE_LOCAL_CALL_DECLINE,
941             CODE_LOCAL_CALL_VCC_ON_PROGRESSING,
942             CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED,
943             CODE_LOCAL_CALL_CS_RETRY_REQUIRED,
944             CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED,
945             CODE_LOCAL_CALL_TERMINATED,
946             CODE_LOCAL_HO_NOT_FEASIBLE,
947             CODE_TIMEOUT_1XX_WAITING,
948             CODE_TIMEOUT_NO_ANSWER,
949             CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE,
950             CODE_CALL_BARRED,
951             CODE_FDN_BLOCKED,
952             CODE_IMEI_NOT_ACCEPTED,
953             CODE_DIAL_MODIFIED_TO_USSD,
954             CODE_DIAL_MODIFIED_TO_SS,
955             CODE_DIAL_MODIFIED_TO_DIAL,
956             CODE_DIAL_MODIFIED_TO_DIAL_VIDEO,
957             CODE_DIAL_VIDEO_MODIFIED_TO_DIAL,
958             CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO,
959             CODE_DIAL_VIDEO_MODIFIED_TO_SS,
960             CODE_DIAL_VIDEO_MODIFIED_TO_USSD,
961             CODE_SIP_REDIRECTED,
962             CODE_SIP_BAD_REQUEST,
963             CODE_SIP_FORBIDDEN,
964             CODE_SIP_NOT_FOUND,
965             CODE_SIP_NOT_SUPPORTED,
966             CODE_SIP_REQUEST_TIMEOUT,
967             CODE_SIP_TEMPRARILY_UNAVAILABLE,
968             CODE_SIP_BAD_ADDRESS,
969             CODE_SIP_BUSY,
970             CODE_SIP_REQUEST_CANCELLED,
971             CODE_SIP_NOT_ACCEPTABLE,
972             CODE_SIP_NOT_REACHABLE,
973             CODE_SIP_CLIENT_ERROR,
974             CODE_SIP_TRANSACTION_DOES_NOT_EXIST,
975             CODE_SIP_SERVER_INTERNAL_ERROR,
976             CODE_SIP_SERVICE_UNAVAILABLE,
977             CODE_SIP_SERVER_TIMEOUT,
978             CODE_SIP_SERVER_ERROR,
979             CODE_SIP_USER_REJECTED,
980             CODE_SIP_GLOBAL_ERROR,
981             CODE_EMERGENCY_TEMP_FAILURE,
982             CODE_EMERGENCY_PERM_FAILURE,
983             CODE_SIP_USER_MARKED_UNWANTED,
984             CODE_SIP_METHOD_NOT_ALLOWED,
985             CODE_SIP_PROXY_AUTHENTICATION_REQUIRED,
986             CODE_SIP_REQUEST_ENTITY_TOO_LARGE,
987             CODE_SIP_REQUEST_URI_TOO_LARGE,
988             CODE_SIP_EXTENSION_REQUIRED,
989             CODE_SIP_INTERVAL_TOO_BRIEF,
990             CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST,
991             CODE_SIP_LOOP_DETECTED,
992             CODE_SIP_TOO_MANY_HOPS,
993             CODE_SIP_AMBIGUOUS,
994             CODE_SIP_REQUEST_PENDING,
995             CODE_SIP_UNDECIPHERABLE,
996             CODE_MEDIA_INIT_FAILED,
997             CODE_MEDIA_NO_DATA,
998             CODE_MEDIA_NOT_ACCEPTABLE,
999             CODE_MEDIA_UNSPECIFIED,
1000             CODE_USER_TERMINATED,
1001             CODE_USER_NOANSWER,
1002             CODE_USER_IGNORE,
1003             CODE_USER_DECLINE,
1004             CODE_LOW_BATTERY,
1005             CODE_BLACKLISTED_CALL_ID,
1006             CODE_USER_TERMINATED_BY_REMOTE,
1007             CODE_USER_REJECTED_SESSION_MODIFICATION,
1008             CODE_USER_CANCELLED_SESSION_MODIFICATION,
1009             CODE_SESSION_MODIFICATION_FAILED,
1010             CODE_UT_NOT_SUPPORTED,
1011             CODE_UT_SERVICE_UNAVAILABLE,
1012             CODE_UT_OPERATION_NOT_ALLOWED,
1013             CODE_UT_NETWORK_ERROR,
1014             CODE_UT_CB_PASSWORD_MISMATCH,
1015             CODE_UT_SS_MODIFIED_TO_DIAL,
1016             CODE_UT_SS_MODIFIED_TO_USSD,
1017             CODE_UT_SS_MODIFIED_TO_SS,
1018             CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO,
1019             CODE_ECBM_NOT_SUPPORTED,
1020             CODE_MULTIENDPOINT_NOT_SUPPORTED,
1021             CODE_REGISTRATION_ERROR,
1022             CODE_ANSWERED_ELSEWHERE,
1023             CODE_CALL_PULL_OUT_OF_SYNC,
1024             CODE_CALL_END_CAUSE_CALL_PULL,
1025             CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE,
1026             CODE_REJECTED_ELSEWHERE,
1027             CODE_SUPP_SVC_FAILED,
1028             CODE_SUPP_SVC_CANCELLED,
1029             CODE_SUPP_SVC_REINVITE_COLLISION,
1030             CODE_IWLAN_DPD_FAILURE,
1031             CODE_EPDG_TUNNEL_ESTABLISH_FAILURE,
1032             CODE_EPDG_TUNNEL_REKEY_FAILURE,
1033             CODE_EPDG_TUNNEL_LOST_CONNECTION,
1034             CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED,
1035             CODE_REMOTE_CALL_DECLINE,
1036             CODE_DATA_LIMIT_REACHED,
1037             CODE_DATA_DISABLED,
1038             CODE_WIFI_LOST,
1039             CODE_IKEV2_AUTH_FAILURE,
1040             CODE_RADIO_OFF,
1041             CODE_NO_VALID_SIM,
1042             CODE_RADIO_INTERNAL_ERROR,
1043             CODE_NETWORK_RESP_TIMEOUT,
1044             CODE_NETWORK_REJECT,
1045             CODE_RADIO_ACCESS_FAILURE,
1046             CODE_RADIO_LINK_FAILURE,
1047             CODE_RADIO_LINK_LOST,
1048             CODE_RADIO_UPLINK_FAILURE,
1049             CODE_RADIO_SETUP_FAILURE,
1050             CODE_RADIO_RELEASE_NORMAL,
1051             CODE_RADIO_RELEASE_ABNORMAL,
1052             CODE_ACCESS_CLASS_BLOCKED,
1053             CODE_NETWORK_DETACH,
1054             CODE_SIP_ALTERNATE_EMERGENCY_CALL,
1055             CODE_UNOBTAINABLE_NUMBER,
1056             CODE_NO_CSFB_IN_CS_ROAM,
1057             CODE_REJECT_UNKNOWN,
1058             CODE_REJECT_ONGOING_CALL_WAITING_DISABLED,
1059             CODE_REJECT_CALL_ON_OTHER_SUB,
1060             CODE_REJECT_1X_COLLISION,
1061             CODE_REJECT_SERVICE_NOT_REGISTERED,
1062             CODE_REJECT_CALL_TYPE_NOT_ALLOWED,
1063             CODE_REJECT_ONGOING_E911_CALL,
1064             CODE_REJECT_ONGOING_CALL_SETUP,
1065             CODE_REJECT_MAX_CALL_LIMIT_REACHED,
1066             CODE_REJECT_UNSUPPORTED_SIP_HEADERS,
1067             CODE_REJECT_UNSUPPORTED_SDP_HEADERS,
1068             CODE_REJECT_ONGOING_CALL_TRANSFER,
1069             CODE_REJECT_INTERNAL_ERROR,
1070             CODE_REJECT_QOS_FAILURE,
1071             CODE_REJECT_ONGOING_HANDOVER,
1072             CODE_REJECT_VT_TTY_NOT_ALLOWED,
1073             CODE_REJECT_ONGOING_CALL_UPGRADE,
1074             CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED,
1075             CODE_REJECT_ONGOING_CONFERENCE_CALL,
1076             CODE_REJECT_VT_AVPF_NOT_ALLOWED,
1077             CODE_REJECT_ONGOING_ENCRYPTED_CALL,
1078             CODE_REJECT_ONGOING_CS_CALL,
1079             CODE_RETRY_ON_IMS_WITHOUT_RTT,
1080             CODE_OEM_CAUSE_1,
1081             CODE_OEM_CAUSE_2,
1082             CODE_OEM_CAUSE_3,
1083             CODE_OEM_CAUSE_4,
1084             CODE_OEM_CAUSE_5,
1085             CODE_OEM_CAUSE_6,
1086             CODE_OEM_CAUSE_7,
1087             CODE_OEM_CAUSE_8,
1088             CODE_OEM_CAUSE_9,
1089             CODE_OEM_CAUSE_10,
1090             CODE_OEM_CAUSE_11,
1091             CODE_OEM_CAUSE_12,
1092             CODE_OEM_CAUSE_13,
1093             CODE_OEM_CAUSE_14,
1094             CODE_OEM_CAUSE_15
1095     }, prefix = "CODE_")
1096     @Retention(RetentionPolicy.SOURCE)
1097     public @interface ImsCode {}
1098 
1099 
1100     private static final Map<Integer, String>   sImsCodeMap;
1101     static {
1102         sImsCodeMap = new HashMap<>();
sImsCodeMap.put(CODE_UNSPECIFIED, "CODE_UNSPECIFIED")1103         sImsCodeMap.put(CODE_UNSPECIFIED, "CODE_UNSPECIFIED");
sImsCodeMap.put(CODE_LOCAL_ILLEGAL_ARGUMENT, "CODE_LOCAL_ILLEGAL_ARGUMENT")1104         sImsCodeMap.put(CODE_LOCAL_ILLEGAL_ARGUMENT, "CODE_LOCAL_ILLEGAL_ARGUMENT");
sImsCodeMap.put(CODE_LOCAL_ILLEGAL_STATE, "CODE_LOCAL_ILLEGAL_STATE")1105         sImsCodeMap.put(CODE_LOCAL_ILLEGAL_STATE, "CODE_LOCAL_ILLEGAL_STATE");
sImsCodeMap.put(CODE_LOCAL_INTERNAL_ERROR, "CODE_LOCAL_INTERNAL_ERROR")1106         sImsCodeMap.put(CODE_LOCAL_INTERNAL_ERROR, "CODE_LOCAL_INTERNAL_ERROR");
sImsCodeMap.put(CODE_LOCAL_IMS_SERVICE_DOWN, "CODE_LOCAL_IMS_SERVICE_DOWN")1107         sImsCodeMap.put(CODE_LOCAL_IMS_SERVICE_DOWN, "CODE_LOCAL_IMS_SERVICE_DOWN");
sImsCodeMap.put(CODE_LOCAL_NO_PENDING_CALL, "CODE_LOCAL_NO_PENDING_CALL")1108         sImsCodeMap.put(CODE_LOCAL_NO_PENDING_CALL, "CODE_LOCAL_NO_PENDING_CALL");
sImsCodeMap.put(CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE, "CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE")1109         sImsCodeMap.put(CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE,
1110                 "CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE");
sImsCodeMap.put(CODE_LOCAL_POWER_OFF, "CODE_LOCAL_POWER_OFF")1111         sImsCodeMap.put(CODE_LOCAL_POWER_OFF, "CODE_LOCAL_POWER_OFF");
sImsCodeMap.put(CODE_LOCAL_LOW_BATTERY, "CODE_LOCAL_LOW_BATTERY")1112         sImsCodeMap.put(CODE_LOCAL_LOW_BATTERY, "CODE_LOCAL_LOW_BATTERY");
sImsCodeMap.put(CODE_LOCAL_NETWORK_NO_SERVICE, "CODE_LOCAL_NETWORK_NO_SERVICE")1113         sImsCodeMap.put(CODE_LOCAL_NETWORK_NO_SERVICE, "CODE_LOCAL_NETWORK_NO_SERVICE");
sImsCodeMap.put(CODE_LOCAL_NETWORK_NO_LTE_COVERAGE, "CODE_LOCAL_NETWORK_NO_LTE_COVERAGE")1114         sImsCodeMap.put(CODE_LOCAL_NETWORK_NO_LTE_COVERAGE, "CODE_LOCAL_NETWORK_NO_LTE_COVERAGE");
sImsCodeMap.put(CODE_LOCAL_NETWORK_ROAMING, "CODE_LOCAL_NETWORK_ROAMING")1115         sImsCodeMap.put(CODE_LOCAL_NETWORK_ROAMING, "CODE_LOCAL_NETWORK_ROAMING");
sImsCodeMap.put(CODE_LOCAL_NETWORK_IP_CHANGED, "CODE_LOCAL_NETWORK_IP_CHANGED")1116         sImsCodeMap.put(CODE_LOCAL_NETWORK_IP_CHANGED, "CODE_LOCAL_NETWORK_IP_CHANGED");
sImsCodeMap.put(CODE_LOCAL_SERVICE_UNAVAILABLE, "CODE_LOCAL_SERVICE_UNAVAILABLE")1117         sImsCodeMap.put(CODE_LOCAL_SERVICE_UNAVAILABLE, "CODE_LOCAL_SERVICE_UNAVAILABLE");
sImsCodeMap.put(CODE_LOCAL_NOT_REGISTERED, "CODE_LOCAL_NOT_REGISTERED")1118         sImsCodeMap.put(CODE_LOCAL_NOT_REGISTERED, "CODE_LOCAL_NOT_REGISTERED");
sImsCodeMap.put(CODE_LOCAL_CALL_EXCEEDED, "CODE_LOCAL_CALL_EXCEEDED")1119         sImsCodeMap.put(CODE_LOCAL_CALL_EXCEEDED, "CODE_LOCAL_CALL_EXCEEDED");
sImsCodeMap.put(CODE_LOCAL_CALL_BUSY, "CODE_LOCAL_CALL_BUSY")1120         sImsCodeMap.put(CODE_LOCAL_CALL_BUSY, "CODE_LOCAL_CALL_BUSY");
sImsCodeMap.put(CODE_LOCAL_CALL_DECLINE, "CODE_LOCAL_CALL_DECLINE")1121         sImsCodeMap.put(CODE_LOCAL_CALL_DECLINE, "CODE_LOCAL_CALL_DECLINE");
sImsCodeMap.put(CODE_LOCAL_CALL_VCC_ON_PROGRESSING, "CODE_LOCAL_CALL_VCC_ON_PROGRESSING")1122         sImsCodeMap.put(CODE_LOCAL_CALL_VCC_ON_PROGRESSING, "CODE_LOCAL_CALL_VCC_ON_PROGRESSING");
sImsCodeMap.put(CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED, "CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED")1123         sImsCodeMap.put(CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED,
1124                 "CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED");
sImsCodeMap.put(CODE_LOCAL_CALL_CS_RETRY_REQUIRED, "CODE_LOCAL_CALL_CS_RETRY_REQUIRED")1125         sImsCodeMap.put(CODE_LOCAL_CALL_CS_RETRY_REQUIRED, "CODE_LOCAL_CALL_CS_RETRY_REQUIRED");
sImsCodeMap.put(CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED, "CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED")1126         sImsCodeMap.put(CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED,
1127                 "CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED");
sImsCodeMap.put(CODE_LOCAL_CALL_TERMINATED, "CODE_LOCAL_CALL_TERMINATED")1128         sImsCodeMap.put(CODE_LOCAL_CALL_TERMINATED, "CODE_LOCAL_CALL_TERMINATED");
sImsCodeMap.put(CODE_LOCAL_HO_NOT_FEASIBLE, "CODE_LOCAL_HO_NOT_FEASIBLE")1129         sImsCodeMap.put(CODE_LOCAL_HO_NOT_FEASIBLE, "CODE_LOCAL_HO_NOT_FEASIBLE");
sImsCodeMap.put(CODE_TIMEOUT_1XX_WAITING, "CODE_TIMEOUT_1XX_WAITING")1130         sImsCodeMap.put(CODE_TIMEOUT_1XX_WAITING, "CODE_TIMEOUT_1XX_WAITING");
sImsCodeMap.put(CODE_TIMEOUT_NO_ANSWER, "CODE_TIMEOUT_NO_ANSWER")1131         sImsCodeMap.put(CODE_TIMEOUT_NO_ANSWER, "CODE_TIMEOUT_NO_ANSWER");
sImsCodeMap.put(CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE, "CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE")1132         sImsCodeMap.put(CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE, "CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE");
sImsCodeMap.put(CODE_CALL_BARRED, "CODE_CALL_BARRED")1133         sImsCodeMap.put(CODE_CALL_BARRED, "CODE_CALL_BARRED");
sImsCodeMap.put(CODE_FDN_BLOCKED, "CODE_FDN_BLOCKED")1134         sImsCodeMap.put(CODE_FDN_BLOCKED, "CODE_FDN_BLOCKED");
sImsCodeMap.put(CODE_IMEI_NOT_ACCEPTED, "CODE_IMEI_NOT_ACCEPTED")1135         sImsCodeMap.put(CODE_IMEI_NOT_ACCEPTED, "CODE_IMEI_NOT_ACCEPTED");
sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_USSD, "CODE_DIAL_MODIFIED_TO_USSD")1136         sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_USSD, "CODE_DIAL_MODIFIED_TO_USSD");
sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_SS, "CODE_DIAL_MODIFIED_TO_SS")1137         sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_SS, "CODE_DIAL_MODIFIED_TO_SS");
sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_DIAL, "CODE_DIAL_MODIFIED_TO_DIAL")1138         sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_DIAL, "CODE_DIAL_MODIFIED_TO_DIAL");
sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_DIAL_VIDEO, "CODE_DIAL_MODIFIED_TO_DIAL_VIDEO")1139         sImsCodeMap.put(CODE_DIAL_MODIFIED_TO_DIAL_VIDEO, "CODE_DIAL_MODIFIED_TO_DIAL_VIDEO");
sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_DIAL, "CODE_DIAL_VIDEO_MODIFIED_TO_DIAL")1140         sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_DIAL, "CODE_DIAL_VIDEO_MODIFIED_TO_DIAL");
sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO, "CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO")1141         sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO,
1142                 "CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO");
sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_SS, "CODE_DIAL_VIDEO_MODIFIED_TO_SS")1143         sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_SS, "CODE_DIAL_VIDEO_MODIFIED_TO_SS");
sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_USSD, "CODE_DIAL_VIDEO_MODIFIED_TO_USSD")1144         sImsCodeMap.put(CODE_DIAL_VIDEO_MODIFIED_TO_USSD, "CODE_DIAL_VIDEO_MODIFIED_TO_USSD");
sImsCodeMap.put(CODE_SIP_REDIRECTED, "CODE_SIP_REDIRECTED")1145         sImsCodeMap.put(CODE_SIP_REDIRECTED, "CODE_SIP_REDIRECTED");
sImsCodeMap.put(CODE_SIP_BAD_REQUEST, "CODE_SIP_BAD_REQUEST")1146         sImsCodeMap.put(CODE_SIP_BAD_REQUEST, "CODE_SIP_BAD_REQUEST");
sImsCodeMap.put(CODE_SIP_FORBIDDEN, "CODE_SIP_FORBIDDEN")1147         sImsCodeMap.put(CODE_SIP_FORBIDDEN, "CODE_SIP_FORBIDDEN");
sImsCodeMap.put(CODE_SIP_NOT_FOUND, "CODE_SIP_NOT_FOUND")1148         sImsCodeMap.put(CODE_SIP_NOT_FOUND, "CODE_SIP_NOT_FOUND");
sImsCodeMap.put(CODE_SIP_NOT_SUPPORTED, "CODE_SIP_NOT_SUPPORTED")1149         sImsCodeMap.put(CODE_SIP_NOT_SUPPORTED, "CODE_SIP_NOT_SUPPORTED");
sImsCodeMap.put(CODE_SIP_REQUEST_TIMEOUT, "CODE_SIP_REQUEST_TIMEOUT")1150         sImsCodeMap.put(CODE_SIP_REQUEST_TIMEOUT, "CODE_SIP_REQUEST_TIMEOUT");
sImsCodeMap.put(CODE_SIP_TEMPRARILY_UNAVAILABLE, "CODE_SIP_TEMPRARILY_UNAVAILABLE")1151         sImsCodeMap.put(CODE_SIP_TEMPRARILY_UNAVAILABLE, "CODE_SIP_TEMPRARILY_UNAVAILABLE");
sImsCodeMap.put(CODE_SIP_BAD_ADDRESS, "CODE_SIP_BAD_ADDRESS")1152         sImsCodeMap.put(CODE_SIP_BAD_ADDRESS, "CODE_SIP_BAD_ADDRESS");
sImsCodeMap.put(CODE_SIP_BUSY, "CODE_SIP_BUSY")1153         sImsCodeMap.put(CODE_SIP_BUSY, "CODE_SIP_BUSY");
sImsCodeMap.put(CODE_SIP_REQUEST_CANCELLED, "CODE_SIP_REQUEST_CANCELLED")1154         sImsCodeMap.put(CODE_SIP_REQUEST_CANCELLED, "CODE_SIP_REQUEST_CANCELLED");
sImsCodeMap.put(CODE_SIP_NOT_ACCEPTABLE, "CODE_SIP_NOT_ACCEPTABLE")1155         sImsCodeMap.put(CODE_SIP_NOT_ACCEPTABLE, "CODE_SIP_NOT_ACCEPTABLE");
sImsCodeMap.put(CODE_SIP_NOT_REACHABLE, "CODE_SIP_NOT_REACHABLE")1156         sImsCodeMap.put(CODE_SIP_NOT_REACHABLE, "CODE_SIP_NOT_REACHABLE");
sImsCodeMap.put(CODE_SIP_CLIENT_ERROR, "CODE_SIP_CLIENT_ERROR")1157         sImsCodeMap.put(CODE_SIP_CLIENT_ERROR, "CODE_SIP_CLIENT_ERROR");
sImsCodeMap.put(CODE_SIP_TRANSACTION_DOES_NOT_EXIST, "CODE_SIP_TRANSACTION_DOES_NOT_EXIST")1158         sImsCodeMap.put(CODE_SIP_TRANSACTION_DOES_NOT_EXIST, "CODE_SIP_TRANSACTION_DOES_NOT_EXIST");
sImsCodeMap.put(CODE_SIP_SERVER_INTERNAL_ERROR, "CODE_SIP_SERVER_INTERNAL_ERROR")1159         sImsCodeMap.put(CODE_SIP_SERVER_INTERNAL_ERROR, "CODE_SIP_SERVER_INTERNAL_ERROR");
sImsCodeMap.put(CODE_SIP_SERVICE_UNAVAILABLE, "CODE_SIP_SERVICE_UNAVAILABLE")1160         sImsCodeMap.put(CODE_SIP_SERVICE_UNAVAILABLE, "CODE_SIP_SERVICE_UNAVAILABLE");
sImsCodeMap.put(CODE_SIP_SERVER_TIMEOUT, "CODE_SIP_SERVER_TIMEOUT")1161         sImsCodeMap.put(CODE_SIP_SERVER_TIMEOUT, "CODE_SIP_SERVER_TIMEOUT");
sImsCodeMap.put(CODE_SIP_SERVER_ERROR, "CODE_SIP_SERVER_ERROR")1162         sImsCodeMap.put(CODE_SIP_SERVER_ERROR, "CODE_SIP_SERVER_ERROR");
sImsCodeMap.put(CODE_SIP_USER_REJECTED, "CODE_SIP_USER_REJECTED")1163         sImsCodeMap.put(CODE_SIP_USER_REJECTED, "CODE_SIP_USER_REJECTED");
sImsCodeMap.put(CODE_SIP_GLOBAL_ERROR, "CODE_SIP_GLOBAL_ERROR")1164         sImsCodeMap.put(CODE_SIP_GLOBAL_ERROR, "CODE_SIP_GLOBAL_ERROR");
sImsCodeMap.put(CODE_EMERGENCY_TEMP_FAILURE, "CODE_EMERGENCY_TEMP_FAILURE")1165         sImsCodeMap.put(CODE_EMERGENCY_TEMP_FAILURE, "CODE_EMERGENCY_TEMP_FAILURE");
sImsCodeMap.put(CODE_EMERGENCY_PERM_FAILURE, "CODE_EMERGENCY_PERM_FAILURE")1166         sImsCodeMap.put(CODE_EMERGENCY_PERM_FAILURE, "CODE_EMERGENCY_PERM_FAILURE");
sImsCodeMap.put(CODE_SIP_USER_MARKED_UNWANTED, "CODE_SIP_USER_MARKED_UNWANTED")1167         sImsCodeMap.put(CODE_SIP_USER_MARKED_UNWANTED, "CODE_SIP_USER_MARKED_UNWANTED");
sImsCodeMap.put(CODE_SIP_METHOD_NOT_ALLOWED, "CODE_SIP_METHOD_NOT_ALLOWED")1168         sImsCodeMap.put(CODE_SIP_METHOD_NOT_ALLOWED, "CODE_SIP_METHOD_NOT_ALLOWED");
sImsCodeMap.put(CODE_SIP_PROXY_AUTHENTICATION_REQUIRED, "CODE_SIP_PROXY_AUTHENTICATION_REQUIRED")1169         sImsCodeMap.put(CODE_SIP_PROXY_AUTHENTICATION_REQUIRED,
1170                 "CODE_SIP_PROXY_AUTHENTICATION_REQUIRED");
sImsCodeMap.put(CODE_SIP_REQUEST_ENTITY_TOO_LARGE, "CODE_SIP_REQUEST_ENTITY_TOO_LARGE")1171         sImsCodeMap.put(CODE_SIP_REQUEST_ENTITY_TOO_LARGE, "CODE_SIP_REQUEST_ENTITY_TOO_LARGE");
sImsCodeMap.put(CODE_SIP_REQUEST_URI_TOO_LARGE, "CODE_SIP_REQUEST_URI_TOO_LARGE")1172         sImsCodeMap.put(CODE_SIP_REQUEST_URI_TOO_LARGE, "CODE_SIP_REQUEST_URI_TOO_LARGE");
sImsCodeMap.put(CODE_SIP_EXTENSION_REQUIRED, "CODE_SIP_EXTENSION_REQUIRED")1173         sImsCodeMap.put(CODE_SIP_EXTENSION_REQUIRED, "CODE_SIP_EXTENSION_REQUIRED");
sImsCodeMap.put(CODE_SIP_INTERVAL_TOO_BRIEF, "CODE_SIP_INTERVAL_TOO_BRIEF")1174         sImsCodeMap.put(CODE_SIP_INTERVAL_TOO_BRIEF, "CODE_SIP_INTERVAL_TOO_BRIEF");
sImsCodeMap.put(CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST, "CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST")1175         sImsCodeMap.put(CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST,
1176                 "CODE_SIP_CALL_OR_TRANS_DOES_NOT_EXIST");
sImsCodeMap.put(CODE_SIP_LOOP_DETECTED, "CODE_SIP_LOOP_DETECTED")1177         sImsCodeMap.put(CODE_SIP_LOOP_DETECTED, "CODE_SIP_LOOP_DETECTED");
sImsCodeMap.put(CODE_SIP_TOO_MANY_HOPS, "CODE_SIP_TOO_MANY_HOPS")1178         sImsCodeMap.put(CODE_SIP_TOO_MANY_HOPS, "CODE_SIP_TOO_MANY_HOPS");
sImsCodeMap.put(CODE_SIP_AMBIGUOUS, "CODE_SIP_AMBIGUOUS")1179         sImsCodeMap.put(CODE_SIP_AMBIGUOUS, "CODE_SIP_AMBIGUOUS");
sImsCodeMap.put(CODE_SIP_REQUEST_PENDING, "CODE_SIP_REQUEST_PENDING")1180         sImsCodeMap.put(CODE_SIP_REQUEST_PENDING, "CODE_SIP_REQUEST_PENDING");
sImsCodeMap.put(CODE_SIP_UNDECIPHERABLE, "CODE_SIP_UNDECIPHERABLE")1181         sImsCodeMap.put(CODE_SIP_UNDECIPHERABLE, "CODE_SIP_UNDECIPHERABLE");
sImsCodeMap.put(CODE_MEDIA_INIT_FAILED, "CODE_MEDIA_INIT_FAILED")1182         sImsCodeMap.put(CODE_MEDIA_INIT_FAILED, "CODE_MEDIA_INIT_FAILED");
sImsCodeMap.put(CODE_MEDIA_NO_DATA, "CODE_MEDIA_NO_DATA")1183         sImsCodeMap.put(CODE_MEDIA_NO_DATA, "CODE_MEDIA_NO_DATA");
sImsCodeMap.put(CODE_MEDIA_NOT_ACCEPTABLE, "CODE_MEDIA_NOT_ACCEPTABLE")1184         sImsCodeMap.put(CODE_MEDIA_NOT_ACCEPTABLE, "CODE_MEDIA_NOT_ACCEPTABLE");
sImsCodeMap.put(CODE_MEDIA_UNSPECIFIED, "CODE_MEDIA_UNSPECIFIED")1185         sImsCodeMap.put(CODE_MEDIA_UNSPECIFIED, "CODE_MEDIA_UNSPECIFIED");
sImsCodeMap.put(CODE_USER_TERMINATED, "CODE_USER_TERMINATED")1186         sImsCodeMap.put(CODE_USER_TERMINATED, "CODE_USER_TERMINATED");
sImsCodeMap.put(CODE_USER_NOANSWER, "CODE_USER_NOANSWER")1187         sImsCodeMap.put(CODE_USER_NOANSWER, "CODE_USER_NOANSWER");
sImsCodeMap.put(CODE_USER_IGNORE, "CODE_USER_IGNORE")1188         sImsCodeMap.put(CODE_USER_IGNORE, "CODE_USER_IGNORE");
sImsCodeMap.put(CODE_USER_DECLINE, "CODE_USER_DECLINE")1189         sImsCodeMap.put(CODE_USER_DECLINE, "CODE_USER_DECLINE");
sImsCodeMap.put(CODE_LOW_BATTERY, "CODE_LOW_BATTERY")1190         sImsCodeMap.put(CODE_LOW_BATTERY, "CODE_LOW_BATTERY");
sImsCodeMap.put(CODE_BLACKLISTED_CALL_ID, "CODE_BLACKLISTED_CALL_ID")1191         sImsCodeMap.put(CODE_BLACKLISTED_CALL_ID, "CODE_BLACKLISTED_CALL_ID");
sImsCodeMap.put(CODE_USER_TERMINATED_BY_REMOTE, "CODE_USER_TERMINATED_BY_REMOTE")1192         sImsCodeMap.put(CODE_USER_TERMINATED_BY_REMOTE, "CODE_USER_TERMINATED_BY_REMOTE");
sImsCodeMap.put(CODE_USER_REJECTED_SESSION_MODIFICATION, "CODE_USER_REJECTED_SESSION_MODIFICATION")1193         sImsCodeMap.put(CODE_USER_REJECTED_SESSION_MODIFICATION,
1194                 "CODE_USER_REJECTED_SESSION_MODIFICATION");
sImsCodeMap.put(CODE_USER_CANCELLED_SESSION_MODIFICATION, "CODE_USER_CANCELLED_SESSION_MODIFICATION")1195         sImsCodeMap.put(CODE_USER_CANCELLED_SESSION_MODIFICATION,
1196                 "CODE_USER_CANCELLED_SESSION_MODIFICATION");
sImsCodeMap.put(CODE_SESSION_MODIFICATION_FAILED, "CODE_SESSION_MODIFICATION_FAILED")1197         sImsCodeMap.put(CODE_SESSION_MODIFICATION_FAILED, "CODE_SESSION_MODIFICATION_FAILED");
sImsCodeMap.put(CODE_UT_NOT_SUPPORTED, "CODE_UT_NOT_SUPPORTED")1198         sImsCodeMap.put(CODE_UT_NOT_SUPPORTED, "CODE_UT_NOT_SUPPORTED");
sImsCodeMap.put(CODE_UT_SERVICE_UNAVAILABLE, "CODE_UT_SERVICE_UNAVAILABLE")1199         sImsCodeMap.put(CODE_UT_SERVICE_UNAVAILABLE, "CODE_UT_SERVICE_UNAVAILABLE");
sImsCodeMap.put(CODE_UT_OPERATION_NOT_ALLOWED, "CODE_UT_OPERATION_NOT_ALLOWED")1200         sImsCodeMap.put(CODE_UT_OPERATION_NOT_ALLOWED, "CODE_UT_OPERATION_NOT_ALLOWED");
sImsCodeMap.put(CODE_UT_NETWORK_ERROR, "CODE_UT_NETWORK_ERROR")1201         sImsCodeMap.put(CODE_UT_NETWORK_ERROR, "CODE_UT_NETWORK_ERROR");
sImsCodeMap.put(CODE_UT_CB_PASSWORD_MISMATCH, "CODE_UT_CB_PASSWORD_MISMATCH")1202         sImsCodeMap.put(CODE_UT_CB_PASSWORD_MISMATCH, "CODE_UT_CB_PASSWORD_MISMATCH");
sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_DIAL, "CODE_UT_SS_MODIFIED_TO_DIAL")1203         sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_DIAL, "CODE_UT_SS_MODIFIED_TO_DIAL");
sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_USSD, "CODE_UT_SS_MODIFIED_TO_USSD")1204         sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_USSD, "CODE_UT_SS_MODIFIED_TO_USSD");
sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_SS, "CODE_UT_SS_MODIFIED_TO_SS")1205         sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_SS, "CODE_UT_SS_MODIFIED_TO_SS");
sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO, "CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO")1206         sImsCodeMap.put(CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO, "CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO");
sImsCodeMap.put(CODE_ECBM_NOT_SUPPORTED, "CODE_ECBM_NOT_SUPPORTED")1207         sImsCodeMap.put(CODE_ECBM_NOT_SUPPORTED, "CODE_ECBM_NOT_SUPPORTED");
sImsCodeMap.put(CODE_MULTIENDPOINT_NOT_SUPPORTED, "CODE_MULTIENDPOINT_NOT_SUPPORTED")1208         sImsCodeMap.put(CODE_MULTIENDPOINT_NOT_SUPPORTED, "CODE_MULTIENDPOINT_NOT_SUPPORTED");
sImsCodeMap.put(CODE_REGISTRATION_ERROR, "CODE_REGISTRATION_ERROR")1209         sImsCodeMap.put(CODE_REGISTRATION_ERROR, "CODE_REGISTRATION_ERROR");
sImsCodeMap.put(CODE_ANSWERED_ELSEWHERE, "CODE_ANSWERED_ELSEWHERE")1210         sImsCodeMap.put(CODE_ANSWERED_ELSEWHERE, "CODE_ANSWERED_ELSEWHERE");
sImsCodeMap.put(CODE_CALL_PULL_OUT_OF_SYNC, "CODE_CALL_PULL_OUT_OF_SYNC")1211         sImsCodeMap.put(CODE_CALL_PULL_OUT_OF_SYNC, "CODE_CALL_PULL_OUT_OF_SYNC");
sImsCodeMap.put(CODE_CALL_END_CAUSE_CALL_PULL, "CODE_CALL_END_CAUSE_CALL_PULL")1212         sImsCodeMap.put(CODE_CALL_END_CAUSE_CALL_PULL, "CODE_CALL_END_CAUSE_CALL_PULL");
sImsCodeMap.put(CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE, "CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE")1213         sImsCodeMap.put(CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE,
1214                 "CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE");
sImsCodeMap.put(CODE_REJECTED_ELSEWHERE, "CODE_REJECTED_ELSEWHERE")1215         sImsCodeMap.put(CODE_REJECTED_ELSEWHERE, "CODE_REJECTED_ELSEWHERE");
sImsCodeMap.put(CODE_SUPP_SVC_FAILED, "CODE_SUPP_SVC_FAILED")1216         sImsCodeMap.put(CODE_SUPP_SVC_FAILED, "CODE_SUPP_SVC_FAILED");
sImsCodeMap.put(CODE_SUPP_SVC_CANCELLED, "CODE_SUPP_SVC_CANCELLED")1217         sImsCodeMap.put(CODE_SUPP_SVC_CANCELLED, "CODE_SUPP_SVC_CANCELLED");
sImsCodeMap.put(CODE_SUPP_SVC_REINVITE_COLLISION, "CODE_SUPP_SVC_REINVITE_COLLISION")1218         sImsCodeMap.put(CODE_SUPP_SVC_REINVITE_COLLISION, "CODE_SUPP_SVC_REINVITE_COLLISION");
sImsCodeMap.put(CODE_IWLAN_DPD_FAILURE, "CODE_IWLAN_DPD_FAILURE")1219         sImsCodeMap.put(CODE_IWLAN_DPD_FAILURE, "CODE_IWLAN_DPD_FAILURE");
sImsCodeMap.put(CODE_EPDG_TUNNEL_ESTABLISH_FAILURE, "CODE_EPDG_TUNNEL_ESTABLISH_FAILURE")1220         sImsCodeMap.put(CODE_EPDG_TUNNEL_ESTABLISH_FAILURE, "CODE_EPDG_TUNNEL_ESTABLISH_FAILURE");
sImsCodeMap.put(CODE_EPDG_TUNNEL_REKEY_FAILURE, "CODE_EPDG_TUNNEL_REKEY_FAILURE")1221         sImsCodeMap.put(CODE_EPDG_TUNNEL_REKEY_FAILURE, "CODE_EPDG_TUNNEL_REKEY_FAILURE");
sImsCodeMap.put(CODE_EPDG_TUNNEL_LOST_CONNECTION, "CODE_EPDG_TUNNEL_LOST_CONNECTION")1222         sImsCodeMap.put(CODE_EPDG_TUNNEL_LOST_CONNECTION, "CODE_EPDG_TUNNEL_LOST_CONNECTION");
sImsCodeMap.put(CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED, "CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED")1223         sImsCodeMap.put(CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED,
1224                 "CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED");
sImsCodeMap.put(CODE_REMOTE_CALL_DECLINE, "CODE_REMOTE_CALL_DECLINE")1225         sImsCodeMap.put(CODE_REMOTE_CALL_DECLINE, "CODE_REMOTE_CALL_DECLINE");
sImsCodeMap.put(CODE_DATA_LIMIT_REACHED, "CODE_DATA_LIMIT_REACHED")1226         sImsCodeMap.put(CODE_DATA_LIMIT_REACHED, "CODE_DATA_LIMIT_REACHED");
sImsCodeMap.put(CODE_DATA_DISABLED, "CODE_DATA_DISABLED")1227         sImsCodeMap.put(CODE_DATA_DISABLED, "CODE_DATA_DISABLED");
sImsCodeMap.put(CODE_WIFI_LOST, "CODE_WIFI_LOST")1228         sImsCodeMap.put(CODE_WIFI_LOST, "CODE_WIFI_LOST");
sImsCodeMap.put(CODE_IKEV2_AUTH_FAILURE, "CODE_IKEV2_AUTH_FAILURE")1229         sImsCodeMap.put(CODE_IKEV2_AUTH_FAILURE, "CODE_IKEV2_AUTH_FAILURE");
sImsCodeMap.put(CODE_RADIO_OFF, "CODE_RADIO_OFF")1230         sImsCodeMap.put(CODE_RADIO_OFF, "CODE_RADIO_OFF");
sImsCodeMap.put(CODE_NO_VALID_SIM, "CODE_NO_VALID_SIM")1231         sImsCodeMap.put(CODE_NO_VALID_SIM, "CODE_NO_VALID_SIM");
sImsCodeMap.put(CODE_RADIO_INTERNAL_ERROR, "CODE_RADIO_INTERNAL_ERROR")1232         sImsCodeMap.put(CODE_RADIO_INTERNAL_ERROR, "CODE_RADIO_INTERNAL_ERROR");
sImsCodeMap.put(CODE_NETWORK_RESP_TIMEOUT, "CODE_NETWORK_RESP_TIMEOUT")1233         sImsCodeMap.put(CODE_NETWORK_RESP_TIMEOUT, "CODE_NETWORK_RESP_TIMEOUT");
sImsCodeMap.put(CODE_NETWORK_REJECT, "CODE_NETWORK_REJECT")1234         sImsCodeMap.put(CODE_NETWORK_REJECT, "CODE_NETWORK_REJECT");
sImsCodeMap.put(CODE_RADIO_ACCESS_FAILURE, "CODE_RADIO_ACCESS_FAILURE")1235         sImsCodeMap.put(CODE_RADIO_ACCESS_FAILURE, "CODE_RADIO_ACCESS_FAILURE");
sImsCodeMap.put(CODE_RADIO_LINK_FAILURE, "CODE_RADIO_LINK_FAILURE")1236         sImsCodeMap.put(CODE_RADIO_LINK_FAILURE, "CODE_RADIO_LINK_FAILURE");
sImsCodeMap.put(CODE_RADIO_LINK_LOST, "CODE_RADIO_LINK_LOST")1237         sImsCodeMap.put(CODE_RADIO_LINK_LOST, "CODE_RADIO_LINK_LOST");
sImsCodeMap.put(CODE_RADIO_UPLINK_FAILURE, "CODE_RADIO_UPLINK_FAILURE")1238         sImsCodeMap.put(CODE_RADIO_UPLINK_FAILURE, "CODE_RADIO_UPLINK_FAILURE");
sImsCodeMap.put(CODE_RADIO_SETUP_FAILURE, "CODE_RADIO_SETUP_FAILURE")1239         sImsCodeMap.put(CODE_RADIO_SETUP_FAILURE, "CODE_RADIO_SETUP_FAILURE");
sImsCodeMap.put(CODE_RADIO_RELEASE_NORMAL, "CODE_RADIO_RELEASE_NORMAL")1240         sImsCodeMap.put(CODE_RADIO_RELEASE_NORMAL, "CODE_RADIO_RELEASE_NORMAL");
sImsCodeMap.put(CODE_RADIO_RELEASE_ABNORMAL, "CODE_RADIO_RELEASE_ABNORMAL")1241         sImsCodeMap.put(CODE_RADIO_RELEASE_ABNORMAL, "CODE_RADIO_RELEASE_ABNORMAL");
sImsCodeMap.put(CODE_ACCESS_CLASS_BLOCKED, "CODE_ACCESS_CLASS_BLOCKED")1242         sImsCodeMap.put(CODE_ACCESS_CLASS_BLOCKED, "CODE_ACCESS_CLASS_BLOCKED");
sImsCodeMap.put(CODE_NETWORK_DETACH, "CODE_NETWORK_DETACH")1243         sImsCodeMap.put(CODE_NETWORK_DETACH, "CODE_NETWORK_DETACH");
sImsCodeMap.put(CODE_SIP_ALTERNATE_EMERGENCY_CALL, "CODE_SIP_ALTERNATE_EMERGENCY_CALL")1244         sImsCodeMap.put(CODE_SIP_ALTERNATE_EMERGENCY_CALL, "CODE_SIP_ALTERNATE_EMERGENCY_CALL");
sImsCodeMap.put(CODE_UNOBTAINABLE_NUMBER, "CODE_UNOBTAINABLE_NUMBER")1245         sImsCodeMap.put(CODE_UNOBTAINABLE_NUMBER, "CODE_UNOBTAINABLE_NUMBER");
sImsCodeMap.put(CODE_NO_CSFB_IN_CS_ROAM, "CODE_NO_CSFB_IN_CS_ROAM")1246         sImsCodeMap.put(CODE_NO_CSFB_IN_CS_ROAM, "CODE_NO_CSFB_IN_CS_ROAM");
sImsCodeMap.put(CODE_REJECT_UNKNOWN, "CODE_REJECT_UNKNOWN")1247         sImsCodeMap.put(CODE_REJECT_UNKNOWN, "CODE_REJECT_UNKNOWN");
sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_WAITING_DISABLED, "CODE_REJECT_ONGOING_CALL_WAITING_DISABLED")1248         sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_WAITING_DISABLED,
1249                 "CODE_REJECT_ONGOING_CALL_WAITING_DISABLED");
sImsCodeMap.put(CODE_REJECT_CALL_ON_OTHER_SUB, "CODE_REJECT_CALL_ON_OTHER_SUB")1250         sImsCodeMap.put(CODE_REJECT_CALL_ON_OTHER_SUB, "CODE_REJECT_CALL_ON_OTHER_SUB");
sImsCodeMap.put(CODE_REJECT_1X_COLLISION, "CODE_REJECT_1X_COLLISION")1251         sImsCodeMap.put(CODE_REJECT_1X_COLLISION, "CODE_REJECT_1X_COLLISION");
sImsCodeMap.put(CODE_REJECT_SERVICE_NOT_REGISTERED, "CODE_REJECT_SERVICE_NOT_REGISTERED")1252         sImsCodeMap.put(CODE_REJECT_SERVICE_NOT_REGISTERED, "CODE_REJECT_SERVICE_NOT_REGISTERED");
sImsCodeMap.put(CODE_REJECT_CALL_TYPE_NOT_ALLOWED, "CODE_REJECT_CALL_TYPE_NOT_ALLOWED")1253         sImsCodeMap.put(CODE_REJECT_CALL_TYPE_NOT_ALLOWED, "CODE_REJECT_CALL_TYPE_NOT_ALLOWED");
sImsCodeMap.put(CODE_REJECT_ONGOING_E911_CALL, "CODE_REJECT_ONGOING_E911_CALL")1254         sImsCodeMap.put(CODE_REJECT_ONGOING_E911_CALL, "CODE_REJECT_ONGOING_E911_CALL");
sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_SETUP, "CODE_REJECT_ONGOING_CALL_SETUP")1255         sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_SETUP, "CODE_REJECT_ONGOING_CALL_SETUP");
sImsCodeMap.put(CODE_REJECT_MAX_CALL_LIMIT_REACHED, "CODE_REJECT_MAX_CALL_LIMIT_REACHED")1256         sImsCodeMap.put(CODE_REJECT_MAX_CALL_LIMIT_REACHED, "CODE_REJECT_MAX_CALL_LIMIT_REACHED");
sImsCodeMap.put(CODE_REJECT_UNSUPPORTED_SIP_HEADERS, "CODE_REJECT_UNSUPPORTED_SIP_HEADERS")1257         sImsCodeMap.put(CODE_REJECT_UNSUPPORTED_SIP_HEADERS, "CODE_REJECT_UNSUPPORTED_SIP_HEADERS");
sImsCodeMap.put(CODE_REJECT_UNSUPPORTED_SDP_HEADERS, "CODE_REJECT_UNSUPPORTED_SDP_HEADERS")1258         sImsCodeMap.put(CODE_REJECT_UNSUPPORTED_SDP_HEADERS, "CODE_REJECT_UNSUPPORTED_SDP_HEADERS");
sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_TRANSFER, "CODE_REJECT_ONGOING_CALL_TRANSFER")1259         sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_TRANSFER, "CODE_REJECT_ONGOING_CALL_TRANSFER");
sImsCodeMap.put(CODE_REJECT_INTERNAL_ERROR, "CODE_REJECT_INTERNAL_ERROR")1260         sImsCodeMap.put(CODE_REJECT_INTERNAL_ERROR, "CODE_REJECT_INTERNAL_ERROR");
sImsCodeMap.put(CODE_REJECT_QOS_FAILURE, "CODE_REJECT_QOS_FAILURE")1261         sImsCodeMap.put(CODE_REJECT_QOS_FAILURE, "CODE_REJECT_QOS_FAILURE");
sImsCodeMap.put(CODE_REJECT_ONGOING_HANDOVER, "CODE_REJECT_ONGOING_HANDOVER")1262         sImsCodeMap.put(CODE_REJECT_ONGOING_HANDOVER, "CODE_REJECT_ONGOING_HANDOVER");
sImsCodeMap.put(CODE_REJECT_VT_TTY_NOT_ALLOWED, "CODE_REJECT_VT_TTY_NOT_ALLOWED")1263         sImsCodeMap.put(CODE_REJECT_VT_TTY_NOT_ALLOWED, "CODE_REJECT_VT_TTY_NOT_ALLOWED");
sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_UPGRADE, "CODE_REJECT_ONGOING_CALL_UPGRADE")1264         sImsCodeMap.put(CODE_REJECT_ONGOING_CALL_UPGRADE, "CODE_REJECT_ONGOING_CALL_UPGRADE");
sImsCodeMap.put(CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED, "CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED")1265         sImsCodeMap.put(CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED,
1266                 "CODE_REJECT_CONFERENCE_TTY_NOT_ALLOWED");
sImsCodeMap.put(CODE_REJECT_ONGOING_CONFERENCE_CALL, "CODE_REJECT_ONGOING_CONFERENCE_CALL")1267         sImsCodeMap.put(CODE_REJECT_ONGOING_CONFERENCE_CALL, "CODE_REJECT_ONGOING_CONFERENCE_CALL");
sImsCodeMap.put(CODE_REJECT_VT_AVPF_NOT_ALLOWED, "CODE_REJECT_VT_AVPF_NOT_ALLOWED")1268         sImsCodeMap.put(CODE_REJECT_VT_AVPF_NOT_ALLOWED, "CODE_REJECT_VT_AVPF_NOT_ALLOWED");
sImsCodeMap.put(CODE_REJECT_ONGOING_ENCRYPTED_CALL, "CODE_REJECT_ONGOING_ENCRYPTED_CALL")1269         sImsCodeMap.put(CODE_REJECT_ONGOING_ENCRYPTED_CALL, "CODE_REJECT_ONGOING_ENCRYPTED_CALL");
sImsCodeMap.put(CODE_REJECT_ONGOING_CS_CALL, "CODE_REJECT_ONGOING_CS_CALL")1270         sImsCodeMap.put(CODE_REJECT_ONGOING_CS_CALL, "CODE_REJECT_ONGOING_CS_CALL");
sImsCodeMap.put(CODE_RETRY_ON_IMS_WITHOUT_RTT, "CODE_RETRY_ON_IMS_WITHOUT_RTT")1271         sImsCodeMap.put(CODE_RETRY_ON_IMS_WITHOUT_RTT, "CODE_RETRY_ON_IMS_WITHOUT_RTT");
sImsCodeMap.put(CODE_OEM_CAUSE_1, "CODE_OEM_CAUSE_1")1272         sImsCodeMap.put(CODE_OEM_CAUSE_1, "CODE_OEM_CAUSE_1");
sImsCodeMap.put(CODE_OEM_CAUSE_2, "CODE_OEM_CAUSE_2")1273         sImsCodeMap.put(CODE_OEM_CAUSE_2, "CODE_OEM_CAUSE_2");
sImsCodeMap.put(CODE_OEM_CAUSE_3, "CODE_OEM_CAUSE_3")1274         sImsCodeMap.put(CODE_OEM_CAUSE_3, "CODE_OEM_CAUSE_3");
sImsCodeMap.put(CODE_OEM_CAUSE_4, "CODE_OEM_CAUSE_4")1275         sImsCodeMap.put(CODE_OEM_CAUSE_4, "CODE_OEM_CAUSE_4");
sImsCodeMap.put(CODE_OEM_CAUSE_5, "CODE_OEM_CAUSE_5")1276         sImsCodeMap.put(CODE_OEM_CAUSE_5, "CODE_OEM_CAUSE_5");
sImsCodeMap.put(CODE_OEM_CAUSE_6, "CODE_OEM_CAUSE_6")1277         sImsCodeMap.put(CODE_OEM_CAUSE_6, "CODE_OEM_CAUSE_6");
sImsCodeMap.put(CODE_OEM_CAUSE_7, "CODE_OEM_CAUSE_7")1278         sImsCodeMap.put(CODE_OEM_CAUSE_7, "CODE_OEM_CAUSE_7");
sImsCodeMap.put(CODE_OEM_CAUSE_8, "CODE_OEM_CAUSE_8")1279         sImsCodeMap.put(CODE_OEM_CAUSE_8, "CODE_OEM_CAUSE_8");
sImsCodeMap.put(CODE_OEM_CAUSE_9, "CODE_OEM_CAUSE_9")1280         sImsCodeMap.put(CODE_OEM_CAUSE_9, "CODE_OEM_CAUSE_9");
sImsCodeMap.put(CODE_OEM_CAUSE_10, "CODE_OEM_CAUSE_10")1281         sImsCodeMap.put(CODE_OEM_CAUSE_10, "CODE_OEM_CAUSE_10");
sImsCodeMap.put(CODE_OEM_CAUSE_11, "CODE_OEM_CAUSE_11")1282         sImsCodeMap.put(CODE_OEM_CAUSE_11, "CODE_OEM_CAUSE_11");
sImsCodeMap.put(CODE_OEM_CAUSE_12, "CODE_OEM_CAUSE_12")1283         sImsCodeMap.put(CODE_OEM_CAUSE_12, "CODE_OEM_CAUSE_12");
sImsCodeMap.put(CODE_OEM_CAUSE_13, "CODE_OEM_CAUSE_13")1284         sImsCodeMap.put(CODE_OEM_CAUSE_13, "CODE_OEM_CAUSE_13");
sImsCodeMap.put(CODE_OEM_CAUSE_14, "CODE_OEM_CAUSE_14")1285         sImsCodeMap.put(CODE_OEM_CAUSE_14, "CODE_OEM_CAUSE_14");
sImsCodeMap.put(CODE_OEM_CAUSE_15, "CODE_OEM_CAUSE_15")1286         sImsCodeMap.put(CODE_OEM_CAUSE_15, "CODE_OEM_CAUSE_15");
1287     }
1288 
1289     /**
1290      * Network string error messages.
1291      * mExtraMessage may have these values.
1292      * @hide
1293      */
1294     @SystemApi
1295     public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED =
1296             "Forbidden. Not Authorized for Service";
1297 
1298 
1299     /*
1300      * Extra codes for the specific code value
1301      * This value can be referred when the code is CODE_LOCAL_CALL_CS_RETRY_REQUIRED.
1302      */
1303     /**
1304      * An extra that may be populated when the {@link #CODE_LOCAL_CALL_CS_RETRY_REQUIRED} result has
1305      * been returned.
1306      * <p>
1307      * Try to connect the call using CS
1308      */
1309     public static final int EXTRA_CODE_CALL_RETRY_NORMAL = 1;
1310     /**
1311      * An extra that may be populated when the {@link #CODE_LOCAL_CALL_CS_RETRY_REQUIRED} result has
1312      * been returned.
1313      * <p>
1314      * Try to connect the call using CS and do not notify the user.
1315      */
1316     public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2;
1317     /**
1318      * An extra that may be populated when the {@link #CODE_LOCAL_CALL_CS_RETRY_REQUIRED} result has
1319      * been returned.
1320      * <p>
1321      * Try to connect the call using CS by using the settings.
1322      */
1323     public static final int EXTRA_CODE_CALL_RETRY_BY_SETTINGS = 3;
1324 
1325 
1326     // For main reason code
1327     /** @hide */
1328     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "{@code "
1329             + "#getCode()}")
1330     public int mCode;
1331     // For the extra code value; it depends on the code value.
1332     /** @hide */
1333     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "{@code "
1334             + "#getExtraCode()}")
1335     public int mExtraCode;
1336     // For the additional message of the reason info.
1337     /** @hide */
1338     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q, publicAlternatives = "{@code "
1339             + "#getExtraMessage()}")
1340     public String mExtraMessage;
1341 
1342     /** @hide */
ImsReasonInfo()1343     public ImsReasonInfo() {
1344         mCode = CODE_UNSPECIFIED;
1345         mExtraCode = CODE_UNSPECIFIED;
1346         mExtraMessage = null;
1347     }
1348 
ImsReasonInfo(Parcel in)1349     private ImsReasonInfo(Parcel in) {
1350         mCode = in.readInt();
1351         mExtraCode = in.readInt();
1352         mExtraMessage = in.readString();
1353     }
1354 
1355     /** @hide */
1356     @UnsupportedAppUsage
ImsReasonInfo(int code, int extraCode)1357     public ImsReasonInfo(int code, int extraCode) {
1358         mCode = code;
1359         mExtraCode = extraCode;
1360         mExtraMessage = null;
1361     }
1362 
ImsReasonInfo(@msCode int code, int extraCode, @Nullable String extraMessage)1363     public ImsReasonInfo(@ImsCode int code, int extraCode, @Nullable String extraMessage) {
1364         mCode = code;
1365         mExtraCode = extraCode;
1366         mExtraMessage = extraMessage;
1367     }
1368 
1369     /**
1370      * @return an integer representing more information about the completion of an operation.
1371      */
getCode()1372     public @ImsCode int getCode() {
1373         return mCode;
1374     }
1375 
1376     /**
1377      * @return an optional OEM specified code that provides extra information.
1378      */
getExtraCode()1379     public int getExtraCode() {
1380         return mExtraCode;
1381     }
1382 
1383     /**
1384      * @return an optional OEM specified string that provides extra information about the operation
1385      * result.
1386      */
getExtraMessage()1387     public @Nullable String getExtraMessage() {
1388         return mExtraMessage;
1389     }
1390 
1391     /**
1392      * @return the string format of {@link ImsReasonInfo}
1393      */
1394     @NonNull
1395     @Override
toString()1396     public String toString() {
1397         String imsCode = (sImsCodeMap.containsKey(mCode)) ? sImsCodeMap.get(mCode) : "UNKNOWN_CODE";
1398         return "ImsReasonInfo :: {" + mCode + " : " + imsCode + ", "
1399                 + mExtraCode + ", " + mExtraMessage + "}";
1400     }
1401 
1402     @Override
describeContents()1403     public int describeContents() {
1404         return 0;
1405     }
1406 
1407     @Override
writeToParcel(@onNull Parcel out, int flags)1408     public void writeToParcel(@NonNull Parcel out, int flags) {
1409         out.writeInt(mCode);
1410         out.writeInt(mExtraCode);
1411         out.writeString(mExtraMessage);
1412     }
1413 
1414     public static final @NonNull Creator<ImsReasonInfo> CREATOR = new Creator<ImsReasonInfo>() {
1415         @Override
1416         public ImsReasonInfo createFromParcel(Parcel in) {
1417             return new ImsReasonInfo(in);
1418         }
1419 
1420         @Override
1421         public ImsReasonInfo[] newArray(int size) {
1422             return new ImsReasonInfo[size];
1423         }
1424     };
1425 }
1426