Merge "WiFi: Replace -1 with LINK_SPEED_UNKNOWN constant"
This commit is contained in:
@@ -376,12 +376,12 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
}
|
}
|
||||||
|
|
||||||
WifiInfo info = mAccessPoint.getInfo();
|
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(
|
addRow(group, R.string.tx_wifi_speed, String.format(
|
||||||
res.getString(R.string.tx_link_speed), info.getTxLinkSpeedMbps()));
|
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(
|
addRow(group, R.string.rx_wifi_speed, String.format(
|
||||||
res.getString(R.string.rx_link_speed), info.getRxLinkSpeedMbps()));
|
res.getString(R.string.rx_link_speed), info.getRxLinkSpeedMbps()));
|
||||||
}
|
}
|
||||||
|
@@ -429,7 +429,7 @@ public class WifiDetailPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void linkSpeedPref_shouldNotShowIfNotSet() {
|
public void linkSpeedPref_shouldNotShowIfNotSet() {
|
||||||
when(mockWifiInfo.getTxLinkSpeedMbps()).thenReturn(-1);
|
when(mockWifiInfo.getTxLinkSpeedMbps()).thenReturn(WifiInfo.LINK_SPEED_UNKNOWN);
|
||||||
|
|
||||||
displayAndResume();
|
displayAndResume();
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ public class WifiDetailPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void rxLinkSpeedPref_shouldNotShowIfNotSet() {
|
public void rxLinkSpeedPref_shouldNotShowIfNotSet() {
|
||||||
when(mockWifiInfo.getRxLinkSpeedMbps()).thenReturn(-1);
|
when(mockWifiInfo.getRxLinkSpeedMbps()).thenReturn(WifiInfo.LINK_SPEED_UNKNOWN);
|
||||||
|
|
||||||
displayAndResume();
|
displayAndResume();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user