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

Commit e8b4c341 authored by Cintia Martins's avatar Cintia Martins
Browse files

Fix com.android.server.supervision.SupervisionServiceTest#setSupervisionRecoveryInfo

Bug: 406449915
Flag: android.app.supervision.flags.persistent_supervision_settings
Test: SupervisionServiceTest
Change-Id: I4dc81a0362e329b8ca791821fd61553d050daa6a
parent f3a4b71e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import com.android.server.SystemService.TargetUser
import com.android.server.pm.UserManagerInternal
import com.android.server.supervision.SupervisionService.ACTION_CONFIRM_SUPERVISION_CREDENTIALS
import com.google.common.truth.Truth.assertThat
import java.nio.file.Files
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
@@ -103,6 +104,11 @@ class SupervisionServiceTest {
        service = SupervisionService(context)
        lifecycle = SupervisionService.Lifecycle(context, service)
        lifecycle.registerProfileOwnerListener()


        // Creating a temporary folder to enable access to SupervisionSettings.
        SupervisionSettings.getInstance().changeDirForTesting(
            Files.createTempDirectory("tempSupervisionFolder").toFile())
    }

    @Test
@@ -364,7 +370,6 @@ class SupervisionServiceTest {
    }

    @Test
    @Ignore("Failing with IOException when trying to create a directory")
    @RequiresFlagsEnabled(Flags.FLAG_PERSISTENT_SUPERVISION_SETTINGS)
    fun setSupervisionRecoveryInfo() {
        assertThat(service.supervisionRecoveryInfo).isNull()