diff --git a/Android.mk b/Android.mk index ba1f8ae8d..e155177ac 100644 --- a/Android.mk +++ b/Android.mk @@ -261,6 +261,12 @@ LOCAL_REQUIRED_MODULES += \ odm_mac_permissions.xml endif +ifneq ($(PLATFORM_SEPOLICY_VERSION),$(TOT_SEPOLICY_VERSION)) +LOCAL_REQUIRED_MODULES += \ + sepolicy_freeze_test \ + +endif # ($(PLATFORM_SEPOLICY_VERSION),$(TOT_SEPOLICY_VERSION)) + include $(BUILD_PHONY_PACKAGE) ################################# @@ -1613,7 +1619,44 @@ base_plat_policy.conf := plat_sepolicy := endif # ($(PRODUCT_SEPOLICY_SPLIT),true) + ################################# +include $(CLEAR_VARS) +LOCAL_MODULE := sepolicy_freeze_test +LOCAL_MODULE_CLASS := ETC +LOCAL_MODULE_TAGS := tests + +include $(BUILD_SYSTEM)/base_rules.mk + +base_plat_public := $(LOCAL_PATH)/public +base_plat_private := $(LOCAL_PATH)/private +base_plat_public_prebuilt := \ + $(LOCAL_PATH)/prebuilts/api/$(PLATFORM_SEPOLICY_VERSION)/public +base_plat_private_prebuilt := \ + $(LOCAL_PATH)/prebuilts/api/$(PLATFORM_SEPOLICY_VERSION)/private + +all_frozen_files := $(call build_policy,$(sepolicy_build_files), \ +$(base_plat_public) $(base_plat_private) $(base_plat_public_prebuilt) $(base_plat_private_prebuilt)) + +$(LOCAL_BUILT_MODULE): PRIVATE_BASE_PLAT_PUBLIC := $(base_plat_public) +$(LOCAL_BUILT_MODULE): PRIVATE_BASE_PLAT_PRIVATE := $(base_plat_private) +$(LOCAL_BUILT_MODULE): PRIVATE_BASE_PLAT_PUBLIC_PREBUILT := $(base_plat_public_prebuilt) +$(LOCAL_BUILT_MODULE): PRIVATE_BASE_PLAT_PRIVATE_PREBUILT := $(base_plat_private_prebuilt) +$(LOCAL_BUILT_MODULE): $(all_frozen_files) +ifneq ($(PLATFORM_SEPOLICY_VERSION),$(TOT_SEPOLICY_VERSION)) + @diff -rq $(PRIVATE_BASE_PLAT_PUBLIC_PREBUILT) $(PRIVATE_BASE_PLAT_PUBLIC) + @diff -rq $(PRIVATE_BASE_PLAT_PRIVATE_PREBUILT) $(PRIVATE_BASE_PLAT_PRIVATE) +endif # ($(PLATFORM_SEPOLICY_VERSION),$(TOT_SEPOLICY_VERSION)) + $(hide) touch $@ + +base_plat_public := +base_plat_private := +base_plat_public_prebuilt := +base_plat_private_prebuilt := +all_frozen_files := + +################################# + add_nl := build_vendor_policy :=