diff --git a/init/selinux.cpp b/init/selinux.cpp index 132fc137d..c49dc9f60 100644 --- a/init/selinux.cpp +++ b/init/selinux.cpp @@ -331,6 +331,12 @@ bool LoadSplitPolicy() { } std::string plat_mapping_file("/system/etc/selinux/mapping/" + vend_plat_vers + ".cil"); + std::string plat_compat_cil_file("/system/etc/selinux/mapping/" + vend_plat_vers + + ".compat.cil"); + if (access(plat_compat_cil_file.c_str(), F_OK) == -1) { + plat_compat_cil_file.clear(); + } + std::string product_policy_cil_file("/product/etc/selinux/product_sepolicy.cil"); if (access(product_policy_cil_file.c_str(), F_OK) == -1) { product_policy_cil_file.clear(); @@ -376,6 +382,9 @@ bool LoadSplitPolicy() { }; // clang-format on + if (!plat_compat_cil_file.empty()) { + compile_args.push_back(plat_compat_cil_file.c_str()); + } if (!product_policy_cil_file.empty()) { compile_args.push_back(product_policy_cil_file.c_str()); }