inputflinger fuzzers: remove FuzzContainer.getPolicyConfig
Because FuzzInputReaderPolicy::getReaderConfiguration does nothing, any
calls to getPolicyConfig can be replaced with default
InputReaderConfiguration structs. This makes it clearer where where a
fuzzer is getting its configuration from, and therefore makes it easier
to understand the fuzzer without having to dig into FuzzContainer and
FuzzInputReaderPolicy.
InputReaderPolicyInterface::getReaderConfiguration is not called by any
of the code being fuzzed, so it's unlikely that
FuzzInputReaderPolicy::getReaderConfiguration will need to be modified
to return a non-default InputReaderConfiguration in future.
Bug: 245989146
Test: build and briefly run all modified fuzzers
$ SANITIZE_TARGET=hwaddress make ${FUZZER_NAME}
$ cd $ANDROID_PRODUCT_OUT
$ adb root
$ adb sync data
$ adb shell /data/fuzz/$(get_build_var TARGET_ARCH)/${FUZZER_NAME}/${FUZZER_NAME}
Change-Id: If933e1ce81439831b24c61dde1c2d24ed1a00942
diff --git a/services/inputflinger/tests/fuzzers/TouchpadInputFuzzer.cpp b/services/inputflinger/tests/fuzzers/TouchpadInputFuzzer.cpp
index ef9663a..796178a 100644
--- a/services/inputflinger/tests/fuzzers/TouchpadInputFuzzer.cpp
+++ b/services/inputflinger/tests/fuzzers/TouchpadInputFuzzer.cpp
@@ -21,6 +21,7 @@
#include <linux/input-event-codes.h>
#include <FuzzContainer.h>
+#include <InputReaderBase.h>
#include <MapperHelpers.h>
#include <TouchpadInputMapper.h>
@@ -133,7 +134,7 @@
setAxisInfos(*fdp, fuzzer);
setDeviceSpecificConfig(*fdp, fuzzer);
- auto policyConfig = fuzzer.getPolicyConfig();
+ InputReaderConfiguration policyConfig;
// Some settings are fuzzed here, as well as in the main loop, to provide randomized data to the
// TouchpadInputMapper constructor.
setTouchpadSettings(*fdp, policyConfig);