JFLib

plat/apple_power_ios.rs#

Source: lib/plat/apple_power_ios.rs

apple_power_ios -- (power.rs) keep an iPhone or iPad awake: UIApplication's idle timer

  hold(reason, what) -> Some(Held)   INHIBIT_IDLE: idleTimerDisabled while a guard of this
                                     process holds it (the screen stays on, no auto-lock; iOS
                                     honours it while the app is in front).  INHIBIT_SUSPEND
                                     alone -> None: iOS has no sleep of its own besides the
                                     screen's lock, and an app in the background runs only
                                     seconds; the reason is not shown anywhere
  release(held)                      the last guard turns the timer on again
  ios_idle_timer_off() -> bool       (tests) idleTimerDisabled as UIKit has it now

The property belongs to the main thread: set there at once, from another thread through the
main queue.  Each setting applies the count of that moment, so settings that arrive out of
order still end in the right state.  Without an app (no UIApplication) nothing happens and
hold still answers: the request is noted for an app that starts later in the process.
  • fn ios_idle_timer_off() -> bool (tests) UIApplication's idleTimerDisabled now (false outside an app)

Source: docs/API.md in the JFLib repository.