Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
DO NOT MERGE: Cherrypick I90d95644: Fix bogus "data disconnected due …
Browse files Browse the repository at this point in the history
…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
David Brown committed Dec 6, 2011
1 parent 8f50bdd commit 96a172b
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/com/android/phone/PhoneApp.java
Expand Up @@ -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);
Expand Down

0 comments on commit 96a172b

Please sign in to comment.