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

Commit 8e62f032 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Android (Google) Code Review
Browse files

Merge "Don't leave root dumpstate-stats.txt" into main

parents d5f99e63 15d4df97
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3657,6 +3657,10 @@ void Dumpstate::MaybeSavePlaceholderScreenshot() {
    // is saved for backwards compatibility.
    std::string path = ds.GetPath(ds.CalledByApi() ? "-png.tmp" : ".png");
    if (android::os::CopyFileToFile(DEFAULT_SCREENSHOT_PATH, path)) {
        if (chown(path.c_str(), AID_SHELL, AID_SHELL)) {
            MYLOGE("Unable to change ownership of copied screenshot %s: %s\n", path.c_str(),
                   strerror(errno));
        }
        MYLOGD("Saved fallback screenshot on %s\n", path.c_str());
    } else {
        MYLOGE("Failed to save fallback screenshot on %s\n", path.c_str());
@@ -4076,6 +4080,10 @@ void Progress::Save() {
    if (!android::base::WriteStringToFile(content, path_)) {
        MYLOGE("Could not save stats on %s\n", path_.c_str());
    }

    if (chown(path_.c_str(), AID_SHELL, AID_SHELL)) {
        MYLOGE("Unable to change ownership of %s: %s\n", path_.c_str(), strerror(errno));
    }
}

int32_t Progress::Get() const {