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

Commit 577ccb17 authored by Harshit Mahajan's avatar Harshit Mahajan
Browse files

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
parent 4f9ed146
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -1196,11 +1196,12 @@ public final class SystemServer implements Dumpable {
        mSystemServiceManager.startService(RecoverySystemService.Lifecycle.class);
        mSystemServiceManager.startService(RecoverySystemService.Lifecycle.class);
        t.traceEnd();
        t.traceEnd();


        // Initialize RescueParty.
        RescueParty.registerHealthObserver(mSystemContext);
        if (!Flags.recoverabilityDetection()) {
        if (!Flags.recoverabilityDetection()) {
            // Now that we have the bare essentials of the OS up and running, take
            // 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
            // note that we just booted, which might send out a rescue party if
            // we're stuck in a runtime restart loop.
            // we're stuck in a runtime restart loop.
            RescueParty.registerHealthObserver(mSystemContext);
            PackageWatchdog.getInstance(mSystemContext).noteBoot();
            PackageWatchdog.getInstance(mSystemContext).noteBoot();
        }
        }


@@ -2917,10 +2918,10 @@ public final class SystemServer implements Dumpable {
        t.traceEnd();
        t.traceEnd();


        if (Flags.recoverabilityDetection()) {
        if (Flags.recoverabilityDetection()) {
            // Now that we have the essential services needed for rescue party, initialize
            // Now that we have the essential services needed for mitigations, register the boot
            // RescuParty. note that we just booted, which might send out a rescue party if
            // with package watchdog.
            // we're stuck in a runtime restart loop.
            // Note that we just booted, which might send out a rescue party if we're stuck in a
            RescueParty.registerHealthObserver(mSystemContext);
            // runtime restart loop.
            PackageWatchdog.getInstance(mSystemContext).noteBoot();
            PackageWatchdog.getInstance(mSystemContext).noteBoot();
        }
        }