Merge change 21655 into eclair
* changes:
resolved conflicts for merge of 696b912e to eclair
This commit is contained in:
@@ -331,7 +331,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
* @return false while no data connection if all above requirements are met.
|
* @return false while no data connection if all above requirements are met.
|
||||||
*/
|
*/
|
||||||
public boolean isDataConnectionAsDesired() {
|
public boolean isDataConnectionAsDesired() {
|
||||||
boolean roaming = phone.getServiceState().getRoaming();
|
boolean roaming = getDataRoaming();
|
||||||
|
|
||||||
if (mGsmPhone.mSIMRecords.getRecordsLoaded() &&
|
if (mGsmPhone.mSIMRecords.getRecordsLoaded() &&
|
||||||
mGsmPhone.mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&
|
mGsmPhone.mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&
|
||||||
@@ -343,6 +343,10 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean getDataRoaming() {
|
||||||
|
return mGsmPhone.mSST.getDataRoaming();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isApnTypeActive(String type) {
|
protected boolean isApnTypeActive(String type) {
|
||||||
// TODO: support simultaneous with List instead
|
// TODO: support simultaneous with List instead
|
||||||
@@ -370,7 +374,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDataAllowed() {
|
private boolean isDataAllowed() {
|
||||||
boolean roaming = phone.getServiceState().getRoaming();
|
boolean roaming = getDataRoaming();
|
||||||
return getAnyDataEnabled() && (!roaming || getDataOnRoamingEnabled());
|
return getAnyDataEnabled() && (!roaming || getDataOnRoamingEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,7 +421,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int gprsState = mGsmPhone.mSST.getCurrentGprsState();
|
int gprsState = mGsmPhone.mSST.getCurrentGprsState();
|
||||||
boolean roaming = phone.getServiceState().getRoaming();
|
boolean roaming = getDataRoaming();
|
||||||
boolean desiredPowerState = mGsmPhone.mSST.getDesiredPowerState();
|
boolean desiredPowerState = mGsmPhone.mSST.getDesiredPowerState();
|
||||||
|
|
||||||
if ((state == State.IDLE || state == State.SCANNING)
|
if ((state == State.IDLE || state == State.SCANNING)
|
||||||
@@ -1074,16 +1078,38 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
trySetupData(reason);
|
trySetupData(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the data roaming consistency since this can be triggered by
|
||||||
|
* voice roaming flag of ServiceState in setDataOnRoamingEnabled()
|
||||||
|
*
|
||||||
|
* TODO make this triggered by data roaming state only
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void onRoamingOff() {
|
protected void onRoamingOff() {
|
||||||
trySetupData(Phone.REASON_ROAMING_OFF);
|
if (!getDataRoaming()) { //data roaming is off
|
||||||
|
trySetupData(Phone.REASON_ROAMING_OFF);
|
||||||
|
} else { // Inconsistent! data roaming is on
|
||||||
|
sendMessage(obtainMessage(EVENT_ROAMING_ON));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the data roaming consistency since this can be triggered by
|
||||||
|
* voice roaming flag of ServiceState in setDataOnRoamingEnabled()
|
||||||
|
*
|
||||||
|
* TODO make this triggered by data roaming state only
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
protected void onRoamingOn() {
|
protected void onRoamingOn() {
|
||||||
if (getDataOnRoamingEnabled()) {
|
if (getDataRoaming()) { // data roaming is on
|
||||||
trySetupData(Phone.REASON_ROAMING_ON);
|
if (getDataOnRoamingEnabled()) {
|
||||||
} else {
|
trySetupData(Phone.REASON_ROAMING_ON);
|
||||||
if (DBG) log("Tear down data connection on roaming.");
|
} else {
|
||||||
cleanUpConnection(true, Phone.REASON_ROAMING_ON);
|
if (DBG) log("Tear down data connection on roaming.");
|
||||||
|
cleanUpConnection(true, Phone.REASON_ROAMING_ON);
|
||||||
|
}
|
||||||
|
} else { // Inconsistent! data roaming is off
|
||||||
|
sendMessage(obtainMessage(EVENT_ROAMING_OFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
private int newNetworkType = 0;
|
private int newNetworkType = 0;
|
||||||
/* gsm roaming status solely based on TS 27.007 7.2 CREG */
|
/* gsm roaming status solely based on TS 27.007 7.2 CREG */
|
||||||
private boolean mGsmRoaming = false;
|
private boolean mGsmRoaming = false;
|
||||||
|
/* data roaming status solely based on TS 27.007 10.1.19 CGREG */
|
||||||
|
private boolean mDataRoaming = false;
|
||||||
|
private boolean newDataRoaming = false;
|
||||||
|
|
||||||
private RegistrantList gprsAttachedRegistrants = new RegistrantList();
|
private RegistrantList gprsAttachedRegistrants = new RegistrantList();
|
||||||
private RegistrantList gprsDetachedRegistrants = new RegistrantList();
|
private RegistrantList gprsDetachedRegistrants = new RegistrantList();
|
||||||
@@ -311,6 +314,10 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
psRestrictDisabledRegistrants.remove(h);
|
psRestrictDisabledRegistrants.remove(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*protected*/ boolean getDataRoaming() {
|
||||||
|
return mDataRoaming;
|
||||||
|
}
|
||||||
|
|
||||||
//***** Called from GSMPhone
|
//***** Called from GSMPhone
|
||||||
public void
|
public void
|
||||||
getLacAndCid(Message onComplete) {
|
getLacAndCid(Message onComplete) {
|
||||||
@@ -668,6 +675,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
newGPRSState = regCodeToServiceState(regState);
|
newGPRSState = regCodeToServiceState(regState);
|
||||||
|
newDataRoaming = regCodeIsRoaming(regState);
|
||||||
newNetworkType = type;
|
newNetworkType = type;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -695,6 +703,11 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
|
|
||||||
if (pollingContext[0] == 0) {
|
if (pollingContext[0] == 0) {
|
||||||
newSS.setRoaming(isRoamingBetweenOperators(mGsmRoaming, newSS));
|
newSS.setRoaming(isRoamingBetweenOperators(mGsmRoaming, newSS));
|
||||||
|
// when both roaming indicators are true but not roaming between
|
||||||
|
// operators, roaming should set to false.
|
||||||
|
if (newDataRoaming && mGsmRoaming && !newSS.getRoaming()) {
|
||||||
|
newDataRoaming = false;
|
||||||
|
}
|
||||||
pollStateDone();
|
pollStateDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -724,6 +737,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
newCellLoc.setStateInvalid();
|
newCellLoc.setStateInvalid();
|
||||||
setSignalStrengthDefaultValues();
|
setSignalStrengthDefaultValues();
|
||||||
mGotCountryCode = false;
|
mGotCountryCode = false;
|
||||||
|
newDataRoaming = false;
|
||||||
|
|
||||||
pollStateDone();
|
pollStateDone();
|
||||||
break;
|
break;
|
||||||
@@ -733,6 +747,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
newCellLoc.setStateInvalid();
|
newCellLoc.setStateInvalid();
|
||||||
setSignalStrengthDefaultValues();
|
setSignalStrengthDefaultValues();
|
||||||
mGotCountryCode = false;
|
mGotCountryCode = false;
|
||||||
|
newDataRoaming = false;
|
||||||
|
|
||||||
pollStateDone();
|
pollStateDone();
|
||||||
break;
|
break;
|
||||||
@@ -747,6 +762,8 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
newCellLoc.setStateInvalid();
|
newCellLoc.setStateInvalid();
|
||||||
setSignalStrengthDefaultValues();
|
setSignalStrengthDefaultValues();
|
||||||
mGotCountryCode = false;
|
mGotCountryCode = false;
|
||||||
|
newDataRoaming = false;
|
||||||
|
mDataRoaming = false;
|
||||||
|
|
||||||
//NOTE: pollStateDone() is not needed in this case
|
//NOTE: pollStateDone() is not needed in this case
|
||||||
break;
|
break;
|
||||||
@@ -831,9 +848,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
|
|
||||||
boolean hasChanged = !newSS.equals(ss);
|
boolean hasChanged = !newSS.equals(ss);
|
||||||
|
|
||||||
boolean hasRoamingOn = !ss.getRoaming() && newSS.getRoaming();
|
boolean hasRoamingOn = !mDataRoaming && newDataRoaming;
|
||||||
|
|
||||||
boolean hasRoamingOff = ss.getRoaming() && !newSS.getRoaming();
|
boolean hasRoamingOff = mDataRoaming && !newDataRoaming;
|
||||||
|
|
||||||
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
||||||
|
|
||||||
@@ -850,6 +867,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
|
|
||||||
gprsState = newGPRSState;
|
gprsState = newGPRSState;
|
||||||
networkType = newNetworkType;
|
networkType = newNetworkType;
|
||||||
|
mDataRoaming = newDataRoaming;
|
||||||
|
|
||||||
newSS.setStateOutOfService(); // clean slate for next time
|
newSS.setStateOutOfService(); // clean slate for next time
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user