Loading core/java/android/os/vibrator/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -145,3 +145,13 @@ flag { purpose: PURPOSE_FEATURE } } flag { namespace: "haptics" name: "fix_vibration_thread_callback_handling" description: "Fix how the VibrationThread handles late callbacks from the vibrator HAL" bug: "395005081" metadata { purpose: PURPOSE_BUGFIX } } services/core/java/com/android/server/vibrator/AbstractVibratorStep.java +2 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,8 @@ abstract class AbstractVibratorStep extends Step { Slog.d(VibrationThread.TAG, "Turning off vibrator " + getVibratorId()); } // Make sure we ignore any pending callback from old vibration commands. conductor.nextVibratorCallbackStepId(getVibratorId()); controller.off(); getVibration().stats.reportVibratorOff(); mPendingVibratorOffDeadline = 0; Loading services/core/java/com/android/server/vibrator/ComposePrimitivesVibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,8 @@ final class ComposePrimitivesVibratorStep extends AbstractComposedVibratorStep { PrimitiveSegment[] primitivesArray = primitives.toArray(new PrimitiveSegment[primitives.size()]); long vibratorOnResult = controller.on(primitivesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(primitivesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePrimitives(vibratorOnResult, primitivesArray); Loading services/core/java/com/android/server/vibrator/ComposePwleV2VibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,8 @@ final class ComposePwleV2VibratorStep extends AbstractComposedVibratorStep { + controller.getVibratorInfo().getId()); } PwlePoint[] pwlesArray = pwles.toArray(new PwlePoint[pwles.size()]); long vibratorOnResult = controller.on(pwlesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(pwlesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePwle(vibratorOnResult, pwlesArray); Loading services/core/java/com/android/server/vibrator/ComposePwleVibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ final class ComposePwleVibratorStep extends AbstractComposedVibratorStep { + controller.getVibratorInfo().getId()); } RampSegment[] pwlesArray = pwles.toArray(new RampSegment[pwles.size()]); long vibratorOnResult = controller.on(pwlesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(pwlesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePwle(vibratorOnResult, pwlesArray); Loading Loading
core/java/android/os/vibrator/flags.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -145,3 +145,13 @@ flag { purpose: PURPOSE_FEATURE } } flag { namespace: "haptics" name: "fix_vibration_thread_callback_handling" description: "Fix how the VibrationThread handles late callbacks from the vibrator HAL" bug: "395005081" metadata { purpose: PURPOSE_BUGFIX } }
services/core/java/com/android/server/vibrator/AbstractVibratorStep.java +2 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,8 @@ abstract class AbstractVibratorStep extends Step { Slog.d(VibrationThread.TAG, "Turning off vibrator " + getVibratorId()); } // Make sure we ignore any pending callback from old vibration commands. conductor.nextVibratorCallbackStepId(getVibratorId()); controller.off(); getVibration().stats.reportVibratorOff(); mPendingVibratorOffDeadline = 0; Loading
services/core/java/com/android/server/vibrator/ComposePrimitivesVibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,8 @@ final class ComposePrimitivesVibratorStep extends AbstractComposedVibratorStep { PrimitiveSegment[] primitivesArray = primitives.toArray(new PrimitiveSegment[primitives.size()]); long vibratorOnResult = controller.on(primitivesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(primitivesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePrimitives(vibratorOnResult, primitivesArray); Loading
services/core/java/com/android/server/vibrator/ComposePwleV2VibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -72,7 +72,8 @@ final class ComposePwleV2VibratorStep extends AbstractComposedVibratorStep { + controller.getVibratorInfo().getId()); } PwlePoint[] pwlesArray = pwles.toArray(new PwlePoint[pwles.size()]); long vibratorOnResult = controller.on(pwlesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(pwlesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePwle(vibratorOnResult, pwlesArray); Loading
services/core/java/com/android/server/vibrator/ComposePwleVibratorStep.java +2 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ final class ComposePwleVibratorStep extends AbstractComposedVibratorStep { + controller.getVibratorInfo().getId()); } RampSegment[] pwlesArray = pwles.toArray(new RampSegment[pwles.size()]); long vibratorOnResult = controller.on(pwlesArray, getVibration().id); int stepId = conductor.nextVibratorCallbackStepId(getVibratorId()); long vibratorOnResult = controller.on(pwlesArray, getVibration().id, stepId); handleVibratorOnResult(vibratorOnResult); getVibration().stats.reportComposePwle(vibratorOnResult, pwlesArray); Loading