Move coalescing to callback, optimize KeyguardStatusView.

Move the recent keyguard hidden coalescing down to the callback
level.  The lifetime of each callback can be short, make sure
they see visibility changes at least once for each change local
to their lifetime.

KeyguardStatusView.refresh() is called multiple times, and instances
are recreated often.  This results in expensive computations
filling the sysui/keyguard ui queue, adding to overall sluggishness.
Traceview points to DateFormat.getBestDateTimePattern as the
main culprit.

As of this change, refresh() will only call the expensive date pattern
computations when absolutely necessary, resulting in better
performance turning the screen off/on.

Bug:11221659
Bug:11447043
Change-Id: I3d4105af7db608803b82d8ef0ff141e42c154257
4 files changed