From 0c82481e783a2fa7d97bbd6140be3f8c3642e4e0 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Sat, 21 Sep 2013 09:01:19 -0700 Subject: Do not always call setIsConnectedToProvisioningNetwork(false) Previously I was calling setIsConnectedToProvisioningNetwork(false) always, but all MDST's receive every broadcast. Thus we could over write an MDST's mNetworkInfo.mIsConnectedToProvisioningNetwork to false, unless the MDST that was set to true was last, i.e the code was order dependent. If the provisioning networks value was false instead of true when handleMobileProvisioningAction was called we wouldn't invoke mdst.enableMobileProvisioning because network info would be null. Thus the provisioning network would never transition to CONNECTED and a default route wouldn't get setup and the browser couldn't access the website. Now setIsConnectedToProvisioningNetwork is only set to false when the apnType matches and we won't indiscriminately change it and are not order dependent. Bug: 10853805 Change-Id: I68a4f9bdf5dc18d90f4cdef7a60811f57be67261 --- core/java/android/net/MobileDataStateTracker.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java index e09254b18419..b2b5314b281b 100644 --- a/core/java/android/net/MobileDataStateTracker.java +++ b/core/java/android/net/MobileDataStateTracker.java @@ -190,8 +190,6 @@ public class MobileDataStateTracker implements NetworkStateTracker { private class MobileDataStateReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - // Assume this isn't a provisioning network. - mNetworkInfo.setIsConnectedToProvisioningNetwork(false); if (intent.getAction().equals(TelephonyIntents. ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN)) { String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY); @@ -218,6 +216,8 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (!TextUtils.equals(apnType, mApnType)) { return; } + // Assume this isn't a provisioning network. + mNetworkInfo.setIsConnectedToProvisioningNetwork(false); if (DBG) { log("Broadcast received: " + intent.getAction() + " apnType=" + apnType); } @@ -299,6 +299,8 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (!TextUtils.equals(apnType, mApnType)) { return; } + // Assume this isn't a provisioning network. + mNetworkInfo.setIsConnectedToProvisioningNetwork(false); String reason = intent.getStringExtra(PhoneConstants.FAILURE_REASON_KEY); String apnName = intent.getStringExtra(PhoneConstants.DATA_APN_KEY); if (DBG) { -- cgit v1.2.3