From 7528f57c4ddbde1c6d0a2a352bd8a1af43711013 Mon Sep 17 00:00:00 2001 From: Joe LaPenna Date: Fri, 22 Jan 2016 07:11:49 -0800 Subject: [DO NOT MERGE ANYWHERE]: Allow button events in ambient. See thread: "key presses & Ambient" BUG: 25964771 BUG: 26524301 Change-Id: I914edd447c38678a06d27677be4597c0ee384635 --- core/java/android/view/ViewRootImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 9569422f880c..8adbace3bd69 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3712,7 +3712,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. -- cgit v1.2.3-59-g8ed1b