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

Commit f3728204 authored by Rafael Prado's avatar Rafael Prado
Browse files

Remove testCanProfileOwnerResetPasswordWhenLocked_nonFbeDevice test which is not relevant anymore.

- ENCRYPTION_STATUS_ACTIVE_PER_USER is the only encryption status supported in Android since version 13, where full disc encryption (FDE) support was removed and only file-based encryption (FBE) is supported now: https://source.android.com/docs/security/features/encryption/full-disk

Bug: 374727579
Flag: android.app.admin.flags.reset_password_with_token_coexistence
Test: atest FrameworksServicesTests_Presubmit:com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I341ddcec9555a93b71cb82a8ed33ae501edffe67
parent dbce09e3
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)))