Add batched createAppData API to installd.
Benchmarking creation of new users shows on a freshly setup device
sees many individual binder calls from system server into installd to
create app data directories. Batching these calls shows a significant
performance improvement.
Bug: 153171028
Test: Manually create guest user, trace performance with Perfetto.
Change-Id: Iea43c058d465be44c0937bf6c353555869fc9fd2
diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h
index 1a8da5f..3f44021 100644
--- a/cmds/installd/InstalldNativeService.h
+++ b/cmds/installd/InstalldNativeService.h
@@ -44,7 +44,12 @@
int32_t userSerial, int32_t flags);
binder::Status destroyUserData(const std::optional<std::string>& uuid, int32_t userId,
int32_t flags);
-
+ binder::Status createAppDataBatched(
+ const std::optional<std::vector<std::optional<std::string>>>& uuids,
+ const std::optional<std::vector<std::optional<std::string>>>& packageNames,
+ int32_t userId, int32_t flags, const std::vector<int32_t>& appIds,
+ const std::vector<std::string>& seInfos, const std::vector<int32_t>& targetSdkVersions,
+ int64_t* _aidl_return);
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);