Merge "Relabel /data/rollback files as enabling rollback (4/n)"
diff --git a/private/file_contexts b/private/file_contexts
index 070579c..73cf012 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -547,6 +547,10 @@
 /data/preloads/demo(/.*)?	u:object_r:preloads_media_file:s0
 /data/server_configurable_flags(/.*)? u:object_r:server_configurable_flags_data_file:s0
 /data/app-staging(/.*)?		u:object_r:staging_data_file:s0
+# Ensure we have the same labels as /data/app or /data/apex/active
+# to avoid restorecon conflicts
+/data/rollback/\d+/[^/]+/.*\.apk  u:object_r:apk_data_file:s0
+/data/rollback/\d+/[^/]+/.*\.apex u:object_r:staging_data_file:s0
 
 # Misc data
 /data/misc/adb(/.*)?            u:object_r:adb_keys_file:s0
diff --git a/private/system_server.te b/private/system_server.te
index 9597fde..752e3e8 100644
--- a/private/system_server.te
+++ b/private/system_server.te
@@ -520,6 +520,9 @@
 allow system_server staging_data_file:dir create_dir_perms;
 allow system_server staging_data_file:file create_file_perms;
 
+# Manage /data/rollback.
+allow system_server staging_data_file:{ file lnk_file } { create_file_perms link };
+
 # Walk /data/data subdirectories.
 allow system_server app_data_file_type:dir { getattr read search };