Loading vibrator/aidl/default/Vibrator.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -139,6 +139,9 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect>& composi return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } std::vector<CompositePrimitive> supported; getSupportedPrimitives(&supported); for (auto& e : composite) { if (e.delayMs > kComposeDelayMaxMs) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); Loading @@ -146,8 +149,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect>& composi if (e.scale <= 0.0f || e.scale > 1.0f) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (e.primitive < CompositePrimitive::NOOP || e.primitive > CompositePrimitive::LIGHT_TICK) { if (std::find(supported.begin(), supported.end(), e.primitive) == supported.end()) { return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } } Loading Loading
vibrator/aidl/default/Vibrator.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -139,6 +139,9 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect>& composi return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } std::vector<CompositePrimitive> supported; getSupportedPrimitives(&supported); for (auto& e : composite) { if (e.delayMs > kComposeDelayMaxMs) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); Loading @@ -146,8 +149,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector<CompositeEffect>& composi if (e.scale <= 0.0f || e.scale > 1.0f) { return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT); } if (e.primitive < CompositePrimitive::NOOP || e.primitive > CompositePrimitive::LIGHT_TICK) { if (std::find(supported.begin(), supported.end(), e.primitive) == supported.end()) { return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION); } } Loading