1 /* 2 * Copyright (C) 2012 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 package com.android.internal.telephony; 17 18 /** 19 * @hide 20 */ 21 public class PhoneConstants { 22 23 /** 24 * The phone state. One of the following:<p> 25 * <ul> 26 * <li>IDLE = no phone activity</li> 27 * <li>RINGING = a phone call is ringing or call waiting. 28 * In the latter case, another call is active as well</li> 29 * <li>OFFHOOK = The phone is off hook. At least one call 30 * exists that is dialing, active or holding and no calls are 31 * ringing or waiting.</li> 32 * </ul> 33 */ 34 public enum State { 35 IDLE, RINGING, OFFHOOK; 36 }; 37 38 /** 39 * The state of a data connection. 40 * <ul> 41 * <li>CONNECTED = IP traffic should be available</li> 42 * <li>CONNECTING = Currently setting up data connection</li> 43 * <li>DISCONNECTED = IP not available</li> 44 * <li>SUSPENDED = connection is created but IP traffic is 45 * temperately not available. i.e. voice call is in place 46 * in 2G network</li> 47 * </ul> 48 */ 49 public enum DataState { 50 CONNECTED, CONNECTING, DISCONNECTED, SUSPENDED; 51 }; 52 53 public static final String STATE_KEY = "state"; 54 55 // Radio Type 56 public static final int PHONE_TYPE_NONE = RILConstants.NO_PHONE; 57 public static final int PHONE_TYPE_GSM = RILConstants.GSM_PHONE; 58 public static final int PHONE_TYPE_CDMA = RILConstants.CDMA_PHONE; 59 public static final int PHONE_TYPE_SIP = RILConstants.SIP_PHONE; 60 public static final int PHONE_TYPE_THIRD_PARTY = RILConstants.THIRD_PARTY_PHONE; 61 public static final int PHONE_TYPE_IMS = RILConstants.IMS_PHONE; 62 // Currently this is used only to differentiate CDMA and CDMALTE Phone in GsmCdma* files. For 63 // anything outside of that, a cdma + lte phone is still CDMA_PHONE 64 public static final int PHONE_TYPE_CDMA_LTE = RILConstants.CDMA_LTE_PHONE; 65 66 // Modes for LTE_ON_CDMA 67 public static final int LTE_ON_CDMA_UNKNOWN = RILConstants.LTE_ON_CDMA_UNKNOWN; 68 public static final int LTE_ON_CDMA_FALSE = RILConstants.LTE_ON_CDMA_FALSE; 69 public static final int LTE_ON_CDMA_TRUE = RILConstants.LTE_ON_CDMA_TRUE; 70 71 // Number presentation type for caller id display (From internal/Connection.java) 72 public static final int PRESENTATION_ALLOWED = 1; // normal 73 public static final int PRESENTATION_RESTRICTED = 2; // block by user 74 public static final int PRESENTATION_UNKNOWN = 3; // no specified or unknown by network 75 public static final int PRESENTATION_PAYPHONE = 4; // show pay phone info 76 77 // Sim activation type 78 public static final int SIM_ACTIVATION_TYPE_VOICE = 0; 79 public static final int SIM_ACTIVATION_TYPE_DATA = 1; 80 81 public static final String PHONE_NAME_KEY = "phoneName"; 82 public static final String DATA_NETWORK_TYPE_KEY = "networkType"; 83 public static final String DATA_FAILURE_CAUSE_KEY = "failCause"; 84 public static final String DATA_APN_TYPE_KEY = "apnType"; 85 public static final String DATA_APN_KEY = "apn"; 86 public static final String DATA_LINK_PROPERTIES_KEY = "linkProperties"; 87 public static final String DATA_NETWORK_CAPABILITIES_KEY = "networkCapabilities"; 88 89 public static final String DATA_IFACE_NAME_KEY = "iface"; 90 public static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable"; 91 public static final String DATA_NETWORK_ROAMING_KEY = "networkRoaming"; 92 public static final String PHONE_IN_ECM_STATE = "phoneinECMState"; 93 public static final String PHONE_IN_EMERGENCY_CALL = "phoneInEmergencyCall"; 94 95 public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged"; 96 97 /** 98 * Return codes for supplyPinReturnResult and 99 * supplyPukReturnResult APIs 100 */ 101 public static final int PIN_RESULT_SUCCESS = 0; 102 public static final int PIN_PASSWORD_INCORRECT = 1; 103 public static final int PIN_GENERAL_FAILURE = 2; 104 105 /** 106 * Return codes for <code>enableApnType()</code> 107 */ 108 public static final int APN_ALREADY_ACTIVE = 0; 109 public static final int APN_REQUEST_STARTED = 1; 110 public static final int APN_TYPE_NOT_AVAILABLE = 2; 111 public static final int APN_REQUEST_FAILED = 3; 112 public static final int APN_ALREADY_INACTIVE = 4; 113 114 /** 115 * APN types for data connections. These are usage categories for an APN 116 * entry. One APN entry may support multiple APN types, eg, a single APN 117 * may service regular internet traffic ("default") as well as MMS-specific 118 * connections.<br/> 119 * APN_TYPE_ALL is a special type to indicate that this APN entry can 120 * service all data connections. 121 */ 122 public static final String APN_TYPE_ALL = "*"; 123 /** APN type for default data traffic */ 124 public static final String APN_TYPE_DEFAULT = "default"; 125 /** APN type for MMS traffic */ 126 public static final String APN_TYPE_MMS = "mms"; 127 /** APN type for SUPL assisted GPS */ 128 public static final String APN_TYPE_SUPL = "supl"; 129 /** APN type for DUN traffic */ 130 public static final String APN_TYPE_DUN = "dun"; 131 /** APN type for HiPri traffic */ 132 public static final String APN_TYPE_HIPRI = "hipri"; 133 /** APN type for FOTA */ 134 public static final String APN_TYPE_FOTA = "fota"; 135 /** APN type for IMS */ 136 public static final String APN_TYPE_IMS = "ims"; 137 /** APN type for CBS */ 138 public static final String APN_TYPE_CBS = "cbs"; 139 /** APN type for IA Initial Attach APN */ 140 public static final String APN_TYPE_IA = "ia"; 141 /** APN type for Emergency PDN. This is not an IA apn, but is used 142 * for access to carrier services in an emergency call situation. */ 143 public static final String APN_TYPE_EMERGENCY = "emergency"; 144 /** APN type for Mission Critical Services */ 145 public static final String APN_TYPE_MCX = "mcx"; 146 /** Array of all APN types */ 147 public static final String[] APN_TYPES = {APN_TYPE_DEFAULT, 148 APN_TYPE_MMS, 149 APN_TYPE_SUPL, 150 APN_TYPE_DUN, 151 APN_TYPE_HIPRI, 152 APN_TYPE_FOTA, 153 APN_TYPE_IMS, 154 APN_TYPE_CBS, 155 APN_TYPE_IA, 156 APN_TYPE_EMERGENCY, 157 APN_TYPE_MCX 158 }; 159 160 public static final int RIL_CARD_MAX_APPS = 8; 161 162 public static final int DEFAULT_CARD_INDEX = 0; 163 164 public static final int MAX_PHONE_COUNT_SINGLE_SIM = 1; 165 166 public static final int MAX_PHONE_COUNT_DUAL_SIM = 2; 167 168 public static final int MAX_PHONE_COUNT_TRI_SIM = 3; 169 170 public static final String PHONE_KEY = "phone"; 171 172 public static final String SLOT_KEY = "slot"; 173 174 /** Fired when a subscriptions phone state changes. */ 175 public static final String ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED = 176 "android.intent.action.SUBSCRIPTION_PHONE_STATE"; 177 178 // FIXME: This is used to pass a subId via intents, we need to look at its usage, which is 179 // FIXME: extensive, and see if this should be an array of all active subId's or ...? 180 /** 181 * @Deprecated use {@link android.telephony.SubscriptionManager#EXTRA_SUBSCRIPTION_INDEX} 182 * instead. 183 */ 184 public static final String SUBSCRIPTION_KEY = "subscription"; 185 186 public static final String SUB_SETTING = "subSettings"; 187 188 public static final int SUB1 = 0; 189 public static final int SUB2 = 1; 190 public static final int SUB3 = 2; 191 192 // TODO: Remove these constants and use an int instead. 193 public static final int SIM_ID_1 = 0; 194 public static final int SIM_ID_2 = 1; 195 public static final int SIM_ID_3 = 2; 196 public static final int SIM_ID_4 = 3; 197 198 // ICC SIM Application Types 199 // TODO: Replace the IccCardApplicationStatus.AppType enums with these constants 200 public static final int APPTYPE_UNKNOWN = 0; 201 public static final int APPTYPE_SIM = 1; 202 public static final int APPTYPE_USIM = 2; 203 public static final int APPTYPE_RUIM = 3; 204 public static final int APPTYPE_CSIM = 4; 205 public static final int APPTYPE_ISIM = 5; 206 207 public enum CardUnavailableReason { 208 REASON_CARD_REMOVED, 209 REASON_RADIO_UNAVAILABLE, 210 REASON_SIM_REFRESH_RESET 211 }; 212 213 // Initial MTU value. 214 public static final int UNSET_MTU = 0; 215 216 //FIXME maybe this shouldn't be here - sprout only 217 public static final int CAPABILITY_3G = 1; 218 219 /** 220 * Values for the adb property "persist.radio.videocall.audio.output" 221 */ 222 public static final int AUDIO_OUTPUT_ENABLE_SPEAKER = 0; 223 public static final int AUDIO_OUTPUT_DISABLE_SPEAKER = 1; 224 public static final int AUDIO_OUTPUT_DEFAULT = AUDIO_OUTPUT_ENABLE_SPEAKER; 225 226 // authContext (parameter P2) when doing SIM challenge, 227 // per 3GPP TS 31.102 (Section 7.1.2) 228 public static final int AUTH_CONTEXT_EAP_SIM = 128; 229 public static final int AUTH_CONTEXT_EAP_AKA = 129; 230 public static final int AUTH_CONTEXT_UNDEFINED = -1; 231 232 /** 233 * Value for the global property CELL_ON 234 * 0: Cell radio is off 235 * 1: Cell radio is on 236 * 2: Cell radio is off because airplane mode is enabled 237 */ 238 public static final int CELL_OFF_FLAG = 0; 239 public static final int CELL_ON_FLAG = 1; 240 public static final int CELL_OFF_DUE_TO_AIRPLANE_MODE_FLAG = 2; 241 } 242