Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08eabcf8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Send SHUTDOWN bc to registered receivers only"

parents ab0c14cd 1fc62600
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2498,6 +2498,9 @@ public class Intent implements Parcelable, Cloneable {
     * off, not sleeping).  Once the broadcast is complete, the final shutdown
     * off, not sleeping).  Once the broadcast is complete, the final shutdown
     * will proceed and all unsaved data lost.  Apps will not normally need
     * will proceed and all unsaved data lost.  Apps will not normally need
     * to handle this, since the foreground activity will be paused as well.
     * to handle this, since the foreground activity will be paused as well.
     * <p>As of {@link Build.VERSION_CODES#P} this broadcast is only sent to receivers registered
     * through {@link Context#registerReceiver(BroadcastReceiver, IntentFilter)
     * Context.registerReceiver}.
     *
     *
     * <p class="note">This is a protected intent that can only be sent
     * <p class="note">This is a protected intent that can only be sent
     * by the system.
     * by the system.
+1 −1
Original line number Original line Diff line number Diff line
@@ -451,7 +451,7 @@ public final class ShutdownThread extends Thread {
        // First send the high-level shut down broadcast.
        // First send the high-level shut down broadcast.
        mActionDone = false;
        mActionDone = false;
        Intent intent = new Intent(Intent.ACTION_SHUTDOWN);
        Intent intent = new Intent(Intent.ACTION_SHUTDOWN);
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND | Intent.FLAG_RECEIVER_REGISTERED_ONLY);
        mContext.sendOrderedBroadcastAsUser(intent,
        mContext.sendOrderedBroadcastAsUser(intent,
                UserHandle.ALL, null, br, mHandler, 0, null, null);
                UserHandle.ALL, null, br, mHandler, 0, null, null);