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:
parent
b144a0aea4
commit
9dc1dd4b7b
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue