blob: 91032f342045890a3a6fc558cb09fffaf399adf0 [file] [log] [blame]
Wink Saville33034b132012-07-10 12:37:54 -07001/*
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 */
16package com.android.internal.telephony;
17
18import com.android.internal.util.Protocol;
19
20/**
21 * @hide
22 */
23public class DctConstants {
24 /**
25 * IDLE: ready to start data connection setup, default state
Wink Saville33034b132012-07-10 12:37:54 -070026 * CONNECTING: state of issued startPppd() but not finish yet
27 * SCANNING: data connection fails with one apn but other apns are available
28 * ready to start data connection on other apns (before INITING)
29 * CONNECTED: IP connection is setup
30 * DISCONNECTING: Connection.disconnect() has been called, but PDP
31 * context is not yet deactivated
32 * FAILED: data connection fail for all apns settings
Wink Saville75c1e692013-03-20 17:06:50 -070033 * RETRYING: data connection failed but we're going to retry.
Wink Saville33034b132012-07-10 12:37:54 -070034 *
35 * getDataConnectionState() maps State to DataState
36 * FAILED or IDLE : DISCONNECTED
Wink Saville75c1e692013-03-20 17:06:50 -070037 * RETRYING or CONNECTING or SCANNING: CONNECTING
Wink Saville33034b132012-07-10 12:37:54 -070038 * CONNECTED : CONNECTED or DISCONNECTING
39 */
40 public enum State {
41 IDLE,
Wink Saville33034b132012-07-10 12:37:54 -070042 CONNECTING,
43 SCANNING,
44 CONNECTED,
45 DISCONNECTING,
Wink Saville75c1e692013-03-20 17:06:50 -070046 FAILED,
Jack Yu090dd722015-12-18 15:16:24 -080047 RETRYING // After moving retry manager to ApnContext, we'll never enter this state!
48 // Todo: Remove this state and other places that use this state and then
49 // rename SCANNING to RETRYING.
Wink Saville33034b132012-07-10 12:37:54 -070050 }
51
52 public enum Activity {
53 NONE,
54 DATAIN,
55 DATAOUT,
56 DATAINANDOUT,
57 DORMANT
58 }
59
60 /***** Event Codes *****/
61 public static final int BASE = Protocol.BASE_DATA_CONNECTION_TRACKER;
62 public static final int EVENT_DATA_SETUP_COMPLETE = BASE + 0;
63 public static final int EVENT_RADIO_AVAILABLE = BASE + 1;
64 public static final int EVENT_RECORDS_LOADED = BASE + 2;
65 public static final int EVENT_TRY_SETUP_DATA = BASE + 3;
66 public static final int EVENT_DATA_STATE_CHANGED = BASE + 4;
67 public static final int EVENT_POLL_PDP = BASE + 5;
68 public static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = BASE + 6;
69 public static final int EVENT_VOICE_CALL_STARTED = BASE + 7;
70 public static final int EVENT_VOICE_CALL_ENDED = BASE + 8;
71 public static final int EVENT_DATA_CONNECTION_DETACHED = BASE + 9;
72 public static final int EVENT_LINK_STATE_CHANGED = BASE + 10;
73 public static final int EVENT_ROAMING_ON = BASE + 11;
74 public static final int EVENT_ROAMING_OFF = BASE + 12;
75 public static final int EVENT_ENABLE_NEW_APN = BASE + 13;
76 public static final int EVENT_RESTORE_DEFAULT_APN = BASE + 14;
77 public static final int EVENT_DISCONNECT_DONE = BASE + 15;
78 public static final int EVENT_DATA_CONNECTION_ATTACHED = BASE + 16;
79 public static final int EVENT_DATA_STALL_ALARM = BASE + 17;
80 public static final int EVENT_DO_RECOVERY = BASE + 18;
81 public static final int EVENT_APN_CHANGED = BASE + 19;
82 public static final int EVENT_CDMA_DATA_DETACHED = BASE + 20;
83 public static final int EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED = BASE + 21;
84 public static final int EVENT_PS_RESTRICT_ENABLED = BASE + 22;
85 public static final int EVENT_PS_RESTRICT_DISABLED = BASE + 23;
86 public static final int EVENT_CLEAN_UP_CONNECTION = BASE + 24;
87 public static final int EVENT_CDMA_OTA_PROVISION = BASE + 25;
88 public static final int EVENT_RESTART_RADIO = BASE + 26;
89 public static final int EVENT_SET_INTERNAL_DATA_ENABLE = BASE + 27;
90 public static final int EVENT_RESET_DONE = BASE + 28;
91 public static final int EVENT_CLEAN_UP_ALL_CONNECTIONS = BASE + 29;
92 public static final int CMD_SET_USER_DATA_ENABLE = BASE + 30;
93 public static final int CMD_SET_DEPENDENCY_MET = BASE + 31;
94 public static final int CMD_SET_POLICY_DATA_ENABLE = BASE + 32;
Alex Yakavenkaa6ce25c2012-08-08 10:30:11 -070095 public static final int EVENT_ICC_CHANGED = BASE + 33;
Wink Saville75c1e692013-03-20 17:06:50 -070096 public static final int EVENT_DISCONNECT_DC_RETRYING = BASE + 34;
97 public static final int EVENT_DATA_SETUP_COMPLETE_ERROR = BASE + 35;
Wink Savilleab9321d2013-06-29 21:10:57 -070098 public static final int CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA = BASE + 36;
Wink Saville948282b2013-08-29 08:55:16 -070099 public static final int CMD_ENABLE_MOBILE_PROVISIONING = BASE + 37;
100 public static final int CMD_IS_PROVISIONING_APN = BASE + 38;
Wink Savillece1e3792013-09-03 16:41:44 -0700101 public static final int EVENT_PROVISIONING_APN_ALARM = BASE + 39;
Yashdev Singh64ce5042013-10-04 17:24:57 -0700102 public static final int CMD_NET_STAT_POLL = BASE + 40;
Robert Greenwalt5acfa702014-05-28 20:15:13 -0700103 public static final int EVENT_DATA_RAT_CHANGED = BASE + 41;
Paul Jensen1de55d32014-10-14 21:06:14 -0400104 public static final int CMD_CLEAR_PROVISIONING_SPINNER = BASE + 42;
Robert Greenwaltbeb482c2016-03-28 15:40:56 -0700105 public static final int EVENT_DEVICE_PROVISIONED_CHANGE = BASE + 43;
fionaxub5592dc2016-04-08 13:19:31 -0700106 public static final int EVENT_REDIRECTION_DETECTED = BASE + 44;
Robert Greenwalteb17ccb2016-06-08 14:19:00 -0700107 public static final int EVENT_PCO_DATA_RECEIVED = BASE + 45;
Jack Yu8781b682016-07-08 14:28:51 -0700108 public static final int EVENT_SET_CARRIER_DATA_ENABLED = BASE + 46;
Jack Yu611c6912017-05-03 13:32:30 -0700109 public static final int EVENT_DATA_RECONNECT = BASE + 47;
Malcolm Chenb0d99e42017-08-25 16:31:41 -0700110 public static final int EVENT_ROAMING_SETTING_CHANGE = BASE + 48;
Wink Saville33034b132012-07-10 12:37:54 -0700111
112 /***** Constants *****/
113
114 public static final int APN_INVALID_ID = -1;
115 public static final int APN_DEFAULT_ID = 0;
116 public static final int APN_MMS_ID = 1;
117 public static final int APN_SUPL_ID = 2;
118 public static final int APN_DUN_ID = 3;
119 public static final int APN_HIPRI_ID = 4;
120 public static final int APN_IMS_ID = 5;
121 public static final int APN_FOTA_ID = 6;
122 public static final int APN_CBS_ID = 7;
Wink Saville5e56bc52013-07-29 15:00:57 -0700123 public static final int APN_IA_ID = 8;
Ram3e0e3bc2014-06-26 11:03:44 -0700124 public static final int APN_EMERGENCY_ID = 9;
125 public static final int APN_NUM_TYPES = 10;
Wink Saville33034b132012-07-10 12:37:54 -0700126
Wink Saville05e6dde2014-08-31 19:24:10 -0700127 public static final int INVALID = -1;
Wink Saville33034b132012-07-10 12:37:54 -0700128 public static final int DISABLED = 0;
129 public static final int ENABLED = 1;
130
131 public static final String APN_TYPE_KEY = "apnType";
Wink Saville948282b2013-08-29 08:55:16 -0700132 public static final String PROVISIONING_URL_KEY = "provisioningUrl";
Wink Saville33034b132012-07-10 12:37:54 -0700133}