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

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java
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