diff options
| author | Wink Saville <wink@google.com> | 2013-07-16 17:16:37 -0700 |
|---|---|---|
| committer | Wink Saville <wink@google.com> | 2013-07-16 17:16:37 -0700 |
| commit | fde1ac9bec7b0b868525d6cd0d0d1d96787b59fc (patch) | |
| tree | 99c9f93ebc6070ff81efac4686d9131452c85dd8 /services/java/com/android/server/ConnectivityService.java | |
| parent | c0f5bb70b72c25c0057d2318bbcc8d79553d1e12 (diff) | |
When a SIM is changed check mobile provisioning.
A simple mechanism for doing this is to take advantage of the fact
that we require the device to reboot after a sim has been changed.
Thus when connectivity service is started we wait to get a connection
then call checkMobileProvisioning once. We also add a check that
the DEVICE_PROVISIONED is true, i.e. SetupWizard has been run.
Bug: 9784024
Change-Id: I5c1936744f6fc55a447ae44cd36eec3849d27e21
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 29c546e19722..ca5fc181dcfa 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -375,6 +375,9 @@ public class ConnectivityService extends IConnectivityManager.Stub { TelephonyManager mTelephonyManager; + // We only want one checkMobileProvisioning after booting. + volatile boolean mFirstProvisioningCheckStarted = false; + public ConnectivityService(Context context, INetworkManagementService netd, INetworkStatsService statsService, INetworkPolicyManager policyManager) { // Currently, omitting a NetworkFactory will create one internally @@ -2730,6 +2733,17 @@ public class ConnectivityService extends IConnectivityManager.Stub { state + "/" + info.getDetailedState()); } + // After booting we'll check once for mobile provisioning + // if we've provisioned by and connected. + if (!mFirstProvisioningCheckStarted + && (0 != Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.DEVICE_PROVISIONED, 0)) + && (state == NetworkInfo.State.CONNECTED)) { + log("check provisioning after booting"); + mFirstProvisioningCheckStarted = true; + checkMobileProvisioning(true, CheckMp.MAX_TIMEOUT_MS, null); + } + EventLogTags.writeConnectivityStateChanged( info.getType(), info.getSubtype(), info.getDetailedState().ordinal()); @@ -3548,6 +3562,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { + " resultReceiver=" + resultReceiver); enforceChangePermission(); + mFirstProvisioningCheckStarted = true; + int timeOutMs = suggestedTimeOutMs; if (suggestedTimeOutMs > CheckMp.MAX_TIMEOUT_MS) { timeOutMs = CheckMp.MAX_TIMEOUT_MS; |
