Update fuzzService to call most common transactions easily
Changing transaction code path in fuzzService so that most commonly
used transact code in AIDL services can be reached and coverage
can be improved.
Test: atest fuzz_service_test
Bug: 300115015
Change-Id: Ifaef7566491e6369e21f2ca3a7724a73f9bbf002
diff --git a/libs/binder/tests/parcel_fuzzer/libbinder_driver.cpp b/libs/binder/tests/parcel_fuzzer/libbinder_driver.cpp
index 93ac116..38e6f32 100644
--- a/libs/binder/tests/parcel_fuzzer/libbinder_driver.cpp
+++ b/libs/binder/tests/parcel_fuzzer/libbinder_driver.cpp
@@ -61,11 +61,11 @@
while (provider.remaining_bytes() > 0) {
// Most of the AIDL services will have small set of transaction codes.
// TODO(b/295942369) : Add remaining transact codes from IBinder.h
- uint32_t code = provider.ConsumeBool()
- ? provider.ConsumeIntegral<uint32_t>()
- : provider.PickValueInArray<int64_t>(
- {provider.ConsumeIntegralInRange<uint32_t>(0, 100),
- IBinder::DUMP_TRANSACTION, IBinder::PING_TRANSACTION,
+ uint32_t code = provider.ConsumeBool() ? provider.ConsumeIntegral<uint32_t>()
+ : provider.ConsumeBool()
+ ? provider.ConsumeIntegralInRange<uint32_t>(0, 100)
+ : provider.PickValueInArray<uint32_t>(
+ {IBinder::DUMP_TRANSACTION, IBinder::PING_TRANSACTION,
IBinder::SHELL_COMMAND_TRANSACTION, IBinder::INTERFACE_TRANSACTION,
IBinder::SYSPROPS_TRANSACTION, IBinder::EXTENSION_TRANSACTION,
IBinder::TWEET_TRANSACTION, IBinder::LIKE_TRANSACTION});