Ignore "-a" dump option.
This option will be used when generating bugreport. We don't want
this to cause invalid option error.
Test: adb shell dumpsys
android.hardware.automotive.vehicle.IVehicle/default -a
Bug: 261768324
Change-Id: I27347a6cd063623b01ada2803a06c2c86f936396
diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
index 62e9dc8..4a4e023 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
@@ -789,10 +789,13 @@
for (uint32_t i = 0; i < numArgs; i++) {
options.push_back(args[i]);
}
+ if (options.size() == 1 && options[0] == "-a") {
+ // Ignore "-a" option. Bugreport will call with this option.
+ options.clear();
+ }
DumpResult result = mVehicleHardware->dump(options);
dprintf(fd, "%s", (result.buffer + "\n").c_str());
if (!result.callerShouldDumpState) {
- ALOGE("Skip dumping Vehicle HAL State.");
return STATUS_OK;
}
dprintf(fd, "Vehicle HAL State: \n");