Drop instanceHint from VintfObject::ListInstances.

ListInstances used to be a function that represents either
a manifest or an IServiceManager. In the case that it represents
a passthrough service manager, the service manager cannot
list instance names directly, so it needs the matrix to tell
the passthrough service manager what instance names are expected.

With I78d4699fcecb0d54
("Refactor vts_treble_vintf_test"),
DeprecateTest.NoDeprecatedHalsOnManager was deleted. We no
longer needed that test because we already enforce:
- No deprecate HALs must be present on manifests
- All HALs on the service manager must be declared in manifests
  (and all HALs in the manifest must be retrievable via
   service managers).

Because we only check deprecation on manifests,
instanceHint is no longer needed to get all instance names.
Hence, we can safely drop this argument for simpler code.

Test: TH
Bug: 280314899
Change-Id: Icb7b279872d82d4fbe40ab885d9e4b229fbe6c53
diff --git a/VintfObject.cpp b/VintfObject.cpp
index b571195..ca36683 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -810,13 +810,8 @@
     const Version& version = oldMatrixInstance.versionRange().minVer();
     const std::string& interface = oldMatrixInstance.interface();
 
-    std::vector<std::string> instanceHint;
-    if (!oldMatrixInstance.isRegex()) {
-        instanceHint.push_back(oldMatrixInstance.exactInstance());
-    }
-
     std::vector<std::string> accumulatedErrors;
-    auto list = listInstances(package, version, interface, instanceHint);
+    auto list = listInstances(package, version, interface);
 
     for (const auto& pair : list) {
         const std::string& servedInstance = pair.first;
@@ -863,8 +858,7 @@
 bool VintfObject::IsInstanceListed(const ListInstances& listInstances,
                                    const FqInstance& fqInstance) {
     auto list =
-        listInstances(fqInstance.getPackage(), fqInstance.getVersion(), fqInstance.getInterface(),
-                      {fqInstance.getInstance()} /* instanceHint*/);
+        listInstances(fqInstance.getPackage(), fqInstance.getVersion(), fqInstance.getInterface());
     return std::any_of(list.begin(), list.end(),
                        [&](const auto& pair) { return pair.first == fqInstance.getInstance(); });
 }
@@ -945,8 +939,7 @@
     // Assuming that targetMatrix requires @x.u-v, require that at least @x.u is served.
     bool targetVersionServed = false;
     for (const auto& newPair :
-         listInstances(fqInstance.getPackage(), targetMatrixMinVer, fqInstance.getInterface(),
-                       {fqInstance.getInstance()} /* instanceHint */)) {
+         listInstances(fqInstance.getPackage(), targetMatrixMinVer, fqInstance.getInterface())) {
         if (newPair.first == fqInstance.getInstance()) {
             targetVersionServed = true;
             break;
@@ -1038,19 +1031,18 @@
                                       std::string* error) {
     using namespace std::placeholders;
     auto deviceManifest = getDeviceHalManifest();
-    ListInstances inManifest =
-        [&deviceManifest](const std::string& package, Version version, const std::string& interface,
-                          const std::vector<std::string>& /* hintInstances */) {
-            std::vector<std::pair<std::string, Version>> ret;
-            deviceManifest->forEachInstanceOfInterface(
-                HalFormat::HIDL, package, version, interface,
-                [&ret](const ManifestInstance& manifestInstance) {
-                    ret.push_back(
-                        std::make_pair(manifestInstance.instance(), manifestInstance.version()));
-                    return true;
-                });
-            return ret;
-        };
+    ListInstances inManifest = [&deviceManifest](const std::string& package, Version version,
+                                                 const std::string& interface) {
+        std::vector<std::pair<std::string, Version>> ret;
+        deviceManifest->forEachInstanceOfInterface(
+            HalFormat::HIDL, package, version, interface,
+            [&ret](const ManifestInstance& manifestInstance) {
+                ret.push_back(
+                    std::make_pair(manifestInstance.instance(), manifestInstance.version()));
+                return true;
+            });
+        return ret;
+    };
     return checkDeprecation(inManifest, hidlMetadata, error);
 }
 
diff --git a/include/vintf/VintfObject.h b/include/vintf/VintfObject.h
index 5fded4d..0695de5 100644
--- a/include/vintf/VintfObject.h
+++ b/include/vintf/VintfObject.h
@@ -180,16 +180,10 @@
     /**
      * A std::function that abstracts a list of "provided" instance names. Given package, version
      * and interface, the function returns a list of instance names that matches.
-     * This function can represent a manifest, an IServiceManager, etc.
-     * If the source is passthrough service manager, a list of instance names cannot be provided.
-     * Instead, the function should call getService on each of the "hintInstances", and
-     * return those instances for which getService does not return a nullptr. This means that for
-     * passthrough HALs, the deprecation on <regex-instance>s cannot be enforced; only <instance>s
-     * can be enforced.
+     * This function should represent a manifest.
      */
     using ListInstances = std::function<std::vector<std::pair<std::string, Version>>(
-        const std::string& package, Version version, const std::string& interface,
-        const std::vector<std::string>& hintInstances)>;
+        const std::string& package, Version version, const std::string& interface)>;
     /**
      * Check deprecation on framework matrices with a provided predicate.
      *
diff --git a/test/vintf_object_tests.cpp b/test/vintf_object_tests.cpp
index 8cc6853..4032813 100644
--- a/test/vintf_object_tests.cpp
+++ b/test/vintf_object_tests.cpp
@@ -1308,8 +1308,7 @@
 
 static VintfObject::ListInstances getInstanceListFunc(
     const std::vector<CheckedFqInstance>& instances) {
-    return [instances](const std::string& package, Version version, const std::string& interface,
-                       const auto& /* instanceHint */) {
+    return [instances](const std::string& package, Version version, const std::string& interface) {
         std::vector<std::pair<std::string, Version>> ret;
         for (auto&& existing : instances) {
             if (existing.getPackage() == package && existing.getVersion().minorAtLeast(version) &&