Make SurfaceView layers captured by screenshotApplications()

Since SurfaceView layers are located below application layers,
SurfaceView is not captured by screenshotApplications()
when the application is running in fullscreen.

Moreover, ws.isFullscreen(dw, dh) returns mostly true
on the devices which do not use the navigation bar.

Change-Id: Ia1036c79054950384a97504714929fd85c8147de
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Keyguard: do not allow to delete the system widget if widgets are disabled

We overwrite the default widget with our own one. In this case it is detected
as a normal widget even though it widgets are disabled and starts listening to
longpress events

Whatever check if widgets are disabled. If this is the case do not allow any
longpress events

Change-Id: I471664bac6ca1f8e57efe4904a385904c40486db
Keyguard: fix not shown overlay widgets from system

google derp....due that if widgets are disabled current AOSP
code just add the default widget. Then checkAppWidgetConsistency()
detects a widget which was added and the complete method is non op.
Whatever lets handle the whole process over checkAppWidgetConsistency()
on widget disabled it tries to bind the default widget over overlay if
this is without sucess it falls back to the system one.
Safemode falls always to the system one

This fixes as well an issue that the saved default id in LockPatternUtils
is not reseted back to default if all widgets were deleted from the user.
Based on an old patch from Danesh. Thanks for the suggestion

Change-Id: I6b21d18346fed5accc72141097939c92ee9aaa3c
Keyguard: let the user drag the challenge down if widgets are disabled

for the system clock widget this does not make much sense
but since our system default is cLock it makes sense to
allow it to see more content.

Change-Id: I0365573c6fa88117a47b01ced81eb36f75324342
FLAG_PRIVILEGED disappears if privileged app is updated and rebooted

Since Kitkat, an app pre-loaded under /system/priv-app/ has
FLAG_PRIVILEGED. However, if the app updated and the device
rebooted, privileged flag is unset from pkgFlags. This patch
fix issue to assign privileged flag when scanning the updated
packages.

Bug: 12640283

Change-Id: Ic24b5882f65dabdfae9cc39da3d68661bed4fc31