Put DEVICE/PRODUCT overlays in different partitions

This change changes auto-generated RROs from DEVICE_PACKAGE_OVERLAYS
to be generated in the vendor partition, as opposed to /product where
they were generated in the past.

Note that PRODUCT_PACKAGE_OVERLAYS continue generating RRO packages
to /product, which means that a single app can be overlayed from
different partitions. These RROs have been given module and package
names based on their location.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: I5cee70e28e3969e67b2d83eaf25d9c6e3a11102d
This commit is contained in:
Anton Hansson
2019-03-18 11:43:30 +00:00
parent 1d38fe98d1
commit cb8276fa93
7 changed files with 82 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
include $(CLEAR_VARS)
enforce_rro_module := $(enforce_rro_source_module)__auto_generated_rro
enforce_rro_module := $(enforce_rro_source_module)__auto_generated_rro_$(enforce_rro_partition)
LOCAL_PACKAGE_NAME := $(enforce_rro_module)
intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),,COMMON)
@@ -14,10 +14,17 @@ $(rro_android_manifest_file): $(enforce_rro_source_manifest_package_info)
endif
$(rro_android_manifest_file): PRIVATE_PACKAGE_INFO := $(enforce_rro_source_manifest_package_info)
$(rro_android_manifest_file): PRIVATE_USE_PACKAGE_NAME := $(use_package_name_arg)
$(rro_android_manifest_file): PRIVATE_PARTITION := $(enforce_rro_partition)
# There should be no duplicate overrides, but just in case, set the priority of
# /product overlays to be higher than /vendor, to at least get deterministic results.
$(rro_android_manifest_file): PRIVATE_PRIORITY := $(if $(filter product,$(enforce_rro_partition)),1,0)
$(rro_android_manifest_file): build/make/tools/generate-enforce-rro-android-manifest.py
$(hide) build/make/tools/generate-enforce-rro-android-manifest.py \
--package-info $(PRIVATE_PACKAGE_INFO) \
$(use_package_name_arg) \
$(PRIVATE_USE_PACKAGE_NAME) \
--partition $(PRIVATE_PARTITION) \
--priority $(PRIVATE_PRIORITY) \
-o $@
LOCAL_PATH:= $(intermediates)
@@ -31,7 +38,14 @@ LOCAL_CERTIFICATE := platform
LOCAL_AAPT_FLAGS += --auto-add-overlay
LOCAL_RESOURCE_DIR := $(enforce_rro_source_overlays)
LOCAL_PRODUCT_MODULE := true
ifeq (product,$(enforce_rro_partition))
LOCAL_PRODUCT_MODULE := true
else ifeq (vendor,$(enforce_rro_partition))
LOCAL_VENDOR_MODULE := true
else
$(error Unsupported partition. Want: [vendor/product] Got: [$(enforce_rro_partition)])
endif
ifneq (,$(LOCAL_RES_LIBRARIES))
# Technically we are linking against the app (if only to grab its resources),