1include $(CLEAR_VARS) 2 3enforce_rro_module := $(enforce_rro_source_module)__auto_generated_rro_$(enforce_rro_partition) 4LOCAL_PACKAGE_NAME := $(enforce_rro_module) 5 6intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON) 7rro_android_manifest_file := $(intermediates)/AndroidManifest.xml 8 9ifeq (true,$(enforce_rro_source_is_manifest_package_name)) 10 use_package_name_arg := --use-package-name 11else 12 use_package_name_arg := 13$(rro_android_manifest_file): $(enforce_rro_source_manifest_package_info) 14endif 15 16$(rro_android_manifest_file): PRIVATE_PACKAGE_INFO := $(enforce_rro_source_manifest_package_info) 17$(rro_android_manifest_file): PRIVATE_USE_PACKAGE_NAME := $(use_package_name_arg) 18$(rro_android_manifest_file): PRIVATE_PARTITION := $(enforce_rro_partition) 19# There should be no duplicate overrides, but just in case, set the priority of 20# /product overlays to be higher than /vendor, to at least get deterministic results. 21$(rro_android_manifest_file): PRIVATE_PRIORITY := $(if $(filter product,$(enforce_rro_partition)),1,0) 22$(rro_android_manifest_file): build/make/tools/generate-enforce-rro-android-manifest.py 23 $(hide) build/make/tools/generate-enforce-rro-android-manifest.py \ 24 --package-info $(PRIVATE_PACKAGE_INFO) \ 25 $(PRIVATE_USE_PACKAGE_NAME) \ 26 --partition $(PRIVATE_PARTITION) \ 27 --priority $(PRIVATE_PRIORITY) \ 28 -o $@ 29 30LOCAL_PATH:= $(intermediates) 31 32ifeq ($(enforce_rro_use_res_lib),true) 33 LOCAL_RES_LIBRARIES := $(enforce_rro_source_module) 34endif 35 36LOCAL_FULL_MANIFEST_FILE := $(rro_android_manifest_file) 37LOCAL_CERTIFICATE := platform 38 39LOCAL_AAPT_FLAGS += --auto-add-overlay 40LOCAL_RESOURCE_DIR := $(enforce_rro_source_overlays) 41 42ifeq (product,$(enforce_rro_partition)) 43 LOCAL_PRODUCT_MODULE := true 44else ifeq (vendor,$(enforce_rro_partition)) 45 LOCAL_VENDOR_MODULE := true 46else 47 $(error Unsupported partition. Want: [vendor/product] Got: [$(enforce_rro_partition)]) 48endif 49 50ifneq (,$(LOCAL_RES_LIBRARIES)) 51 # Technically we are linking against the app (if only to grab its resources), 52 # and because it's potentially not building against the SDK, we can't either. 53 LOCAL_PRIVATE_PLATFORM_APIS := true 54else ifeq (framework-res,$(enforce_rro_source_module)) 55 LOCAL_PRIVATE_PLATFORM_APIS := true 56else 57 LOCAL_SDK_VERSION := current 58endif 59 60include $(BUILD_RRO_PACKAGE) 61