diff options
| author | 2016-01-22 07:11:49 -0800 | |
|---|---|---|
| committer | 2016-02-22 20:39:48 +0000 | |
| commit | 90776de6bbcd7dd40cb2690d4441fbafe29747d9 (patch) | |
| tree | 4b7232207bc007be8bd5636172c6a1c729ec7fb3 | |
| parent | 15e124f2df93e3d6825cf2c7b2dd2c32dafa2a57 (diff) | |
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 7528f57c4ddbde1c6d0a2a352bd8a1af43711013)
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 05177885f3dc..673c609dd7c4 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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. |