summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Insun Kang <insun@google.com> 2016-04-07 15:34:34 +0900
committer Insun Kang <insun@google.com> 2016-04-08 11:34:46 +0900
commit2054db33599f096a07b483062bb1973efcfd2d3a (patch)
treeb83502fd697bc8271305d84ff07f2f47bc8d9cd7
parent03f1e026996a7665aefcda947ed97faae009735e (diff)
MediaSessionService: Send MEDIA_BUTTON intents with foreground priority
Bug: 27179450 Change-Id: Id4f530e87fff67b0582d13ef5b5333f3eae2d927
-rw-r--r--services/core/java/com/android/server/media/MediaSessionService.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index e3c540a54eb2..a4d2cd25cb14 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -962,6 +962,7 @@ public class MediaSessionService extends SystemService implements Monitor {
mKeyEventReceiver.aquireWakeLockLocked();
}
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
+ mediaButtonIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
mediaButtonIntent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
try {
if (user.mLastMediaButtonReceiver != null) {
@@ -986,6 +987,7 @@ public class MediaSessionService extends SystemService implements Monitor {
}
// Fallback to legacy behavior
Intent keyIntent = new Intent(Intent.ACTION_MEDIA_BUTTON, null);
+ keyIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
keyIntent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent);
if (needWakeLock) {
keyIntent.putExtra(EXTRA_WAKELOCK_ACQUIRED,