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

Commit 1ff4d2ff authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

KeyGestureControllerTests: Cleanup InputManagerGlobal test session

The test fails to clean up properly after changing the
InputManagerGlobal session for testing.

Bug: 370828465
Test: atest InputTests
Flag: TEST_ONLY
Change-Id: Ibbec7e72116117dcc725f7fd079041620b2556a9
parent b0bd2dba
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import com.android.internal.util.FrameworkStatsLog
import com.android.modules.utils.testing.ExtendedMockitoRule
import junitparams.JUnitParamsRunner
import junitparams.Parameters
import org.junit.After
import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
@@ -128,6 +129,13 @@ class KeyGestureControllerTests {
        currentPid = Process.myPid()
    }

    @After
    fun teardown() {
        if (this::inputManagerGlobalSession.isInitialized) {
            inputManagerGlobalSession.close()
        }
    }

    private fun setupBehaviors() {
        Mockito.`when`(
            resources.getBoolean(