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

Commit 8c5600b5 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: Ie03a9a25161f8b70f5a8432d43cbf554d39d1686
parent 566af37c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.test.input
import android.Manifest
import android.hardware.input.InputManager
import android.platform.test.annotations.RequiresFlagsEnabled
import android.platform.test.flag.junit.CheckFlagsRule
import android.platform.test.flag.junit.DeviceFlagsValueProvider
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.platform.app.InstrumentationRegistry
import com.android.compatibility.common.util.AdoptShellPermissionsRule
@@ -43,6 +45,9 @@ class KeyEventActivityListenerTest {
    private lateinit var inputManager: InputManager
    private lateinit var listener: InputManager.KeyEventActivityListener
    private val instrumentation = InstrumentationRegistry.getInstrumentation()

    @get:Rule val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()

    @get:Rule
    val rule = ActivityScenarioRule<CaptureEventActivity>(CaptureEventActivity::class.java)