From 850842f77ce01fc632e07066297f2b324787a1e0 Mon Sep 17 00:00:00 2001 From: Andrei Onea Date: Wed, 23 Dec 2020 15:21:23 +0000 Subject: [PATCH] Add data directory for appcompat This directory is used to store override config, so that they can persist across reboot. Test: atest CompatConfigTest Bug: 145509340 Change-Id: I5e8f2b3093daeccd6c95dff24a8c6c0ff31235ca --- private/compat/30.0/30.0.ignore.cil | 1 + private/file_contexts | 1 + private/system_server.te | 4 ++++ public/file.te | 1 + 4 files changed, 7 insertions(+) diff --git a/private/compat/30.0/30.0.ignore.cil b/private/compat/30.0/30.0.ignore.cil index 9db6e4843..86d73f24f 100644 --- a/private/compat/30.0/30.0.ignore.cil +++ b/private/compat/30.0/30.0.ignore.cil @@ -12,6 +12,7 @@ apex_art_staging_data_file apex_info_file app_hibernation_service + appcompat_data_file arm64_memtag_prop authorization_service cgroup_desc_api_file diff --git a/private/file_contexts b/private/file_contexts index 89c67fcba..1e16169d1 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -561,6 +561,7 @@ /data/misc/apexdata/com\.android\.wifi(/.*)? u:object_r:apex_wifi_data_file:s0 /data/misc/apexrollback(/.*)? u:object_r:apex_rollback_data_file:s0 /data/misc/apns(/.*)? u:object_r:radio_data_file:s0 +/data/misc/appcompat(/.*)? u:object_r:appcompat_data_file:s0 /data/misc/audio(/.*)? u:object_r:audio_data_file:s0 /data/misc/audioserver(/.*)? u:object_r:audioserver_data_file:s0 /data/misc/audiohal(/.*)? u:object_r:audiohal_data_file:s0 diff --git a/private/system_server.te b/private/system_server.te index 6767cd11e..abfafa994 100644 --- a/private/system_server.te +++ b/private/system_server.te @@ -500,6 +500,10 @@ allow system_server heapdump_data_file:file create_file_perms; allow system_server adb_keys_file:dir create_dir_perms; allow system_server adb_keys_file:file create_file_perms; +# Manage /data/misc/appcompat. +allow system_server appcompat_data_file:dir rw_dir_perms; +allow system_server appcompat_data_file:file create_file_perms; + # Manage /data/misc/emergencynumberdb allow system_server emergency_data_file:dir create_dir_perms; allow system_server emergency_data_file:file create_file_perms; diff --git a/public/file.te b/public/file.te index dceb96e8d..b7336eabc 100644 --- a/public/file.te +++ b/public/file.te @@ -377,6 +377,7 @@ type apex_module_data_file, file_type, data_file_type, core_data_file_type; type apex_permission_data_file, file_type, data_file_type, core_data_file_type; type apex_rollback_data_file, file_type, data_file_type, core_data_file_type; type apex_wifi_data_file, file_type, data_file_type, core_data_file_type; +type appcompat_data_file, file_type, data_file_type, core_data_file_type; type audio_data_file, file_type, data_file_type, core_data_file_type; type audioserver_data_file, file_type, data_file_type, core_data_file_type; type bluetooth_data_file, file_type, data_file_type, core_data_file_type, app_data_file_type;