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

Commit b5bba8fb 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: I60df21a38ee69fa4d9e36774b9862ac7663ff8e1
parent 566af37c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ import android.hardware.display.DisplayManagerInternal;
import android.os.PowerManager;
import android.os.Temperature;
import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.provider.Settings;
import android.util.SparseArray;
import android.util.Spline;
@@ -65,6 +67,7 @@ import com.android.server.display.feature.DisplayManagerFlags;
import com.android.server.display.feature.flags.Flags;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -100,6 +103,10 @@ public final class DisplayDeviceConfigTest {
    private DisplayDeviceConfig mDisplayDeviceConfig;
    private static final float ZERO_DELTA = 0.0f;
    private static final float SMALL_DELTA = 0.0001f;

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

    @Mock
    private Context mContext;