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

Commit 6bfbb4a8 authored by Ömer Faruk Yılmaz's avatar Ömer Faruk Yılmaz
Browse files

Add CheckFlagsRule to tests with `@RequiresFlags[Enabled|Disabled]`

To enable Global lint CheckFlagsRuleDetector, we need to first fix
(or baseline) all existing errors.

For context on the development of this new lint, see b/430031210.

Bug: 435371380
Test: m .
Flag: EXEMPT test change
Change-Id: I227ec4c8df543985a83257dc96de86fd6d2f2b57
parent a45e410c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFI
import android.hardware.devicestate.feature.flags.Flags
import android.platform.test.annotations.RequiresFlagsDisabled
import android.platform.test.annotations.RequiresFlagsEnabled
import android.platform.test.flag.junit.CheckFlagsRule
import android.platform.test.flag.junit.DeviceFlagsValueProvider
import android.testing.TestableResources
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
@@ -31,6 +33,7 @@ import com.android.systemui.testKosmos
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.kotlin.whenever
@@ -38,6 +41,7 @@ import org.mockito.kotlin.whenever
@SmallTest
@RunWith(AndroidJUnit4::class)
class UtilsTest : SysuiTestCase() {
    @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()

    private val kosmos = testKosmos()
    private val deviceStateManager = kosmos.deviceStateManager