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

Commit 6f7381e5 authored by Lais Andrade's avatar Lais Andrade Committed by Automerger Merge Worker
Browse files

Merge "Add support to slowly bring the vibrator down in VibrationThread" into...

Merge "Add support to slowly bring the vibrator down in VibrationThread" into sc-dev am: a9d5203a am: 715eb117

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15159450

Change-Id: I3a9b039b2de42b559092b5ebf16a4bff6dc834dd
parents afe59fa4 715eb117
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3370,8 +3370,7 @@
    <integer name="config_vibrationWaveformRampStepDuration">5</integer>

    <!-- The duration (in milliseconds) that should be applied to waveform vibrations that ends in
         non-zero amplitudes, . The waveform will
         be played as a PWLE instead of on/off calls if this value is set. -->
         non-zero amplitudes, to bring the vibrator amplitude down to zero using this timing. -->
    <integer name="config_vibrationWaveformRampDownDuration">0</integer>

    <!-- Number of retries Cell Data should attempt for a given error code before
+12 −4
Original line number Diff line number Diff line
@@ -99,16 +99,24 @@ final class VibrationSettings {
    private boolean mLowPowerMode;

    VibrationSettings(Context context, Handler handler) {
        this(context, handler,
                context.getResources().getInteger(
                        com.android.internal.R.integer.config_vibrationWaveformRampDownDuration),
                context.getResources().getInteger(
                        com.android.internal.R.integer.config_vibrationWaveformRampStepDuration));
    }

    @VisibleForTesting
    VibrationSettings(Context context, Handler handler, int rampDownDuration,
            int rampStepDuration) {
        mContext = context;
        mSettingObserver = new SettingsObserver(handler);
        mUidObserver = new UidObserver();
        mUserReceiver = new UserObserver();

        // TODO(b/191150049): move these to vibrator static config file
        mRampStepDuration = context.getResources().getInteger(
                com.android.internal.R.integer.config_vibrationWaveformRampStepDuration);
        mRampDownDuration = context.getResources().getInteger(
                com.android.internal.R.integer.config_vibrationWaveformRampDownDuration);
        mRampDownDuration = rampDownDuration;
        mRampStepDuration = rampStepDuration;

        VibrationEffect clickEffect = createEffectFromResource(
                com.android.internal.R.array.config_virtualKeyVibePattern);
Loading