WhisperSystems/RedPhone — pull request #45 by emblem (2012-10-29 06:23:39+00:00)
Title: Refactor Wakelocks

This is the first step in adding proximity based locking

-Moves the WakeLock and KeyGuard handling into a new LockManager class.
-Adds the AccelerometerListener class from Android's PhoneApp.

This changes user-visible behavior in one way. We now acquire only a partial wake lock when we receive incoming call notification before verifying freshness. This avoids turning on the screen and showing the keyguard briefly when we have a stale or invalid call.

Next step will be to use the internal proximity sensor based wake lock mode during in-call, augmented with the AccelerometerListener's orientation information.