public class SystemWatchdogManager extends java.lang.Object
It allows applications to initialize and refresh the system watchdog service. If the system watchdog is not refreshed within the configured timeout, the system will reboot.
Unless noted, all system watchdog API methods require the
com.digi.android.permission.WATCHDOG permission. If your
application does not have this permission it will not be able to interact
with the system watchdog API.
|Modifier and Type||Field||Description|
Minimum configurable timeout for the system watchdog service: milliseconds.
|Modifier and Type||Method||Description|
Returns the configured system watchdog service timeout.
Initializes the system watchdog service with the given timeout (in milliseconds).
Returns whether the system watchdog service has been initialized or not.
Refreshes the system watchdog.
public static final long MINIMUM_WATCHDOG_TIMEOUT
public SystemWatchdogManager(android.content.Context context)
SystemWatchdogManagerusing the given application context.
SystemWatchdogManager allows your application to interact
with the system watchdog service.
context- Android application context.
context == null.
public long init(long timeout)
This method can be called only once per device boot. Once system watchdog service is started, it can't be stopped. Any Android application can refresh the system watchdog service. If the system watchdog service is not refreshed within the configured timeout after initialization, the system will reboot.
If this method is called again when the system watchdog service is
already running, an
UnsupportedOperationException will be thrown.
Note the possibility that system driver may not be able to set the
desired timeout. The real timeout value that is set is returned in this
method after initialization. You can also use
read the real driver assigned watchdog timeout any time after
timeout- System watchdog service timeout in milliseconds (must be greater than
timeout < MINIMUM_WATCHDOG_TIMEOUT.
java.lang.UnsupportedOperationException- If system watchdog service has been already initialized.
public long getTimeout()
This method can be called only after the system watchdog service is
initialized, otherwise an
UnsupportedOperationException will be
public boolean isRunning()