vibrator: Add an initial value for non-motion vibration intensity

Bug: 155709426
Test: remove cal file and trigger vibration
Signed-off-by: chasewu <chasewu@google.com>
Change-Id: I07e63dc8106a2f5d875b6be665e67e6f8dda9239
This commit is contained in:
chasewu
2020-05-06 15:47:59 +08:00
committed by Cyan_Hsieh
parent b40e5fc813
commit 6b2456b0d7

View File

@@ -363,11 +363,16 @@ Vibrator::Vibrator(std::unique_ptr<HwApi> hwapi, std::unique_ptr<HwCal> hwcal)
} else {
if (hasExternalSteadyG) {
STEADY_TARGET_G[0] = externalSteadyTargetG[0];
STEADY_TARGET_G[2] = externalSteadyTargetG[2];
}
mSteadyTargetOdClamp[0] =
mHwCal->getSteadyAmpMax(&tempAmpMax)
? round((STEADY_TARGET_G[0] / tempAmpMax) * longVoltageMax)
: longVoltageMax;
mSteadyTargetOdClamp[2] =
mHwCal->getSteadyAmpMax(&tempAmpMax)
? round((STEADY_TARGET_G[2] / tempAmpMax) * longVoltageMax)
: longVoltageMax;
}
mHwCal->getSteadyShape(&shape);
mSteadyConfig.reset(new VibrationConfig({