From 21028b7ad6a52738ff39b14d4588695dc95df1f0 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Tue, 15 Jan 2019 18:30:51 +0100 Subject: [PATCH] Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true Fixes: 122957987 Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true make droid Change-Id: Iafef8cc69971fd10718882326fbba99a6223d0f8 --- core/definitions.mk | 2 ++ core/dex_preopt.mk | 2 ++ core/package_internal.mk | 2 ++ core/prebuilt_internal.mk | 2 ++ core/soong_app_prebuilt.mk | 2 ++ 5 files changed, 10 insertions(+) diff --git a/core/definitions.mk b/core/definitions.mk index 2cf2bf1d9..362a345c2 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2694,6 +2694,7 @@ endif # UNSAFE_DISABLE_HIDDENAPI_FLAGS # Generate a greylist.txt from a classes.jar define hiddenapi-generate-csv +ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) ifneq (,$(wildcard frameworks/base)) # Only generate this target if we're in a tree with frameworks/base present. $(2): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) @@ -2712,6 +2713,7 @@ $(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): \ PRIVATE_METADATA_INPUTS := $$(PRIVATE_METADATA_INPUTS) $(3) endif +endif # UNSAFE_DISABLE_HIDDENAPI_FLAGS endef diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 60fd8dbbe..c1d4e8aad 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -31,6 +31,7 @@ $(foreach b,$(DEXPREOPT_BOOT_JARS_MODULES),$(eval $(call _dexpreopt-boot-jar-rem include $(BUILD_SYSTEM)/dex_preopt_libart.mk # === hiddenapi rules === +ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) hiddenapi_stubs_jar = $(call intermediates-dir-for,JAVA_LIBRARIES,$(1),,COMMON)/javalib.jar @@ -88,6 +89,7 @@ $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): $(HIDDENAPI) $(HIDDENAPI_STUBS) \ # Additional inputs are filled with `hiddenapi-generate-csv` $(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): $(SOONG_HIDDENAPI_GREYLIST_METADATA) $(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): PRIVATE_METADATA_INPUTS := $(SOONG_HIDDENAPI_GREYLIST_METADATA) +endif # UNSAFE_DISABLE_HIDDENAPI_FLAGS ifeq ($(PRODUCT_DIST_BOOT_AND_SYSTEM_JARS),true) boot_profile_jars_zip := $(PRODUCT_OUT)/boot_profile_jars.zip diff --git a/core/package_internal.mk b/core/package_internal.mk index 9ddbd1b6b..06dc1b711 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -576,9 +576,11 @@ endif module_run_appcompat := ifeq (true,$(non_system_module)) ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build +ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) module_run_appcompat := true endif endif +endif ifeq ($(module_run_appcompat),true) $(LOCAL_BUILT_MODULE) : $(appcompat-files) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 0b48a7733..cd4802530 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -74,9 +74,11 @@ endif module_run_appcompat := ifeq (true,$(non_system_module)) ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build +ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) module_run_appcompat := true endif endif +endif ifdef LOCAL_COMPRESSED_MODULE ifneq (true,$(LOCAL_COMPRESSED_MODULE)) diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index a6315b40d..b67381ea5 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -46,9 +46,11 @@ endif module_run_appcompat := ifeq (true,$(non_system_module)) ifeq (,$(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK))) # ! unbundled app build +ifneq ($(UNSAFE_DISABLE_HIDDENAPI_FLAGS),true) module_run_appcompat := true endif endif +endif ifeq ($(module_run_appcompat),true) $(LOCAL_BUILT_MODULE): $(appcompat-files)