diff options
author | Irfan Sheriff <isheriff@google.com> | 2012-09-20 13:33:51 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-20 13:33:52 -0700 |
commit | 314488b791d36756504ee593f818f04b4cd24893 (patch) | |
tree | 75192abbc12701b86885b4866aed2cd0f41804e1 /services | |
parent | d86077c3792ca03f004376d81e449a3ecdaa5e8b (diff) | |
parent | 9538bdd3c77968c7673719c580ae653ede4654d6 (diff) | |
download | frameworks_base-314488b791d36756504ee593f818f04b4cd24893.zip frameworks_base-314488b791d36756504ee593f818f04b4cd24893.tar.gz frameworks_base-314488b791d36756504ee593f818f04b4cd24893.tar.bz2 |
Merge "Captive check for both mobile and wifi" into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 5c7a3ed..9676eb9 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -32,6 +32,7 @@ import static android.net.ConnectivityManager.isNetworkTypeValid; import static android.net.NetworkPolicyManager.RULE_ALLOW_ALL; import static android.net.NetworkPolicyManager.RULE_REJECT_METERED; +import android.app.Activity; import android.bluetooth.BluetoothTetheringDataTracker; import android.content.BroadcastReceiver; import android.content.ContentResolver; @@ -548,6 +549,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { mSettingsObserver = new SettingsObserver(mHandler, EVENT_APPLY_GLOBAL_HTTP_PROXY); mSettingsObserver.observe(mContext); + mCaptivePortalTracker = CaptivePortalTracker.makeCaptivePortalTracker(mContext, this); loadGlobalProxy(); } @@ -1694,7 +1696,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { } Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION); - intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, info); + intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, new NetworkInfo(info)); intent.putExtra(ConnectivityManager.EXTRA_NETWORK_TYPE, info.getType()); if (info.isFailover()) { intent.putExtra(ConnectivityManager.EXTRA_IS_FAILOVER, true); @@ -1825,7 +1827,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { } Intent intent = new Intent(bcastType); - intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, info); + intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, new NetworkInfo(info)); intent.putExtra(ConnectivityManager.EXTRA_NETWORK_TYPE, info.getType()); if (info.isFailover()) { intent.putExtra(ConnectivityManager.EXTRA_IS_FAILOVER, true); @@ -1882,7 +1884,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { loge("Attempt to connect to " + info.getTypeName() + " failed" + reasonText); Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION); - intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, info); + intent.putExtra(ConnectivityManager.EXTRA_NETWORK_INFO, new NetworkInfo(info)); intent.putExtra(ConnectivityManager.EXTRA_NETWORK_TYPE, info.getType()); if (getActiveNetworkInfo() == null) { intent.putExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, true); @@ -2075,8 +2077,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != type) { if (isNewNetTypePreferredOverCurrentNetType(type)) { if (DBG) log("Captive check on " + info.getTypeName()); - mCaptivePortalTracker = CaptivePortalTracker.detect(mContext, info, - ConnectivityService.this); + mCaptivePortalTracker.detectCaptivePortal(new NetworkInfo(info)); return; } else { if (DBG) log("Tear down low priority net " + info.getTypeName()); @@ -2092,7 +2093,6 @@ public class ConnectivityService extends IConnectivityManager.Stub { /** @hide */ public void captivePortalCheckComplete(NetworkInfo info) { mNetTrackers[info.getType()].captivePortalCheckComplete(); - mCaptivePortalTracker = null; } /** |