summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRobert Greenwalt <rgreenwalt@google.com>2011-06-15 12:22:07 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2011-06-16 11:26:54 -0700
commitec896c6a863b3cc0a55538a19879e2112b5b8658 (patch)
treef13477e726080b2bf768ff7022803371021a59ff /core
parenteb5e633a2488456874f829263fa6cb96588d25aa (diff)
downloadframeworks_base-ec896c6a863b3cc0a55538a19879e2112b5b8658.zip
frameworks_base-ec896c6a863b3cc0a55538a19879e2112b5b8658.tar.gz
frameworks_base-ec896c6a863b3cc0a55538a19879e2112b5b8658.tar.bz2
Reset connections AFTER we take down the network.
If you do it before you have a race condition and some apps will manage to reconnect on the dieing network before it goes and then get no notification when it goes. bug: 3408025 Change-Id: I5386ff313c759b3f687bc38731454ab43dbe76b8
Diffstat (limited to 'core')
-rw-r--r--core/java/android/net/MobileDataStateTracker.java41
1 files changed, 0 insertions, 41 deletions
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java
index 770f152..f3c863f 100644
--- a/core/java/android/net/MobileDataStateTracker.java
+++ b/core/java/android/net/MobileDataStateTracker.java
@@ -69,10 +69,6 @@ public class MobileDataStateTracker implements NetworkStateTracker {
private boolean mPrivateDnsRouteSet = false;
private boolean mDefaultRouteSet = false;
- // DEFAULT and HIPRI are the same connection. If we're one of these we need to check if
- // the other is also disconnected before we reset sockets
- private boolean mIsDefaultOrHipri = false;
-
private Handler mHandler;
private AsyncChannel mDataConnectionTrackerAc;
private Messenger mMessenger;
@@ -87,12 +83,6 @@ public class MobileDataStateTracker implements NetworkStateTracker {
TelephonyManager.getDefault().getNetworkType(), tag,
TelephonyManager.getDefault().getNetworkTypeName());
mApnType = networkTypeToApnType(netType);
- if (netType == ConnectivityManager.TYPE_MOBILE ||
- netType == ConnectivityManager.TYPE_MOBILE_HIPRI) {
- mIsDefaultOrHipri = true;
- }
-
- mPhoneService = null;
}
/**
@@ -180,8 +170,6 @@ public class MobileDataStateTracker implements NetworkStateTracker {
}
private class MobileDataStateReceiver extends BroadcastReceiver {
- IConnectivityManager mConnectivityManager;
-
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(TelephonyIntents.
@@ -218,35 +206,6 @@ public class MobileDataStateTracker implements NetworkStateTracker {
}
setDetailedState(DetailedState.DISCONNECTED, reason, apnName);
- boolean doReset = true;
- if (mIsDefaultOrHipri == true) {
- // both default and hipri must go down before we reset
- int typeToCheck = (Phone.APN_TYPE_DEFAULT.equals(mApnType) ?
- ConnectivityManager.TYPE_MOBILE_HIPRI :
- ConnectivityManager.TYPE_MOBILE);
- if (mConnectivityManager == null) {
- IBinder b = ServiceManager.getService(
- Context.CONNECTIVITY_SERVICE);
- mConnectivityManager = IConnectivityManager.Stub.asInterface(b);
- }
- try {
- if (mConnectivityManager != null) {
- NetworkInfo info = mConnectivityManager.getNetworkInfo(
- typeToCheck);
- if (info.isConnected() == true) {
- doReset = false;
- }
- }
- } catch (RemoteException e) {
- // just go ahead with the reset
- loge("Exception trying to contact ConnService: " + e);
- }
- }
- if (doReset && mLinkProperties != null) {
- String iface = mLinkProperties.getInterfaceName();
- if (iface != null) NetworkUtils.resetConnections(iface);
- }
- // TODO - check this
// can't do this here - ConnectivityService needs it to clear stuff
// it's ok though - just leave it to be refreshed next time
// we connect.