Merge "Add comment for added restriction."
diff --git a/scripts/update_crate_tests.py b/scripts/update_crate_tests.py
index 0e24371..bfcc4cf 100755
--- a/scripts/update_crate_tests.py
+++ b/scripts/update_crate_tests.py
@@ -20,6 +20,18 @@
 import subprocess
 import sys
 
+test_options = {"ring_device_test_tests_digest_tests": [{"test-timeout": "600000"}]}
+test_exclude = [
+        "aidl_test_rust_client",
+        "aidl_test_rust_service"
+    ]
+exclude_paths = [
+        "//external/adhd",
+        "//external/crosvm",
+        "//external/libchromeos-rs",
+        "//external/vm_tools"
+    ]
+
 class Env(object):
     def __init__(self):
         try:
@@ -61,29 +73,30 @@
     # Return all reverse dependencies for a single module.
     def query_rdeps(self, module):
         with open(os.devnull, 'wb') as DEVNULL:
-            # Bazel queryview special-cases external/ so we need two
-            # separate queries to collect all the reverse dependencies.
             cmd = (self.path() + " query --config=queryview \'rdeps(//..., " +
                     module + ")\' --output=label_kind")
             out = (subprocess.check_output(cmd, shell=True, stderr=DEVNULL, text=True)
                     .strip().split("\n"))
-            cmd = (self.path() + " query --config=queryview --universe_scope=//external/... " +
-                    "--order_output=no \"allrdeps(" + module + ")\" --output=label_kind")
-            out += (subprocess.check_output(cmd, shell=True, stderr=DEVNULL, text=True)
-                    .strip().split("\n"))
             if '' in out:
                 out.remove('')
             return out
 
+    def exclude_module(self, module):
+        for path in exclude_paths:
+            if module.startswith(path):
+                return True
+        return False
+
     # Return all reverse dependency tests for modules in this package.
     def query_rdep_tests(self, modules):
         rdep_tests = set()
         print("Querying tests that depend on this crate for TEST_MAPPING. This can take a couple of minutes...")
         for module in modules:
             for rdep in self.query_rdeps(module):
-                rule_type, tmp, module = rdep.split(" ")
+                rule_type, tmp, mod = rdep.split(" ")
                 if rule_type == "rust_test_" or rule_type == "rust_test":
-                    rdep_tests.add(module.split(":")[1].split("--")[0])
+                    if self.exclude_module(mod) == False:
+                        rdep_tests.add(mod.split(":")[1].split("--")[0])
         return rdep_tests
 
 
@@ -118,7 +131,12 @@
     def tests_to_mapping(self, tests):
         test_mapping = {"presubmit": []}
         for test in tests:
-            test_mapping["presubmit"].append({"name": test})
+            if test in test_exclude:
+                continue
+            if test in test_options:
+                test_mapping["presubmit"].append({"name": test, "options": test_options[test]})
+            else:
+                test_mapping["presubmit"].append({"name": test})
         return test_mapping
 
     def write_test_mapping(self, test_mapping):
diff --git a/vndk/tools/header-checker/android/envsetup.sh b/vndk/tools/header-checker/android/envsetup.sh
index f41ed37..e2eee41 100644
--- a/vndk/tools/header-checker/android/envsetup.sh
+++ b/vndk/tools/header-checker/android/envsetup.sh
@@ -15,5 +15,5 @@
 # limitations under the License.
 
 export LLVM_BUILD_HOST_TOOLS=true
-export LLVM_PREBUILTS_VERSION=clang-r407598
-export LLVM_RELEASE_VERSION=12.0.1
+export LLVM_PREBUILTS_VERSION=clang-r407598b
+export LLVM_RELEASE_VERSION=12.0.2