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