Skip to content
Browse files

DO NOT MERGE: Cherrypick I90d95644: Fix bogus "data disconnected due …

…to roaming" notification

Cherry-pick change I90d95644
<https://android-git.corp.google.com/g/153144> into ics-mr0.

(Ed and Justin have already cherry-picked this change directly into
ics-mr0-release, so here's the same change for ics-mr0 to keep it in
sync.)

Bug: 5632572
Change-Id: I31418d851907a752505d8ed0babf5712d16beabc
  • Loading branch information...
1 parent 8f50bdd commit 96a172bd077f08da5af3ccd305391a29c46d6b6d David Brown committed Dec 1, 2011
Showing with 8 additions and 13 deletions.
  1. +8 −13 src/com/android/phone/PhoneApp.java
View
21 src/com/android/phone/PhoneApp.java
@@ -1444,19 +1444,14 @@ public void onReceive(Context context, Intent intent) {
if (VDBG) Log.d(LOG_TAG, "- reason: "
+ intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
- // The "data disconnected due to roaming" notification is
- // visible if you've lost data connectivity because you're
- // roaming and you have the "data roaming" feature turned off.
- boolean disconnectedDueToRoaming = false;
- if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
- String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
- if (Phone.REASON_ROAMING_ON.equals(reason)) {
- // We just lost our data connection, and the reason
- // is that we started roaming. This implies that
- // the user has data roaming turned off.
- disconnectedDueToRoaming = true;
- }
- }
+ // The "data disconnected due to roaming" notification is shown
+ // if (a) you have the "data roaming" feature turned off, and
+ // (b) you just lost data connectivity because you're roaming.
+ boolean disconnectedDueToRoaming =
+ !phone.getDataRoamingEnabled()
+ && "DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))
+ && Phone.REASON_ROAMING_ON.equals(
+ intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);

0 comments on commit 96a172b

Please sign in to comment.
Something went wrong with that request. Please try again.