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

Commit 2f85bb8d authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

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
parent d390e326
Loading
Loading
Loading
Loading
+9 −14
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ import android.hardware.input.InputManager
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 @@ class InputManagerServiceTests {
    val fakeSettingsProviderRule = FakeSettingsProvider.rule()!!

    @get:Rule
    val setFlagsRule = SetFlagsRule()
    val checkFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()!!

    @Mock
    private lateinit var native: NativeInputManagerService
@@ -173,10 +174,9 @@ class InputManagerServiceTests {
        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 @@ class InputManagerServiceTests {
        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 @@ class InputManagerServiceTests {
        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 @@ class InputManagerServiceTests {
        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 @@ class InputManagerServiceTests {
        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 @@ class InputManagerServiceTests {
        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)