Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 531378cc authored by Rafael Prado's avatar Rafael Prado Committed by Android (Google) Code Review
Browse files

Merge "Remove testCanProfileOwnerResetPasswordWhenLocked_nonFbeDevice test...

Merge "Remove testCanProfileOwnerResetPasswordWhenLocked_nonFbeDevice test which is not relevant anymore." into main
parents bf6fdf73 f3728204
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -322,6 +322,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
        setUpUserManager();

        when(getServices().lockPatternUtils.hasSecureLockScreen()).thenReturn(true);
        when(getServices().storageManager.isFileBasedEncryptionEnabled()).thenReturn(true);

        mIsAutomotive = mContext.getPackageManager()
                .hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
@@ -7421,7 +7422,6 @@ public class DevicePolicyManagerTest extends DpmTestBase {
    @Test
    public void testCanProfileOwnerResetPasswordWhenLocked_nonDirectBootAwarePo()
            throws Exception {
        setDeviceEncryptionPerUser();
        setupProfileOwner();
        setupPasswordResetToken();

@@ -7432,7 +7432,6 @@ public class DevicePolicyManagerTest extends DpmTestBase {

    @Test
    public void testCanProfileOwnerResetPasswordWhenLocked_noActiveToken() throws Exception {
        setDeviceEncryptionPerUser();
        setupProfileOwner();
        makeAdmin1DirectBootAware();

@@ -7441,21 +7440,9 @@ public class DevicePolicyManagerTest extends DpmTestBase {
                .that(dpm.canProfileOwnerResetPasswordWhenLocked(CALLER_USER_HANDLE)).isFalse();
    }

    @Test
    public void testCanProfileOwnerResetPasswordWhenLocked_nonFbeDevice() throws Exception {
        setupProfileOwner();
        makeAdmin1DirectBootAware();
        setupPasswordResetToken();

        mContext.binder.callingUid = DpmMockContext.SYSTEM_UID;
        assertWithMessage("device is not FBE")
                .that(dpm.canProfileOwnerResetPasswordWhenLocked(CALLER_USER_HANDLE)).isFalse();
    }

    @Test
    @Ignore("b/277916462")
    public void testCanProfileOwnerResetPasswordWhenLocked() throws Exception {
        setDeviceEncryptionPerUser();
        setupProfileOwner();
        makeAdmin1DirectBootAware();
        setupPasswordResetToken();
@@ -7500,10 +7487,6 @@ public class DevicePolicyManagerTest extends DpmTestBase {
                eq(CALLER_USER_HANDLE));
    }

    private void setDeviceEncryptionPerUser() {
        when(getServices().storageManager.isFileBasedEncryptionEnabled()).thenReturn(true);
    }

    private void setCrossProfileAppsList(String... packages) {
        when(mContext.getResources()
                .getStringArray(eq(R.array.cross_profile_apps)))