Logic for atmoic/tombstone behavior; split mode.
Flesh out logic for cache directories that request new atomic and/or
tombstone clearing behaviors. Atomic directories are considered for
deletion as a single all-or-nothing unit, and tombstone directories
truncate any removed files instead of unlinking them.
Since these behaviors can be mixed together, add local tests that
quickly verify several different permutations.
Reduce memory footprint of CacheItem objects by only storing name
and pointer to parent (instead of full path). Fix ordering bug by
switching to std::stable_sort.
Add "V2_DEFY_QUOTA" flag so we can split clearing into two distinct
phases: clearing data for apps above their quotas, and then pushing
deeper by clearing data for apps below their quotas.
Test: adb shell /data/nativetest64/installd_cache_test/installd_cache_test
Bug: 34692014, 33811826
Change-Id: I156897de1d1d1c371b2b837128b2e286bf33d40d
diff --git a/cmds/installd/tests/Android.bp b/cmds/installd/tests/Android.bp
index a32df22..b5b080d 100644
--- a/cmds/installd/tests/Android.bp
+++ b/cmds/installd/tests/Android.bp
@@ -14,3 +14,22 @@
"libdiskusage",
],
}
+
+cc_test {
+ name: "installd_cache_test",
+ clang: true,
+ srcs: ["installd_cache_test.cpp"],
+ shared_libs: [
+ "libbase",
+ "libbinder",
+ "libcutils",
+ "liblog",
+ "liblogwrap",
+ "libselinux",
+ "libutils",
+ ],
+ static_libs: [
+ "libinstalld",
+ "libdiskusage",
+ ],
+}