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

Commit d1434cb7 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: I7c8f7899090c4d9cc0416ed1632fbcee0e2ea97a
parent 566af37c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import android.permission.flags.Flags.FLAG_APP_FUNCTION_ACCESS_API_ENABLED
import android.permission.flags.Flags.FLAG_APP_FUNCTION_ACCESS_SERVICE_ENABLED
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 androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.dx.mockito.inline.extended.ExtendedMockito
@@ -52,6 +54,9 @@ import org.mockito.kotlin.whenever
/** Tests that AppFunctionsStatsLog logs AppFunctionsRequestReported with the expected values. */
@RunWith(AndroidJUnit4::class)
class AppFunctionsLoggingTest {
    @get:Rule
    val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()

    @get:Rule
    val mExtendedMockitoRule: ExtendedMockitoRule =
        ExtendedMockitoRule.Builder(this)