Fix various issues found when testing Mms.

Fix some race conditions (check isTeardownRequested).
Fix the passing of mInterfaceName to subtypes (mms, etc).
Fix the generation of CONNECTED message to already active subtypes.
Fix the enabling of Data in DataConnectionTracker.

bug: 2065037
This commit is contained in:
Robert Greenwalt
2009-08-19 20:19:33 -07:00
parent fde2b76814
commit a52c75ae24

View File

@@ -513,7 +513,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mNetRequestersPids[usedNetworkType].add(currentPid); mNetRequestersPids[usedNetworkType].add(currentPid);
} }
if (ni.isConnectedOrConnecting() == true) { if ((ni.isConnectedOrConnecting() == true) &&
!network.isTeardownRequested()) {
if (ni.isConnected() == true) { if (ni.isConnected() == true) {
// add the pid-specific dns // add the pid-specific dns
handleDnsConfigurationChange(); handleDnsConfigurationChange();
@@ -686,6 +687,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
++numConnectedNets; ++numConnectedNets;
} }
} }
if (DBG) Log.d(TAG, "numConnectedNets returning "+numConnectedNets);
return numConnectedNets; return numConnectedNets;
} }
@@ -792,7 +794,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
if (newNet.isAvailable()) { if (newNet.isAvailable()) {
NetworkInfo switchTo = newNet.getNetworkInfo(); NetworkInfo switchTo = newNet.getNetworkInfo();
switchTo.setFailover(true); switchTo.setFailover(true);
if (!switchTo.isConnectedOrConnecting()) { if (!switchTo.isConnectedOrConnecting() ||
newNet.isTeardownRequested()) {
newNet.reconnect(); newNet.reconnect();
} }
if (DBG) { if (DBG) {