WiFi: Replace -1 with LINK_SPEED_UNKNOWN constant

Defined constant LINK_SPEED_UNKNOWN = -1 in WiFiInfo for unknown link
speeds. So replacing -1 with this new macro.

Bug: 124302657
Test: Connect STA to AP and verify the link speeds in network details.
Change-Id: Ie21069984adb02420ca55b08a8cb161aaad2b7b3
This commit is contained in:
Sunil Ravi
2019-02-26 11:43:03 -08:00
parent 683bbb5ce9
commit 7d0d684339
2 changed files with 4 additions and 4 deletions

View File

@@ -376,12 +376,12 @@ public class WifiConfigController implements TextWatcher,
}
WifiInfo info = mAccessPoint.getInfo();
if (info != null && info.getTxLinkSpeedMbps() != -1) {
if (info != null && info.getTxLinkSpeedMbps() != WifiInfo.LINK_SPEED_UNKNOWN) {
addRow(group, R.string.tx_wifi_speed, String.format(
res.getString(R.string.tx_link_speed), info.getTxLinkSpeedMbps()));
}
if (info != null && info.getRxLinkSpeedMbps() != -1) {
if (info != null && info.getRxLinkSpeedMbps() != WifiInfo.LINK_SPEED_UNKNOWN) {
addRow(group, R.string.rx_wifi_speed, String.format(
res.getString(R.string.rx_link_speed), info.getRxLinkSpeedMbps()));
}