Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +10 −6 Original line number Diff line number Diff line Loading @@ -721,6 +721,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Behavior of rotation suggestions. (See Settings.Secure.SHOW_ROTATION_SUGGESTION) int mShowRotationSuggestions; // Whether system navigation keys are enabled boolean mSystemNavigationKeysEnabled; Display mDisplay; int mLandscapeRotation = 0; // default landscape rotation Loading Loading @@ -984,6 +987,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Global.getUriFor( Settings.Global.POLICY_CONTROL), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Global.getUriFor( Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED), false, this, UserHandle.USER_ALL); updateSettings(); } Loading Loading @@ -2359,6 +2365,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); mSystemNavigationKeysEnabled = Settings.Secure.getIntForUser(resolver, Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0, UserHandle.USER_CURRENT) == 1; // Configure rotation suggestions. int showRotationSuggestions = Settings.Secure.getIntForUser(resolver, Loading Loading @@ -6214,7 +6223,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (event.getAction() == KeyEvent.ACTION_UP) { if (!mAccessibilityManager.isEnabled() || !mAccessibilityManager.sendFingerprintGesture(event.getKeyCode())) { if (areSystemNavigationKeysEnabled()) { if (mSystemNavigationKeysEnabled) { sendSystemKeyToStatusBarAsync(event.getKeyCode()); } } Loading Loading @@ -7793,11 +7802,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Global.THEATER_MODE_ON, 0) == 1; } private boolean areSystemNavigationKeysEnabled() { return Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0, UserHandle.USER_CURRENT) == 1; } @Override public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) { if (!mVibrator.hasVibrator()) { Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +10 −6 Original line number Diff line number Diff line Loading @@ -721,6 +721,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Behavior of rotation suggestions. (See Settings.Secure.SHOW_ROTATION_SUGGESTION) int mShowRotationSuggestions; // Whether system navigation keys are enabled boolean mSystemNavigationKeysEnabled; Display mDisplay; int mLandscapeRotation = 0; // default landscape rotation Loading Loading @@ -984,6 +987,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Global.getUriFor( Settings.Global.POLICY_CONTROL), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Global.getUriFor( Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED), false, this, UserHandle.USER_ALL); updateSettings(); } Loading Loading @@ -2359,6 +2365,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); mSystemNavigationKeysEnabled = Settings.Secure.getIntForUser(resolver, Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0, UserHandle.USER_CURRENT) == 1; // Configure rotation suggestions. int showRotationSuggestions = Settings.Secure.getIntForUser(resolver, Loading Loading @@ -6214,7 +6223,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (event.getAction() == KeyEvent.ACTION_UP) { if (!mAccessibilityManager.isEnabled() || !mAccessibilityManager.sendFingerprintGesture(event.getKeyCode())) { if (areSystemNavigationKeysEnabled()) { if (mSystemNavigationKeysEnabled) { sendSystemKeyToStatusBarAsync(event.getKeyCode()); } } Loading Loading @@ -7793,11 +7802,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Global.THEATER_MODE_ON, 0) == 1; } private boolean areSystemNavigationKeysEnabled() { return Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 0, UserHandle.USER_CURRENT) == 1; } @Override public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) { if (!mVibrator.hasVibrator()) { Loading