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

Commit 5328f80a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AnrTest: Use try-with-resources to close UinputTouchScreen" into main

parents c4c481e6 5897ff75
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -166,12 +166,12 @@ class AnrTest {
        val displayManager =
            instrumentation.context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
        val display = displayManager.getDisplay(obj.getDisplayId())
        val touchScreen = UinputTouchScreen(instrumentation, display)

        val rect: Rect = obj.visibleBounds
        val pointer = touchScreen.touchDown(rect.centerX(), rect.centerY())
        pointer.lift()
        touchScreen.close()
        UinputTouchScreen(instrumentation, display).use { touchScreen ->
            touchScreen
                .touchDown(rect.centerX(), rect.centerY())
                .lift()
        }
    }

    private fun triggerAnr() {