Make hardware buttons just wake up device

Refrain from propagating hardware button events
to applications when in non-interactive state.

Bug: 159070675
Bug: 151278668
Change-Id: Ifa8c2702084430b1ce81ff41aab4bfef9bb54d9f
(cherry picked from commit 6c139702f6feb783ea93651a2a3ebd7712d71d9d)
(cherry picked from commit ffae2f6b750b3db835404fcdbe37b9e3d94b125a)
This commit is contained in:
Ludvig Hansson
2020-06-16 12:26:11 +00:00
committed by Shreerag Jayakrishnan
parent ac132b65e9
commit c138fa64ec

View File

@@ -4012,9 +4012,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return true;
}
// Watches handle BACK specially
// Watches handle BACK and hardware buttons specially
if (mHasFeatureWatch && (keyCode == KeyEvent.KEYCODE_BACK
|| keyCode == KeyEvent.KEYCODE_STEM_PRIMARY)) {
|| keyCode == KeyEvent.KEYCODE_STEM_PRIMARY
|| keyCode == KeyEvent.KEYCODE_STEM_1
|| keyCode == KeyEvent.KEYCODE_STEM_2
|| keyCode == KeyEvent.KEYCODE_STEM_3)) {
return false;
}