OSDN Git Service

Send ACTION_SHUTDOWN broadcast to manifest receivers
authorChristopher Tate <ctate@google.com>
Tue, 13 Jun 2017 19:11:09 +0000 (12:11 -0700)
committerChristopher Tate <ctate@google.com>
Tue, 13 Jun 2017 19:31:18 +0000 (12:31 -0700)
Fix #36767224
Test: manual

Change-Id: If8f1fa986b9b8f3c426e4c0623bbca6f96b7199c

services/core/java/com/android/server/am/UserController.java
services/core/java/com/android/server/power/ShutdownThread.java

index 6a310f2..eeab605 100644 (file)
@@ -599,6 +599,7 @@ final class UserController {
     void finishUserStopping(final int userId, final UserState uss) {
         // On to the next.
         final Intent shutdownIntent = new Intent(Intent.ACTION_SHUTDOWN);
+        shutdownIntent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
         // This is the result receiver for the final shutdown broadcast.
         final IIntentReceiver shutdownReceiver = new IIntentReceiver.Stub() {
             @Override
index 28ffc94..02f2afc 100644 (file)
@@ -391,7 +391,8 @@ public final class ShutdownThread extends Thread {
         // First send the high-level shut down broadcast.
         mActionDone = false;
         Intent intent = new Intent(Intent.ACTION_SHUTDOWN);
-        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND
+                | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
         mContext.sendOrderedBroadcastAsUser(intent,
                 UserHandle.ALL, null, br, mHandler, 0, null, null);