Shift to measure per-userId OBB directories.
They're now isolated per user, and no longer merged together.
Bug: 128331327
Test: atest android.appsecurity.cts.StorageHostTest#testVerifyStats
Test: atest android.appsecurity.cts.StorageHostTest#testVerifyStatsMultiple
Change-Id: Iaf9243c00114a5a4e102bc0398f5e54c5d4df43e
diff --git a/cmds/installd/InstalldNativeService.cpp b/cmds/installd/InstalldNativeService.cpp
index 2efcf11..92fac66 100644
--- a/cmds/installd/InstalldNativeService.cpp
+++ b/cmds/installd/InstalldNativeService.cpp
@@ -1648,7 +1648,8 @@
ATRACE_BEGIN("obb");
for (const auto& packageName : packageNames) {
- auto obbCodePath = create_data_media_obb_path(uuid_, packageName.c_str());
+ auto obbCodePath = create_data_media_package_path(uuid_, userId,
+ "obb", packageName.c_str());
calculate_tree_size(obbCodePath, &extStats.codeSize);
}
ATRACE_END();
@@ -1982,7 +1983,8 @@
ATRACE_END();
ATRACE_BEGIN("obb");
- auto obbPath = create_data_media_obb_path(uuid_, "");
+ auto obbPath = StringPrintf("%s/Android/obb",
+ create_data_media_path(uuid_, userId).c_str());
calculate_tree_size(obbPath, &obbSize);
ATRACE_END();
}