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

Commit d292ef2f authored by Lais Andrade's avatar Lais Andrade
Browse files

Rename vibration_pipeline_enabled flag

The flag was previously submitted as a non bugfix flag, so it cannot be
changed to a bugfix flag.

Bug: 344494220
Flag: android.os.vibrator.vibration_pipeline_fix_enabled
Test: VibratorManagerServiceTest
Change-Id: I437a2255fa9818384b02dfd56b8b83c5ebe8a6dc
parent 5a136f7b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -107,11 +107,11 @@ flag {

flag {
    namespace: "haptics"
    name: "vibration_pipeline_enabled"
    name: "vibration_pipeline_fix_enabled"
    description: "Enables functionality to pipeline vibration effects to avoid cancelling short vibrations"
    bug: "344494220"
    metadata {
        purpose: PURPOSE_FEATURE
        purpose: PURPOSE_BUGFIX
    }
}

+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ final class HalVibration extends Vibration {
    /** Returns true if this vibration can pipeline with the specified one. */
    public boolean canPipelineWith(HalVibration vib,
            @Nullable SparseArray<VibratorInfo> vibratorInfos, int durationThresholdMs) {
        long effectDuration = Flags.vibrationPipelineEnabled() && (vibratorInfos != null)
        long effectDuration = Flags.vibrationPipelineFixEnabled() && (vibratorInfos != null)
                ? mEffectToPlay.getDuration(vibratorInfos)
                : mEffectToPlay.getDuration();
        if (effectDuration == Long.MAX_VALUE) {
@@ -165,7 +165,7 @@ final class HalVibration extends Vibration {
            // if we have a use-case, requiring changes to how pipelined vibrations are cancelled.
            return false;
        }
        if (Flags.vibrationPipelineEnabled()
        if (Flags.vibrationPipelineFixEnabled()
                && (effectDuration > 0) && (effectDuration < durationThresholdMs)) {
            // Duration is known and it's less than the pipeline threshold, so allow it.
            // No need to check UID, as we want to avoid cancelling any short effect and let the
+1 −1
Original line number Diff line number Diff line
@@ -1406,7 +1406,7 @@ public class VibratorManagerServiceTest {
    }

    @Test
    @EnableFlags(android.os.vibrator.Flags.FLAG_VIBRATION_PIPELINE_ENABLED)
    @EnableFlags(android.os.vibrator.Flags.FLAG_VIBRATION_PIPELINE_FIX_ENABLED)
    public void vibrate_withPipelineFlagEnabledAndShortEffect_continuesOngoingEffect()
            throws Exception {
        assumeTrue(mVibrationConfig.getVibrationPipelineMaxDurationMs() > 0);