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

Commit 0f0f389b authored by Harshit Mahajan's avatar Harshit Mahajan
Browse files

Run test only when flag reset mitigation is disabled

The test is testing the behaviour when the flag reset functionality
is disabled. Add the required annotation.

Bug: 435472071
Flag: com.android.crashrecovery.flags.flag_reset_enabled
Test: http://go/abtd-run/L90400030014709577
Change-Id: I222a95d88a59039b23a54a851ef6eb431e69b27a
parent fbd0a419
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server;

import static android.service.watchdog.ExplicitHealthCheckService.PackageConfig;

import static com.android.crashrecovery.flags.Flags.FLAG_FLAG_RESET_ENABLED;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doAnswer;

import static com.google.common.truth.Truth.assertThat;
@@ -48,7 +49,9 @@ import android.net.ConnectivityModuleConnector.ConnectivityModuleHealthListener;
import android.os.Handler;
import android.os.SystemProperties;
import android.os.test.TestLooper;
import android.platform.test.flag.junit.SetFlagsRule;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.provider.DeviceConfig;
import android.util.AtomicFile;

@@ -107,7 +110,8 @@ public class CrashRecoveryTest {
            PackageManager.ROLLBACK_USER_IMPACT_ONLY_MANUAL);

    @Rule
    public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
    public final CheckFlagsRule mCheckFlagsRule =
            DeviceFlagsValueProvider.createCheckFlagsRule();

    private final TestClock mTestClock = new TestClock();
    private TestLooper mTestLooper;
@@ -302,6 +306,7 @@ public class CrashRecoveryTest {
    }

    @Test
    @RequiresFlagsDisabled(FLAG_FLAG_RESET_ENABLED)
    public void testBootLoopWithRescuePartyAndRollbackObserverNoFlags() throws Exception {
        PackageWatchdog watchdog = createWatchdog();
        RescuePartyObserver rescuePartyObserver = setUpRescuePartyObserver(watchdog);