installd: Implement support for userdata snapshot and restore.
Adds two binder APIs:
- snapshotAppData: Makes a copy of the apps credential encrypted
and/or device encrypted data for a given user to one of
/data/misc_[ce|de]/rollback. This path is writable only by
installd.
- restoreAppDataSnapshot: Restores a copy of the apps credential
encrypted and/or device encrypted data from a snapshot, if one
exists.
Implemented for use from RollbackManagerService, which will make
a transient copy of an app package as well as its data in order to
roll them back within a specified window.
Bug: 112431924
Test: installd_utils_test, installd_service_test
Change-Id: I3e4d36c11e52fb885b585b1946e215cf986206fd
diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h
index 367f2c1..123859a 100644
--- a/cmds/installd/InstalldNativeService.h
+++ b/cmds/installd/InstalldNativeService.h
@@ -60,6 +60,12 @@
binder::Status fixupAppData(const std::unique_ptr<std::string>& uuid, int32_t flags);
+ binder::Status snapshotAppData(const std::unique_ptr<std::string>& volumeUuid,
+ const std::string& packageName, const int32_t user, int32_t storageFlags);
+ binder::Status restoreAppDataSnapshot(const std::unique_ptr<std::string>& volumeUuid,
+ const std::string& packageName, const int32_t appId, const int64_t ceDataInode,
+ const std::string& seInfo, const int32_t user, int32_t storageFlags);
+
binder::Status getAppSize(const std::unique_ptr<std::string>& uuid,
const std::vector<std::string>& packageNames, int32_t userId, int32_t flags,
int32_t appId, const std::vector<int64_t>& ceDataInodes,