Mark some hidl interface libs as double_loadable

Following interface libs are explicitly marked as double_loadable since
they are one of the (indirect) dependencies of LLNDK libraries and at
the same time are member of VNDK. Such lib can be double loaded inside a
vendor process.

* android.hardware.configstore@: due to libgui
* android.hardware.graphics.allocator@: due to libgui
* android.hardware.graphics.bufferqueue@: due to libgui
* android.hardware.media@: due to android.hardware.graphics.bufferqueue@
* android.hardware.media.omx@: due to libmedia_omx
* android.hardware.media.omx@*: due to dependency from libmedia_omx
* android.hidl.token@: due to libgui
* android.hardware.neuralnetworks and android.hidl.allocator: due to
  dependency from libneuralnetworks

Note: even without this change, the library is already capable of being
double loaded due to the dependency graph around it. This change is to
make it explicit so that double loading of a library is carefully
tracked and signed-off by the owner of the lib.

Bug: 77155589
Test: m -j

Merged-In: I7194df66d265bb865d918ffb491d9eed64b83067
Change-Id: I7194df66d265bb865d918ffb491d9eed64b83067
(cherry picked from commit ee9921ab975d3982167ddf9c1e127978b576ed2f)
diff --git a/build/hidl_interface.go b/build/hidl_interface.go
index 24b8ce6..0f44b72 100644
--- a/build/hidl_interface.go
+++ b/build/hidl_interface.go
@@ -254,6 +254,7 @@
 			Name:              proptools.StringPtr(name.string()),
 			Owner:             i.properties.Owner,
 			Vendor_available:  proptools.BoolPtr(true),
+			Double_loadable:   proptools.BoolPtr(isDoubleLoadable(name.string())),
 			Defaults:          []string{"hidl-module-defaults"},
 			Generated_sources: []string{name.sourcesName()},
 			Generated_headers: []string{name.headersName()},
@@ -432,3 +433,23 @@
 	}
 	return nil
 }
+
+var doubleLoadablePackageNames = []string {
+	"android.hardware.configstore@",
+	"android.hardware.graphics.allocator@",
+	"android.hardware.graphics.bufferqueue@",
+	"android.hardware.media.omx@",
+	"android.hardware.media@",
+	"android.hardware.neuralnetworks@",
+	"android.hidl.allocator@",
+	"android.hidl.token@",
+}
+
+func isDoubleLoadable(name string) bool {
+	for _, pkgname := range doubleLoadablePackageNames {
+		if strings.HasPrefix(name, pkgname) {
+			return true
+		}
+	}
+	return false
+}