diff options
author | RoboErik <epastern@google.com> | 2014-09-26 23:13:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-26 23:13:54 +0000 |
commit | 66aec18ad3ce02f13ad162f3c0edd73f648a316c (patch) | |
tree | 13c20609d3ad12a613f33c1c701cadadc712a783 /policy | |
parent | 5d8bcd285d190de924a47c39155530038799d148 (diff) | |
parent | 7412965a544e0e5249d91c3fec9edef5fa190990 (diff) | |
download | frameworks_base-66aec18ad3ce02f13ad162f3c0edd73f648a316c.zip frameworks_base-66aec18ad3ce02f13ad162f3c0edd73f648a316c.tar.gz frameworks_base-66aec18ad3ce02f13ad162f3c0edd73f648a316c.tar.bz2 |
am e825d695: am 3a85b618: am 065b605c: am 55ecb483: Merge "Don\'t forward media keys to the app if the phone session is active" into lmp-dev
* commit 'e825d6958821a4d63c2e7db39c1c02b4300dd1c8':
Don't forward media keys to the app if the phone session is active
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 88e59da..35e5dab 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -4248,8 +4248,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0 || event.isWakeKey(); if (interactive || (isInjected && !isWakeKey)) { - // When the device is interactive or the key is injected pass the key to the - // application. + // When the device is interactive or the key is injected pass the + // key to the application. result = ACTION_PASS_TO_USER; isWakeKey = false; } else if (!interactive && shouldDispatchInputWhenNonInteractive()) { @@ -4449,16 +4449,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_PLAY: case KeyEvent.KEYCODE_MEDIA_PAUSE: case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: - if (down) { - TelecomManager telecomManager = getTelecommService(); - if (telecomManager != null) { - if (telecomManager.isInCall()) { - // Suppress PLAY/PAUSE toggle when phone is ringing or in-call - // to avoid music playback. - break; - } - } - } case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MUTE: case KeyEvent.KEYCODE_MEDIA_STOP: @@ -4468,6 +4458,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_RECORD: case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK: { + if (MediaSessionLegacyHelper.getHelper(mContext).isGlobalPriorityActive()) { + // If the global session is active pass all media keys to it + // instead of the active window. + result &= ~ACTION_PASS_TO_USER; + } if ((result & ACTION_PASS_TO_USER) == 0) { // Only do this if we would otherwise not pass it to the user. In that // case, the PhoneWindow class will do the same thing, except it will |