Move hasHwKeysEnabled() and updateKeyAssignments() bellow navbar on/off detection

Based here: https://github.com/CyanogenMod/android_frameworks_base/commit/a8909012f7a78c2399f603c809a6a4e9b3dfa5c8

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

(cherry picked from commit 15e2dcfc39b8b0a7797ad960107ae79281076f6d)