From c4f57dbd3b3c18fa4a0ba9c1b00dfb1ea6ab79d5 Mon Sep 17 00:00:00 2001 From: Peter Kalauskas Date: Thu, 17 Nov 2022 08:17:25 -0800 Subject: [PATCH] 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 --- .../SystemUI/src/com/android/systemui/SystemUIApplication.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 83747b4f86364..191ac76753bbc 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -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.