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

Commit 9d86fafe authored by Adam Powell's avatar Adam Powell
Browse files

Added haptic feedback support for scroll barriers

parent 668f06f3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -179,6 +179,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    // Vibrator pattern for haptic feedback during boot when safe mode is enabled.
    long[] mSafeModeEnabledVibePattern;
    
    // Vibrator pattern for haptic feedback when the user hits a touch scroll barrier.
    long[] mScrollBarrierVibePattern;
    
    /** If true, hitting shift & menu will broadcast Intent.ACTION_BUG_REPORT */
    boolean mEnableShiftMenuBugReports = false;
    
@@ -562,6 +565,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                com.android.internal.R.array.config_safeModeDisabledVibePattern);
        mSafeModeEnabledVibePattern = getLongIntArray(mContext.getResources(),
                com.android.internal.R.array.config_safeModeEnabledVibePattern);
        mScrollBarrierVibePattern = getLongIntArray(mContext.getResources(),
                com.android.internal.R.array.config_scrollBarrierVibePattern);
    }

    void updatePlugged(Intent powerIntent) {
@@ -2316,6 +2321,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case HapticFeedbackConstants.SAFE_MODE_ENABLED:
                mVibrator.vibrate(mSafeModeEnabledVibePattern, -1);
                return true;
            case HapticFeedbackConstants.SCROLL_BARRIER:
                mVibrator.vibrate(mScrollBarrierVibePattern, -1);
                return true;
        }
        return false;
    }