@Alan_S:
If the sensor hasn't changed behavior since whomever wrote that piece of code tested it, the intended behavior is:
Sleep Cover is closed -> PRESS event -> SUSPEND
Sleep Cover is opened -> RELEASE event -> RESUME
The general power handling code has guards against double-suspend/double-wakeup attempts, so closing the cover after flicking the power button shouldn't have any impact.
Opening the cover should, however, wake the device up, no matter how it was put to sleep.
TL;DR: Unless you see spurious RELEASE events coming from the sensor, the device shouldn't wake-up from the sleep cover.
EDIT: On the other hand, doing it the other way around, i.e., closing the sleep cover and *THEN* flicking the power switch, that *WILL* cancel the suspend, if you do that in the ~10s window before the device is actually put to sleep.
EDITē: With debug logging enabled, any of these events will be logged ("Suspending..." or "Resuming...").
Last edited by NiLuJe; 12-06-2015 at 08:54 AM.
|