Allow dependencies on non-default link paths

The dependency test differentiates default link paths and permitted
paths. Vendor objects may depend on libraries in non-default link paths.
The test allows the dependencies if the objects have RUNPATHs in vendor
or odm partition.

Test: atest vts_vndk_dependency_test
Bug: 185363536
Change-Id: I7f370677cf535d0bf97e752e72bde1f860970e3a
diff --git a/dependency/vts_vndk_dependency_test.py b/dependency/vts_vndk_dependency_test.py
index ff62885..0c13c41 100644
--- a/dependency/vts_vndk_dependency_test.py
+++ b/dependency/vts_vndk_dependency_test.py
@@ -46,8 +46,12 @@
                  expected to be in /vendor/lib[64].
         _vndk: Set of strings. The names of VNDK-core libraries.
         _vndk_sp: Set of strings. The names of VNDK-SP libraries.
-        _SP_HAL_LINK_PATHS: Format strings of same-process HAL's link paths.
-        _VENDOR_LINK_PATHS: Format strings of vendor processes' link paths.
+        _SP_HAL_LINK_PATHS: Format strings of same-process HAL's default link
+                            paths.
+        _VENDOR_LINK_PATHS: Format strings of vendor processes' default link
+                            paths.
+        _VENDOR_PERMITTED_PATHS: Same-process HAL and vendor processes'
+                                 permitted link paths.
         _VENDOR_APP_DIRS: The app directories in vendor partitions.
     """
     _TARGET_DIR_SEP = "/"
@@ -63,6 +67,9 @@
         "/odm/{LIB}/hw", "/odm/{LIB}/egl", "/odm/{LIB}",
         "/vendor/{LIB}/hw", "/vendor/{LIB}/egl", "/vendor/{LIB}"
     ]
+    _VENDOR_PERMITTED_PATHS = [
+        "/odm", "/vendor"
+    ]
     _VENDOR_APP_DIRS = [
         "/vendor/app", "/vendor/priv-app", "/odm/app", "/odm/priv-app"
     ]
@@ -366,7 +373,7 @@
         vendor_link_paths = [vndk_utils.FormatVndkPath(x, bitness) for
                              x in self._VENDOR_LINK_PATHS]
         vendor_namespace = self._FindLibsInLinkPaths(
-            bitness, vendor_link_paths + self._VENDOR_APP_DIRS, objs)
+            bitness, self._VENDOR_PERMITTED_PATHS, objs)
         # Exclude VNDK and VNDK-SP extensions from vendor libraries.
         for vndk_ext_dir in (vndk_utils.GetVndkExtDirectories(bitness) +
                              vndk_utils.GetVndkSpExtDirectories(bitness)):
@@ -377,8 +384,8 @@
 
         sp_hal_link_paths = [vndk_utils.FormatVndkPath(x, bitness) for
                              x in self._SP_HAL_LINK_PATHS]
-        sp_hal_namespace = self._FindLibsInLinkPaths(bitness,
-                                                     sp_hal_link_paths, objs)
+        sp_hal_namespace = self._FindLibsInLinkPaths(
+            bitness, self._VENDOR_PERMITTED_PATHS, objs)
 
         # Find same-process HAL and dependencies
         sp_hal_libs = set()