Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1064a50d authored by Jeff Brown's avatar Jeff Brown
Browse files

hasVibrator() should only report presence of built-in vibrator.

Bug: 6430585
Change-Id: Ia8d8656a2f0467b83f22a1dd747fbd17575573b3
parent 93de746e
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -391,9 +391,15 @@ public class VibratorService extends IVibratorService.Stub
    }

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

    private void doVibratorOn(long millis) {