From cd3d3f22ab6f5dd33b67fc0df58cce6ef46209c5 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Tue, 22 Sep 2009 11:44:29 -0500 Subject: [PATCH] fw/policy/base:Phonewindowmanager: Make vkey button haptics part of global haptic setting This change ties the virtual key haptics to the global haptics settings Signed-off-by: Dan Murphy --- .../com/android/internal/policy/impl/PhoneWindowManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 policy/com/android/internal/policy/impl/PhoneWindowManager.java diff --git a/policy/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/com/android/internal/policy/impl/PhoneWindowManager.java old mode 100644 new mode 100755 index 967817c54e2c2..4234247cef21f --- a/policy/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2184,7 +2184,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { public void keyFeedbackFromInput(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN && (event.getFlags()&KeyEvent.FLAG_VIRTUAL_HARD_KEY) != 0) { - mVibrator.vibrate(mVirtualKeyVibePattern, -1); + if (Settings.System.getInt(mContext.getContentResolver(), + Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) != 0) { + mVibrator.vibrate(mVirtualKeyVibePattern, -1); + } } }