Skip to content

Commit 9617921

Browse files
committed
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
1 parent 6ae8a24 commit 9617921

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,6 +4302,9 @@ private boolean isGlobalAccessibilityGestureEnabled() {
43024302
}
43034303

43044304
public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
4305+
if (!mVibrator.hasVibrator()) {
4306+
return false;
4307+
}
43054308
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
43064309
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
43074310
if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {

0 commit comments

Comments
 (0)