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

Commit fda19ecd authored by JW Wang's avatar JW Wang
Browse files

Delete APK snapshots during restoration (3/n)

The snapshots are no longer needed after restore is done.

We do this in keeping with the fact that apk/apex code data is
deleted immediately after the rollback is committed.

See go/rollbackmanager-snapshot-deletion for more details.

Bug: 151805360
Test: N/A. Will be added in the next CL.
Change-Id: I5a7540aa08922c4b0c617c9cb37e1bec2ff23fc1
parent ef685e33
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1064,6 +1064,7 @@ binder::Status InstalldNativeService::restoreAppDataSnapshot(
            res = error(rc, "Failed copying " + from_ce + " to " + to_ce);
            return res;
        }
        delete_dir_contents_and_dir(from_ce, true /* ignore_if_missing */);
    }

    if (needs_de_rollback) {
@@ -1080,6 +1081,7 @@ binder::Status InstalldNativeService::restoreAppDataSnapshot(
            res = error(rc, "Failed copying " + from_de + " to " + to_de);
            return res;
        }
        delete_dir_contents_and_dir(from_de, true /* ignore_if_missing */);
    }

    // Finally, restore the SELinux label on the app data.