diff options
| author | 2017-09-18 13:53:05 +0000 | |
|---|---|---|
| committer | 2017-09-18 13:53:05 +0000 | |
| commit | 56b19d49373f29b7af2086bfb654554a860e7ad4 (patch) | |
| tree | b98fd2ce343bff22a1a07e315a454432f88f0289 | |
| parent | a7a2a0545ad404f9af9a6de2eb175e3170250d14 (diff) | |
| parent | 0a7e2ea766971beccf29516f641007b86779be32 (diff) | |
Merge "Ignore only internal volume keys when in VR mode."
| -rw-r--r-- | services/core/java/com/android/server/policy/PhoneWindowManager.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index a806af46d021..1d7f66f54faf 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -3627,10 +3627,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { return -1; } - // If the device is in Vr mode, drop the volume keys and don't - // forward it to the application/dispatch the audio event. + // If the device is in VR mode and keys are "internal" (e.g. on the side of the + // device), then drop the volume keys and don't forward it to the application/dispatch + // the audio event. if (mPersistentVrModeEnabled) { - return -1; + final InputDevice d = event.getDevice(); + if (d != null && !d.isExternal()) { + return -1; + } } } else if (keyCode == KeyEvent.KEYCODE_TAB && event.isMetaPressed()) { // Pass through keyboard navigation keys. |