Remove modem log after they are added to bugreport
Delete the modem logfiles after it is added to the
bugreport zip file.
Bug: 32871032
Test: Take bugreports on the device and ensure that
the modem log file is deleted. Also ensure that
the generated bugreport zip file contains modem
logs on userdebug builds
Change-Id: Ia512c11cae95e370b77024492898b3ad697fa8b0
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index d9b6a5c..6de2eb5 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -457,6 +457,9 @@
MYLOGE("Unable to add modem log %s to zip file\n", modem_log_file.c_str());
} else {
MYLOGD("Modem Log %s is added to zip\n", modem_log_file.c_str());
+ if (remove(modem_log_file.c_str())) {
+ MYLOGE("Error removing modem log %s\n", modem_log_file.c_str());
+ }
}
}