From a64b68501351e1f5617278d429c5406905f11b2a Mon Sep 17 00:00:00 2001
From: Fyodor Kupolov <fkupolov@google.com>
Date: Wed, 7 Sep 2016 13:11:12 -0700
Subject: [PATCH] Allow installd to delete from preloads/file_cache

When clearing cache, installd should be able to search for and delete
files in /data/preloads/file_cache

Test: Manually trigger installd freeCache
Bug: 31008665
Change-Id: I4c345cc8b0f7a6a8702a55f4720d21283c9d502a
---
 public/installd.te | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/public/installd.te b/public/installd.te
index 08c438d6f..3b4fd2e26 100644
--- a/public/installd.te
+++ b/public/installd.te
@@ -130,6 +130,11 @@ allow installd permission_service:service_manager find;
 allow installd block_device:dir { search };
 allow installd labeledfs:filesystem { quotaget quotamod };
 
+# Allow installd to delete from /data/preloads when trimming data caches
+# TODO b/34690396 Remove when time-based purge policy for preloads is implemented in system_server
+allow installd preloads_data_file:file { r_file_perms unlink };
+allow installd preloads_data_file:dir { r_dir_perms write remove_name rmdir };
+
 ###
 ### Neverallow rules
 ###
-- 
GitLab