No sound produced on global actions dialog pops up if no vibrator is present.

1. If the global gesture to enable accessibility is enabled there should
   be a haptic or auditory feedback after the global actions dialog pops up
   as a result of a long press on power. On devices with no vibrator an
   attempt to vibrate was performed evne if not hardware support exists
   As a result no sound was played because the it was assumed a haptic
   feedback was provided.

bug:7324903

Change-Id: Ic76db232d761a2899c1ca5f59ca55ff15ae575dd
This commit is contained in:
Svetoslav Ganov
2012-10-10 14:17:45 -07:00
parent 6ae8a24fc0
commit 96179213ba

View File

@@ -4302,6 +4302,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
if (!mVibrator.hasVibrator()) {
return false;
}
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {