Support migrating app data to a new appId
Add logic in installd to recursively chown an app's internal data and
profile directory to its new appId. In the case of an app upgrade and
the user profile is unlocked, the previous appId is passed over to
verify and only chown files that the app owns.
Bug: 179284822
Test: to be included with CL in framework/base
Change-Id: I11d9bed9fc8dc3179c4936001450b452ddce8a75
diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h
index ae257df..8cfda01 100644
--- a/cmds/installd/InstalldNativeService.h
+++ b/cmds/installd/InstalldNativeService.h
@@ -47,7 +47,8 @@
binder::Status createAppData(const std::optional<std::string>& uuid,
const std::string& packageName, int32_t userId, int32_t flags, int32_t appId,
- const std::string& seInfo, int32_t targetSdkVersion, int64_t* _aidl_return);
+ int32_t previousAppId, const std::string& seInfo, int32_t targetSdkVersion,
+ int64_t* _aidl_return);
binder::Status createAppData(
const android::os::CreateAppDataArgs& args,