mozilla/MozStumbler — pull request #1298 by crankycoder (2014-11-24 20:42:52+00:00)
Title: Features/1297 filter gravity

This fixes #1297 by adding a filter to extract gravity from the regular accelerometer readings.

This patch also includes a test that checks for convergence using raw values that I extracted from my device on startup.

The patch includes a testcase using robolectric. The most important detail in the test is that robolectric isn't magic. You still can't construct a SensorEvent because of private constructors and final instance attributes (thanks Android!), so I ended up passing a flattened SensorEvent back from the event listener to the LegacyMotionSensor instance.