Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ca7d087 authored by Ecco Park's avatar Ecco Park
Browse files

dumpstate: add the property(ro.radio.log_loc) for modem_logs



For temporary solution for not saving modem logs in bugreport,
I created the property(ro.radio.log_loc) to indicate the place
where modem_logs are saved.

During transition to hal dump of telephony, we will keep the property in
device configuration.
Bug: 33820081

Change-Id: I7712ce095686a54ea7f097f190611aec7a64d79c
Signed-off-by: default avatarEcco Park <eccopark@google.com>
parent 1b705dc2
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -431,12 +431,16 @@ static void DumpModemLogs() {
        return;
    }

    // TODO: use bugreport_dir_ directly when this function is moved to Dumpstate class
    std::string bugreport_dir = dirname(ds.GetPath("").c_str());
    // TODO: b/33820081 we need to provide a right way to dump modem logs.
    std::string radio_bugreport_dir = android::base::GetProperty("ro.radio.log_loc", "");
    if (radio_bugreport_dir.empty()) {
        radio_bugreport_dir = dirname(ds.GetPath("").c_str());
    }

    MYLOGD("DumpModemLogs: directory is %s and file_prefix is %s\n",
           bugreport_dir.c_str(), file_prefix.c_str());
           radio_bugreport_dir.c_str(), file_prefix.c_str());

    std::string modem_log_file = GetLastModifiedFileWithPrefix(bugreport_dir, file_prefix);
    std::string modem_log_file = GetLastModifiedFileWithPrefix(radio_bugreport_dir, file_prefix);

    struct stat s;
    if (modem_log_file.empty() || stat(modem_log_file.c_str(), &s) != 0) {