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

Commit 29c05688 authored by Olivier Gaillard's avatar Olivier Gaillard
Browse files

Extends the watchdog timeout when rebooting the device.

This change will help to decrease the default timeout in dogfood.

Change-Id: I01c406b060988ce0f759a804912f63b735121c9e
Bug: 316120613
parent 65403b12
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.internal.widget.LockSettingsInternal;
import com.android.internal.widget.RebootEscrowListener;
import com.android.internal.widget.RebootEscrowListener;
import com.android.server.LocalServices;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.SystemService;
import com.android.server.Watchdog;
import com.android.server.pm.ApexManager;
import com.android.server.pm.ApexManager;
import com.android.server.recoverysystem.hal.BootControlHIDL;
import com.android.server.recoverysystem.hal.BootControlHIDL;


@@ -112,6 +113,9 @@ public class RecoverySystemService extends IRecoverySystem.Stub implements Reboo


    private static final int SOCKET_CONNECTION_MAX_RETRY = 30;
    private static final int SOCKET_CONNECTION_MAX_RETRY = 30;


    /** How long to pause the watchdog for when rebooting the device. */
    private static final int REBOOT_WATCHDOG_PAUSE_DURATION_MS = 20_000;

    static final String REQUEST_LSKF_TIMESTAMP_PREF_SUFFIX = "_request_lskf_timestamp";
    static final String REQUEST_LSKF_TIMESTAMP_PREF_SUFFIX = "_request_lskf_timestamp";
    static final String REQUEST_LSKF_COUNT_PREF_SUFFIX = "_request_lskf_count";
    static final String REQUEST_LSKF_COUNT_PREF_SUFFIX = "_request_lskf_count";


@@ -899,7 +903,8 @@ public class RecoverySystemService extends IRecoverySystem.Stub implements Reboo


        // Clear the metrics prefs after a successful RoR reboot.
        // Clear the metrics prefs after a successful RoR reboot.
        mInjector.getMetricsPrefs().deletePrefsFile();
        mInjector.getMetricsPrefs().deletePrefsFile();

        Watchdog.getInstance().pauseWatchingCurrentThreadFor(
                REBOOT_WATCHDOG_PAUSE_DURATION_MS, "reboot can be slow");
        PowerManager pm = mInjector.getPowerManager();
        PowerManager pm = mInjector.getPowerManager();
        pm.reboot(reason);
        pm.reboot(reason);
        return RESUME_ON_REBOOT_REBOOT_ERROR_UNSPECIFIED;
        return RESUME_ON_REBOOT_REBOOT_ERROR_UNSPECIFIED;