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