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

Commit bb7f48c2 authored by lpeter's avatar lpeter
Browse files

Limit to deliver LOCKED_BOOT_COMPLETED before boot completed.

PackageManager can sometimes attempt to deliver LOCKED_BOOT_COMPLETED
to apps before boot process is complete, which can lead to a
system server crash.

Use the flag "FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT" to
limit to deliver LOCKED_BOOT_COMPLETED before boot completed.

Flag: EXEMPT bugfix

Bug: 420361741
Test: atest BroadcastQueueImplTest
Test: atest BroadcastHelperTest
Change-Id: Ieb6a9d86a792a703f520a17366beeda679097083
parent e706d62b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ public final class BroadcastHelper {
            Intent lockedBcIntent = new Intent(Intent.ACTION_LOCKED_BOOT_COMPLETED)
                    .setPackage(packageName);
            lockedBcIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
            lockedBcIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
            if (includeStopped) {
                lockedBcIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
            }