diff options
| author | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-20 18:01:43 -0700 |
|---|---|---|
| committer | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-21 05:38:36 -0700 |
| commit | 029be81302c7a00901e0af34afc06ddabb2805ef (patch) | |
| tree | 0b1fbf7acb477fab4b81715581f6d6e864ebfe5a /services/java/com/android/server/ConnectivityService.java | |
| parent | 313af5a3b5ba51eb75dea35eb568c841aa4beb6a (diff) | |
Inet status bug fix
Don't wipe out the connected status every time we get a cellular status change.
Don't filter out disconnect event for wifi - we need them.
bug:3009923
Change-Id: I68cadac5f44d6eb4e0fe711fda7c5d218abb45bd
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 8603e51d3da8..f38748b44e83 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -920,11 +920,19 @@ public class ConnectivityService extends IConnectivityManager.Stub { newNet = tryFailover(prevNetType); if (newNet != null) { NetworkInfo switchTo = newNet.getNetworkInfo(); + if (!switchTo.isConnected()) { + // if the other net is connected they've already reset this and perhaps even gotten + // a positive report we don't want to overwrite, but if not we need to clear this now + // to turn our cellular sig strength white + mDefaultInetConditionPublished = 0; + } intent.putExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO, switchTo); } else { + mDefaultInetConditionPublished = 0; // we're not connected anymore intent.putExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, true); } } + intent.putExtra(ConnectivityManager.EXTRA_INET_CONDITION, mDefaultInetConditionPublished); // do this before we broadcast the change handleConnectivityChange(prevNetType); @@ -1083,12 +1091,20 @@ public class ConnectivityService extends IConnectivityManager.Stub { newNet = tryFailover(info.getType()); if (newNet != null) { NetworkInfo switchTo = newNet.getNetworkInfo(); + if (!switchTo.isConnected()) { + // if the other net is connected they've already reset this and perhaps even gotten + // a positive report we don't want to overwrite, but if not we need to clear this now + // to turn our cellular sig strength white + mDefaultInetConditionPublished = 0; + } intent.putExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO, switchTo); } else { + mDefaultInetConditionPublished = 0; intent.putExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, true); } } + intent.putExtra(ConnectivityManager.EXTRA_INET_CONDITION, mDefaultInetConditionPublished); sendStickyBroadcast(intent); /* * If the failover network is already connected, then immediately send |
