Loading core/java/android/os/vibrator/flags.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -88,16 +88,6 @@ flag { } } flag { namespace: "haptics" name: "vibration_pipeline_fix_enabled" description: "Enables functionality to pipeline vibration effects to avoid cancelling short vibrations" bug: "344494220" metadata { purpose: PURPOSE_BUGFIX } } flag { namespace: "haptics" name: "remove_hidl_support" Loading services/core/java/com/android/server/vibrator/HalVibration.java +2 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.os.CombinedVibration; import android.os.VibrationAttributes; import android.os.VibrationEffect; import android.os.VibratorInfo; import android.os.vibrator.Flags; import android.os.vibrator.PrebakedSegment; import android.os.vibrator.VibrationEffectSegment; import android.util.SparseArray; Loading Loading @@ -163,7 +162,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.vibrationPipelineFixEnabled() && (vibratorInfos != null) long effectDuration = vibratorInfos != null ? mEffectToPlay.getDuration(vibratorInfos) : mEffectToPlay.getDuration(); if (effectDuration == Long.MAX_VALUE) { Loading @@ -172,8 +171,7 @@ final class HalVibration extends Vibration { // if we have a use-case, requiring changes to how pipelined vibrations are cancelled. return false; } if (Flags.vibrationPipelineFixEnabled() && (effectDuration > 0) && (effectDuration < durationThresholdMs)) { if (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 // vibrator hardware gracefully finish the vibration. Loading services/tests/vibrator/src/com/android/server/vibrator/VibratorManagerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -1465,8 +1465,7 @@ public class VibratorManagerServiceTest { } @Test @EnableFlags(Flags.FLAG_VIBRATION_PIPELINE_FIX_ENABLED) public void vibrate_withPipelineFlagEnabledAndShortEffect_continuesOngoingEffect() public void vibrate_withPipelineMaxDurationConfigAndShortEffect_continuesOngoingEffect() throws Exception { assumeTrue(mVibrationConfig.getVibrationPipelineMaxDurationMs() > 0); Loading Loading
core/java/android/os/vibrator/flags.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -88,16 +88,6 @@ flag { } } flag { namespace: "haptics" name: "vibration_pipeline_fix_enabled" description: "Enables functionality to pipeline vibration effects to avoid cancelling short vibrations" bug: "344494220" metadata { purpose: PURPOSE_BUGFIX } } flag { namespace: "haptics" name: "remove_hidl_support" Loading
services/core/java/com/android/server/vibrator/HalVibration.java +2 −4 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.os.CombinedVibration; import android.os.VibrationAttributes; import android.os.VibrationEffect; import android.os.VibratorInfo; import android.os.vibrator.Flags; import android.os.vibrator.PrebakedSegment; import android.os.vibrator.VibrationEffectSegment; import android.util.SparseArray; Loading Loading @@ -163,7 +162,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.vibrationPipelineFixEnabled() && (vibratorInfos != null) long effectDuration = vibratorInfos != null ? mEffectToPlay.getDuration(vibratorInfos) : mEffectToPlay.getDuration(); if (effectDuration == Long.MAX_VALUE) { Loading @@ -172,8 +171,7 @@ final class HalVibration extends Vibration { // if we have a use-case, requiring changes to how pipelined vibrations are cancelled. return false; } if (Flags.vibrationPipelineFixEnabled() && (effectDuration > 0) && (effectDuration < durationThresholdMs)) { if (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 // vibrator hardware gracefully finish the vibration. Loading
services/tests/vibrator/src/com/android/server/vibrator/VibratorManagerServiceTest.java +1 −2 Original line number Diff line number Diff line Loading @@ -1465,8 +1465,7 @@ public class VibratorManagerServiceTest { } @Test @EnableFlags(Flags.FLAG_VIBRATION_PIPELINE_FIX_ENABLED) public void vibrate_withPipelineFlagEnabledAndShortEffect_continuesOngoingEffect() public void vibrate_withPipelineMaxDurationConfigAndShortEffect_continuesOngoingEffect() throws Exception { assumeTrue(mVibrationConfig.getVibrationPipelineMaxDurationMs() > 0); Loading