Note net availability even when apn not enabled

Fixes a problem where mms apn was on when we lost the network (airplane mode) but mms was
off when airplane mode was turned off so it kept thinking we didn't have access and
future mms always failed.

bug: 2075145
This commit is contained in:
Robert Greenwalt
2009-08-24 15:44:55 -07:00
parent 4a51c20ce6
commit 0badd0b700
2 changed files with 5 additions and 2 deletions

View File

@ -147,7 +147,10 @@ public class MobileDataStateTracker extends NetworkStateTracker {
", unavailable = " + unavailable + ", reason = " +
(reason == null ? "(unspecified)" : reason));
if (isApnTypeIncluded(apnTypeList)) {
// set this even if the apn isn't Enabled
mNetworkInfo.setIsAvailable(!unavailable);
if (mEnabled == false) {
// if we're not enabled but the APN Type is supported by this connection
// we should record the interface name if one's provided. If the user
@ -168,7 +171,6 @@ public class MobileDataStateTracker extends NetworkStateTracker {
return;
}
mNetworkInfo.setIsAvailable(!unavailable);
if (mMobileDataState != state) {
mMobileDataState = state;
switch (state) {

View File

@ -453,7 +453,8 @@ public abstract class DataConnectionTracker extends Handler {
}
protected synchronized void setEnabled(int id, boolean enable) {
if (DBG) Log.d(LOG_TAG, "setEnabled(" + id + ", " + enable + ')');
if (DBG) Log.d(LOG_TAG, "setEnabled(" + id + ", " + enable + ") with old state = " +
dataEnabled[id] + " and enabledCount = " + enabledCount);
if (dataEnabled[id] != enable) {
dataEnabled[id] = enable;