diff options
| -rw-r--r-- | services/inputflinger/tests/fuzzers/InputDispatcherFuzzer.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/inputflinger/tests/fuzzers/InputDispatcherFuzzer.cpp b/services/inputflinger/tests/fuzzers/InputDispatcherFuzzer.cpp index 214649cf41..0bd8fb3de3 100644 --- a/services/inputflinger/tests/fuzzers/InputDispatcherFuzzer.cpp +++ b/services/inputflinger/tests/fuzzers/InputDispatcherFuzzer.cpp @@ -41,14 +41,16 @@ static constexpr int32_t MAX_RANDOM_WINDOWS = 4; class NotifyStreamProvider { public: NotifyStreamProvider(FuzzedDataProvider& fdp) - : mFdp(fdp), mIdGenerator(IdGenerator::Source::OTHER), mVerifier("Fuzz verifier") {} + : mFdp(fdp), mIdGenerator(IdGenerator::Source::OTHER) {} std::optional<NotifyMotionArgs> nextMotion() { NotifyMotionArgs args = generateFuzzedMotionArgs(mIdGenerator, mFdp, MAX_RANDOM_DISPLAYS); + auto [it, _] = mVerifiers.emplace(args.displayId, "Fuzz Verifier"); + InputVerifier& verifier = it->second; const Result<void> result = - mVerifier.processMovement(args.deviceId, args.source, args.action, - args.getPointerCount(), args.pointerProperties.data(), - args.pointerCoords.data(), args.flags); + verifier.processMovement(args.deviceId, args.source, args.action, + args.getPointerCount(), args.pointerProperties.data(), + args.pointerCoords.data(), args.flags); if (result.ok()) { return args; } @@ -60,7 +62,7 @@ private: IdGenerator mIdGenerator; - InputVerifier mVerifier; + std::map<int32_t /*displayId*/, InputVerifier> mVerifiers; }; } // namespace |