ModLockscreen: custom background optimizations
- moved all background related logic under maybeCreateKeyguard hook
ModLockscreen: added new custom background type: Last screen
When this style is selected and screen is about to be turned off,
current screen is captured to be used as custom lockscreen background.
This happens in DisplayPowerController which runs in different process
than Keyguard. There is no standard interface for delivering captured
bitmap to Keyguard and since DisplayPowerController is a system service
that has no access to external storage, it cannot write image to
filesystem itself. Thus captured image has to be mediated via our
KeyguardImageService. This happens in a dedicated thread so we don't
block user while he is turning off screen.

Since exchanging large amount of data between client and service is
limited by maximum size of inter-process communication transaction
buffer (which is 1MB in Android), we must ensure captured bitmap is
delivered per partes. Client (DisplayPowerController) initiates bitmap
delivery and then service will ask for new chunks after processing
current chunk of data. After all chunks are processed, keyguard is
notified via broadcast that the image is ready to be read and set.

Cherry-picked and backported from KitKat branch