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

Commit 800547e5 authored by Olivier Gaillard's avatar Olivier Gaillard
Browse files

Move the logic to update the system server timeouts to the end of the startup process.

That change will help using smaller system server timeouts.

Bug: 209932320
Change-Id: I5f7ccfb75b410385def362031be60d87f00014cd
parent fe367953
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -929,6 +929,9 @@ public final class SystemServer implements Dumpable {
            startCoreServices(t);
            startOtherServices(t);
            startApexServices(t);
            // Only update the timeout after starting all the services so that we use
            // the default timeout to start system server.
            updateWatchdogTimeout(t);
        } catch (Throwable ex) {
            Slog.e("System", "******************************************");
            Slog.e("System", "************ Failure starting system services", ex);
@@ -1499,10 +1502,6 @@ public final class SystemServer implements Dumpable {
            SQLiteCompatibilityWalFlags.reset();
            t.traceEnd();

            t.traceBegin("UpdateWatchdogTimeout");
            Watchdog.getInstance().registerSettingsObserver(context);
            t.traceEnd();

            // Records errors and logs, for example wtf()
            // Currently this service indirectly depends on SettingsProvider so do this after
            // InstallSystemProviders.
@@ -3055,6 +3054,12 @@ public final class SystemServer implements Dumpable {
        t.traceEnd(); // startApexServices
    }

    private void updateWatchdogTimeout(@NonNull TimingsTraceAndSlog t) {
        t.traceBegin("UpdateWatchdogTimeout");
        Watchdog.getInstance().registerSettingsObserver(mSystemContext);
        t.traceEnd();
    }

    private boolean deviceHasConfigString(@NonNull Context context, @StringRes int resId) {
        String serviceName = context.getString(resId);
        return !TextUtils.isEmpty(serviceName);