mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Fix default vibrator HAL to check support on getPrimitiveDuration"
This commit is contained in:
@@ -125,6 +125,11 @@ ndk::ScopedAStatus Vibrator::getSupportedPrimitives(std::vector<CompositePrimiti
|
||||
|
||||
ndk::ScopedAStatus Vibrator::getPrimitiveDuration(CompositePrimitive primitive,
|
||||
int32_t* durationMs) {
|
||||
std::vector<CompositePrimitive> supported;
|
||||
getSupportedPrimitives(&supported);
|
||||
if (std::find(supported.begin(), supported.end(), primitive) == supported.end()) {
|
||||
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
|
||||
}
|
||||
if (primitive != CompositePrimitive::NOOP) {
|
||||
*durationMs = 100;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user