Update strings and layout for enterprise privacy
This CL continues the finalization of UI layout and strings for the enterprise privacy page: * Turn footer into a header * Update strings * Dynamically generate summaries for entry points in security page Bug: 32692748 Test: m RunSettingsRoboTests Change-Id: Ibf248ac269380fb1b919b01f88f721130060b7f9
This commit is contained in:
@@ -60,6 +60,8 @@ import static org.mockito.Mockito.when;
|
||||
public final class EnterprisePrivacyFeatureProviderImplTest {
|
||||
|
||||
private final ComponentName OWNER = new ComponentName("dummy", "component");
|
||||
private final ComponentName ADMIN_1 = new ComponentName("dummy", "admin1");
|
||||
private final ComponentName ADMIN_2 = new ComponentName("dummy", "admin2");
|
||||
private final String OWNER_ORGANIZATION = new String("ACME");
|
||||
private final Date TIMESTAMP = new Date(2011, 11, 11);
|
||||
private final int MY_USER_ID = UserHandle.myUserId();
|
||||
@@ -113,6 +115,15 @@ public final class EnterprisePrivacyFeatureProviderImplTest {
|
||||
assertThat(mProvider.isInCompMode()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDeviceOwnerOrganizationName() {
|
||||
when(mDevicePolicyManager.getDeviceOwnerOrganizationName()).thenReturn(null);
|
||||
assertThat(mProvider.getDeviceOwnerOrganizationName()).isNull();
|
||||
|
||||
when(mDevicePolicyManager.getDeviceOwnerOrganizationName()).thenReturn(OWNER_ORGANIZATION);
|
||||
assertThat(mProvider.getDeviceOwnerOrganizationName()).isEqualTo(OWNER_ORGANIZATION);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDeviceOwnerDisclosure() {
|
||||
when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(null);
|
||||
@@ -292,6 +303,21 @@ public final class EnterprisePrivacyFeatureProviderImplTest {
|
||||
assertThat(mProvider.getNumberOfOwnerInstalledCaCertsInManagedProfile()).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() {
|
||||
when(mDevicePolicyManager.getActiveAdminsAsUser(MY_USER_ID))
|
||||
.thenReturn(Arrays.asList(new ComponentName[] {ADMIN_1, ADMIN_2}));
|
||||
when(mDevicePolicyManager.getActiveAdminsAsUser(MANAGED_PROFILE_USER_ID))
|
||||
.thenReturn(Arrays.asList(new ComponentName[] {ADMIN_1}));
|
||||
|
||||
assertThat(mProvider.getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile())
|
||||
.isEqualTo(2);
|
||||
|
||||
mProfiles.add(new UserInfo(MANAGED_PROFILE_USER_ID, "", "", UserInfo.FLAG_MANAGED_PROFILE));
|
||||
assertThat(mProvider.getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile())
|
||||
.isEqualTo(3);
|
||||
}
|
||||
|
||||
private void resetAndInitializePackageManagerWrapper() {
|
||||
reset(mPackageManagerWrapper);
|
||||
when(mPackageManagerWrapper.hasSystemFeature(PackageManager.FEATURE_DEVICE_ADMIN))
|
||||
|
Reference in New Issue
Block a user