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

Commit e25d33ce authored by Danesh M's avatar Danesh M
Browse files

Notification Widgets : Fix vibration

The initial value of the array determines how long till the vibration starts,
and second value determines how long to leave it on till.

Since config_virtualKeyVibePattern is in an overlay and we cannot rely on its consitency,
we check the length of the array, and based on it execute the appropriate vibration.

Change-Id: Ida88dabc2b3b364501e335bdbe45c84c3845c913
parent f412f1e8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -143,8 +143,14 @@ public abstract class PowerButton {
    private View.OnClickListener mClickListener = new View.OnClickListener() {
        public void onClick(View v) {
            if (mHapticFeedback && mClickPattern != null) {
                if (mClickPattern.length == 1) {
                    // One-shot vibration
                    mVibrator.vibrate(mClickPattern[0]);
                } else {
                    // Pattern vibration
                    mVibrator.vibrate(mClickPattern, -1);
                }
            }
            toggleState(v.getContext());
            update(v.getContext());