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

Commit ad972e03 authored by Massimo Carli's avatar Massimo Carli
Browse files

[35/n] InputEventReceiver.dispose() in Looper Thread

InputEventReceiver#dispose() should be called in the Looper Thread.

Flag: com.android.window.flags.app_compat_refactoring
Fix: 410574853
Test: atest WMShellUnitTests:LetterboxInputControllerTest

Change-Id: Iaea301bf5a233506532a0e6e072455c662f1ece9
parent fb008518
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -185,13 +185,17 @@ class LetterboxInputDetector(
        }

        fun stop(tx: Transaction) {
            handler.post(::resetInputState)
            inputSurface?.let { s ->
                tx.remove(s)
            }
        }

        private fun resetInputState() {
            receiver?.dispose()
            receiver = null
            inputChannel.dispose()
            windowSession.removeToken(inputToken)
            inputSurface?.let { s ->
                tx.remove(s)
            }
        }

        // Removes the provided token