summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Harshit Mahajan <harshitmahajan@google.com> 2024-06-11 12:02:43 +0000
committer Harshit Mahajan <harshitmahajan@google.com> 2024-06-11 12:02:43 +0000
commit577ccb17e46f5236548cd558dc8d79ea63ea18d6 (patch)
treefa8b26320cd0f248c56b054ee63899c08665d97a
parent4f9ed146cbc11edf7f0286eadf5adce8470a8cb9 (diff)
Move RescueParty registration back to the beginning of SystemServer.
This is to ensure that RescueParty is registered before other things that call RescueParty. Keeping the noteBoot at the updated place would still ensure that bootloop mitigations are handled correctly. Change-Id: Ib0647a26e031fbb322112a8b3e9a5ee434116341 Test: TH Bug: 291137901
-rw-r--r--services/java/com/android/server/SystemServer.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index cfe4e17eb1be..107c2947c550 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1196,11 +1196,12 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(RecoverySystemService.Lifecycle.class);
t.traceEnd();
+ // Initialize RescueParty.
+ RescueParty.registerHealthObserver(mSystemContext);
if (!Flags.recoverabilityDetection()) {
// Now that we have the bare essentials of the OS up and running, take
// note that we just booted, which might send out a rescue party if
// we're stuck in a runtime restart loop.
- RescueParty.registerHealthObserver(mSystemContext);
PackageWatchdog.getInstance(mSystemContext).noteBoot();
}
@@ -2917,10 +2918,10 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
if (Flags.recoverabilityDetection()) {
- // Now that we have the essential services needed for rescue party, initialize
- // RescuParty. note that we just booted, which might send out a rescue party if
- // we're stuck in a runtime restart loop.
- RescueParty.registerHealthObserver(mSystemContext);
+ // Now that we have the essential services needed for mitigations, register the boot
+ // with package watchdog.
+ // Note that we just booted, which might send out a rescue party if we're stuck in a
+ // runtime restart loop.
PackageWatchdog.getInstance(mSystemContext).noteBoot();
}