Don't use the remote pool when using clang-tidy am: 0aecdac89e am: 31686577e1

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/12317649

Change-Id: Ia1e8e065fc1bbb0f41851232c1e253bb49319f02
diff --git a/Changes.md b/Changes.md
index 3109e9b..84c8d95 100644
--- a/Changes.md
+++ b/Changes.md
@@ -1,5 +1,15 @@
 # Build System Changes for Android.mk Writers
 
+## `LOCAL_REQUIRED_MODULES` requires listed modules to exist {#BUILD_BROKEN_MISSING_REQUIRED_MODULES}
+
+Modules listed in `LOCAL_REQUIRED_MODULES`, `LOCAL_HOST_REQUIRED_MODULES` and
+`LOCAL_TARGET_REQUIRED_MODULES` need to exist unless `ALLOW_MISSING_DEPENDENCIES`
+is set.
+
+To temporarily relax missing required modules check, use:
+
+`BUILD_BROKEN_MISSING_REQUIRED_MODULES := true`
+
 ## Changes in system properties settings
 
 ### Product variables
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 67aca7c..9d80ab9 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -744,7 +744,7 @@
 $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts-core-tradefed.jar)
 $(call add-clean-step, rm -rf $(HOST_OUT)/vts10/*)
 $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts10-tradefed.jar)
-# Clean up VTS again as VTS-Core will be renamed to VTS
+# Clean up VTS again as VTS-Core will be renamed to VTS 
 $(call add-clean-step, rm -rf $(HOST_OUT)/vts/*)
 $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts-tradefed.jar)
 
diff --git a/core/board_config.mk b/core/board_config.mk
index d4fe618..e517895 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -93,13 +93,14 @@
 
 _build_broken_var_list := \
   BUILD_BROKEN_DUP_RULES \
+  BUILD_BROKEN_DUP_SYSPROP \
   BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES \
+  BUILD_BROKEN_MISSING_REQUIRED_MODULES \
   BUILD_BROKEN_OUTSIDE_INCLUDE_DIRS \
   BUILD_BROKEN_PREBUILT_ELF_FILES \
   BUILD_BROKEN_TREBLE_SYSPROP_NEVERALLOW \
   BUILD_BROKEN_USES_NETWORK \
   BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES \
-  BUILD_BROKEN_DUP_SYSPROP \
 
 _build_broken_var_list += \
   $(foreach m,$(AVAILABLE_BUILD_MODULE_TYPES) \
diff --git a/core/build_id.mk b/core/build_id.mk
index 11f4a80..2f9c3f3 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -18,4 +18,4 @@
 # (like "CRB01").  It must be a single word, and is
 # capitalized by convention.
 
-BUILD_ID=RVC
+BUILD_ID=MASTER
diff --git a/core/main.mk b/core/main.mk
index 6df0de0..fc220d0 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -635,7 +635,6 @@
 )
 endef
 
-# TODO(b/7456955): error if a required module doesn't exist.
 # Resolve the required module names to 32-bit or 64-bit variant for:
 #   ALL_MODULES.<*>.REQUIRED_FROM_TARGET
 #   ALL_MODULES.<*>.REQUIRED_FROM_HOST
@@ -668,7 +667,8 @@
             $(if $(and $(module_is_native),$(required_is_shared_library_or_native_test)), \
               $(if $(ALL_MODULES.$(m).FOR_2ND_ARCH),$(r_i_2nd),$(r_i)), \
               $(r_i) $(r_i_2nd)))) \
-        $(eval ### TODO(b/7456955): error if r_m is empty / does not exist) \
+        $(eval r_m := $(foreach r_j,$(r_m),$(if $(ALL_MODULES.$(r_j).PATH),$(r_j)))) \
+        $(if $(r_m),,$(eval _nonexistent_required += $(1)$(comma)$(m)$(comma)$(1)$(comma)$(r_i))) \
         $(r_m))) \
     $(eval ALL_MODULES.$(m).REQUIRED_FROM_$(1) := $(sort $(r_r))) \
   ) \
@@ -691,18 +691,37 @@
     $(eval r_r := \
       $(foreach r_i,$(r), \
         $(eval r_m := $(call resolve-bitness-for-modules,$(1),$(r_i))) \
-        $(eval ### TODO(b/7456955): error if r_m is empty / does not exist) \
+        $(eval r_m := $(foreach r_j,$(r_m),$(if $(ALL_MODULES.$(r_j).PATH),$(r_j)))) \
+        $(if $(r_m),,$(eval _nonexistent_required += $(2)$(comma)$(m)$(comma)$(1)$(comma)$(r_i))) \
         $(r_m))) \
     $(eval ALL_MODULES.$(m).$(1)_REQUIRED_FROM_$(2) := $(sort $(r_r))) \
   ) \
 )
 endef
 
+_nonexistent_required :=
 $(call select-bitness-of-required-modules,TARGET)
 $(call select-bitness-of-required-modules,HOST)
 $(call select-bitness-of-required-modules,HOST_CROSS)
 $(call select-bitness-of-target-host-required-modules,TARGET,HOST)
 $(call select-bitness-of-target-host-required-modules,HOST,TARGET)
+_nonexistent_required := $(sort $(_nonexistent_required))
+
+# HOST OS darwin build is broken, disable this check for darwin for now.
+# TODO(b/162102724): Remove this
+ifeq (,$(filter $(HOST_OS),darwin))
+ifeq (,$(filter true,$(ALLOW_MISSING_DEPENDENCIES) $(BUILD_BROKEN_MISSING_REQUIRED_MODULES)))
+ifneq (,$(_nonexistent_required))
+  $(warning Missing required dependencies:)
+  $(foreach r_i,$(_nonexistent_required), \
+    $(eval r := $(subst $(comma),$(space),$(r_i))) \
+    $(info $(word 1,$(r)) module $(word 2,$(r)) requires non-existent $(word 3,$(r)) module: $(word 4,$(r))) \
+  )
+  $(warning Set BUILD_BROKEN_MISSING_REQUIRED_MODULES := true to bypass this check if this is intentional)
+  $(error Build failed)
+endif # _nonexistent_required != empty
+endif # ALLOW_MISSING_DEPENDENCIES != true && BUILD_BROKEN_MISSING_REQUIRED_MODULES != true
+endif # HOST_OS != darwin
 
 define add-required-deps
 $(1): | $(2)
diff --git a/target/board/go_defaults_common.prop b/target/board/go_defaults_common.prop
index d4989e0..ec2eb63 100644
--- a/target/board/go_defaults_common.prop
+++ b/target/board/go_defaults_common.prop
@@ -21,7 +21,6 @@
 ro.lmk.upgrade_pressure=40
 ro.lmk.downgrade_pressure=60
 ro.lmk.kill_heaviest_task=false
-ro.statsd.enable=true
 
 # set threshold to filter unused apps
 pm.dexopt.downgrade_after_inactive_days=10
diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 301e890..083d86a 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -50,6 +50,7 @@
     charger \
     cmd \
     com.android.adbd \
+    com.android.appsearch \
     com.android.conscrypt \
     com.android.cronet \
     com.android.extservices \
@@ -83,6 +84,7 @@
     e2fsck \
     ExtShared \
     flags_health_check \
+    framework-graphics \
     framework-minus-apex \
     framework-res \
     framework-sysconfig.xml \
@@ -207,6 +209,7 @@
     media_profiles_V1_0.dtd \
     MediaProviderLegacy \
     mediaserver \
+    mediatranscoding \
     mke2fs \
     monkey \
     mtpd \
@@ -323,6 +326,7 @@
 PRODUCT_BOOT_JARS := \
     $(ART_APEX_JARS) \
     framework-minus-apex \
+    framework-graphics \
     ext \
     com.android.i18n:core-icu4j \
     telephony-common \
@@ -330,6 +334,7 @@
     ims-common
 
 PRODUCT_UPDATABLE_BOOT_JARS := \
+    com.android.appsearch:framework-appsearch \
     com.android.conscrypt:conscrypt \
     com.android.media:updatable-media \
     com.android.mediaprovider:framework-mediaprovider \
diff --git a/target/product/base_vendor.mk b/target/product/base_vendor.mk
index 471340b..c644dd2 100644
--- a/target/product/base_vendor.mk
+++ b/target/product/base_vendor.mk
@@ -57,6 +57,7 @@
     libdynproc \
     libeffectproxy \
     libeffects \
+    libhapticgenerator \
     libldnhncr \
     libreference-ril \
     libreverbwrapper \
diff --git a/target/product/cfi-common.mk b/target/product/cfi-common.mk
index 42edd92..6ddc081 100644
--- a/target/product/cfi-common.mk
+++ b/target/product/cfi-common.mk
@@ -32,7 +32,7 @@
     system/bt \
     system/chre \
     system/core/libnetutils \
-    system/core/libziparchive \
+    system/libziparchive \
     system/gatekeeper \
     system/keymaster \
     system/nfc \
diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index 89c3f3a..74e5e8c 100644
--- a/target/product/emulator_vendor.mk
+++ b/target/product/emulator_vendor.mk
@@ -49,4 +49,4 @@
 
 # disable setupwizard
 PRODUCT_SYSTEM_EXT_PROPERTIES += \
-    ro.setupwizard.mode=DISABLED
+    ro.setupwizard.mode?=DISABLED
diff --git a/target/product/gsi/current.txt b/target/product/gsi/current.txt
index baf1382..03060fe 100644
--- a/target/product/gsi/current.txt
+++ b/target/product/gsi/current.txt
@@ -80,7 +80,6 @@
 VNDK-core: android.hidl.token@1.0-utils.so
 VNDK-core: android.hidl.token@1.0.so
 VNDK-core: android.system.suspend@1.0.so
-VNDK-core: libadf.so
 VNDK-core: libaudioroute.so
 VNDK-core: libaudioutils.so
 VNDK-core: libbinder.so
diff --git a/target/product/mainline_system_arm64.mk b/target/product/mainline_system_arm64.mk
index 360b657..fd3b920 100644
--- a/target/product/mainline_system_arm64.mk
+++ b/target/product/mainline_system_arm64.mk
@@ -38,6 +38,8 @@
 
 PRODUCT_SHIPPING_API_LEVEL := 29
 
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_arm64
 PRODUCT_DEVICE := mainline_arm64
 PRODUCT_BRAND := generic
diff --git a/target/product/mainline_system_x86.mk b/target/product/mainline_system_x86.mk
index 88d8a80..b154e72 100644
--- a/target/product/mainline_system_x86.mk
+++ b/target/product/mainline_system_x86.mk
@@ -37,6 +37,8 @@
 
 PRODUCT_SHIPPING_API_LEVEL := 29
 
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_x86
 PRODUCT_DEVICE := mainline_x86
 PRODUCT_BRAND := generic
diff --git a/target/product/mainline_system_x86_64.mk b/target/product/mainline_system_x86_64.mk
index 879f4ec..410c998 100644
--- a/target/product/mainline_system_x86_64.mk
+++ b/target/product/mainline_system_x86_64.mk
@@ -38,6 +38,8 @@
 
 PRODUCT_SHIPPING_API_LEVEL := 29
 
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_x86_64
 PRODUCT_DEVICE := mainline_x86_64
 PRODUCT_BRAND := generic
diff --git a/target/product/mainline_system_x86_arm.mk b/target/product/mainline_system_x86_arm.mk
index 1fc6574..9658444 100644
--- a/target/product/mainline_system_x86_arm.mk
+++ b/target/product/mainline_system_x86_arm.mk
@@ -37,6 +37,8 @@
 
 PRODUCT_SHIPPING_API_LEVEL := 29
 
+PRODUCT_RESTRICT_VENDOR_FILES := all
+
 PRODUCT_NAME := mainline_system_x86_arm
 PRODUCT_DEVICE := mainline_x86_arm
 PRODUCT_BRAND := generic
diff --git a/target/product/media_system.mk b/target/product/media_system.mk
index 4ebec51..a76125b 100644
--- a/target/product/media_system.mk
+++ b/target/product/media_system.mk
@@ -57,6 +57,7 @@
 # system server jars which are updated via apex modules.
 # The values should be of the format <apex name>:<jar name>
 PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS := \
+    com.android.appsearch:service-appsearch \
     com.android.permission:service-permission \
     com.android.ipsec:android.net.ipsec.ike \
 
diff --git a/tools/signapk/Android.bp b/tools/signapk/Android.bp
index c799dbf..f5b2ba7 100644
--- a/tools/signapk/Android.bp
+++ b/tools/signapk/Android.bp
@@ -16,7 +16,7 @@
 
 // the signapk tool (a .jar application used to sign packages)
 // ============================================================
-java_library_host {
+java_binary_host {
     name: "signapk",
     srcs: ["src/**/*.java"],
     manifest: "SignApk.mf",
@@ -32,6 +32,7 @@
     // The post-build signing tools need signapk.jar (and its shared libraries,
     // handled in their own Android.bp files)
     dist: {
+        tag: ".jar",
         targets: ["droidcore"],
     },
 }