10825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville/* 20825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * Copyright (C) 2007 The Android Open Source Project 30825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * 40825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * Licensed under the Apache License, Version 2.0 (the "License"); 50825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * you may not use this file except in compliance with the License. 60825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * You may obtain a copy of the License at 70825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * 80825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * http://www.apache.org/licenses/LICENSE-2.0 90825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * 100825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * Unless required by applicable law or agreed to in writing, software 110825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * distributed under the License is distributed on an "AS IS" BASIS, 120825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * See the License for the specific language governing permissions and 140825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * limitations under the License. 150825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville */ 160825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 170825495a331bb44df395a0cdb79fab85e68db5d5Wink Savillepackage com.android.internal.telephony; 180825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 1999c2e1d6749cfad2a8ca94a47857d8c3bfc09454Wink Savilleimport android.telephony.Rlog; 200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 210825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville/** 220825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * {@hide} 230825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville */ 240825495a331bb44df395a0cdb79fab85e68db5d5Wink Savillepublic class CommandException extends RuntimeException { 2522d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville private Error mError; 260825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 270825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public enum Error { 280825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville INVALID_RESPONSE, 290825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville RADIO_NOT_AVAILABLE, 300825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville GENERIC_FAILURE, 310825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville PASSWORD_INCORRECT, 320825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_PIN2, 330825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_PUK2, 340825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville REQUEST_NOT_SUPPORTED, 350825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville OP_NOT_ALLOWED_DURING_VOICE_CALL, 360825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville OP_NOT_ALLOWED_BEFORE_REG_NW, 370825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SMS_FAIL_RETRY, 380825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_ABSENT, 390825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SUBSCRIPTION_NOT_AVAILABLE, 400825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville MODE_NOT_SUPPORTED, 410825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville FDN_CHECK_FAILURE, 420825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville ILLEGAL_SIM_OR_ME, 4340d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal MISSING_RESOURCE, 4440d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal NO_SUCH_ELEMENT, 45a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville SUBSCRIPTION_NOT_SUPPORTED, 4609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_USSD, 4709b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_SS, 4809b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_DIAL, 4909b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_DIAL, 5009b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_SS, 5109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_USSD, 5209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_DIAL, 5397d2609e31917538360d1632c9bdd0cc901eace4Suresh Koleti SS_MODIFIED_TO_DIAL_VIDEO, 5409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_USSD, 5509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_SS, 566fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ALREADY_POWERED_OFF, 576fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ALREADY_POWERED_ON, 586fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_DATA_NOT_AVAILABLE, 596fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_CONNECT_FAILURE, 606fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_MSG_SIZE_TOO_LARGE, 616fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_MSG_SIZE_TOO_SMALL, 626fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_CONNECT_OK_CALL_ONGOING, 636fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe LCE_NOT_SUPPORTED, 646fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_MEMORY, 656fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INTERNAL_ERR, 666fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SYSTEM_ERR, 676fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe MODEM_ERR, 686fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_STATE, 696fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_RESOURCES, 706fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ERR, 716fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_ARGUMENTS, 726fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_SIM_STATE, 736fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_MODEM_STATE, 746fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_CALL_ID, 756fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_SMS_TO_ACK, 766fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NETWORK_ERR, 776fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe REQUEST_RATE_LIMITED, 78702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang SIM_BUSY, 79702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang SIM_FULL, 80702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang NETWORK_REJECT, 81702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang OPERATION_NOT_ALLOWED, 82702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang EMPTY_RECORD, 838461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi INVALID_SMS_FORMAT, 848461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi ENCODING_ERR, 858461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi INVALID_SMSC_ADDRESS, 868461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NO_SUCH_ENTRY, 878461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NETWORK_NOT_READY, 888461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NOT_PROVISIONED, 89dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi NO_SUBSCRIPTION, 90dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi NO_NETWORK_FOUND, 91dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi DEVICE_IN_USE, 92dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi ABORTED, 93cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_1, 94cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_2, 95cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_3, 96cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_4, 97cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_5, 98cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_6, 99cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_7, 100cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_8, 101cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_9, 102cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_10, 103cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_11, 104cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_12, 105cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_13, 106cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_14, 107cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_15, 108cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_16, 109cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_17, 110cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_18, 111cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_19, 112cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_20, 113cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_21, 114cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_22, 115cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_23, 116cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_24, 117cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_25, 1180825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 1190825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 1200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public CommandException(Error e) { 1210825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville super(e.toString()); 12222d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville mError = e; 1230825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 1240825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 12508e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh public CommandException(Error e, String errString) { 12608e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh super(errString); 12708e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh mError = e; 12808e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh } 12908e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh 1300825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public static CommandException 1310825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville fromRilErrno(int ril_errno) { 1320825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville switch(ril_errno) { 1330825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SUCCESS: return null; 1340825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.RIL_ERRNO_INVALID_RESPONSE: 1350825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.INVALID_RESPONSE); 1360825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.RADIO_NOT_AVAILABLE: 1370825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.RADIO_NOT_AVAILABLE); 1380825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.GENERIC_FAILURE: 1390825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.GENERIC_FAILURE); 1400825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.PASSWORD_INCORRECT: 1410825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.PASSWORD_INCORRECT); 1420825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_PIN2: 1430825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_PIN2); 1440825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_PUK2: 1450825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_PUK2); 1460825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.REQUEST_NOT_SUPPORTED: 1470825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.REQUEST_NOT_SUPPORTED); 1480825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.OP_NOT_ALLOWED_DURING_VOICE_CALL: 1490825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.OP_NOT_ALLOWED_DURING_VOICE_CALL); 1500825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.OP_NOT_ALLOWED_BEFORE_REG_NW: 1510825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.OP_NOT_ALLOWED_BEFORE_REG_NW); 1520825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SMS_SEND_FAIL_RETRY: 1530825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SMS_FAIL_RETRY); 1540825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_ABSENT: 1550825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_ABSENT); 1560825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SUBSCRIPTION_NOT_AVAILABLE: 1570825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SUBSCRIPTION_NOT_AVAILABLE); 1580825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.MODE_NOT_SUPPORTED: 1590825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.MODE_NOT_SUPPORTED); 1600825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.FDN_CHECK_FAILURE: 1610825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.FDN_CHECK_FAILURE); 1620825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.ILLEGAL_SIM_OR_ME: 1630825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.ILLEGAL_SIM_OR_ME); 16440d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal case RILConstants.MISSING_RESOURCE: 16540d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal return new CommandException(Error.MISSING_RESOURCE); 16640d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal case RILConstants.NO_SUCH_ELEMENT: 16740d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal return new CommandException(Error.NO_SUCH_ELEMENT); 168a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville case RILConstants.SUBSCRIPTION_NOT_SUPPORTED: 169a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville return new CommandException(Error.SUBSCRIPTION_NOT_SUPPORTED); 17009b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_USSD: 17109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_USSD); 17209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_SS: 17309b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_SS); 17409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_DIAL: 17509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_DIAL); 17609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_DIAL: 17709b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_DIAL); 17809b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_SS: 17909b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_SS); 18009b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_USSD: 18109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_USSD); 18209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_DIAL: 18309b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_DIAL); 18409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_USSD: 18509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_USSD); 18609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_SS: 18709b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_SS); 1886fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ALREADY_POWERED_OFF: 1896fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ALREADY_POWERED_OFF); 1906fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ALREADY_POWERED_ON: 1916fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ALREADY_POWERED_ON); 1926fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_DATA_NOT_AVAILABLE: 1936fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_DATA_NOT_AVAILABLE); 1946fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_CONNECT_FAILURE: 1956fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_CONNECT_FAILURE); 1966fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_MSG_SIZE_TOO_LARGE: 1976fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_MSG_SIZE_TOO_LARGE); 1986fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_MSG_SIZE_TOO_SMALL: 1996fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_MSG_SIZE_TOO_SMALL); 2006fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_CONNECT_OK_CALL_ONGOING: 2016fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_CONNECT_OK_CALL_ONGOING); 2026fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.LCE_NOT_SUPPORTED: 2036fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.LCE_NOT_SUPPORTED); 2046fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_MEMORY: 2056fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_MEMORY); 2066fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INTERNAL_ERR: 2076fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INTERNAL_ERR); 2086fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SYSTEM_ERR: 2096fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SYSTEM_ERR); 2106fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.MODEM_ERR: 2116fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.MODEM_ERR); 2126fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_STATE: 2136fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_STATE); 2146fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_RESOURCES: 2156fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_RESOURCES); 2166fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ERR: 2176fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ERR); 2186fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_ARGUMENTS: 2196fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_ARGUMENTS); 2206fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_SIM_STATE: 2216fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_SIM_STATE); 2226fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_MODEM_STATE: 2236fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_MODEM_STATE); 2246fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_CALL_ID: 2256fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_CALL_ID); 2266fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_SMS_TO_ACK: 2276fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_SMS_TO_ACK); 2286fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NETWORK_ERR: 2296fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NETWORK_ERR); 2306fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.REQUEST_RATE_LIMITED: 2316fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.REQUEST_RATE_LIMITED); 232702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.SIM_BUSY: 233702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.SIM_BUSY); 234702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.SIM_FULL: 235702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.SIM_FULL); 236702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.NETWORK_REJECT: 237702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.NETWORK_REJECT); 238702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.OPERATION_NOT_ALLOWED: 239702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.OPERATION_NOT_ALLOWED); 240702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.EMPTY_RECORD: 241702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.EMPTY_RECORD); 2428461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.INVALID_SMS_FORMAT: 2438461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.INVALID_SMS_FORMAT); 2448461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.ENCODING_ERR: 2458461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.ENCODING_ERR); 2468461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.INVALID_SMSC_ADDRESS: 2478461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.INVALID_SMSC_ADDRESS); 2488461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NO_SUCH_ENTRY: 2498461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NO_SUCH_ENTRY); 2508461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NETWORK_NOT_READY: 2518461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NETWORK_NOT_READY); 2528461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NOT_PROVISIONED: 2538461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NOT_PROVISIONED); 254dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.NO_SUBSCRIPTION: 255dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.NO_SUBSCRIPTION); 256dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.NO_NETWORK_FOUND: 257dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.NO_NETWORK_FOUND); 258dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.DEVICE_IN_USE: 259dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.DEVICE_IN_USE); 260dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.ABORTED: 261dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.ABORTED); 262f9d8835c31c9a0347e5d40f6b0f582bbf09b9e51Nathan Harold case RILConstants.INVALID_RESPONSE: 263f9d8835c31c9a0347e5d40f6b0f582bbf09b9e51Nathan Harold return new CommandException(Error.INVALID_RESPONSE); 264cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_1: 265cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_1); 266cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_2: 267cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_2); 268cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_3: 269cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_3); 270cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_4: 271cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_4); 272cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_5: 273cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_5); 274cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_6: 275cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_6); 276cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_7: 277cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_7); 278cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_8: 279cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_8); 280cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_9: 281cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_9); 282cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_10: 283cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_10); 284cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_11: 285cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_11); 286cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_12: 287cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_12); 288cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_13: 289cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_13); 290cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_14: 291cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_14); 292cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_15: 293cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_15); 294cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_16: 295cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_16); 296cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_17: 297cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_17); 298cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_18: 299cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_18); 300cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_19: 301cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_19); 302cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_20: 303cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_20); 304cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_21: 305cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_21); 306cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_22: 307cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_22); 308cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_23: 309cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_23); 310cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_24: 311cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_24); 312cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_25: 313cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_25); 3146fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe 3150825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville default: 31699c2e1d6749cfad2a8ca94a47857d8c3bfc09454Wink Saville Rlog.e("GSM", "Unrecognized RIL errno " + ril_errno); 3170825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.INVALID_RESPONSE); 3180825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3190825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3210825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public Error getCommandError() { 32222d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville return mError; 3230825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3240825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3250825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3260825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3270825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville} 328