Merge change Id8df149c into eclair
* changes: Turn some logging back on in ConnectionManager
This commit is contained in:
@@ -42,7 +42,7 @@ import android.text.TextUtils;
|
|||||||
public class MobileDataStateTracker extends NetworkStateTracker {
|
public class MobileDataStateTracker extends NetworkStateTracker {
|
||||||
|
|
||||||
private static final String TAG = "MobileDataStateTracker";
|
private static final String TAG = "MobileDataStateTracker";
|
||||||
private static final boolean DBG = false;
|
private static final boolean DBG = true;
|
||||||
|
|
||||||
private Phone.DataState mMobileDataState;
|
private Phone.DataState mMobileDataState;
|
||||||
private ITelephony mPhoneService;
|
private ITelephony mPhoneService;
|
||||||
@@ -142,11 +142,6 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
|||||||
|
|
||||||
boolean unavailable = intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,
|
boolean unavailable = intent.getBooleanExtra(Phone.NETWORK_UNAVAILABLE_KEY,
|
||||||
false);
|
false);
|
||||||
if (DBG) Log.d(TAG, mApnType + " Received " + intent.getAction() +
|
|
||||||
" broadcast - state = " + state + ", oldstate = " + mMobileDataState +
|
|
||||||
", unavailable = " + unavailable + ", reason = " +
|
|
||||||
(reason == null ? "(unspecified)" : reason) +
|
|
||||||
", apnTypeList = " + apnTypeList);
|
|
||||||
|
|
||||||
// set this regardless of the apnTypeList. It's all the same radio/network
|
// set this regardless of the apnTypeList. It's all the same radio/network
|
||||||
// underneath
|
// underneath
|
||||||
@@ -166,14 +161,17 @@ public class MobileDataStateTracker extends NetworkStateTracker {
|
|||||||
" for " + mApnType);
|
" for " + mApnType);
|
||||||
mInterfaceName = intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
|
mInterfaceName = intent.getStringExtra(Phone.DATA_IFACE_NAME_KEY);
|
||||||
}
|
}
|
||||||
if (DBG) Log.d(TAG, " dropped - mEnabled = false");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (DBG) Log.d(TAG, " dropped - wrong Apn");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DBG) Log.d(TAG, mApnType + " Received state= " + state + ", old= " +
|
||||||
|
mMobileDataState + ", reason= " +
|
||||||
|
(reason == null ? "(unspecified)" : reason) +
|
||||||
|
", apnTypeList= " + apnTypeList);
|
||||||
|
|
||||||
if (mMobileDataState != state) {
|
if (mMobileDataState != state) {
|
||||||
mMobileDataState = state;
|
mMobileDataState = state;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ConnectivityService extends IConnectivityManager.Stub {
|
public class ConnectivityService extends IConnectivityManager.Stub {
|
||||||
|
|
||||||
private static final boolean DBG = false;
|
private static final boolean DBG = true;
|
||||||
private static final String TAG = "ConnectivityService";
|
private static final String TAG = "ConnectivityService";
|
||||||
|
|
||||||
// Event log tags (must be in sync with event-log-tags)
|
// Event log tags (must be in sync with event-log-tags)
|
||||||
@@ -740,7 +740,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
++numConnectedNets;
|
++numConnectedNets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (DBG) Log.d(TAG, "numConnectedNets returning "+numConnectedNets);
|
|
||||||
return numConnectedNets;
|
return numConnectedNets;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,10 +765,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
private void handleDisconnect(NetworkInfo info) {
|
private void handleDisconnect(NetworkInfo info) {
|
||||||
|
|
||||||
int prevNetType = info.getType();
|
int prevNetType = info.getType();
|
||||||
if (DBG) {
|
|
||||||
Log.v(TAG, "Handle DISCONNECT for " + info.getTypeName() +
|
|
||||||
(mNetAttributes[prevNetType].isDefault() ? ", a default network" : ""));
|
|
||||||
}
|
|
||||||
|
|
||||||
mNetTrackers[prevNetType].setTeardownRequested(false);
|
mNetTrackers[prevNetType].setTeardownRequested(false);
|
||||||
/*
|
/*
|
||||||
@@ -878,11 +873,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
// do this before we broadcast the change
|
// do this before we broadcast the change
|
||||||
handleConnectivityChange();
|
handleConnectivityChange();
|
||||||
|
|
||||||
if (DBG) Log.v(TAG, "Sending DISCONNECT bcast for " +
|
|
||||||
info.getTypeName() +
|
|
||||||
(newNet == null || !newNet.isAvailable() ? "" : " other=" +
|
|
||||||
newNet.getNetworkInfo().getTypeName()));
|
|
||||||
|
|
||||||
sendStickyBroadcast(intent);
|
sendStickyBroadcast(intent);
|
||||||
/*
|
/*
|
||||||
* If the failover network is already connected, then immediately send
|
* If the failover network is already connected, then immediately send
|
||||||
@@ -975,8 +965,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleConnect(NetworkInfo info) {
|
private void handleConnect(NetworkInfo info) {
|
||||||
if (DBG) Log.d(TAG, "Handle CONNECT for " + info.getTypeName());
|
|
||||||
|
|
||||||
int type = info.getType();
|
int type = info.getType();
|
||||||
|
|
||||||
// snapshot isFailover, because sendConnectedBroadcast() resets it
|
// snapshot isFailover, because sendConnectedBroadcast() resets it
|
||||||
@@ -986,7 +974,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
// if this is a default net and other default is running
|
// if this is a default net and other default is running
|
||||||
// kill the one not preferred
|
// kill the one not preferred
|
||||||
if (mNetAttributes[type].isDefault()) {
|
if (mNetAttributes[type].isDefault()) {
|
||||||
if (DBG) Log.d(TAG, "connecting to a default network");
|
|
||||||
if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != type) {
|
if (mActiveDefaultNetwork != -1 && mActiveDefaultNetwork != type) {
|
||||||
if ((type != mNetworkPreference &&
|
if ((type != mNetworkPreference &&
|
||||||
mNetAttributes[mActiveDefaultNetwork].mPriority >
|
mNetAttributes[mActiveDefaultNetwork].mPriority >
|
||||||
@@ -1016,7 +1003,6 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
mActiveDefaultNetwork = type;
|
mActiveDefaultNetwork = type;
|
||||||
}
|
}
|
||||||
thisNet.setTeardownRequested(false);
|
thisNet.setTeardownRequested(false);
|
||||||
if (DBG) Log.d(TAG, "Sending CONNECT bcast for " + info.getTypeName());
|
|
||||||
thisNet.updateNetworkSettings();
|
thisNet.updateNetworkSettings();
|
||||||
handleConnectivityChange();
|
handleConnectivityChange();
|
||||||
sendConnectedBroadcast(info);
|
sendConnectedBroadcast(info);
|
||||||
|
|||||||
Reference in New Issue
Block a user