Create supplemental data directories when app data is created
Supplemental data is closely related to app data, as such we want
their creation to happen at the same time. Owner of the these data
will be the supplemental process instead of the app.
The root directory for supplemental data is
/data/misc_{ce,de}/<user-id>/supplemental. This directory will be
created by vold when user is created.
Installd is responsible for creating app level directories under the
root, e.g, /data/misc_ce/0/supplemental/<app-name>. We also need code
level directory under the app direcotory, but that will be done with a
separate API. CreateAppData is responsible for things at app level, so
we will be maintaining the same level of abstraction.
Instlld will also create the shared directory under the app-level
directory, e.g, /data/misc_ce/0/supplemental/<app-name>/shared and
`cache` and `code_cache` directory under the `shared` directory.
Supplemental data should be removed when app data is removed. This
will be done in follow up Cls too.
Some of the public APIs of installd service was not being used by
anybody else, so made them private.
Bug: 211763739
Bug: 217543371
Test: atest installd_service_test:AppSupplementalDataTest
Ignore-AOSP-First: Feature is being developed in internal branch
Change-Id: I966c76b032821610293c53ba875e2800a5ce4804
diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h
index ecc60b5..6b4ba1f 100644
--- a/cmds/installd/InstalldNativeService.h
+++ b/cmds/installd/InstalldNativeService.h
@@ -47,14 +47,9 @@
int32_t flags);
binder::Status createAppData(const std::optional<std::string>& uuid,
- const std::string& packageName, int32_t userId, int32_t flags, int32_t appId,
- int32_t previousAppId, const std::string& seInfo, int32_t targetSdkVersion,
- int64_t* _aidl_return);
- binder::Status createAppDataLocked(const std::optional<std::string>& uuid,
- const std::string& packageName, int32_t userId,
- int32_t flags, int32_t appId, int32_t previousAppId,
- const std::string& seInfo, int32_t targetSdkVersion,
- int64_t* _aidl_return);
+ const std::string& packageName, int32_t userId, int32_t flags,
+ int32_t appId, int32_t previousAppId, const std::string& seInfo,
+ int32_t targetSdkVersion, int64_t* _aidl_return);
binder::Status createAppData(
const android::os::CreateAppDataArgs& args,
@@ -203,6 +198,18 @@
std::unordered_map<uid_t, int64_t> mCacheQuotas;
std::string findDataMediaPath(const std::optional<std::string>& uuid, userid_t userid);
+
+ binder::Status createAppDataLocked(const std::optional<std::string>& uuid,
+ const std::string& packageName, int32_t userId,
+ int32_t flags, int32_t appId, int32_t previousAppId,
+ const std::string& seInfo, int32_t targetSdkVersion,
+ int64_t* _aidl_return);
+
+ binder::Status createAppDirectoryForSupplementalData(const std::optional<std::string>& uuid,
+ const std::string& packageName,
+ int32_t userId, int32_t appId,
+ int32_t previousAppId,
+ const std::string& seInfo, int32_t flags);
};
} // namespace installd