summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2013-08-29 08:55:16 -0700
committerWink Saville <wink@google.com>2013-08-29 08:55:16 -0700
commit948282b0e6cf5310f09db97a4ae939db7c1cef72 (patch)
tree8d24b04f379e58a6fa40751106ff2452a6c54e62 /telephony/java
parentdce52cdbf1eab8bd979bf4676973699c39f7b32e (diff)
downloadframeworks_base-948282b0e6cf5310f09db97a4ae939db7c1cef72.zip
frameworks_base-948282b0e6cf5310f09db97a4ae939db7c1cef72.tar.gz
frameworks_base-948282b0e6cf5310f09db97a4ae939db7c1cef72.tar.bz2
Add support for handling mobile provisioning networks.
When a sim is new or it has expired it needs to be provisioned with the carrier. Basically provisioning is associating a sim with a user account. When a sim isn't provisioned then operators will restrict access to the network and only allow certain addresses or services to be used. This set of changes allows two types of provisioning networks to be recognized. The first is a network that causes all DNS lookups to be redirected to a different address than was intended. This is exemplified by how T-Mobile works. The second technique uses a special apn for provisioning. An example is AT&T where lwaactivate is the provisioning apn and broadband is the normal apn. We first try broadband and if we are unable to connect we try lwaactivate. When we see the activate we identify it as special and the ApnContext.isProvisioningApn will return true. In the future our plan is to create a new network type that can be added to the apn list, but for now it identified by name. Here is a list of significant changes: - CaptivePortalTracker now only test WiFi networks instead of all networks - checkMobileProvisioning checks for provisioning networks and doesn't try to ping. - IConnectivityManager.aidl changes: * getProvisioningOrActiveNetworkInfo was added to and used by Manage mobile plan in WirelessSettings so even when there is no active network it will still allow provisioning. Otherwise it would report no internet connection. * setSignInErrorNotificationVisible is used by both CaptiviePortalTracker and checkMobileProvisioning so they use the same code for the notifications. * checkMobileProvisioning was simplified to have only a timeout as returning the result is now harder as we abort simultaneous call otherwise we'd could get into loops because we now check every time we connect to mobile. - Enhanced MDST to handle the provisioning network. - Added CONNECTED_TO_PROVISIONING_NETWORK to NetworkInfo to make a new state so we don't announce to the world we're connected. - TelephonyIntents.ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN is sent by the low level data connection code to notify Connectivity Service that a provisioning apn has connected. This allows CS to handle the connection differently than a normal connection. Bug: 10328264 Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/com/android/internal/telephony/DctConstants.java3
-rw-r--r--telephony/java/com/android/internal/telephony/TelephonyIntents.java23
2 files changed, 26 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/DctConstants.java b/telephony/java/com/android/internal/telephony/DctConstants.java
index 4d8342c..eb93e9c 100644
--- a/telephony/java/com/android/internal/telephony/DctConstants.java
+++ b/telephony/java/com/android/internal/telephony/DctConstants.java
@@ -94,6 +94,8 @@ public class DctConstants {
public static final int EVENT_DISCONNECT_DC_RETRYING = BASE + 34;
public static final int EVENT_DATA_SETUP_COMPLETE_ERROR = BASE + 35;
public static final int CMD_SET_ENABLE_FAIL_FAST_MOBILE_DATA = BASE + 36;
+ public static final int CMD_ENABLE_MOBILE_PROVISIONING = BASE + 37;
+ public static final int CMD_IS_PROVISIONING_APN = BASE + 38;
/***** Constants *****/
@@ -112,4 +114,5 @@ public class DctConstants {
public static final int ENABLED = 1;
public static final String APN_TYPE_KEY = "apnType";
+ public static final String PROVISIONING_URL_KEY = "provisioningUrl";
}
diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
index 3cfd0bf..40a3c8f 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -145,6 +145,29 @@ public class TelephonyIntents {
public static final String ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
= "android.intent.action.ANY_DATA_STATE";
+ /**
+ * Broadcast Action: Occurs when a data connection connects to a provisioning apn
+ * and is broadcast by the low level data connection code.
+ * The intent will have the following extra values:</p>
+ * <ul>
+ * <li><em>apn</em> - A string that is the APN associated with this
+ * connection.</li>
+ * <li><em>apnType</em> - A string array of APN types associated with
+ * this connection. The APN type <code>"*"</code> is a special
+ * type that means this APN services all types.</li>
+ * <li><em>linkProperties</em> - The <code>LinkProperties</code> for this APN</li>
+ * <li><em>linkCapabilities</em> - The <code>linkCapabilities</code> for this APN</li>
+ * <li><em>iface</em> - A string that is the name of the interface</li>
+ * </ul>
+ *
+ * <p class="note">
+ * Requires the READ_PHONE_STATE permission.
+ *
+ * <p class="note">This is a protected intent that can only be sent
+ * by the system.
+ */
+ public static final String ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN
+ = "android.intent.action.DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN";
/**
* Broadcast Action: An attempt to establish a data connection has failed.