2 * Copyright (C) 2012 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package com.android.internal.telephony;
21 public class PhoneConstants {
24 * The phone state. One of the following:<p>
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>
35 IDLE, RINGING, OFFHOOK;
39 * The state of a data connection.
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
49 public enum DataState {
50 CONNECTED, CONNECTING, DISCONNECTED, SUSPENDED;
53 public static final String STATE_KEY = "state";
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;
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;
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
78 public static final String PHONE_NAME_KEY = "phoneName";
79 public static final String FAILURE_REASON_KEY = "reason";
80 public static final String STATE_CHANGE_REASON_KEY = "reason";
81 public static final String DATA_NETWORK_TYPE_KEY = "networkType";
82 public static final String DATA_FAILURE_CAUSE_KEY = "failCause";
83 public static final String DATA_APN_TYPE_KEY = "apnType";
84 public static final String DATA_APN_KEY = "apn";
85 public static final String DATA_LINK_PROPERTIES_KEY = "linkProperties";
86 public static final String DATA_NETWORK_CAPABILITIES_KEY = "networkCapabilities";
88 public static final String DATA_IFACE_NAME_KEY = "iface";
89 public static final String NETWORK_UNAVAILABLE_KEY = "networkUnvailable";
90 public static final String DATA_NETWORK_ROAMING_KEY = "networkRoaming";
91 public static final String PHONE_IN_ECM_STATE = "phoneinECMState";
92 public static final String PHONE_IN_EMERGENCY_CALL = "phoneInEmergencyCall";
94 public static final String REASON_LINK_PROPERTIES_CHANGED = "linkPropertiesChanged";
97 * Return codes for supplyPinReturnResult and
98 * supplyPukReturnResult APIs
100 public static final int PIN_RESULT_SUCCESS = 0;
101 public static final int PIN_PASSWORD_INCORRECT = 1;
102 public static final int PIN_GENERAL_FAILURE = 2;
105 * Return codes for <code>enableApnType()</code>
107 public static final int APN_ALREADY_ACTIVE = 0;
108 public static final int APN_REQUEST_STARTED = 1;
109 public static final int APN_TYPE_NOT_AVAILABLE = 2;
110 public static final int APN_REQUEST_FAILED = 3;
111 public static final int APN_ALREADY_INACTIVE = 4;
114 * APN types for data connections. These are usage categories for an APN
115 * entry. One APN entry may support multiple APN types, eg, a single APN
116 * may service regular internet traffic ("default") as well as MMS-specific
118 * APN_TYPE_ALL is a special type to indicate that this APN entry can
119 * service all data connections.
121 public static final String APN_TYPE_ALL = "*";
122 /** APN type for default data traffic */
123 public static final String APN_TYPE_DEFAULT = "default";
124 /** APN type for MMS traffic */
125 public static final String APN_TYPE_MMS = "mms";
126 /** APN type for SUPL assisted GPS */
127 public static final String APN_TYPE_SUPL = "supl";
128 /** APN type for DUN traffic */
129 public static final String APN_TYPE_DUN = "dun";
130 /** APN type for HiPri traffic */
131 public static final String APN_TYPE_HIPRI = "hipri";
132 /** APN type for FOTA */
133 public static final String APN_TYPE_FOTA = "fota";
134 /** APN type for IMS */
135 public static final String APN_TYPE_IMS = "ims";
136 /** APN type for CBS */
137 public static final String APN_TYPE_CBS = "cbs";
138 /** APN type for IA Initial Attach APN */
139 public static final String APN_TYPE_IA = "ia";
140 /** APN type for Emergency PDN. This is not an IA apn, but is used
141 * for access to carrier services in an emergency call situation. */
142 public static final String APN_TYPE_EMERGENCY = "emergency";
144 public static final int RIL_CARD_MAX_APPS = 8;
146 public static final int DEFAULT_CARD_INDEX = 0;
148 public static final int MAX_PHONE_COUNT_SINGLE_SIM = 1;
150 public static final int MAX_PHONE_COUNT_DUAL_SIM = 2;
152 public static final int MAX_PHONE_COUNT_TRI_SIM = 3;
154 public static final String PHONE_KEY = "phone";
156 public static final String SLOT_KEY = "slot";
158 /** Fired when a subscriptions phone state changes. */
159 public static final String ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED =
160 "android.intent.action.SUBSCRIPTION_PHONE_STATE";
162 // FIXME: This is used to pass a subId via intents, we need to look at its usage, which is
163 // FIXME: extensive, and see if this should be an array of all active subId's or ...?
164 public static final String SUBSCRIPTION_KEY = "subscription";
166 public static final String SUB_SETTING = "subSettings";
168 public static final int SUB1 = 0;
169 public static final int SUB2 = 1;
170 public static final int SUB3 = 2;
172 // TODO: Remove these constants and use an int instead.
173 public static final int SIM_ID_1 = 0;
174 public static final int SIM_ID_2 = 1;
175 public static final int SIM_ID_3 = 2;
176 public static final int SIM_ID_4 = 3;
178 // ICC SIM Application Types
179 // TODO: Replace the IccCardApplicationStatus.AppType enums with these constants
180 public static final int APPTYPE_UNKNOWN = 0;
181 public static final int APPTYPE_SIM = 1;
182 public static final int APPTYPE_USIM = 2;
183 public static final int APPTYPE_RUIM = 3;
184 public static final int APPTYPE_CSIM = 4;
185 public static final int APPTYPE_ISIM = 5;
187 public enum CardUnavailableReason {
189 REASON_RADIO_UNAVAILABLE,
190 REASON_SIM_REFRESH_RESET
193 // Initial MTU value.
194 public static final int UNSET_MTU = 0;
196 //FIXME maybe this shouldn't be here - sprout only
197 public static final int CAPABILITY_3G = 1;
200 * Values for the adb property "persist.radio.videocall.audio.output"
202 public static final int AUDIO_OUTPUT_ENABLE_SPEAKER = 0;
203 public static final int AUDIO_OUTPUT_DISABLE_SPEAKER = 1;
204 public static final int AUDIO_OUTPUT_DEFAULT = AUDIO_OUTPUT_ENABLE_SPEAKER;
206 // authContext (parameter P2) when doing SIM challenge,
207 // per 3GPP TS 31.102 (Section 7.1.2)
208 public static final int AUTH_CONTEXT_EAP_SIM = 128;
209 public static final int AUTH_CONTEXT_EAP_AKA = 129;
210 public static final int AUTH_CONTEXT_UNDEFINED = -1;