Skip to content

Commit 4dafaf1

Browse files
author
Robert Greenwalt
committed
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
1 parent e167c9f commit 4dafaf1

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

telephony/java/com/android/internal/telephony/DataConnectionTracker.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,14 @@ protected void onSetUserDataEnabled(boolean enabled) {
11391139
mUserDataEnabled = enabled;
11401140
Settings.Secure.putInt(mPhone.getContext().getContentResolver(),
11411141
Settings.Secure.MOBILE_DATA, enabled ? 1 : 0);
1142+
if (getDataOnRoamingEnabled() == false &&
1143+
mPhone.getServiceState().getRoaming() == true) {
1144+
if (enabled) {
1145+
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_ON);
1146+
} else {
1147+
notifyOffApnsOfAvailability(Phone.REASON_DATA_DISABLED);
1148+
}
1149+
}
11421150
if (prevEnabled != getAnyDataEnabled()) {
11431151
if (!prevEnabled) {
11441152
resetAllRetryCounts();

telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ protected boolean onTrySetupData(String reason) {
629629
*/
630630
@Override
631631
protected void onRoamingOff() {
632+
if (mUserDataEnabled == false) return;
633+
632634
if (getDataOnRoamingEnabled() == false) {
633635
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
634636
trySetupData(Phone.REASON_ROAMING_OFF);
@@ -642,6 +644,8 @@ protected void onRoamingOff() {
642644
*/
643645
@Override
644646
protected void onRoamingOn() {
647+
if (mUserDataEnabled == false) return;
648+
645649
if (getDataOnRoamingEnabled()) {
646650
trySetupData(Phone.REASON_ROAMING_ON);
647651
notifyDataConnection(Phone.REASON_ROAMING_ON);

telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,8 @@ protected boolean onTrySetupData(ApnContext apnContext) {
18631863
protected void onRoamingOff() {
18641864
if (DBG) log("onRoamingOff");
18651865

1866+
if (mUserDataEnabled == false) return;
1867+
18661868
if (getDataOnRoamingEnabled() == false) {
18671869
notifyOffApnsOfAvailability(Phone.REASON_ROAMING_OFF);
18681870
setupDataOnReadyApns(Phone.REASON_ROAMING_OFF);
@@ -1873,6 +1875,8 @@ protected void onRoamingOff() {
18731875

18741876
@Override
18751877
protected void onRoamingOn() {
1878+
if (mUserDataEnabled == false) return;
1879+
18761880
if (getDataOnRoamingEnabled()) {
18771881
if (DBG) log("onRoamingOn: setup data on roaming");
18781882
setupDataOnReadyApns(Phone.REASON_ROAMING_ON);

0 commit comments

Comments
 (0)