diff options
| author | 2024-05-21 09:58:16 -0700 | |
|---|---|---|
| committer | 2024-05-21 09:58:16 -0700 | |
| commit | a01aeadce5ad605354bedadc4c089c26ea915fc8 (patch) | |
| tree | 789884839a1762175c1f8eeeb85c8175358fec56 | |
| parent | 321860fa089017dc865cf56fad2d9606fe8d8f43 (diff) | |
Adding volume slider tracker configuration.
A customized SeekableSliderTrackerConfig object is supplied to the
vertical volume slider haptics. The purpose is to decrease the lower
bookend threshold and increase the upper booken threshold. With
this,bookend haptics will correspond to the lower and upper limits of
the volume stream controlled by the volume slider.
Test: atest SystemUITests:VolumeDialogImplTest
Test: manual. Short-press volume keys to reach uppper and lower bookends
-> verify that haptics are delivered on the true upper and lower
limits
Flag: ACONFIG com.android.systemui.haptic_volume_slider NEXTFOOD
Bug: 341664106
Change-Id: I861d6e4628b4123a34697180bf63508d7b9dcc22
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java index c69fb662b67d..fbfead1becd0 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java @@ -118,6 +118,7 @@ import com.android.systemui.Dumpable; import com.android.systemui.Prefs; import com.android.systemui.dump.DumpManager; import com.android.systemui.haptics.slider.HapticSliderViewBinder; +import com.android.systemui.haptics.slider.SeekableSliderTrackerConfig; import com.android.systemui.haptics.slider.SeekbarHapticPlugin; import com.android.systemui.haptics.slider.SliderHapticFeedbackConfig; import com.android.systemui.media.dialog.MediaOutputDialogManager; @@ -2619,6 +2620,13 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, /* upperBookendScale= */ 1f, /* lowerBookendScale= */ 0.05f, /* exponent= */ 1f / 0.89f); + private static final SeekableSliderTrackerConfig sSliderTrackerConfig = + new SeekableSliderTrackerConfig( + /* waitTimeMillis= */100, + /* jumpThreshold= */0.02f, + /* lowerBookendThreshold= */0.01f, + /* upperBookendThreshold= */0.99f + ); private View view; private TextView header; @@ -2661,7 +2669,8 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, mHapticPlugin = new SeekbarHapticPlugin( vibratorHelper, systemClock, - sSliderHapticFeedbackConfig); + sSliderHapticFeedbackConfig, + sSliderTrackerConfig); } |