Loading packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +3 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,9 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback, } Drawable getInternetWifiDrawable(@NonNull WifiEntry wifiEntry) { if (wifiEntry.getLevel() == WifiEntry.WIFI_LEVEL_UNREACHABLE) { return null; } final Drawable drawable = mWifiIconInjector.getIcon(wifiEntry.shouldShowXLevelIcon(), wifiEntry.getLevel()); if (drawable == null) { Loading packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -259,7 +259,7 @@ public class InternetDialogControllerTest extends SysuiTestCase { } @Test public void getWifiDrawable_withConnectedEntry_returnIntentIconWithCorrectColor() { public void getInternetWifiDrawable_withConnectedEntry_returnIntentIconWithCorrectColor() { final Drawable drawable = mock(Drawable.class); when(mWifiIconInjector.getIcon(anyBoolean(), anyInt())).thenReturn(drawable); Loading @@ -269,6 +269,15 @@ public class InternetDialogControllerTest extends SysuiTestCase { verify(drawable).setTint(mContext.getColor(R.color.connected_network_primary_color)); } @Test public void getInternetWifiDrawable_withWifiLevelUnreachable_returnNull() { when(mConnectedEntry.getLevel()).thenReturn(WifiEntry.WIFI_LEVEL_UNREACHABLE); Drawable drawable = mInternetDialogController.getInternetWifiDrawable(mConnectedEntry); assertThat(drawable).isNull(); } @Test public void launchWifiNetworkDetailsSetting_withNoWifiEntryKey_doNothing() { mInternetDialogController.launchWifiNetworkDetailsSetting(null /* key */); Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java +3 −0 Original line number Diff line number Diff line Loading @@ -337,6 +337,9 @@ public class InternetDialogController implements WifiEntry.DisconnectCallback, } Drawable getInternetWifiDrawable(@NonNull WifiEntry wifiEntry) { if (wifiEntry.getLevel() == WifiEntry.WIFI_LEVEL_UNREACHABLE) { return null; } final Drawable drawable = mWifiIconInjector.getIcon(wifiEntry.shouldShowXLevelIcon(), wifiEntry.getLevel()); if (drawable == null) { Loading
packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -259,7 +259,7 @@ public class InternetDialogControllerTest extends SysuiTestCase { } @Test public void getWifiDrawable_withConnectedEntry_returnIntentIconWithCorrectColor() { public void getInternetWifiDrawable_withConnectedEntry_returnIntentIconWithCorrectColor() { final Drawable drawable = mock(Drawable.class); when(mWifiIconInjector.getIcon(anyBoolean(), anyInt())).thenReturn(drawable); Loading @@ -269,6 +269,15 @@ public class InternetDialogControllerTest extends SysuiTestCase { verify(drawable).setTint(mContext.getColor(R.color.connected_network_primary_color)); } @Test public void getInternetWifiDrawable_withWifiLevelUnreachable_returnNull() { when(mConnectedEntry.getLevel()).thenReturn(WifiEntry.WIFI_LEVEL_UNREACHABLE); Drawable drawable = mInternetDialogController.getInternetWifiDrawable(mConnectedEntry); assertThat(drawable).isNull(); } @Test public void launchWifiNetworkDetailsSetting_withNoWifiEntryKey_doNothing() { mInternetDialogController.launchWifiNetworkDetailsSetting(null /* key */); Loading