diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2012-04-30 10:59:56 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2012-04-30 10:59:56 -0700 |
commit | 4dafaf117e680c138b3b0e0893a8ce09bc75f519 (patch) | |
tree | e2fe3f7ac839f339d90ac520fe612c53eb02aa4c /telephony | |
parent | e167c9fcb3c3dafd08d85746265a3f7d5bc4a6b3 (diff) | |
download | frameworks_base-4dafaf117e680c138b3b0e0893a8ce09bc75f519.zip frameworks_base-4dafaf117e680c138b3b0e0893a8ce09bc75f519.tar.gz frameworks_base-4dafaf117e680c138b3b0e0893a8ce09bc75f519.tar.bz2 |
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
Diffstat (limited to 'telephony')
3 files changed, 16 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java index 55f2ca3..97a8755 100644 --- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java @@ -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(); diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java index 7e5e707..a691eae 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java @@ -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); diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java index 56dbfb8..bfdb706 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java @@ -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); |