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

Commit 0c6db849 authored by Daniel Chapin's avatar Daniel Chapin Committed by Android Build Coastguard Worker
Browse files

Revert "Delivering haptic feedback on stable values of slider progress change."

This reverts commit ebd86954.
Reason for revert: Droidfood blocking bugL: b/328545341
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2ab0450eed59fe67653e7dbd28f18468bc029791)
Merged-In: If1e001ba07b8a89da0a86cba6019ff91006bb24c
Change-Id: If1e001ba07b8a89da0a86cba6019ff91006bb24c
parent 72c34b6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,6 +163,6 @@ constructor(
    }

    companion object {
        const val KEY_UP_TIMEOUT = 60L
        const val KEY_UP_TIMEOUT = 100L
    }
}
+4 −15
Original line number Diff line number Diff line
@@ -2082,9 +2082,6 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
                } else {
                    row.anim.cancel();
                    row.anim.setIntValues(progress, newProgress);
                    // The animator can't keep up with the volume changes so haptics need to be
                    // triggered here. This happens when the volume keys are continuously pressed.
                    row.deliverOnProgressChangedHaptics(false, newProgress);
                }
                row.animTargetProgress = newProgress;
                row.anim.setDuration(UPDATE_ANIMATION_DURATION);
@@ -2489,10 +2486,10 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
            if (getActiveRow().equals(mRow)
                    && mRow.slider.getVisibility() == VISIBLE
                    && mRow.mHapticPlugin != null) {
                if (fromUser || mRow.animTargetProgress == progress) {
                    // Deliver user-generated slider changes immediately, or when the animation
                    // completes
                    mRow.deliverOnProgressChangedHaptics(fromUser, progress);
                mRow.mHapticPlugin.onProgressChanged(seekBar, progress, fromUser);
                if (!fromUser) {
                    // Consider a change from program as the volume key being continuously pressed
                    mRow.mHapticPlugin.onKeyDown();
                }
            }
            if (D.BUG) Log.d(TAG, AudioSystem.streamToString(mRow.stream)
@@ -2645,14 +2642,6 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        void removeHaptics() {
            slider.setOnTouchListener(null);
        }

        void deliverOnProgressChangedHaptics(boolean fromUser, int progress) {
            mHapticPlugin.onProgressChanged(slider, progress, fromUser);
            if (!fromUser) {
                // Consider a change from program as the volume key being continuously pressed
                mHapticPlugin.onKeyDown();
            }
        }
    }

    /**