summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author JW Wang <wangchun@google.com> 2020-05-18 16:54:08 +0800
committer JW Wang <wangchun@google.com> 2020-05-29 16:18:17 +0800
commit9b9b1aa0626b01a4836a2c1144d5830a2318235b (patch)
tree6e89b22a524c12ad338022f6ea2417a6c062d3b5
parenta38a3e145a22b0262926345413635a4c6ef4cda2 (diff)
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. Merged-In: I5a7540aa08922c4b0c617c9cb37e1bec2ff23fc1 Change-Id: I5a7540aa08922c4b0c617c9cb37e1bec2ff23fc1
-rw-r--r--cmds/installd/InstalldNativeService.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 7d1c1ad37d..b9c1addf89 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -1074,6 +1074,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) {
@@ -1090,6 +1091,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.