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 /packages/SystemUI | |
parent | 313af5a3b5ba51eb75dea35eb568c841aa4beb6a (diff) | |
download | frameworks_base-029be81302c7a00901e0af34afc06ddabb2805ef.zip frameworks_base-029be81302c7a00901e0af34afc06ddabb2805ef.tar.gz frameworks_base-029be81302c7a00901e0af34afc06ddabb2805ef.tar.bz2 |
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 'packages/SystemUI')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java index 7ccf210..0fc092e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java @@ -711,21 +711,20 @@ public class StatusBarPolicy { ConnectivityManager.EXTRA_NETWORK_INFO)); int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0); Slog.d(TAG, "got CONNECTIVITY_ACTION - info=" + info + ", status = " + connectionStatus); - if (info.isConnected() == false) return; + + int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0); switch (info.getType()) { case ConnectivityManager.TYPE_MOBILE: - if (info.isConnected()) { - updateDataNetType(info.getSubtype(), connectionStatus); - updateDataIcon(); - updateSignalStrength(); // apply any change in connectionStatus - } + mInetCondition = inetCondition; + updateDataNetType(info.getSubtype()); + updateDataIcon(); + updateSignalStrength(); // apply any change in connectionStatus break; case ConnectivityManager.TYPE_WIFI: + mInetCondition = inetCondition; if (info.isConnected()) { mIsWifiConnected = true; - mInetCondition = - (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0); int iconId; if (mLastWifiSignalLevel == -1) { iconId = sWifiSignalImages[mInetCondition][0]; @@ -738,7 +737,6 @@ public class StatusBarPolicy { } else { mLastWifiSignalLevel = -1; mIsWifiConnected = false; - mInetCondition = 0; int iconId = sWifiSignalImages[0][0]; mService.setIcon("wifi", iconId, 0); @@ -777,9 +775,8 @@ public class StatusBarPolicy { @Override public void onDataConnectionStateChanged(int state, int networkType) { mDataState = state; - updateDataNetType(networkType, 0); + updateDataNetType(networkType); updateDataIcon(); - updateSignalStrength(); // apply the change in connection status } @Override @@ -940,8 +937,7 @@ public class StatusBarPolicy { return (levelEvdoDbm < levelEvdoSnr) ? levelEvdoDbm : levelEvdoSnr; } - private final void updateDataNetType(int net, int inetCondition) { - mInetCondition = (inetCondition > INET_CONDITION_THRESHOLD ? 1 : 0); + private final void updateDataNetType(int net) { switch (net) { case TelephonyManager.NETWORK_TYPE_EDGE: mDataIconList = sDataNetType_e[mInetCondition]; |