/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.telephony.ims;

import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;

This class enables an application to get details on why a method call failed.
@hide
/** * This class enables an application to get details on why a method call failed. * * @hide */
@SystemApi public final class ImsReasonInfo implements Parcelable {
Specific code of each types
/** * Specific code of each types */
public static final int CODE_UNSPECIFIED = 0;
LOCAL
/** * LOCAL */
// IMS -> Telephony // The passed argument is an invalid public static final int CODE_LOCAL_ILLEGAL_ARGUMENT = 101; // The operation is invoked in invalid call state public static final int CODE_LOCAL_ILLEGAL_STATE = 102; // IMS service internal error public static final int CODE_LOCAL_INTERNAL_ERROR = 103; // IMS service goes down (service connection is lost) public static final int CODE_LOCAL_IMS_SERVICE_DOWN = 106; // No pending incoming call exists public static final int CODE_LOCAL_NO_PENDING_CALL = 107; // IMS Call ended during conference merge process public static final int CODE_LOCAL_ENDED_BY_CONFERENCE_MERGE = 108; // IMS -> Telephony // Service unavailable; by power off public static final int CODE_LOCAL_POWER_OFF = 111; // Service unavailable; by low battery public static final int CODE_LOCAL_LOW_BATTERY = 112; // Service unavailable; by out of service (data service state) public static final int CODE_LOCAL_NETWORK_NO_SERVICE = 121; // Service unavailable; by no LTE coverage // (VoLTE is not supported even though IMS is registered) public static final int CODE_LOCAL_NETWORK_NO_LTE_COVERAGE = 122; // Service unavailable; by located in roaming area public static final int CODE_LOCAL_NETWORK_ROAMING = 123; // Service unavailable; by IP changed public static final int CODE_LOCAL_NETWORK_IP_CHANGED = 124; // Service unavailable; other public static final int CODE_LOCAL_SERVICE_UNAVAILABLE = 131; // Service unavailable; IMS connection is lost (IMS is not registered) public static final int CODE_LOCAL_NOT_REGISTERED = 132; // IMS <-> Telephony // Max call exceeded public static final int CODE_LOCAL_CALL_EXCEEDED = 141; // IMS <- Telephony // Call busy public static final int CODE_LOCAL_CALL_BUSY = 142; // Call decline public static final int CODE_LOCAL_CALL_DECLINE = 143; // IMS -> Telephony // SRVCC is in progress public static final int CODE_LOCAL_CALL_VCC_ON_PROGRESSING = 144; // Resource reservation is failed (QoS precondition) public static final int CODE_LOCAL_CALL_RESOURCE_RESERVATION_FAILED = 145; // Retry CS call; VoLTE service can't be provided by the network or remote end // Resolve the extra code(EXTRA_CODE_CALL_RETRY_*) if the below code is set public static final int CODE_LOCAL_CALL_CS_RETRY_REQUIRED = 146; // Retry VoLTE call; VoLTE service can't be provided by the network temporarily public static final int CODE_LOCAL_CALL_VOLTE_RETRY_REQUIRED = 147; // IMS call is already terminated (in TERMINATED state) public static final int CODE_LOCAL_CALL_TERMINATED = 148; // Handover not feasible public static final int CODE_LOCAL_HO_NOT_FEASIBLE = 149;
TIMEOUT (IMS -> Telephony)
/** * TIMEOUT (IMS -> Telephony) */
// 1xx waiting timer is expired after sending INVITE request (MO only) public static final int CODE_TIMEOUT_1XX_WAITING = 201; // User no answer during call setup operation (MO/MT) // MO : 200 OK to INVITE request is not received, // MT : No action from user after alerting the call public static final int CODE_TIMEOUT_NO_ANSWER = 202; // User no answer during call update operation (MO/MT) // MO : 200 OK to re-INVITE request is not received, // MT : No action from user after alerting the call public static final int CODE_TIMEOUT_NO_ANSWER_CALL_UPDATE = 203; //Call was blocked by call barring public static final int CODE_CALL_BARRED = 240; //Call failures for FDN public static final int CODE_FDN_BLOCKED = 241; // Network does not accept the emergency call request because IMEI was used as identification // and this capability is not supported by the network. public static final int CODE_IMEI_NOT_ACCEPTED = 243; //STK CC errors public static final int CODE_DIAL_MODIFIED_TO_USSD = 244; public static final int CODE_DIAL_MODIFIED_TO_SS = 245; public static final int CODE_DIAL_MODIFIED_TO_DIAL = 246; public static final int CODE_DIAL_MODIFIED_TO_DIAL_VIDEO = 247; public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL = 248; public static final int CODE_DIAL_VIDEO_MODIFIED_TO_DIAL_VIDEO = 249; public static final int CODE_DIAL_VIDEO_MODIFIED_TO_SS = 250; public static final int CODE_DIAL_VIDEO_MODIFIED_TO_USSD = 251;
STATUSCODE (SIP response code) (IMS -> Telephony)
/** * STATUSCODE (SIP response code) (IMS -> Telephony) */
// 3xx responses // SIP request is redirected public static final int CODE_SIP_REDIRECTED = 321; // 4xx responses // 400 : Bad Request public static final int CODE_SIP_BAD_REQUEST = 331; // 403 : Forbidden public static final int CODE_SIP_FORBIDDEN = 332; // 404 : Not Found public static final int CODE_SIP_NOT_FOUND = 333; // 415 : Unsupported Media Type // 416 : Unsupported URI Scheme // 420 : Bad Extension public static final int CODE_SIP_NOT_SUPPORTED = 334; // 408 : Request Timeout public static final int CODE_SIP_REQUEST_TIMEOUT = 335; // 480 : Temporarily Unavailable public static final int CODE_SIP_TEMPRARILY_UNAVAILABLE = 336; // 484 : Address Incomplete public static final int CODE_SIP_BAD_ADDRESS = 337; // 486 : Busy Here // 600 : Busy Everywhere public static final int CODE_SIP_BUSY = 338; // 487 : Request Terminated public static final int CODE_SIP_REQUEST_CANCELLED = 339; // 406 : Not Acceptable // 488 : Not Acceptable Here // 606 : Not Acceptable public static final int CODE_SIP_NOT_ACCEPTABLE = 340; // 410 : Gone // 604 : Does Not Exist Anywhere public static final int CODE_SIP_NOT_REACHABLE = 341; // Others public static final int CODE_SIP_CLIENT_ERROR = 342; // 5xx responses // 501 : Server Internal Error public static final int CODE_SIP_SERVER_INTERNAL_ERROR = 351; // 503 : Service Unavailable public static final int CODE_SIP_SERVICE_UNAVAILABLE = 352; // 504 : Server Time-out public static final int CODE_SIP_SERVER_TIMEOUT = 353; // Others public static final int CODE_SIP_SERVER_ERROR = 354; // 6xx responses // 603 : Decline public static final int CODE_SIP_USER_REJECTED = 361; // Others public static final int CODE_SIP_GLOBAL_ERROR = 362; // Emergency failure public static final int CODE_EMERGENCY_TEMP_FAILURE = 363; public static final int CODE_EMERGENCY_PERM_FAILURE = 364;
MEDIA (IMS -> Telephony)
/** * MEDIA (IMS -> Telephony) */
// Media resource initialization failed public static final int CODE_MEDIA_INIT_FAILED = 401; // RTP timeout (no audio / video traffic in the session) public static final int CODE_MEDIA_NO_DATA = 402; // Media is not supported; so dropped the call public static final int CODE_MEDIA_NOT_ACCEPTABLE = 403; // Unknown media related errors public static final int CODE_MEDIA_UNSPECIFIED = 404;
USER
/** * USER */
// Telephony -> IMS // User triggers the call end public static final int CODE_USER_TERMINATED = 501; // No action while an incoming call is ringing public static final int CODE_USER_NOANSWER = 502; // User ignores an incoming call public static final int CODE_USER_IGNORE = 503; // User declines an incoming call public static final int CODE_USER_DECLINE = 504; // Device declines/ends a call due to low battery public static final int CODE_LOW_BATTERY = 505; // Device declines call due to blacklisted call ID public static final int CODE_BLACKLISTED_CALL_ID = 506; // IMS -> Telephony // The call is terminated by the network or remote user public static final int CODE_USER_TERMINATED_BY_REMOTE = 510;
Extra codes for the specific code value This value can be referred when the code is CODE_LOCAL_CALL_CS_RETRY_REQUIRED.
/** * Extra codes for the specific code value * This value can be referred when the code is CODE_LOCAL_CALL_CS_RETRY_REQUIRED. */
// Try to connect CS call; normal public static final int EXTRA_CODE_CALL_RETRY_NORMAL = 1; // Try to connect CS call without the notification to user public static final int EXTRA_CODE_CALL_RETRY_SILENT_REDIAL = 2; // Try to connect CS call by the settings of the menu public static final int EXTRA_CODE_CALL_RETRY_BY_SETTINGS = 3;
UT
/** * UT */
public static final int CODE_UT_NOT_SUPPORTED = 801; public static final int CODE_UT_SERVICE_UNAVAILABLE = 802; public static final int CODE_UT_OPERATION_NOT_ALLOWED = 803; public static final int CODE_UT_NETWORK_ERROR = 804; public static final int CODE_UT_CB_PASSWORD_MISMATCH = 821; //STK CC errors public static final int CODE_UT_SS_MODIFIED_TO_DIAL = 822; public static final int CODE_UT_SS_MODIFIED_TO_USSD = 823; public static final int CODE_UT_SS_MODIFIED_TO_SS = 824; public static final int CODE_UT_SS_MODIFIED_TO_DIAL_VIDEO = 825;
ECBM
/** * ECBM */
public static final int CODE_ECBM_NOT_SUPPORTED = 901;
Fail code used to indicate that Multi-endpoint is not supported by the Ims framework.
/** * Fail code used to indicate that Multi-endpoint is not supported by the Ims framework. */
public static final int CODE_MULTIENDPOINT_NOT_SUPPORTED = 902;
Ims Registration error code
/** * Ims Registration error code */
public static final int CODE_REGISTRATION_ERROR = 1000; /** * CALL DROP error codes (Call could drop because of many reasons like Network not available, * handover, failed, etc) */
CALL DROP error code for the case when a device is ePDG capable and when the user is on an active wifi call and at the edge of coverage and there is no qualified LTE network available to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error code is received as part of the handover message.
/** * CALL DROP error code for the case when a device is ePDG capable and when the user is on an * active wifi call and at the edge of coverage and there is no qualified LTE network available * to handover the call to. We get a handover NOT_TRIGERRED message from the modem. This error * code is received as part of the handover message. */
public static final int CODE_CALL_DROP_IWLAN_TO_LTE_UNAVAILABLE = 1100;
MT call has ended due to a release from the network because the call was answered elsewhere
/** * MT call has ended due to a release from the network * because the call was answered elsewhere */
public static final int CODE_ANSWERED_ELSEWHERE = 1014;
For MultiEndpoint - Call Pull request has failed
/** * For MultiEndpoint - Call Pull request has failed */
public static final int CODE_CALL_PULL_OUT_OF_SYNC = 1015;
For MultiEndpoint - Call has been pulled from primary to secondary
/** * For MultiEndpoint - Call has been pulled from primary to secondary */
public static final int CODE_CALL_END_CAUSE_CALL_PULL = 1016;
Supplementary services (HOLD/RESUME) failure error codes. Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision.
/** * Supplementary services (HOLD/RESUME) failure error codes. * Values for Supplemetary services failure - Failed, Cancelled and Re-Invite collision. */
public static final int CODE_SUPP_SVC_FAILED = 1201; public static final int CODE_SUPP_SVC_CANCELLED = 1202; public static final int CODE_SUPP_SVC_REINVITE_COLLISION = 1203;
DPD Procedure received no response or send failed
/** * DPD Procedure received no response or send failed */
public static final int CODE_IWLAN_DPD_FAILURE = 1300;
Establishment of the ePDG Tunnel Failed
/** * Establishment of the ePDG Tunnel Failed */
public static final int CODE_EPDG_TUNNEL_ESTABLISH_FAILURE = 1400;
Re-keying of the ePDG Tunnel Failed; may not always result in teardown
/** * Re-keying of the ePDG Tunnel Failed; may not always result in teardown */
public static final int CODE_EPDG_TUNNEL_REKEY_FAILURE = 1401;
Connection to the packet gateway is lost
/** * Connection to the packet gateway is lost */
public static final int CODE_EPDG_TUNNEL_LOST_CONNECTION = 1402;
The maximum number of calls allowed has been reached. Used in a multi-endpoint scenario where the number of calls across all connected devices has reached the maximum.
/** * The maximum number of calls allowed has been reached. Used in a multi-endpoint scenario * where the number of calls across all connected devices has reached the maximum. */
public static final int CODE_MAXIMUM_NUMBER_OF_CALLS_REACHED = 1403;
Similar to CODE_LOCAL_CALL_DECLINE, except indicates that a remote device has declined the call. Used in a multi-endpoint scenario where a remote device declined an incoming call.
/** * Similar to {@link #CODE_LOCAL_CALL_DECLINE}, except indicates that a remote device has * declined the call. Used in a multi-endpoint scenario where a remote device declined an * incoming call. */
public static final int CODE_REMOTE_CALL_DECLINE = 1404;
Indicates the call was disconnected due to the user reaching their data limit.
/** * Indicates the call was disconnected due to the user reaching their data limit. */
public static final int CODE_DATA_LIMIT_REACHED = 1405;
Indicates the call was disconnected due to the user disabling cellular data.
/** * Indicates the call was disconnected due to the user disabling cellular data. */
public static final int CODE_DATA_DISABLED = 1406;
Indicates a call was disconnected due to loss of wifi signal.
/** * Indicates a call was disconnected due to loss of wifi signal. */
public static final int CODE_WIFI_LOST = 1407;
Indicates the registration attempt on IWLAN failed due to IKEv2 authetication failure during tunnel establishment.
/** * Indicates the registration attempt on IWLAN failed due to IKEv2 authetication failure * during tunnel establishment. */
public static final int CODE_IKEV2_AUTH_FAILURE = 1408;
The call cannot be established because RADIO is OFF
/** The call cannot be established because RADIO is OFF */
public static final int CODE_RADIO_OFF = 1500;
The call cannot be established because of no valid SIM
/** The call cannot be established because of no valid SIM */
public static final int CODE_NO_VALID_SIM = 1501;
The failure is due internal error at modem
/** The failure is due internal error at modem */
public static final int CODE_RADIO_INTERNAL_ERROR = 1502;
The failure is due to UE timer expired while waiting for a response from network
/** The failure is due to UE timer expired while waiting for a response from network */
public static final int CODE_NETWORK_RESP_TIMEOUT = 1503;
The failure is due to explicit reject from network
/** The failure is due to explicit reject from network */
public static final int CODE_NETWORK_REJECT = 1504;
The failure is due to radio access failure. ex. RACH failure
/** The failure is due to radio access failure. ex. RACH failure */
public static final int CODE_RADIO_ACCESS_FAILURE = 1505;
Call/IMS registration failed/dropped because of a RLF
/** Call/IMS registration failed/dropped because of a RLF */
public static final int CODE_RADIO_LINK_FAILURE = 1506;
Call/IMS registration failed/dropped because of radio link lost
/** Call/IMS registration failed/dropped because of radio link lost */
public static final int CODE_RADIO_LINK_LOST = 1507;
The call Call/IMS registration failed because of a radio uplink issue
/** The call Call/IMS registration failed because of a radio uplink issue */
public static final int CODE_RADIO_UPLINK_FAILURE = 1508;
Call failed because of a RRC connection setup failure
/** Call failed because of a RRC connection setup failure */
public static final int CODE_RADIO_SETUP_FAILURE = 1509;
Call failed/dropped because of RRC connection release from NW
/** Call failed/dropped because of RRC connection release from NW */
public static final int CODE_RADIO_RELEASE_NORMAL = 1510;
Call failed/dropped because of RRC abnormally released by modem/network
/** Call failed/dropped because of RRC abnormally released by modem/network */
public static final int CODE_RADIO_RELEASE_ABNORMAL = 1511;
Call failed because of access class barring
/** Call failed because of access class barring */
public static final int CODE_ACCESS_CLASS_BLOCKED = 1512;
Call/IMS registration is failed/dropped because of a network detach
/** Call/IMS registration is failed/dropped because of a network detach */
public static final int CODE_NETWORK_DETACH = 1513;
Call failed due to SIP code 380 (Alternative Service response) while dialing an "undetected emergency number". This scenario is important in some regions where the carrier network will identify other non-emergency help numbers (e.g. mountain rescue) when attempting to dial.
/** * Call failed due to SIP code 380 (Alternative Service response) while dialing an "undetected * emergency number". This scenario is important in some regions where the carrier network will * identify other non-emergency help numbers (e.g. mountain rescue) when attempting to dial. */
public static final int CODE_SIP_ALTERNATE_EMERGENCY_CALL = 1514;
Call failed because of unobtainable number
@hide
/** * Call failed because of unobtainable number * @hide */
public static final int CODE_UNOBTAINABLE_NUMBER = 1515; /* OEM specific error codes. To be used by OEMs when they don't want to reveal error code which would be replaced by ERROR_UNSPECIFIED */ public static final int CODE_OEM_CAUSE_1 = 0xf001; public static final int CODE_OEM_CAUSE_2 = 0xf002; public static final int CODE_OEM_CAUSE_3 = 0xf003; public static final int CODE_OEM_CAUSE_4 = 0xf004; public static final int CODE_OEM_CAUSE_5 = 0xf005; public static final int CODE_OEM_CAUSE_6 = 0xf006; public static final int CODE_OEM_CAUSE_7 = 0xf007; public static final int CODE_OEM_CAUSE_8 = 0xf008; public static final int CODE_OEM_CAUSE_9 = 0xf009; public static final int CODE_OEM_CAUSE_10 = 0xf00a; public static final int CODE_OEM_CAUSE_11 = 0xf00b; public static final int CODE_OEM_CAUSE_12 = 0xf00c; public static final int CODE_OEM_CAUSE_13 = 0xf00d; public static final int CODE_OEM_CAUSE_14 = 0xf00e; public static final int CODE_OEM_CAUSE_15 = 0xf00f;
Network string error messages. mExtraMessage may have these values.
/** * Network string error messages. * mExtraMessage may have these values. */
public static final String EXTRA_MSG_SERVICE_NOT_AUTHORIZED = "Forbidden. Not Authorized for Service"; // For main reason code
@hide
/** @hide */
public int mCode; // For the extra code value; it depends on the code value.
@hide
/** @hide */
public int mExtraCode; // For the additional message of the reason info.
@hide
/** @hide */
public String mExtraMessage;
@hide
/** @hide */
public ImsReasonInfo() { mCode = CODE_UNSPECIFIED; mExtraCode = CODE_UNSPECIFIED; mExtraMessage = null; } private ImsReasonInfo(Parcel in) { mCode = in.readInt(); mExtraCode = in.readInt(); mExtraMessage = in.readString(); }
@hide
/** @hide */
public ImsReasonInfo(int code, int extraCode) { mCode = code; mExtraCode = extraCode; mExtraMessage = null; } public ImsReasonInfo(int code, int extraCode, String extraMessage) { mCode = code; mExtraCode = extraCode; mExtraMessage = extraMessage; } /** * */ public int getCode() { return mCode; } /** * */ public int getExtraCode() { return mExtraCode; } /** * */ public String getExtraMessage() { return mExtraMessage; }
Returns the string format of ImsReasonInfo
Returns:the string format of ImsReasonInfo
/** * Returns the string format of {@link ImsReasonInfo} * * @return the string format of {@link ImsReasonInfo} */
public String toString() { return "ImsReasonInfo :: {" + mCode + ", " + mExtraCode + ", " + mExtraMessage + "}"; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel out, int flags) { out.writeInt(mCode); out.writeInt(mExtraCode); out.writeString(mExtraMessage); } public static final Creator<ImsReasonInfo> CREATOR = new Creator<ImsReasonInfo>() { @Override public ImsReasonInfo createFromParcel(Parcel in) { return new ImsReasonInfo(in); } @Override public ImsReasonInfo[] newArray(int size) { return new ImsReasonInfo[size]; } }; }