vibrator: Ensure waveform_index and vmax is set for other effects
It seems that the DOUBLE_CLICK and HEAVY_CLICK effects assume that `waveform_index` is always set to 1 and `vmax` is set to 1600, because if the last played effect is TICK, then all the other effects (aside from CLICK) end up feeling different, presumably because `waveform_index` is left as set to 2 and `vmax` is left as set to 1600. Fix this by having DOUBLE_CLICK and HEAVY_CLICK set `waveform_index` back to 1 and `vmax` back to 1600. Change-Id: Ic116f45894cf4af25bcd25b66764eeb472631af5
This commit is contained in:
@@ -485,6 +485,8 @@ ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength es, const std
|
|||||||
ledVib.write_value(LED_DEVICE "/rtp", "0");
|
ledVib.write_value(LED_DEVICE "/rtp", "0");
|
||||||
break;
|
break;
|
||||||
case Effect::DOUBLE_CLICK:
|
case Effect::DOUBLE_CLICK:
|
||||||
|
ledVib.write_value(LED_DEVICE "/waveform_index", "1");
|
||||||
|
ledVib.write_value(LED_DEVICE "/vmax", "1600");
|
||||||
ledVib.write_value(LED_DEVICE "/duration", "30");
|
ledVib.write_value(LED_DEVICE "/duration", "30");
|
||||||
ledVib.write_value(LED_DEVICE "/state", "1");
|
ledVib.write_value(LED_DEVICE "/state", "1");
|
||||||
ledVib.write_value(LED_DEVICE "/activate", "1");
|
ledVib.write_value(LED_DEVICE "/activate", "1");
|
||||||
@@ -503,6 +505,8 @@ ndk::ScopedAStatus Vibrator::perform(Effect effect, EffectStrength es, const std
|
|||||||
ledVib.write_value(LED_DEVICE "/rtp", "0");
|
ledVib.write_value(LED_DEVICE "/rtp", "0");
|
||||||
break;
|
break;
|
||||||
case Effect::HEAVY_CLICK:
|
case Effect::HEAVY_CLICK:
|
||||||
|
ledVib.write_value(LED_DEVICE "/waveform_index", "1");
|
||||||
|
ledVib.write_value(LED_DEVICE "/vmax", "1600");
|
||||||
ledVib.write_value(LED_DEVICE "/duration", "1");
|
ledVib.write_value(LED_DEVICE "/duration", "1");
|
||||||
ledVib.write_value(LED_DEVICE "/state", "1");
|
ledVib.write_value(LED_DEVICE "/state", "1");
|
||||||
ledVib.write_value(LED_DEVICE "/activate", "1");
|
ledVib.write_value(LED_DEVICE "/activate", "1");
|
||||||
|
|||||||
Reference in New Issue
Block a user