InputManagerServiceTests: Disable legacy tests for pointer choreographer
Since PointerChoreographer is enabled now, disable tests for the legacy
pipeline which is no longer actively maintained by checking the device
flag value.
Bug: 324154406
Test: atest InputManagerServiceTests
Change-Id: Ibf24fe6857ac6c467bbf6ae292e2a37f5bc993fa
diff --git a/tests/Input/src/com/android/server/input/InputManagerServiceTests.kt b/tests/Input/src/com/android/server/input/InputManagerServiceTests.kt
index cbec85e..f6f766a 100644
--- a/tests/Input/src/com/android/server/input/InputManagerServiceTests.kt
+++ b/tests/Input/src/com/android/server/input/InputManagerServiceTests.kt
@@ -24,7 +24,8 @@
import android.hardware.input.InputManagerGlobal
import android.os.test.TestLooper
import android.platform.test.annotations.Presubmit
-import android.platform.test.flag.junit.SetFlagsRule
+import android.platform.test.annotations.RequiresFlagsDisabled
+import android.platform.test.flag.junit.DeviceFlagsValueProvider
import android.provider.Settings
import android.test.mock.MockContentResolver
import android.view.Display
@@ -74,7 +75,7 @@
val fakeSettingsProviderRule = FakeSettingsProvider.rule()!!
@get:Rule
- val setFlagsRule = SetFlagsRule()
+ val checkFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()!!
@Mock
private lateinit var native: NativeInputManagerService
@@ -173,10 +174,9 @@
verify(wmCallbacks).notifyPointerDisplayIdChanged(displayId, x, y)
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun testSetVirtualMousePointerDisplayId() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
// Set the virtual mouse pointer displayId, and ensure that the calling thread is blocked
// until the native callback happens.
var countDownLatch = CountDownLatch(1)
@@ -226,10 +226,9 @@
verify(native).setPointerDisplayId(pointerDisplayId)
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun testSetVirtualMousePointerDisplayId_unsuccessfulUpdate() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
// Set the virtual mouse pointer displayId, and ensure that the calling thread is blocked
// until the native callback happens.
val countDownLatch = CountDownLatch(1)
@@ -253,10 +252,9 @@
verify(native).setPointerDisplayId(overrideDisplayId)
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun testSetVirtualMousePointerDisplayId_competingRequests() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
val firstRequestSyncLatch = CountDownLatch(1)
doAnswer {
firstRequestSyncLatch.countDown()
@@ -298,10 +296,9 @@
verify(native, times(2)).setPointerDisplayId(anyInt())
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun onDisplayRemoved_resetAllAdditionalInputProperties() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
setVirtualMousePointerDisplayIdAndVerify(10)
localService.setPointerIconVisible(false, 10)
@@ -324,10 +321,9 @@
verifyNoMoreInteractions(native)
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun updateAdditionalInputPropertiesForOverrideDisplay() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
setVirtualMousePointerDisplayIdAndVerify(10)
localService.setPointerIconVisible(false, 10)
@@ -354,10 +350,9 @@
verify(native).setPointerIconType(eq(PointerIcon.TYPE_NULL))
}
+ @RequiresFlagsDisabled(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
@Test
fun setAdditionalInputPropertiesBeforeOverride() {
- setFlagsRule.disableFlags(com.android.input.flags.Flags.FLAG_ENABLE_POINTER_CHOREOGRAPHER)
-
localService.setPointerIconVisible(false, 10)
localService.setMousePointerAccelerationEnabled(false, 10)