cs40l26: Fix the composed effect delay problem

When user typed the gboard back-to-back, HAL will send a STOP call right
after it sends a START call. At this moment, driver is under an
activating process and the vibe_state is not 1, so the erasing process
will be forced to wait for the FW's completed signal.
This makes STOP call consumes lots of waiting time and user would still
feels a delay gap under back-to-back typing behavior.

This patch removes the erased process from the STOP call and let it be
done in the completed process.

Bug: 263476381
Test: atest PtsVibratorHalTestSuite \
            PtsHapticsTestCases \
            PtsHapticsFeatureTestCases \
            VibratorHalCs40l26TestSuite \
            VtsHalVibratorManagerTargetTest \
            VtsHalVibratorTargetTest \
            android.os.cts.VibratorTest \
            android.os.cts.VibratorManagerTest \
            android.os.cts.VibrationEffectTest \
            android.os.cts.VibrationAttributesTest \
            android.os.cts.CombinedVibrationTest
Test: Type Gboard with five fingers

Change-Id: I02dfdae4e9e9334a253106f631c933228398b077
This commit is contained in:
Chase Wu 2023-02-09 22:57:44 +08:00
parent ea50a3e631
commit 968c3d1a00

View file

@ -576,18 +576,7 @@ ndk::ScopedAStatus Vibrator::off() {
strerror(errno));
ret = false;
}
/* Do erase process */
if ((mActiveId >= WAVEFORM_MAX_PHYSICAL_INDEX) &&
(!mHwApiDef->eraseOwtEffect(mInputFd, mActiveId, &mFfEffects))) {
ALOGE("Off: Failed to clean up the composed effect %d", mActiveId);
ret = false;
}
if (mIsDual && (mActiveId >= WAVEFORM_MAX_PHYSICAL_INDEX) &&
(!mHwApiDual->eraseOwtEffect(mInputFdDual, mActiveId, &mFfEffectsDual))) {
ALOGE("Off: Failed to clean up flip's the composed effect %d", mActiveId);
ret = false;
}
if (!mHwGPIO->setGPIOOutput(false)) {
ALOGE("Off: Failed to reset GPIO(%d): %s", errno, strerror(errno));
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);