mozilla/MozStumbler — pull request #1270 by garvankeeley (2014-11-18 02:56:27+00:00)
Title: Battery-saving mode (by pausing GPS and scanners) on unchanging location.

Uses motion detection to wake the scanning up after being paused. Note, on Android 4.3 and higher, the significant motion detector is used, which does a great job of detection user movement. On lower Androids, the acceleration sensor is used (with a low threshold), which will wake on small movements of the device.

Uses 2-part detection:
1) DetectUnchangingLocation is used to determine if the user has not
moved in 2 minutes, then the ScanManager pauses (this is a low power
state)
2) When the MotionSensor detects movement (which uses very low power
sensors to do so), start scanning again.

Also worth noting, the notification text changes when paused, and the
map view shows a paused message also.

@crankycoder this branched was based of my previous battery change PR, so I'll clean that one up, land it first, and merge this one. However changes I make there won't affect this in any major way, so if you feel like starting on a review, go nuts.