idleMilliseconds method

  1. @override
int idleMilliseconds()
override

The Idle duration in milliseconds.

Throws UnsupportedError when isSupported is false. Implementations that are supported must not throw for ordinary OS failures — they report 0 (treat the user as active) so a transient failure cannot silently end monitoring.

Implementation

@override
int idleMilliseconds() {
  final nanoseconds = _readIdleNanoseconds();
  return idleFromNanoseconds(
    succeeded: nanoseconds != null,
    nanoseconds: nanoseconds ?? 0,
  );
}