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

Commit 90776de6 authored by Joe LaPenna's avatar Joe LaPenna Committed by Anthony Hugh
Browse files

Allow button events in ambient.

See thread: "key presses & Ambient"

Bluetooth media button presses and Stem buttons were being rejected in ambient.  This change allows those keys while disabling touch events while in ambient.

BUG: 25964771
BUG: 26524301

Change-Id: I914edd447c38678a06d27677be4597c0ee384635
(cherry picked from commit 7528f57c)
parent 15e124f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3797,7 +3797,8 @@ public final class ViewRootImpl implements ViewParent,
                return true;
            } else if ((!mAttachInfo.mHasWindowFocus
                    && !q.mEvent.isFromSource(InputDevice.SOURCE_CLASS_POINTER)) || mStopped
                    || mIsAmbientMode || (mPausedForTransition && !isBack(q.mEvent))) {
                    || (mIsAmbientMode && !q.mEvent.isFromSource(InputDevice.SOURCE_CLASS_BUTTON))
                    || (mPausedForTransition && !isBack(q.mEvent))) {
                // This is a focus event and the window doesn't currently have input focus or
                // has stopped. This could be an event that came back from the previous stage
                // but the window has lost focus or stopped in the meantime.