Loading packages/SystemUI/src/com/android/systemui/haptics/slider/SeekableSliderHapticPlugin.kt +1 −1 Original line number Diff line number Diff line Loading @@ -163,6 +163,6 @@ constructor( } companion object { const val KEY_UP_TIMEOUT = 100L const val KEY_UP_TIMEOUT = 60L } } packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +15 −4 Original line number Diff line number Diff line Loading @@ -2082,6 +2082,9 @@ 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); Loading Loading @@ -2486,10 +2489,10 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, if (getActiveRow().equals(mRow) && mRow.slider.getVisibility() == VISIBLE && mRow.mHapticPlugin != null) { mRow.mHapticPlugin.onProgressChanged(seekBar, progress, fromUser); if (!fromUser) { // Consider a change from program as the volume key being continuously pressed mRow.mHapticPlugin.onKeyDown(); if (fromUser || mRow.animTargetProgress == progress) { // Deliver user-generated slider changes immediately, or when the animation // completes mRow.deliverOnProgressChangedHaptics(fromUser, progress); } } if (D.BUG) Log.d(TAG, AudioSystem.streamToString(mRow.stream) Loading Loading @@ -2642,6 +2645,14 @@ 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(); } } } /** Loading Loading
packages/SystemUI/src/com/android/systemui/haptics/slider/SeekableSliderHapticPlugin.kt +1 −1 Original line number Diff line number Diff line Loading @@ -163,6 +163,6 @@ constructor( } companion object { const val KEY_UP_TIMEOUT = 100L const val KEY_UP_TIMEOUT = 60L } }
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +15 −4 Original line number Diff line number Diff line Loading @@ -2082,6 +2082,9 @@ 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); Loading Loading @@ -2486,10 +2489,10 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, if (getActiveRow().equals(mRow) && mRow.slider.getVisibility() == VISIBLE && mRow.mHapticPlugin != null) { mRow.mHapticPlugin.onProgressChanged(seekBar, progress, fromUser); if (!fromUser) { // Consider a change from program as the volume key being continuously pressed mRow.mHapticPlugin.onKeyDown(); if (fromUser || mRow.animTargetProgress == progress) { // Deliver user-generated slider changes immediately, or when the animation // completes mRow.deliverOnProgressChangedHaptics(fromUser, progress); } } if (D.BUG) Log.d(TAG, AudioSystem.streamToString(mRow.stream) Loading Loading @@ -2642,6 +2645,14 @@ 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(); } } } /** Loading