summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hidenari Koshimae <hidenari.koshimae@sonymobile.com> 2016-02-05 18:13:17 +0900
committer Michael Wright <michaelwr@google.com> 2016-09-26 18:29:06 +0100
commit469e65e37f04fa3aa46e5116b6028cd7113308b3 (patch)
treeea4fc2e1d9d993c26af98b6b87bf905be4e9879e
parentc3fddb984c9bca51c0df3a528764cbb817627850 (diff)
Increase priority for broadcast intent triggered by HW key
Add the FLAG_RECEIVER_FOREGROUND flag to the broadcast intent triggered by hardware key. This prevents the framework from delaying the delivery of the intent to its recipients, and improves the response for hardware key event under heavy load on the system. Bug: 28735973 Change-Id: Ib7f219845be34794f4c7545927e53cc6c2b504a3
-rw-r--r--core/java/com/android/internal/policy/PhoneFallbackEventHandler.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
index 2cb9c250d2d1..fb0edea398ce 100644
--- a/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
+++ b/core/java/com/android/internal/policy/PhoneFallbackEventHandler.java
@@ -150,6 +150,7 @@ public class PhoneFallbackEventHandler implements FallbackEventHandler {
sendCloseSystemWindows();
// Broadcast an intent that the Camera button was longpressed
Intent intent = new Intent(Intent.ACTION_CAMERA_BUTTON, null);
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
intent.putExtra(Intent.EXTRA_KEY_EVENT, event);
mContext.sendOrderedBroadcastAsUser(intent, UserHandle.CURRENT_OR_SELF,
null, null, null, 0, null, null);