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

Commit 899621a5 authored by LuK1337's avatar LuK1337
Browse files

Avoid sending duplicate MSG_BACK_LONG_PRESS messages

Now that KEYCODE_BACK is sending proper repeat events, we must ignore
additional KeyEvents in interceptBackKeyDown().

Change-Id: Ib8e4da21ddadc181ab96c1f8cc02553a99cc14c3
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4241
parent 7ba7894a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1024,7 +1024,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        // Reset back key state for long press
        mBackKeyHandled = false;

        if (hasLongPressOnBackBehavior()) {
        if (hasLongPressOnBackBehavior() && !mHandler.hasMessages(MSG_BACK_LONG_PRESS)) {
            Message msg = mHandler.obtainMessage(MSG_BACK_LONG_PRESS, event);
            msg.setAsynchronous(true);
            mHandler.sendMessageDelayed(msg,