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

Commit c4f57dbd authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Move SysUI boot-complete event earlier

Replace Intent.ACTION_BOOT_COMPLETED receiver with
Intent.ACTION_LOCKED_BOOT_COMPLETED.

This makes the timings of the onBootCompleted() callback more
predictable.

Previously, onBootCompleted() was typically called after the system user
unlocked (e.g. the primary user has entered their PIN). However, there
were edge-cases where it could be called earlier. For example, to
support secondary users we also checked the sysprop sys.boot_completed
during startup. This meant that if SysUI crashed, onBootCompleted()
could be called before the system is unlocked.

Test: manual
Bug: 259474752
Change-Id: I06e61f77f723308f9a82b4756a4c71092e1f308c
parent d16866aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ public class SystemUIApplication extends Application implements
        setTheme(R.style.Theme_SystemUI);

        if (Process.myUserHandle().equals(UserHandle.SYSTEM)) {
            IntentFilter bootCompletedFilter = new IntentFilter(Intent.ACTION_BOOT_COMPLETED);
            IntentFilter bootCompletedFilter = new
                    IntentFilter(Intent.ACTION_LOCKED_BOOT_COMPLETED);
            bootCompletedFilter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);

            // If SF GPU context priority is set to realtime, then SysUI should run at high.