Merge "[Provider Model] Fix InternetPreferenceControllerTest failed issue." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-02-01 17:00:04 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 1 deletions

View File

@@ -62,7 +62,8 @@ public class InternetPreferenceController extends AbstractPreferenceController i
private InternetUpdater mInternetUpdater; private InternetUpdater mInternetUpdater;
private @InternetUpdater.InternetType int mInternetType; private @InternetUpdater.InternetType int mInternetType;
private static Map<Integer, Integer> sIconMap = new HashMap<>(); @VisibleForTesting
static Map<Integer, Integer> sIconMap = new HashMap<>();
static { static {
sIconMap.put(INTERNET_APM, R.drawable.ic_airplanemode_active); sIconMap.put(INTERNET_APM, R.drawable.ic_airplanemode_active);
sIconMap.put(INTERNET_APM_NETWORKS, R.drawable.ic_airplane_safe_networks_24dp); sIconMap.put(INTERNET_APM_NETWORKS, R.drawable.ic_airplane_safe_networks_24dp);

View File

@@ -79,6 +79,7 @@ public class InternetPreferenceControllerTest {
when(wifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED); when(wifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED);
mController = new InternetPreferenceController(mContext, mock(Lifecycle.class)); mController = new InternetPreferenceController(mContext, mock(Lifecycle.class));
mController.sIconMap.put(INTERNET_WIFI, 0);
if (Looper.myLooper() == null) { if (Looper.myLooper() == null) {
Looper.prepare(); Looper.prepare();
} }