Keyguard: LaterLock: improve the handling of policy timeout

If the security policy specifies a maximumTimeToLock, the
previous implementation would consider the screen's
displayTimeout as having elapsed, even if the user simply
pushed the power button to turn the screen off.

Consider the case of a 30 minute policy timeout and a 30 minute
display timeout.  In this case, pressing the power button will
cause the phone to be immediately locked (even if the user
requested it remain unlocked for 30 minutes).

This commit differentiates these two cases (display timeout
vs. user initiated display off) and only counts the displayTimeout
period if it wasn't user initiated.  After this change, the
lock would only occur 30 minutes after the power button was
pushed.

Note: if the user requests, in the Settings app, that the
Daydream start immediately, it will still consider the
displayTimeout to have occurred because we don't have enough
context at this level to tell whethr or not Daydream was
user initiated or due to a displayTimeout.

Change-Id: I8ea971c75685b2c2b9d4ec050a7bce6e28f45746
Fix PhoneWindowManager animationFinished callback.

Change-Id: I86863a44e3e710aa5ea6ad433a42a3fad3bccac1
Active display: Don't register proximity if pocket mode not used
[log]

Change-Id: I6f27bd86e2dbe2bc14b88acb94668a593590853a
Active display: turn off display if device gets pocketed again

Change-Id: Icb4c002add915b75de7607f71c0d400e323feb5b
Active display: Fix "turn off display if device gets pocketed again"

Change-Id: Ifc2e148fca44c1ff143e93283c4c75319cf79bf9
Active display: Respect Quiet Hours
[log]

Change-Id: I3b260d3eb373203b471a50027a2e598cd686b07d
Active display: Add threshold to proximity sensor…
… [log]

Display will only be activated if the proximity sensor is covered for 5 seconds or more.

Change-Id: I0e9744d82884fc7aa7671ca8c93f49430359fee6