use of com.android.settings.testutils.shadow.ShadowConnectivityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MobileNetworkPreferenceControllerTest method wifiOnly_prefIsNotAvailable.
@Test
public void wifiOnly_prefIsNotAvailable() {
ShadowUserManager userManager = extract(mContext.getSystemService(UserManager.class));
userManager.setIsAdminUser(true);
ShadowConnectivityManager connectivityManager = extract(mContext.getSystemService(ConnectivityManager.class));
connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false);
mController = new MobileNetworkPreferenceController(mContext);
assertThat(mController.isAvailable()).isFalse();
}
use of com.android.settings.testutils.shadow.ShadowConnectivityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MobileNetworkPreferenceControllerTest method secondaryUser_prefIsNotAvailable.
@Test
public void secondaryUser_prefIsNotAvailable() {
ShadowUserManager userManager = extract(mContext.getSystemService(UserManager.class));
userManager.setIsAdminUser(false);
ShadowConnectivityManager connectivityManager = extract(mContext.getSystemService(ConnectivityManager.class));
connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true);
mController = new MobileNetworkPreferenceController(mContext);
assertThat(mController.isAvailable()).isFalse();
}
use of com.android.settings.testutils.shadow.ShadowConnectivityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BasebandVersionPreferenceControllerTest method getAvailability_wifiOnly_unavailable.
@Test
public void getAvailability_wifiOnly_unavailable() {
final ShadowConnectivityManager connectivityManager = extract(mContext.getSystemService(ConnectivityManager.class));
connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, false);
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
}
use of com.android.settings.testutils.shadow.ShadowConnectivityManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BasebandVersionPreferenceControllerTest method getAvailability_hasMobile_available.
@Test
public void getAvailability_hasMobile_available() {
final String text = "test";
SystemProperties.set(BASEBAND_PROPERTY, text);
ShadowConnectivityManager connectivityManager = extract(mContext.getSystemService(ConnectivityManager.class));
connectivityManager.setNetworkSupported(ConnectivityManager.TYPE_MOBILE, true);
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
Aggregations