Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 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 | |
Artur Satayev | 74cb719 | 2019-12-10 17:47:56 +0000 | [diff] [blame] | 18 | import android.compat.annotation.UnsupportedAppUsage; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 19 | |
Artur Satayev | 74cb719 | 2019-12-10 17:47:56 +0000 | [diff] [blame] | 20 | import com.android.internal.util.Protocol; |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 21 | |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 22 | /** |
| 23 | * @hide |
| 24 | */ |
| 25 | public class DctConstants { |
| 26 | /** |
| 27 | * IDLE: ready to start data connection setup, default state |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 28 | * CONNECTING: state of issued startPppd() but not finish yet |
Jack Yu | 239aa0a | 2018-12-23 19:59:08 -0800 | [diff] [blame] | 29 | * RETRYING: data connection fails with one apn but other apns are available |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 30 | * 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 Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 35 | * RETRYING: data connection failed but we're going to retry. |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 36 | * |
| 37 | * getDataConnectionState() maps State to DataState |
| 38 | * FAILED or IDLE : DISCONNECTED |
Jack Yu | 239aa0a | 2018-12-23 19:59:08 -0800 | [diff] [blame] | 39 | * RETRYING or CONNECTING: CONNECTING |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 40 | * CONNECTED : CONNECTED or DISCONNECTING |
| 41 | */ |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 42 | @UnsupportedAppUsage(implicitMember = |
| 43 | "values()[Lcom/android/internal/telephony/DctConstants$State;") |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 44 | public enum State { |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 45 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 46 | IDLE, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 47 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 48 | CONNECTING, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 49 | @UnsupportedAppUsage |
Jack Yu | 239aa0a | 2018-12-23 19:59:08 -0800 | [diff] [blame] | 50 | RETRYING, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 51 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 52 | CONNECTED, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 53 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 54 | DISCONNECTING, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 55 | @UnsupportedAppUsage |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 56 | FAILED, |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 57 | } |
| 58 | |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 59 | @UnsupportedAppUsage(implicitMember = |
| 60 | "values()[Lcom/android/internal/telephony/DctConstants$Activity;") |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 61 | public enum Activity { |
| 62 | NONE, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 63 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 64 | DATAIN, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 65 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 66 | DATAOUT, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 67 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 68 | DATAINANDOUT, |
Artur Satayev | 7c3d157 | 2019-08-13 18:03:58 +0100 | [diff] [blame] | 69 | @UnsupportedAppUsage |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 70 | 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 Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 77 | public static final int EVENT_TRY_SETUP_DATA = BASE + 3; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 78 | 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 Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 82 | public static final int EVENT_ROAMING_ON = BASE + 11; |
| 83 | public static final int EVENT_ROAMING_OFF = BASE + 12; |
Jack Yu | 4810387 | 2019-01-16 14:47:38 -0800 | [diff] [blame] | 84 | public static final int EVENT_ENABLE_APN = BASE + 13; |
| 85 | public static final int EVENT_DISABLE_APN = BASE + 14; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 86 | 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 Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 91 | 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 Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 94 | public static final int EVENT_RESTART_RADIO = BASE + 26; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 95 | public static final int EVENT_CLEAN_UP_ALL_CONNECTIONS = BASE + 29; |
Wink Saville | 75c1e69 | 2013-03-20 17:06:50 -0700 | [diff] [blame] | 96 | public static final int EVENT_DATA_SETUP_COMPLETE_ERROR = BASE + 35; |
Wink Saville | ab9321d | 2013-06-29 21:10:57 -0700 | [diff] [blame] | 97 | public static final int CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA = BASE + 36; |
Wink Saville | 948282b | 2013-08-29 08:55:16 -0700 | [diff] [blame] | 98 | public static final int CMD_ENABLE_MOBILE_PROVISIONING = BASE + 37; |
| 99 | public static final int CMD_IS_PROVISIONING_APN = BASE + 38; |
Wink Saville | ce1e379 | 2013-09-03 16:41:44 -0700 | [diff] [blame] | 100 | public static final int EVENT_PROVISIONING_APN_ALARM = BASE + 39; |
Yashdev Singh | 64ce504 | 2013-10-04 17:24:57 -0700 | [diff] [blame] | 101 | public static final int CMD_NET_STAT_POLL = BASE + 40; |
Robert Greenwalt | 5acfa70 | 2014-05-28 20:15:13 -0700 | [diff] [blame] | 102 | public static final int EVENT_DATA_RAT_CHANGED = BASE + 41; |
Paul Jensen | 1de55d3 | 2014-10-14 21:06:14 -0400 | [diff] [blame] | 103 | public static final int CMD_CLEAR_PROVISIONING_SPINNER = BASE + 42; |
Jayachandran C | 8ef41bf | 2018-12-06 11:12:07 -0800 | [diff] [blame] | 104 | public static final int EVENT_NETWORK_STATUS_CHANGED = BASE + 44; |
Robert Greenwalt | eb17ccb | 2016-06-08 14:19:00 -0700 | [diff] [blame] | 105 | public static final int EVENT_PCO_DATA_RECEIVED = BASE + 45; |
Jack Yu | 5bf83d8 | 2018-12-13 13:37:48 -0800 | [diff] [blame] | 106 | public static final int EVENT_DATA_ENABLED_CHANGED = BASE + 46; |
Jack Yu | 611c691 | 2017-05-03 13:32:30 -0700 | [diff] [blame] | 107 | public static final int EVENT_DATA_RECONNECT = BASE + 47; |
Malcolm Chen | b0d99e4 | 2017-08-25 16:31:41 -0700 | [diff] [blame] | 108 | public static final int EVENT_ROAMING_SETTING_CHANGE = BASE + 48; |
Jack Yu | fcbda45 | 2018-02-01 14:50:53 -0800 | [diff] [blame] | 109 | public static final int EVENT_DATA_SERVICE_BINDING_CHANGED = BASE + 49; |
chen xu | 61fbefbbe | 2019-01-15 16:17:47 -0800 | [diff] [blame] | 110 | public static final int EVENT_DEVICE_PROVISIONED_CHANGE = BASE + 50; |
Jack Yu | 0d26d71 | 2019-05-23 16:37:35 -0700 | [diff] [blame] | 111 | public static final int EVENT_DATA_ENABLED_OVERRIDE_RULES_CHANGED = BASE + 51; |
Sarah Chin | 86b8a84 | 2020-04-23 10:48:29 -0700 | [diff] [blame] | 112 | 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 Nalluri | 4f302c1 | 2020-11-30 14:23:48 -0800 | [diff] [blame^] | 116 | public static final int EVENT_GET_RADIO_CAPABILITY = BASE + 56; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 117 | |
| 118 | /***** Constants *****/ |
| 119 | |
Wink Saville | 05e6dde | 2014-08-31 19:24:10 -0700 | [diff] [blame] | 120 | public static final int INVALID = -1; |
Wink Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 121 | public static final int DISABLED = 0; |
| 122 | public static final int ENABLED = 1; |
| 123 | |
| 124 | public static final String APN_TYPE_KEY = "apnType"; |
Wink Saville | 948282b | 2013-08-29 08:55:16 -0700 | [diff] [blame] | 125 | public static final String PROVISIONING_URL_KEY = "provisioningUrl"; |
Sarah Chin | 5023ffd | 2020-02-07 10:33:06 -0800 | [diff] [blame] | 126 | public static final String BANDWIDTH_SOURCE_MODEM_KEY = "modem"; |
| 127 | public static final String BANDWIDTH_SOURCE_CARRIER_CONFIG_KEY = "carrier_config"; |
Sarah Chin | 152161a | 2020-03-18 19:10:37 -0700 | [diff] [blame] | 128 | 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 Saville | 33034b13 | 2012-07-10 12:37:54 -0700 | [diff] [blame] | 131 | } |