Skip to content

Commit 2c6200d

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "hasVibrator() should only report presence of built-in vibrator." into jb-dev
2 parents e19dbd9 + 1064a50 commit 2c6200d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

services/java/com/android/server/VibratorService.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,15 @@ public void onInputDeviceRemoved(int deviceId) {
391391
}
392392

393393
private boolean doVibratorExists() {
394-
synchronized (mInputDeviceVibrators) {
395-
return !mInputDeviceVibrators.isEmpty() || vibratorExists();
396-
}
394+
// For now, we choose to ignore the presence of input devices that have vibrators
395+
// when reporting whether the device has a vibrator. Applications often use this
396+
// information to decide whether to enable certain features so they expect the
397+
// result of hasVibrator() to be constant. For now, just report whether
398+
// the device has a built-in vibrator.
399+
//synchronized (mInputDeviceVibrators) {
400+
// return !mInputDeviceVibrators.isEmpty() || vibratorExists();
401+
//}
402+
return vibratorExists();
397403
}
398404

399405
private void doVibratorOn(long millis) {

0 commit comments

Comments
 (0)