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

Commit 1a6fa090 authored by Olivier Gaillard's avatar Olivier Gaillard Committed by Android (Google) Code Review
Browse files

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

parents 29f7983f 800547e5
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);