Framework: Forward port Fix Profiles Insecure lock screen not working

This fixes Issue 6226: The insecure lockscreen setting is not being activated with
the use of profiles if the default is secure (PIN or Password)

Change-Id: Iaba6d39df0000da073c3ea0c35de1c78f63ad08d
Keyguard: remove duplicated code

Patchset 2: fixed whitespace error
Patchset 3: a few more tiny changes
Patchset 4: some code moving, removing an unnecessary member
Patchset 5: make toggleSilentMode() a bit easier to read
Patchset 6: revert most of the cleanup
Patchset 7: fix syntax error
Patchset 8: fixes pointed out by Danny Baumann

Change-Id: I4e5f8c92b223c1260891472dbf807d5ff53e5721
LockPatternUtils: isSecure: respect profile settings

When the lock screen is set to secure and overridden to insecure
by profile settings, isSecure() would return true causing confusion
to some code.

For example, attempting to use a lockscreen shortcut
to launch an activity will cause the device to soft-reboot due to
recursive calling and a stack overflow.

Change-Id: I02984671c2a047765f4da1f6a44bb19dea5bf2d3
Profile: respect DPM when overriding screen lock (1/2)

Profile currently allows the user to override the keyguard set by
device policy, which is undesired.

Change-Id: Id8d80cfdad51ca0a64dc231a77e53b104ecb9825
Merge branch 'jb3' of https://github.com/CarbonDev/android_frameworks_base into jb3