Allow tests to be disabled for presubmit check

A test can be disabled in two ways:
1. Add the test name to ALL_DISABLED_PRESUBMIT_TESTS variable.
   Integration tests (tests inside TradeFed) can only be disabled in
   this way.
2. In module config, set LOCAL_PRESUBMIT_DISABLED to true. This works
   for tests with build target.

This change allows tests to be skipped in presubmit check to be saved in
a list that's included in test-mappings.zip build artifact.

Bug: 74971025
Test: m dist -j test-mapping
Change-Id: I6e3016b017ce1ade024dc4ded72a10c778b88e7f
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 94c323e..f1ba90b 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -646,6 +646,13 @@
 endif  # LOCAL_COMPATIBILITY_SUITE
 
 ###########################################################
+## Add test module to ALL_DISABLED_PRESUBMIT_TESTS if LOCAL_PRESUBMIT_DISABLED is set to true.
+###########################################################
+ifeq ($(LOCAL_PRESUBMIT_DISABLED),true)
+  ALL_DISABLED_PRESUBMIT_TESTS += $(LOCAL_MODULE)
+endif  # LOCAL_PRESUBMIT_DISABLED
+
+###########################################################
 ## Register with ALL_MODULES
 ###########################################################