blob: 5b44012673b91be7561dd61fb8f412381ef2ec18 [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
Artur Satayev74cb7192019-12-10 17:47:56 +000018import android.compat.annotation.UnsupportedAppUsage;
Wink Saville33034b132012-07-10 12:37:54 -070019
Artur Satayev74cb7192019-12-10 17:47:56 +000020import com.android.internal.util.Protocol;
Artur Satayev7c3d1572019-08-13 18:03:58 +010021
Wink Saville33034b132012-07-10 12:37:54 -070022/**
23 * @hide
24 */
25public class DctConstants {
26 /**
27 * IDLE: ready to start data connection setup, default state
Wink Saville33034b132012-07-10 12:37:54 -070028 * CONNECTING: state of issued startPppd() but not finish yet
Jack Yu239aa0a2018-12-23 19:59:08 -080029 * RETRYING: data connection fails with one apn but other apns are available
Wink Saville33034b132012-07-10 12:37:54 -070030 * ready to start data connection on other apns (before INITING)
31 * CONNECTED: IP connection is setup
32 * DISCONNECTING: Connection.disconnect() has been called, but PDP
33 * context is not yet deactivated
34 * FAILED: data connection fail for all apns settings
Wink Saville75c1e692013-03-20 17:06:50 -070035 * RETRYING: data connection failed but we're going to retry.
Wink Saville33034b132012-07-10 12:37:54 -070036 *
37 * getDataConnectionState() maps State to DataState
38 * FAILED or IDLE : DISCONNECTED
Jack Yu239aa0a2018-12-23 19:59:08 -080039 * RETRYING or CONNECTING: CONNECTING
Wink Saville33034b132012-07-10 12:37:54 -070040 * CONNECTED : CONNECTED or DISCONNECTING
41 */
Artur Satayev7c3d1572019-08-13 18:03:58 +010042 @UnsupportedAppUsage(implicitMember =
43 "values()[Lcom/android/internal/telephony/DctConstants$State;")
Wink Saville33034b132012-07-10 12:37:54 -070044 public enum State {
Artur Satayev7c3d1572019-08-13 18:03:58 +010045 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070046 IDLE,
Artur Satayev7c3d1572019-08-13 18:03:58 +010047 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070048 CONNECTING,
Artur Satayev7c3d1572019-08-13 18:03:58 +010049 @UnsupportedAppUsage
Jack Yu239aa0a2018-12-23 19:59:08 -080050 RETRYING,
Artur Satayev7c3d1572019-08-13 18:03:58 +010051 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070052 CONNECTED,
Artur Satayev7c3d1572019-08-13 18:03:58 +010053 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070054 DISCONNECTING,
Artur Satayev7c3d1572019-08-13 18:03:58 +010055 @UnsupportedAppUsage
Wink Saville75c1e692013-03-20 17:06:50 -070056 FAILED,
Wink Saville33034b132012-07-10 12:37:54 -070057 }
58
Artur Satayev7c3d1572019-08-13 18:03:58 +010059 @UnsupportedAppUsage(implicitMember =
60 "values()[Lcom/android/internal/telephony/DctConstants$Activity;")
Wink Saville33034b132012-07-10 12:37:54 -070061 public enum Activity {
62 NONE,
Artur Satayev7c3d1572019-08-13 18:03:58 +010063 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070064 DATAIN,
Artur Satayev7c3d1572019-08-13 18:03:58 +010065 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070066 DATAOUT,
Artur Satayev7c3d1572019-08-13 18:03:58 +010067 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070068 DATAINANDOUT,
Artur Satayev7c3d1572019-08-13 18:03:58 +010069 @UnsupportedAppUsage
Wink Saville33034b132012-07-10 12:37:54 -070070 DORMANT
71 }
72
73 /***** Event Codes *****/
74 public static final int BASE = Protocol.BASE_DATA_CONNECTION_TRACKER;
75 public static final int EVENT_DATA_SETUP_COMPLETE = BASE + 0;
76 public static final int EVENT_RADIO_AVAILABLE = BASE + 1;
Wink Saville33034b132012-07-10 12:37:54 -070077 public static final int EVENT_TRY_SETUP_DATA = BASE + 3;
Wink Saville33034b132012-07-10 12:37:54 -070078 public static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = BASE + 6;
79 public static final int EVENT_VOICE_CALL_STARTED = BASE + 7;
80 public static final int EVENT_VOICE_CALL_ENDED = BASE + 8;
81 public static final int EVENT_DATA_CONNECTION_DETACHED = BASE + 9;
Wink Saville33034b132012-07-10 12:37:54 -070082 public static final int EVENT_ROAMING_ON = BASE + 11;
83 public static final int EVENT_ROAMING_OFF = BASE + 12;
Jack Yu48103872019-01-16 14:47:38 -080084 public static final int EVENT_ENABLE_APN = BASE + 13;
85 public static final int EVENT_DISABLE_APN = BASE + 14;
Wink Saville33034b132012-07-10 12:37:54 -070086 public static final int EVENT_DISCONNECT_DONE = BASE + 15;
87 public static final int EVENT_DATA_CONNECTION_ATTACHED = BASE + 16;
88 public static final int EVENT_DATA_STALL_ALARM = BASE + 17;
89 public static final int EVENT_DO_RECOVERY = BASE + 18;
90 public static final int EVENT_APN_CHANGED = BASE + 19;
Wink Saville33034b132012-07-10 12:37:54 -070091 public static final int EVENT_PS_RESTRICT_ENABLED = BASE + 22;
92 public static final int EVENT_PS_RESTRICT_DISABLED = BASE + 23;
93 public static final int EVENT_CLEAN_UP_CONNECTION = BASE + 24;
Wink Saville33034b132012-07-10 12:37:54 -070094 public static final int EVENT_RESTART_RADIO = BASE + 26;
Wink Saville33034b132012-07-10 12:37:54 -070095 public static final int EVENT_CLEAN_UP_ALL_CONNECTIONS = BASE + 29;
Wink Saville75c1e692013-03-20 17:06:50 -070096 public static final int EVENT_DATA_SETUP_COMPLETE_ERROR = BASE + 35;
Wink Savilleab9321d2013-06-29 21:10:57 -070097 public static final int CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA = BASE + 36;
Wink Saville948282b2013-08-29 08:55:16 -070098 public static final int CMD_ENABLE_MOBILE_PROVISIONING = BASE + 37;
99 public static final int CMD_IS_PROVISIONING_APN = BASE + 38;
Wink Savillece1e3792013-09-03 16:41:44 -0700100 public static final int EVENT_PROVISIONING_APN_ALARM = BASE + 39;
Yashdev Singh64ce5042013-10-04 17:24:57 -0700101 public static final int CMD_NET_STAT_POLL = BASE + 40;
Robert Greenwalt5acfa702014-05-28 20:15:13 -0700102 public static final int EVENT_DATA_RAT_CHANGED = BASE + 41;
Paul Jensen1de55d32014-10-14 21:06:14 -0400103 public static final int CMD_CLEAR_PROVISIONING_SPINNER = BASE + 42;
Jayachandran C8ef41bf2018-12-06 11:12:07 -0800104 public static final int EVENT_NETWORK_STATUS_CHANGED = BASE + 44;
Robert Greenwalteb17ccb2016-06-08 14:19:00 -0700105 public static final int EVENT_PCO_DATA_RECEIVED = BASE + 45;
Jack Yu5bf83d82018-12-13 13:37:48 -0800106 public static final int EVENT_DATA_ENABLED_CHANGED = BASE + 46;
Jack Yu611c6912017-05-03 13:32:30 -0700107 public static final int EVENT_DATA_RECONNECT = BASE + 47;
Malcolm Chenb0d99e42017-08-25 16:31:41 -0700108 public static final int EVENT_ROAMING_SETTING_CHANGE = BASE + 48;
Jack Yufcbda452018-02-01 14:50:53 -0800109 public static final int EVENT_DATA_SERVICE_BINDING_CHANGED = BASE + 49;
chen xu61fbefbbe2019-01-15 16:17:47 -0800110 public static final int EVENT_DEVICE_PROVISIONED_CHANGE = BASE + 50;
Jack Yu0d26d712019-05-23 16:37:35 -0700111 public static final int EVENT_DATA_ENABLED_OVERRIDE_RULES_CHANGED = BASE + 51;
Sarah Chin86b8a842020-04-23 10:48:29 -0700112 public static final int EVENT_TELEPHONY_DISPLAY_INFO_CHANGED = BASE + 52;
113 public static final int EVENT_NR_TIMER_WATCHDOG = BASE + 53;
114 public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 54;
115 public static final int EVENT_SIM_STATE_UPDATED = BASE + 55;
Avinash Nalluri4f302c12020-11-30 14:23:48 -0800116 public static final int EVENT_GET_RADIO_CAPABILITY = BASE + 56;
Wink Saville33034b132012-07-10 12:37:54 -0700117
118 /***** Constants *****/
119
Wink Saville05e6dde2014-08-31 19:24:10 -0700120 public static final int INVALID = -1;
Wink Saville33034b132012-07-10 12:37:54 -0700121 public static final int DISABLED = 0;
122 public static final int ENABLED = 1;
123
124 public static final String APN_TYPE_KEY = "apnType";
Wink Saville948282b2013-08-29 08:55:16 -0700125 public static final String PROVISIONING_URL_KEY = "provisioningUrl";
Sarah Chin5023ffd2020-02-07 10:33:06 -0800126 public static final String BANDWIDTH_SOURCE_MODEM_KEY = "modem";
127 public static final String BANDWIDTH_SOURCE_CARRIER_CONFIG_KEY = "carrier_config";
Sarah Chin152161a2020-03-18 19:10:37 -0700128 public static final String RAT_NAME_LTE = "LTE";
129 public static final String RAT_NAME_NR_NSA = "NR_NSA";
130 public static final String RAT_NAME_NR_NSA_MMWAVE = "NR_NSA_MMWAVE";
Wink Saville33034b132012-07-10 12:37:54 -0700131}