From b09abc1dd271d0eb4ba4050d8bf9670802a7d0fe Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 13 Jan 2011 21:08:27 -0800 Subject: Add volume down as a safe mode key for Stingray. Fixed a race condition during startup. We need to wait for the input devices to actually be ready before trying to detect safe mode. Fixed a problem during safe mode activation where we would try to add the overlay window but the display was not initialized. Now we do it after the system is ready. Bug: 3134825 Change-Id: I4c043c142ae6bf0d865c79d266d36154eaf00709 --- policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'policy') diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index a6037aa..ee1a141 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2550,7 +2550,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { int sState = mWindowManager.getKeycodeState(KeyEvent.KEYCODE_S); int dpadState = mWindowManager.getDPadKeycodeState(KeyEvent.KEYCODE_DPAD_CENTER); int trackballState = mWindowManager.getTrackballScancodeState(BTN_MOUSE); - mSafeMode = menuState > 0 || sState > 0 || dpadState > 0 || trackballState > 0; + int volumeDownState = mWindowManager.getKeycodeState(KeyEvent.KEYCODE_VOLUME_DOWN); + mSafeMode = menuState > 0 || sState > 0 || dpadState > 0 || trackballState > 0 + || volumeDownState > 0; performHapticFeedbackLw(null, mSafeMode ? HapticFeedbackConstants.SAFE_MODE_ENABLED : HapticFeedbackConstants.SAFE_MODE_DISABLED, true); -- cgit v1.1