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

Commit c98d6548 authored by Jeongsik Mun's avatar Jeongsik Mun Committed by Cherrypicker Worker
Browse files

Add a userId to BOOT_COMPLETED in BroadcastHelper

Bug: 304586137
Test: manually tested that a receiver could get it
(cherry picked from https://partner-android-review.googlesource.com/q/commit:f6932c1f87e5eb54b63a87c3539c4ccd7c3d5fb7)
Merged-In: I2a001278b7f2163f3c868241ba437cd8fb79e3c4
Change-Id: I2a001278b7f2163f3c868241ba437cd8fb79e3c4
parent dc292749
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -262,6 +262,7 @@ public final class BroadcastHelper {
            // Deliver LOCKED_BOOT_COMPLETED first
            // Deliver LOCKED_BOOT_COMPLETED first
            Intent lockedBcIntent = new Intent(Intent.ACTION_LOCKED_BOOT_COMPLETED)
            Intent lockedBcIntent = new Intent(Intent.ACTION_LOCKED_BOOT_COMPLETED)
                    .setPackage(packageName);
                    .setPackage(packageName);
            lockedBcIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
            if (includeStopped) {
            if (includeStopped) {
                lockedBcIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
                lockedBcIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
            }
            }
@@ -275,6 +276,7 @@ public final class BroadcastHelper {
            // Deliver BOOT_COMPLETED only if user is unlocked
            // Deliver BOOT_COMPLETED only if user is unlocked
            if (mUmInternal.isUserUnlockingOrUnlocked(userId)) {
            if (mUmInternal.isUserUnlockingOrUnlocked(userId)) {
                Intent bcIntent = new Intent(Intent.ACTION_BOOT_COMPLETED).setPackage(packageName);
                Intent bcIntent = new Intent(Intent.ACTION_BOOT_COMPLETED).setPackage(packageName);
                bcIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
                if (includeStopped) {
                if (includeStopped) {
                    bcIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
                    bcIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
                }
                }