Loading core/java/android/os/vibrator/flags.aconfig +2 −2 Original line number Diff line number Diff line Loading @@ -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 } } Loading services/core/java/com/android/server/vibrator/HalVibration.java +2 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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 Loading services/tests/vibrator/src/com/android/server/vibrator/VibratorManagerServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
core/java/android/os/vibrator/flags.aconfig +2 −2 Original line number Diff line number Diff line Loading @@ -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 } } Loading
services/core/java/com/android/server/vibrator/HalVibration.java +2 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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 Loading
services/tests/vibrator/src/com/android/server/vibrator/VibratorManagerServiceTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading