use of org.robolectric.shadows.ShadowUserManager in project platform_packages_apps_Settings by AospExtended.
the class RedactionInterstitialTest method managedProfileUnredactedRestrictionTest.
@Test
public void managedProfileUnredactedRestrictionTest() {
setupSettings(1, /* show */
1);
final ShadowUserManager sum = Shadow.extract(RuntimeEnvironment.application.getSystemService(UserManager.class));
sum.addProfile(UserHandle.myUserId(), UserHandle.myUserId(), "work-profile", /* profileName */
UserInfo.FLAG_MANAGED_PROFILE);
ShadowRestrictedLockUtilsInternal.setKeyguardDisabledFeatures(KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS);
setupActivity();
assertHideAllVisible(false);
assertEnabledButtons(false, /* all */
true);
assertSelectedButton(R.id.redact_sensitive);
}
use of org.robolectric.shadows.ShadowUserManager in project platform_packages_apps_Settings by AospExtended.
the class TopLevelNetworkEntryPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
mController = new TopLevelNetworkEntryPreferenceController(mContext, "test_key");
ReflectionHelpers.setField(mController, "mMobileNetworkPreferenceController", mMobileNetworkPreferenceController);
}
use of org.robolectric.shadows.ShadowUserManager in project packages_apps_Settings by PixelExperience.
the class DevelopmentTilesTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mService = spy(Robolectric.setupService(DevelopmentTiles.ShowLayout.class));
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
doReturn(mTile).when(mService).getQsTile();
}
use of org.robolectric.shadows.ShadowUserManager in project packages_apps_Settings by PixelExperience.
the class TopLevelNetworkEntryPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = RuntimeEnvironment.application;
final ShadowUserManager um = Shadows.shadowOf(RuntimeEnvironment.application.getSystemService(UserManager.class));
um.setIsAdminUser(true);
mController = new TopLevelNetworkEntryPreferenceController(mContext, "test_key");
ReflectionHelpers.setField(mController, "mMobileNetworkPreferenceController", mMobileNetworkPreferenceController);
}
use of org.robolectric.shadows.ShadowUserManager in project packages_apps_Settings by PixelExperience.
the class RedactionInterstitialTest method managedProfileUnredactedRestrictionTest.
@Test
public void managedProfileUnredactedRestrictionTest() {
setupSettings(1, /* show */
1);
final ShadowUserManager sum = Shadow.extract(RuntimeEnvironment.application.getSystemService(UserManager.class));
sum.addProfile(UserHandle.myUserId(), UserHandle.myUserId(), "work-profile", /* profileName */
UserInfo.FLAG_MANAGED_PROFILE);
ShadowRestrictedLockUtilsInternal.setKeyguardDisabledFeatures(KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS);
setupActivity();
assertHideAllVisible(false);
assertEnabledButtons(false, /* all */
true);
assertSelectedButton(R.id.redact_sensitive);
}
Aggregations