Fix default value of BoardSepolicyVers
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly so far. Below is the reason why it hasn't been discovered yet. DeviceConfig.PlatformSepolicyVersion() was added to support mixed sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy with old plat policy files). Soong compares PlatformSepolicyVersion() and BoardSepolicyVers(), and used old vendor sources if both are different. Back then, the only place where such logic played a role was selinux contexts. Test codes were running as intended: after setting BOARD_SEPOLICY_VERS the context files were built against old policies. But there were two mistakes: 1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was always empty. 2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk, which was processed after soong_config. So if BOARD_SEPOLICY_VERS was not set in BoardConfig.mk, BoardSepolicyVers() was empty, not PLATFORM_SEPOLICY_VERSION. And there were no issues as Soong only checked equality. To fix the issue correctly, this commit adds the variable PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by returning PlatformSepolicyVersion if it's empty. Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes Change-Id: Ie55827f47d2903e9739eccacc3874d354d5c9f2d
Loading
Please register or sign in to comment