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

Commit 7d00b432 authored by Lais Andrade's avatar Lais Andrade Committed by Android (Google) Code Review
Browse files

Merge "Rename vibration_pipeline_enabled flag" into main

parents 4f475b27 d292ef2f
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);