RestartConfig class

How the Android service restarts itself (Android 12+/14 restrictions).

Constructors

RestartConfig({bool useAlarmClock = true, bool resumeNotification = true, String resumeTitle = 'Tracking stopped', String resumeText = 'Tap to resume tracking', String resumeChannelName = 'Resume tracking', int keepAliveMs = 900000})
Creates a RestartConfig.
const
RestartConfig.fromMap(Map m)
Builds a RestartConfig from a map; missing keys keep their defaults.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
keepAliveMs → int
Safety net against a hard process kill (OEM task killer, low-memory killer, crash): while tracking, a restart alarm is kept armed this far ahead and slid forward by the running service, so it only ever fires after the process died (and START_STICKY did not bring it back - HyperOS/MIUI often does not). Uses setExactAndAllowWhileIdle (no status-bar alarm icon); needs the same eligibility as every restart. 0 = off. Default 15 min.
final
resumeChannelName → String
Name of the notification channel used by the resume notification.
final
resumeNotification → bool
When a restart is blocked (no background location, or neither exact alarms nor battery exemption, or the OS refuses a background FGS start): emit status restartBlocked and post a tap-to-resume notification.
final
resumeText → String
Text of the notification that asks the user to resume tracking.
final
resumeTitle → String
Title of the notification that asks the user to resume tracking.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
useAlarmClock → bool
Use AlarmManager.setAlarmClock when exact alarms are allowed (exempt from Doze; Android shows a next-alarm icon). false = setExactAndAllowWhileIdle.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() → Map<String, dynamic>
Serializes this RestartConfig to a JSON-friendly map (the format sent to the native side and stored).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited