Don't enforce <uses-library> checks if dexpreopt for apps is disabled.

Otherwise the check fails, as it depend on non-existent dexpreopt.config
files. This CL fixes broken build cf_x86_phone-userdebug_coverage.

Bug: 183931403
Bug: 132357300
Test: forrest build for cf_x86_phone-userdebug_coverage.
Change-Id: I6f977c1e0c2d2160b1813d2d1c36459f0641235e
This commit is contained in:
Ulya Trafimovich
2021-03-29 15:01:05 +01:00
parent bc50bb88e2
commit 03befa00fe

View File

@@ -47,15 +47,21 @@ ifeq (true,$(DISABLE_PREOPT))
LOCAL_DEX_PREOPT :=
endif
# Disable <uses-library> checks and preopt if not WITH_DEXPREOPT
#
# Disable preopt if not WITH_DEXPREOPT
ifneq (true,$(WITH_DEXPREOPT))
LOCAL_DEX_PREOPT :=
endif
# Disable <uses-library> checks if dexpreopt is globally disabled.
# Without dexpreopt the check is not necessary, and although it is good to have,
# it is difficult to maintain on non-linux build platforms where dexpreopt is
# generally disabled (the check may fail due to various unrelated reasons, such
# as a failure to get manifest from an APK).
ifneq (true,$(WITH_DEXPREOPT))
LOCAL_ENFORCE_USES_LIBRARIES := false
LOCAL_DEX_PREOPT :=
endif
ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
LOCAL_ENFORCE_USES_LIBRARIES := false
endif
ifdef LOCAL_UNINSTALLABLE_MODULE