OSDN Git Service

Whitelist PHONE_STATE to wakeup apps
authorBrad Ebinger <breadley@google.com>
Sat, 22 Apr 2017 00:05:18 +0000 (17:05 -0700)
committerBrad Ebinger <breadley@google.com>
Sat, 22 Apr 2017 00:14:16 +0000 (00:14 +0000)
Whitelists PHONE_STATE to wake up apps that are not
running when this intent is broadcast.

The bug to track removing this intent from the whitelist is b/37579761

Test: Compile and run
Change-Id: I89987195c9e6d5160b40666fbfc3893602ab1c15

services/core/java/com/android/server/TelephonyRegistry.java

index dd4d906..4ce76f4 100644 (file)
@@ -1531,6 +1531,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
             intent.putExtra(PhoneConstants.SLOT_KEY, phoneId);
         }
 
+        // Wakeup apps for the (SUBSCRIPTION_)PHONE_STATE broadcast.
+        intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
+
         // Send broadcast twice, once for apps that have PRIVILEGED permission and once for those
         // that have the runtime one
         mContext.sendBroadcastAsUser(intent, UserHandle.ALL,