summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Daniel Sandler <dsandler@android.com> 2011-09-25 15:53:33 -0400
committer Daniel Sandler <dsandler@android.com> 2011-09-25 15:53:33 -0400
commit7c12eee6439435d7f29d49cab76edaedbd809460 (patch)
tree1a290661a6905dbbd653e2d46d7ba12e6d91725d
parenta6ccaa736d18d1ee375162e9df9d2aad8db869e5 (diff)
Update all RSSIs whenever the connectivity changes.
The connectivity includes the network condition, which is a magic number that indicates how useful the connection is (driven by ability to connect to GTalk, and manifested with a differently-colored signal icon). Previously we were only updating the icons of the network type currently in use. Now we tickle all the icons any time the connectivity changes, to avoid the two icons getting out of sync (example: on mobile, connection is bad, connect to wifi, conncetion is good; wifi icon appears and turns blue but mobile RSSI remains gray). Bug: 5369405 Change-Id: I78b62084b819c83f83aacc146feeb323c1199dc0
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java37
1 files changed, 14 insertions, 23 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index fdb4548c6215..4baf1afe84a5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -719,28 +719,19 @@ public class NetworkController extends BroadcastReceiver {
Slog.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
}
- int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
-
- switch (info.getType()) {
- case ConnectivityManager.TYPE_MOBILE:
- mInetCondition = inetCondition;
- updateDataNetType();
- updateDataIcon();
- updateTelephonySignalStrength(); // apply any change in connectionStatus
- break;
- case ConnectivityManager.TYPE_WIFI:
- mInetCondition = inetCondition;
- updateWifiIcons();
- break;
- case ConnectivityManager.TYPE_BLUETOOTH:
- mInetCondition = inetCondition;
- if (info != null) {
- mBluetoothTethered = info.isConnected() ? true: false;
- } else {
- mBluetoothTethered = false;
- }
- break;
+ mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
+
+ if (info != null && info.getType() == ConnectivityManager.TYPE_BLUETOOTH) {
+ mBluetoothTethered = info.isConnected() ? true: false;
+ } else {
+ mBluetoothTethered = false;
}
+
+ // We want to update all the icons, all at once, for any condition change
+ updateDataNetType();
+ updateDataIcon();
+ updateTelephonySignalStrength();
+ updateWifiIcons();
}
@@ -1033,8 +1024,8 @@ public class NetworkController extends BroadcastReceiver {
pw.println(mWifiLevel);
pw.print(" mWifiSsid=");
pw.println(mWifiSsid);
- pw.print(" mWifiIconId=");
- pw.println(mWifiIconId);
+ pw.print(String.format(" mWifiIconId=0x%08x/%s",
+ mWifiIconId, getResourceName(mWifiIconId)));
pw.print(" mWifiActivity=");
pw.println(mWifiActivity);