vibrator: effect: Fallback to click if an effect is missing

On some device certain effects can be garbage to the point
where its just better to use the default click effect.

Change-Id: I047f72aaba2a1d56138a6431b5b96f0f626e2e83
This commit is contained in:
Adithya R 2023-08-11 19:33:04 +05:30 committed by Bruno Martins
parent b144a0aea4
commit 9dc1dd4b7b

View file

@ -117,6 +117,9 @@ const struct effect_stream* get_effect_stream(uint32_t effectId) {
auto result = sEffectStreams.emplace(effectId, *newEffectStream);
return &result.first->second;
}
} else if (effectId != (uint32_t)Effect::CLICK) {
LOG(VERBOSE) << "Could not get effect " << effectId << ", falling back to click effect";
return get_effect_stream((uint32_t)Effect::CLICK);
}
} else {
return &it->second;