Skip to content

Commit 7c12eee

Browse files
committed
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
1 parent a6ccaa7 commit 7c12eee

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -719,28 +719,19 @@ private void updateConnectivity(Intent intent) {
719719
Slog.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
720720
}
721721

722-
int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
723-
724-
switch (info.getType()) {
725-
case ConnectivityManager.TYPE_MOBILE:
726-
mInetCondition = inetCondition;
727-
updateDataNetType();
728-
updateDataIcon();
729-
updateTelephonySignalStrength(); // apply any change in connectionStatus
730-
break;
731-
case ConnectivityManager.TYPE_WIFI:
732-
mInetCondition = inetCondition;
733-
updateWifiIcons();
734-
break;
735-
case ConnectivityManager.TYPE_BLUETOOTH:
736-
mInetCondition = inetCondition;
737-
if (info != null) {
738-
mBluetoothTethered = info.isConnected() ? true: false;
739-
} else {
740-
mBluetoothTethered = false;
741-
}
742-
break;
722+
mInetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
723+
724+
if (info != null && info.getType() == ConnectivityManager.TYPE_BLUETOOTH) {
725+
mBluetoothTethered = info.isConnected() ? true: false;
726+
} else {
727+
mBluetoothTethered = false;
743728
}
729+
730+
// We want to update all the icons, all at once, for any condition change
731+
updateDataNetType();
732+
updateDataIcon();
733+
updateTelephonySignalStrength();
734+
updateWifiIcons();
744735
}
745736

746737

@@ -1033,8 +1024,8 @@ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
10331024
pw.println(mWifiLevel);
10341025
pw.print(" mWifiSsid=");
10351026
pw.println(mWifiSsid);
1036-
pw.print(" mWifiIconId=");
1037-
pw.println(mWifiIconId);
1027+
pw.print(String.format(" mWifiIconId=0x%08x/%s",
1028+
mWifiIconId, getResourceName(mWifiIconId)));
10381029
pw.print(" mWifiActivity=");
10391030
pw.println(mWifiActivity);
10401031

0 commit comments

Comments
 (0)