FUL now restarts when flipping tablet 180 (bug 7484464)

When a tablet rotates, FUL must be stopped and restarted in a new
position.  90 degree rotations cause a configuration change, causing
FUL to be automatically reconstructed in the new location.  However,
a 180 degree rotation is not a configuration change, so FUL was not
restarting.  A 180 degree rotation happens more often than one might
think.  If you set the tablet down and later picked it up in the
opposite orientation, FUL would not work prior to this fix.

This change adds a rotation watcher to KeyguardFaceUnlockView.  It
watches for 180 degree rotations and stops and restarts FUL
accordingly.

The rotation watcher callback must be unregistered when
KeyguardFaceUnlockView is recreated (as during 90 degree rotation
changes), otherwise the number of rotation watcher callbacks will keep
growing and they will never go away.  This is a problem not just
because there are many callbacks hanging around, but also because the
old callbacks end up trying to access biometric unlock views that no
longer exist, resulting in crashes.  So, a simple function was added
to the window manager to unregister a rotation watcher.

Change-Id: Ie1ef20a9a22b8f4e39918987dff2b8ad444fcfd1
4 files changed