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 190825495a331bb44df395a0cdb79fab85e68db5d5Wink Savilleimport com.android.internal.telephony.RILConstants; 200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 2199c2e1d6749cfad2a8ca94a47857d8c3bfc09454Wink Savilleimport android.telephony.Rlog; 220825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 230825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville/** 240825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville * {@hide} 250825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville */ 260825495a331bb44df395a0cdb79fab85e68db5d5Wink Savillepublic class CommandException extends RuntimeException { 2722d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville private Error mError; 280825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 290825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public enum Error { 300825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville INVALID_RESPONSE, 310825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville RADIO_NOT_AVAILABLE, 320825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville GENERIC_FAILURE, 330825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville PASSWORD_INCORRECT, 340825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_PIN2, 350825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_PUK2, 360825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville REQUEST_NOT_SUPPORTED, 370825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville OP_NOT_ALLOWED_DURING_VOICE_CALL, 380825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville OP_NOT_ALLOWED_BEFORE_REG_NW, 390825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SMS_FAIL_RETRY, 400825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SIM_ABSENT, 410825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville SUBSCRIPTION_NOT_AVAILABLE, 420825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville MODE_NOT_SUPPORTED, 430825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville FDN_CHECK_FAILURE, 440825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville ILLEGAL_SIM_OR_ME, 4540d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal MISSING_RESOURCE, 4640d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal NO_SUCH_ELEMENT, 47a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville SUBSCRIPTION_NOT_SUPPORTED, 4809b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_USSD, 4909b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_SS, 5009b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja DIAL_MODIFIED_TO_DIAL, 5109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_DIAL, 5209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_SS, 5309b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja USSD_MODIFIED_TO_USSD, 5409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_DIAL, 5509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_USSD, 5609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja SS_MODIFIED_TO_SS, 576fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ALREADY_POWERED_OFF, 586fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ALREADY_POWERED_ON, 596fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_DATA_NOT_AVAILABLE, 606fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_CONNECT_FAILURE, 616fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_MSG_SIZE_TOO_LARGE, 626fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_MSG_SIZE_TOO_SMALL, 636fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_SAP_CONNECT_OK_CALL_ONGOING, 646fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe LCE_NOT_SUPPORTED, 656fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_MEMORY, 666fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INTERNAL_ERR, 676fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SYSTEM_ERR, 686fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe MODEM_ERR, 696fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_STATE, 706fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_RESOURCES, 716fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe SIM_ERR, 726fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_ARGUMENTS, 736fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_SIM_STATE, 746fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_MODEM_STATE, 756fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe INVALID_CALL_ID, 766fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NO_SMS_TO_ACK, 776fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe NETWORK_ERR, 786fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe REQUEST_RATE_LIMITED, 79702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang SIM_BUSY, 80702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang SIM_FULL, 81702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang NETWORK_REJECT, 82702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang OPERATION_NOT_ALLOWED, 83702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang EMPTY_RECORD, 848461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi INVALID_SMS_FORMAT, 858461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi ENCODING_ERR, 868461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi INVALID_SMSC_ADDRESS, 878461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NO_SUCH_ENTRY, 888461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NETWORK_NOT_READY, 898461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi NOT_PROVISIONED, 90dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi NO_SUBSCRIPTION, 91dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi NO_NETWORK_FOUND, 92dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi DEVICE_IN_USE, 93dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi ABORTED, 94cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_1, 95cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_2, 96cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_3, 97cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_4, 98cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_5, 99cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_6, 100cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_7, 101cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_8, 102cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_9, 103cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_10, 104cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_11, 105cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_12, 106cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_13, 107cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_14, 108cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_15, 109cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_16, 110cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_17, 111cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_18, 112cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_19, 113cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_20, 114cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_21, 115cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_22, 116cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_23, 117cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_24, 118cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe OEM_ERROR_25, 1190825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 1200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 1210825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public CommandException(Error e) { 1220825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville super(e.toString()); 12322d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville mError = e; 1240825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 1250825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 12608e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh public CommandException(Error e, String errString) { 12708e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh super(errString); 12808e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh mError = e; 12908e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh } 13008e9c4b483dac2cbf1b7fe4cbad22f003ff92bcbShriram Ganesh 1310825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public static CommandException 1320825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville fromRilErrno(int ril_errno) { 1330825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville switch(ril_errno) { 1340825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SUCCESS: return null; 1350825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.RIL_ERRNO_INVALID_RESPONSE: 1360825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.INVALID_RESPONSE); 1370825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.RADIO_NOT_AVAILABLE: 1380825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.RADIO_NOT_AVAILABLE); 1390825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.GENERIC_FAILURE: 1400825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.GENERIC_FAILURE); 1410825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.PASSWORD_INCORRECT: 1420825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.PASSWORD_INCORRECT); 1430825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_PIN2: 1440825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_PIN2); 1450825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_PUK2: 1460825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_PUK2); 1470825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.REQUEST_NOT_SUPPORTED: 1480825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.REQUEST_NOT_SUPPORTED); 1490825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.OP_NOT_ALLOWED_DURING_VOICE_CALL: 1500825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.OP_NOT_ALLOWED_DURING_VOICE_CALL); 1510825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.OP_NOT_ALLOWED_BEFORE_REG_NW: 1520825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.OP_NOT_ALLOWED_BEFORE_REG_NW); 1530825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SMS_SEND_FAIL_RETRY: 1540825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SMS_FAIL_RETRY); 1550825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SIM_ABSENT: 1560825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SIM_ABSENT); 1570825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.SUBSCRIPTION_NOT_AVAILABLE: 1580825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.SUBSCRIPTION_NOT_AVAILABLE); 1590825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.MODE_NOT_SUPPORTED: 1600825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.MODE_NOT_SUPPORTED); 1610825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.FDN_CHECK_FAILURE: 1620825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.FDN_CHECK_FAILURE); 1630825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville case RILConstants.ILLEGAL_SIM_OR_ME: 1640825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.ILLEGAL_SIM_OR_ME); 16540d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal case RILConstants.MISSING_RESOURCE: 16640d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal return new CommandException(Error.MISSING_RESOURCE); 16740d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal case RILConstants.NO_SUCH_ELEMENT: 16840d1d394302d83eb56f66cf08daecc612c97cd28Shishir Agrawal return new CommandException(Error.NO_SUCH_ELEMENT); 169a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville case RILConstants.SUBSCRIPTION_NOT_SUPPORTED: 170a8467dd0c524787104b1ccdddc5e8af10ba729edWink Saville return new CommandException(Error.SUBSCRIPTION_NOT_SUPPORTED); 17109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_USSD: 17209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_USSD); 17309b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_SS: 17409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_SS); 17509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.DIAL_MODIFIED_TO_DIAL: 17609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.DIAL_MODIFIED_TO_DIAL); 17709b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_DIAL: 17809b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_DIAL); 17909b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_SS: 18009b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_SS); 18109b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.USSD_MODIFIED_TO_USSD: 18209b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.USSD_MODIFIED_TO_USSD); 18309b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_DIAL: 18409b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_DIAL); 18509b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_USSD: 18609b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_USSD); 18709b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja case RILConstants.SS_MODIFIED_TO_SS: 18809b65da3b46e18c8acc146d722047ba2fb161bfePreeti Ahuja return new CommandException(Error.SS_MODIFIED_TO_SS); 1896fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ALREADY_POWERED_OFF: 1906fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ALREADY_POWERED_OFF); 1916fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ALREADY_POWERED_ON: 1926fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ALREADY_POWERED_ON); 1936fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_DATA_NOT_AVAILABLE: 1946fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_DATA_NOT_AVAILABLE); 1956fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_CONNECT_FAILURE: 1966fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_CONNECT_FAILURE); 1976fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_MSG_SIZE_TOO_LARGE: 1986fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_MSG_SIZE_TOO_LARGE); 1996fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_MSG_SIZE_TOO_SMALL: 2006fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_MSG_SIZE_TOO_SMALL); 2016fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_SAP_CONNECT_OK_CALL_ONGOING: 2026fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_SAP_CONNECT_OK_CALL_ONGOING); 2036fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.LCE_NOT_SUPPORTED: 2046fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.LCE_NOT_SUPPORTED); 2056fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_MEMORY: 2066fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_MEMORY); 2076fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INTERNAL_ERR: 2086fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INTERNAL_ERR); 2096fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SYSTEM_ERR: 2106fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SYSTEM_ERR); 2116fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.MODEM_ERR: 2126fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.MODEM_ERR); 2136fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_STATE: 2146fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_STATE); 2156fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_RESOURCES: 2166fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_RESOURCES); 2176fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.SIM_ERR: 2186fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.SIM_ERR); 2196fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_ARGUMENTS: 2206fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_ARGUMENTS); 2216fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_SIM_STATE: 2226fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_SIM_STATE); 2236fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_MODEM_STATE: 2246fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_MODEM_STATE); 2256fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.INVALID_CALL_ID: 2266fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.INVALID_CALL_ID); 2276fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NO_SMS_TO_ACK: 2286fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NO_SMS_TO_ACK); 2296fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.NETWORK_ERR: 2306fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.NETWORK_ERR); 2316fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe case RILConstants.REQUEST_RATE_LIMITED: 2326fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe return new CommandException(Error.REQUEST_RATE_LIMITED); 233702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.SIM_BUSY: 234702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.SIM_BUSY); 235702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.SIM_FULL: 236702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.SIM_FULL); 237702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.NETWORK_REJECT: 238702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.NETWORK_REJECT); 239702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.OPERATION_NOT_ALLOWED: 240702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.OPERATION_NOT_ALLOWED); 241702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang case RILConstants.EMPTY_RECORD: 242702f07cf67cb60b2f827a5602c6db5f76cdf2061twen.chang return new CommandException(Error.EMPTY_RECORD); 2438461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.INVALID_SMS_FORMAT: 2448461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.INVALID_SMS_FORMAT); 2458461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.ENCODING_ERR: 2468461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.ENCODING_ERR); 2478461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.INVALID_SMSC_ADDRESS: 2488461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.INVALID_SMSC_ADDRESS); 2498461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NO_SUCH_ENTRY: 2508461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NO_SUCH_ENTRY); 2518461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NETWORK_NOT_READY: 2528461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NETWORK_NOT_READY); 2538461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi case RILConstants.NOT_PROVISIONED: 2548461e8bca26872ab91f25daa2c89cc0cc49bc077Ajay Nambi return new CommandException(Error.NOT_PROVISIONED); 255dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.NO_SUBSCRIPTION: 256dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.NO_SUBSCRIPTION); 257dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.NO_NETWORK_FOUND: 258dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.NO_NETWORK_FOUND); 259dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.DEVICE_IN_USE: 260dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.DEVICE_IN_USE); 261dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi case RILConstants.ABORTED: 262dcbe2c1a0bbc3c07effa30461ba1e764141c0a5fAjay Nambi return new CommandException(Error.ABORTED); 263cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_1: 264cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_1); 265cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_2: 266cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_2); 267cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_3: 268cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_3); 269cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_4: 270cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_4); 271cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_5: 272cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_5); 273cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_6: 274cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_6); 275cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_7: 276cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_7); 277cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_8: 278cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_8); 279cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_9: 280cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_9); 281cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_10: 282cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_10); 283cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_11: 284cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_11); 285cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_12: 286cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_12); 287cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_13: 288cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_13); 289cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_14: 290cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_14); 291cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_15: 292cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_15); 293cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_16: 294cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_16); 295cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_17: 296cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_17); 297cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_18: 298cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_18); 299cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_19: 300cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_19); 301cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_20: 302cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_20); 303cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_21: 304cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_21); 305cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_22: 306cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_22); 307cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_23: 308cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_23); 309cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_24: 310cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_24); 311cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe case RILConstants.OEM_ERROR_25: 312cd3800ef6d32f5173e647924620501f7b5fcdb3fSanket Padawe return new CommandException(Error.OEM_ERROR_25); 3136fa55254bb98131d8aff306f27c0c86410c3349eSanket Padawe 3140825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville default: 31599c2e1d6749cfad2a8ca94a47857d8c3bfc09454Wink Saville Rlog.e("GSM", "Unrecognized RIL errno " + ril_errno); 3160825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville return new CommandException(Error.INVALID_RESPONSE); 3170825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3180825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3190825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3200825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville public Error getCommandError() { 32122d85a8e3a575a6d01d2c788587971657dfe20c6Wink Saville return mError; 3220825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville } 3230825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3240825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3250825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville 3260825495a331bb44df395a0cdb79fab85e68db5d5Wink Saville} 327