1 /* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.telephony.cat; 18 19 import android.annotation.UnsupportedAppUsage; 20 21 22 /** 23 * Enumeration for the return code in TERMINAL RESPONSE. 24 * To get the actual return code for each enum value, call {@link #value} 25 * method. 26 * 27 * {@hide} 28 */ 29 public enum ResultCode { 30 31 /* 32 * Results '0X' and '1X' indicate that the command has been performed. 33 */ 34 35 /** Command performed successfully */ 36 @UnsupportedAppUsage 37 OK(0x00), 38 39 /** Command performed with partial comprehension */ 40 @UnsupportedAppUsage 41 PRFRMD_WITH_PARTIAL_COMPREHENSION(0x01), 42 43 /** Command performed, with missing information */ 44 @UnsupportedAppUsage 45 PRFRMD_WITH_MISSING_INFO(0x02), 46 47 /** REFRESH performed with additional EFs read */ 48 @UnsupportedAppUsage 49 PRFRMD_WITH_ADDITIONAL_EFS_READ(0x03), 50 51 /** 52 * Command performed successfully, but requested icon could not be 53 * displayed 54 */ 55 @UnsupportedAppUsage 56 PRFRMD_ICON_NOT_DISPLAYED(0x04), 57 58 /** Command performed, but modified by call control by NAA */ 59 @UnsupportedAppUsage 60 PRFRMD_MODIFIED_BY_NAA(0x05), 61 62 /** Command performed successfully, limited service */ 63 @UnsupportedAppUsage 64 PRFRMD_LIMITED_SERVICE(0x06), 65 66 /** Command performed with modification */ 67 @UnsupportedAppUsage 68 PRFRMD_WITH_MODIFICATION(0x07), 69 70 /** REFRESH performed but indicated NAA was not active */ 71 @UnsupportedAppUsage 72 PRFRMD_NAA_NOT_ACTIVE(0x08), 73 74 /** Command performed successfully, tone not played */ 75 @UnsupportedAppUsage 76 PRFRMD_TONE_NOT_PLAYED(0x09), 77 78 /** Proactive UICC session terminated by the user */ 79 @UnsupportedAppUsage 80 UICC_SESSION_TERM_BY_USER(0x10), 81 82 /** Backward move in the proactive UICC session requested by the user */ 83 @UnsupportedAppUsage 84 BACKWARD_MOVE_BY_USER(0x11), 85 86 /** No response from user */ 87 @UnsupportedAppUsage 88 NO_RESPONSE_FROM_USER(0x12), 89 90 /** Help information required by the user */ 91 @UnsupportedAppUsage 92 HELP_INFO_REQUIRED(0x13), 93 94 /** USSD or SS transaction terminated by the user */ 95 USSD_SS_SESSION_TERM_BY_USER(0x14), 96 97 98 /* 99 * Results '2X' indicate to the UICC that it may be worth re-trying the 100 * command at a later opportunity. 101 */ 102 103 /** Terminal currently unable to process command */ 104 @UnsupportedAppUsage 105 TERMINAL_CRNTLY_UNABLE_TO_PROCESS(0x20), 106 107 /** Network currently unable to process command */ 108 @UnsupportedAppUsage 109 NETWORK_CRNTLY_UNABLE_TO_PROCESS(0x21), 110 111 /** User did not accept the proactive command */ 112 @UnsupportedAppUsage 113 USER_NOT_ACCEPT(0x22), 114 115 /** User cleared down call before connection or network release */ 116 USER_CLEAR_DOWN_CALL(0x23), 117 118 /** Action in contradiction with the current timer state */ 119 CONTRADICTION_WITH_TIMER(0x24), 120 121 /** Interaction with call control by NAA, temporary problem */ 122 NAA_CALL_CONTROL_TEMPORARY(0x25), 123 124 /** Launch browser generic error code */ 125 @UnsupportedAppUsage 126 LAUNCH_BROWSER_ERROR(0x26), 127 128 /** MMS temporary problem. */ 129 MMS_TEMPORARY(0x27), 130 131 132 /* 133 * Results '3X' indicate that it is not worth the UICC re-trying with an 134 * identical command, as it will only get the same response. However, the 135 * decision to retry lies with the application. 136 */ 137 138 /** Command beyond terminal's capabilities */ 139 @UnsupportedAppUsage 140 BEYOND_TERMINAL_CAPABILITY(0x30), 141 142 /** Command type not understood by terminal */ 143 CMD_TYPE_NOT_UNDERSTOOD(0x31), 144 145 /** Command data not understood by terminal */ 146 @UnsupportedAppUsage 147 CMD_DATA_NOT_UNDERSTOOD(0x32), 148 149 /** Command number not known by terminal */ 150 CMD_NUM_NOT_KNOWN(0x33), 151 152 /** SS Return Error */ 153 SS_RETURN_ERROR(0x34), 154 155 /** SMS RP-ERROR */ 156 SMS_RP_ERROR(0x35), 157 158 /** Error, required values are missing */ 159 @UnsupportedAppUsage 160 REQUIRED_VALUES_MISSING(0x36), 161 162 /** USSD Return Error */ 163 USSD_RETURN_ERROR(0x37), 164 165 /** MultipleCard commands error */ 166 MULTI_CARDS_CMD_ERROR(0x38), 167 168 /** 169 * Interaction with call control by USIM or MO short message control by 170 * USIM, permanent problem 171 */ 172 @UnsupportedAppUsage 173 USIM_CALL_CONTROL_PERMANENT(0x39), 174 175 /** Bearer Independent Protocol error */ 176 @UnsupportedAppUsage 177 BIP_ERROR(0x3a), 178 179 /** Access Technology unable to process command */ 180 ACCESS_TECH_UNABLE_TO_PROCESS(0x3b), 181 182 /** Frames error */ 183 FRAMES_ERROR(0x3c), 184 185 /** MMS Error */ 186 MMS_ERROR(0x3d); 187 188 189 private int mCode; 190 ResultCode(int code)191 ResultCode(int code) { 192 mCode = code; 193 } 194 195 /** 196 * Retrieves the actual result code that this object represents. 197 * @return Actual result code 198 */ 199 @UnsupportedAppUsage value()200 public int value() { 201 return mCode; 202 } 203 fromInt(int value)204 public static ResultCode fromInt(int value) { 205 for (ResultCode r : ResultCode.values()) { 206 if (r.mCode == value) { 207 return r; 208 } 209 } 210 return null; 211 } 212 } 213