Fix data roaming notification.

We shouldn't tell people we're not connected due to roaming if it's really because
of data-disabled.

Use the data-disabled setting to decide if we should inform people about
data-discon due to roaming.  Note this doesn't effect other notifications about roaming.

Also fix the data-enable/disable code to take roaming into account and clear/set the
roaming notification as needed (if data is enabled while we can't get on due to roaming
we should put up the roaming notifcation..  if data is disabled while that notification is
up we should take it down).

bug:5805666
Change-Id: I5c925dfdca4abc27e0034b113508df5719f04fae
This commit is contained in:
Robert Greenwalt
2012-04-30 10:59:56 -07:00
parent e167c9fcb3
commit 4dafaf117e
3 changed files with 16 additions and 0 deletions

View File

@@ -1139,6 +1139,14 @@ public abstract class DataConnectionTracker extends Handler {
mUserDataEnabled = enabled;
Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
Settings.Secure.MOBILE_DATA, enabled ? 1 : 0);
if (getDataOnRoamingEnabled() == false &&
mPhone.getServiceState().getRoaming() == true) {
if (enabled) {
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_ON);
} else {
notifyOffApnsOfAvailability(Phone.REASON_DATA_DISABLED);
}
}
if (prevEnabled != getAnyDataEnabled()) {
if (!prevEnabled) {
resetAllRetryCounts();

View File

@@ -629,6 +629,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
*/
@Override
protected void onRoamingOff() {
if (mUserDataEnabled == false) return;
if (getDataOnRoamingEnabled() == false) {
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
trySetupData(Phone.REASON_ROAMING_OFF);
@@ -642,6 +644,8 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
*/
@Override
protected void onRoamingOn() {
if (mUserDataEnabled == false) return;
if (getDataOnRoamingEnabled()) {
trySetupData(Phone.REASON_ROAMING_ON);
notifyDataConnection(Phone.REASON_ROAMING_ON);

View File

@@ -1863,6 +1863,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
protected void onRoamingOff() {
if (DBG) log("onRoamingOff");
if (mUserDataEnabled == false) return;
if (getDataOnRoamingEnabled() == false) {
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
setupDataOnReadyApns(Phone.REASON_ROAMING_OFF);
@@ -1873,6 +1875,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
@Override
protected void onRoamingOn() {
if (mUserDataEnabled == false) return;
if (getDataOnRoamingEnabled()) {
if (DBG) log("onRoamingOn: setup data on roaming");
setupDataOnReadyApns(Phone.REASON_ROAMING_ON);