Skip to content

3akare/grid-sensing

v0.1.0MIT

Detect power cuts from phones' charging state. The Android charging-sensor pattern (JobScheduler stop as the signal), the Poisson detection engine with its tested numbers, and per-maker battery steps (Tecno, Infinix, itel, Samsung, Xiaomi, Pixel) that stop the OS killing a background sensor. Patterns from the Outage project.

charging-sensor

Design and review an Android sensor that detects mains power loss from the phone's charging state, using a JobScheduler job with a charging constraint whose stop is the signal. Use when building or debugging a charging-stop or unplug detector, handling job stop reasons, plug types, battery-full cases, monotonic event time, reboots and process death, a foreground-service receiver for phones that sit at 100%, or a native alarm that rings offline when power returns.

License
MIT
Read SKILL.md at the source

Pinned to revision 18ab87dd7664, so it is the text this page describes rather than whatever the author pushed since.

Files

Every link opens the file at its source, pinned to the revision this page describes.