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

Commit 820ec787 authored by Juan Sebastian Martinez's avatar Juan Sebastian Martinez
Browse files

Cleanup of the haptic volume slider flag.

This feature has been released.

Test: atest VolumeDialogImplTest
Test: presubmit
Flag: NONE This is a flag cleanup CL
Bug: 316953430
Change-Id: Icde13d325cee067e5eeb1f4bddc5eb3f6acb7f9c
parent 3a288a1e
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -544,13 +544,6 @@ flag {
    }
}

flag {
    name: "haptic_volume_slider"
    namespace: "systemui"
    description: "Adds haptic feedback to the volume slider."
    bug: "316953430"
}

flag {
    name: "new_volume_panel"
    namespace: "systemui"
+2 −5
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_VOLUME_CONTROL;
import static com.android.internal.jank.InteractionJankMonitor.Configuration.Builder;
import static com.android.settingslib.flags.Flags.volumeDialogAudioSharingFix;
import static com.android.systemui.Flags.hapticVolumeSlider;
import static com.android.systemui.volume.Events.DISMISS_REASON_POSTURE_CHANGED;
import static com.android.systemui.volume.Events.DISMISS_REASON_SETTINGS_CLICKED;

@@ -928,11 +927,9 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
    }

    private void addSliderHapticsToRow(VolumeRow row) {
        if (hapticVolumeSlider()) {
        row.createPlugin(mVibratorHelper, mSystemClock);
        HapticSliderViewBinder.bind(row.slider, row.mHapticPlugin);
    }
    }

    @VisibleForTesting void addSliderHapticsToRows() {
        for (VolumeRow row: mRows) {
+2 −19
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import static android.media.AudioManager.RINGER_MODE_NORMAL;
import static android.media.AudioManager.RINGER_MODE_SILENT;
import static android.media.AudioManager.RINGER_MODE_VIBRATE;

import static com.android.systemui.Flags.FLAG_HAPTIC_VOLUME_SLIDER;
import static com.android.systemui.volume.Events.DISMISS_REASON_UNKNOWN;
import static com.android.systemui.volume.Events.SHOW_REASON_UNKNOWN;
import static com.android.systemui.volume.VolumeDialogControllerImpl.DYNAMIC_STREAM_BROADCAST;
@@ -51,7 +50,6 @@ import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.media.AudioSystem;
import android.os.SystemClock;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.provider.Settings;
import android.testing.TestableLooper;
@@ -285,23 +283,8 @@ public class VolumeDialogImplTest extends SysuiTestCase {
    }

    @Test
    @DisableFlags(FLAG_HAPTIC_VOLUME_SLIDER)
    public void addSliderHaptics_withHapticsDisabled_doesNotDeliverOnProgressChangedHaptics() {
        // GIVEN that the slider haptics flag is disabled and we try to add haptics to volume rows
        mDialog.addSliderHapticsToRows();

        // WHEN haptics try to be delivered to a volume stream
        boolean canDeliverHaptics =
                mDialog.canDeliverProgressHapticsToStream(AudioSystem.STREAM_MUSIC, true, 50);

        // THEN the result is that haptics are not successfully delivered
        assertFalse(canDeliverHaptics);
    }

    @Test
    @EnableFlags(FLAG_HAPTIC_VOLUME_SLIDER)
    public void addSliderHaptics_withHapticsEnabled_canDeliverOnProgressChangedHaptics() {
        // GIVEN that the slider haptics flag is enabled and we try to add haptics to volume rows
    public void addSliderHaptics_canDeliverOnProgressChangedHaptics() {
        // GIVEN that the slider haptics are added to rows
        mDialog.addSliderHapticsToRows();

        // WHEN haptics try to be delivered to a volume stream