From c7da8aa098f3a1675eba9567b5bf4f57d9a8b720 Mon Sep 17 00:00:00 2001 From: kierancyphus Date: Wed, 15 Nov 2023 15:04:21 +0800 Subject: [PATCH] dump_modemlog: always move modem logs Dynamic log mask events can occur without leaving the logging status property as enabled, which means when dumpstate should always try to stop modem logging so that the new logs can be copied over. Having the copying of logs and stopping of modem logging combined in one command is no longer an ideal design, so b/289435256 was created to find a better solution to this. Test: build, flash, trigger log mask event, check logs in bugreport. Bug: 302435001 Change-Id: I56358d3f08ac1f2a6099ede14c5e17b5ebffabbd --- modem/dump_modemlog/modem_log_dumper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modem/dump_modemlog/modem_log_dumper.cpp b/modem/dump_modemlog/modem_log_dumper.cpp index 951f89f..127478e 100644 --- a/modem/dump_modemlog/modem_log_dumper.cpp +++ b/modem/dump_modemlog/modem_log_dumper.cpp @@ -15,7 +15,11 @@ void ModemLogDumper::DumpModemLogs() { kModemLoggingNumberBugreportProperty.data(), kDefaultBugreportNumberFiles); - if (shouldRestartModemLogging) { + // Should always trigger `stopModemLogging`. This is because currently copying + // modem logs and stopping modem logging are entangled. + // TODO: b/289435256 - Always copy logs and return this to checking if logging + // is actively running. + if (allowedToStopModemLogging()) { // If modem logging is running at time of bugreport, it needs to be stopped // to ensure that the most recent logs are included in the bugreport. If // this command fails, only older log files will be included, as seen in