blob: 80c985f1d5c57e0b511d2d1f17b2cea3ba6e7cd6 [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
33 *
34 * getDataConnectionState() maps State to DataState
35 * FAILED or IDLE : DISCONNECTED
Robert Greenwalt8c190cc2012-12-06 11:07:57 -080036 * CONNECTING or SCANNING: CONNECTING
Wink Saville33034b132012-07-10 12:37:54 -070037 * CONNECTED : CONNECTED or DISCONNECTING
38 */
39 public enum State {
40 IDLE,
Wink Saville33034b132012-07-10 12:37:54 -070041 CONNECTING,
42 SCANNING,
43 CONNECTED,
44 DISCONNECTING,
45 FAILED
46 }
47
48 public enum Activity {
49 NONE,
50 DATAIN,
51 DATAOUT,
52 DATAINANDOUT,
53 DORMANT
54 }
55
56 /***** Event Codes *****/
57 public static final int BASE = Protocol.BASE_DATA_CONNECTION_TRACKER;
58 public static final int EVENT_DATA_SETUP_COMPLETE = BASE + 0;
59 public static final int EVENT_RADIO_AVAILABLE = BASE + 1;
60 public static final int EVENT_RECORDS_LOADED = BASE + 2;
61 public static final int EVENT_TRY_SETUP_DATA = BASE + 3;
62 public static final int EVENT_DATA_STATE_CHANGED = BASE + 4;
63 public static final int EVENT_POLL_PDP = BASE + 5;
64 public static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = BASE + 6;
65 public static final int EVENT_VOICE_CALL_STARTED = BASE + 7;
66 public static final int EVENT_VOICE_CALL_ENDED = BASE + 8;
67 public static final int EVENT_DATA_CONNECTION_DETACHED = BASE + 9;
68 public static final int EVENT_LINK_STATE_CHANGED = BASE + 10;
69 public static final int EVENT_ROAMING_ON = BASE + 11;
70 public static final int EVENT_ROAMING_OFF = BASE + 12;
71 public static final int EVENT_ENABLE_NEW_APN = BASE + 13;
72 public static final int EVENT_RESTORE_DEFAULT_APN = BASE + 14;
73 public static final int EVENT_DISCONNECT_DONE = BASE + 15;
74 public static final int EVENT_DATA_CONNECTION_ATTACHED = BASE + 16;
75 public static final int EVENT_DATA_STALL_ALARM = BASE + 17;
76 public static final int EVENT_DO_RECOVERY = BASE + 18;
77 public static final int EVENT_APN_CHANGED = BASE + 19;
78 public static final int EVENT_CDMA_DATA_DETACHED = BASE + 20;
79 public static final int EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED = BASE + 21;
80 public static final int EVENT_PS_RESTRICT_ENABLED = BASE + 22;
81 public static final int EVENT_PS_RESTRICT_DISABLED = BASE + 23;
82 public static final int EVENT_CLEAN_UP_CONNECTION = BASE + 24;
83 public static final int EVENT_CDMA_OTA_PROVISION = BASE + 25;
84 public static final int EVENT_RESTART_RADIO = BASE + 26;
85 public static final int EVENT_SET_INTERNAL_DATA_ENABLE = BASE + 27;
86 public static final int EVENT_RESET_DONE = BASE + 28;
87 public static final int EVENT_CLEAN_UP_ALL_CONNECTIONS = BASE + 29;
88 public static final int CMD_SET_USER_DATA_ENABLE = BASE + 30;
89 public static final int CMD_SET_DEPENDENCY_MET = BASE + 31;
90 public static final int CMD_SET_POLICY_DATA_ENABLE = BASE + 32;
Alex Yakavenkaa6ce25c2012-08-08 10:30:11 -070091 public static final int EVENT_ICC_CHANGED = BASE + 33;
Wink Saville33034b132012-07-10 12:37:54 -070092
93 /***** Constants *****/
94
95 public static final int APN_INVALID_ID = -1;
96 public static final int APN_DEFAULT_ID = 0;
97 public static final int APN_MMS_ID = 1;
98 public static final int APN_SUPL_ID = 2;
99 public static final int APN_DUN_ID = 3;
100 public static final int APN_HIPRI_ID = 4;
101 public static final int APN_IMS_ID = 5;
102 public static final int APN_FOTA_ID = 6;
103 public static final int APN_CBS_ID = 7;
104 public static final int APN_NUM_TYPES = 8;
105
106 public static final int DISABLED = 0;
107 public static final int ENABLED = 1;
108
109 public static final String APN_TYPE_KEY = "apnType";
110 public static String ACTION_DATA_CONNECTION_TRACKER_MESSENGER =
111 "com.android.internal.telephony";
112 public static String EXTRA_MESSENGER = "EXTRA_MESSENGER";
113}