Toggleable services check vintf specifies toggled.

Test: toggled hals work as expected on marlin
Bug: 34791816

Merged-In: Id97e94ce89156d0a9a3075d33ae38028af4cb175

Change-Id: Id97e94ce89156d0a9a3075d33ae38028af4cb175
diff --git a/transport/LegacySupport.cpp b/transport/LegacySupport.cpp
index d2e8688..bf91777 100644
--- a/transport/LegacySupport.cpp
+++ b/transport/LegacySupport.cpp
@@ -47,6 +47,18 @@
 void blockIfBinderizationDisabled(const std::string& interface,
                                   const std::string& instance) {
     // TODO(b/34274385) remove this
+
+    size_t loc = interface.find_first_of("@");
+    if (loc == std::string::npos) {
+        LOG_ALWAYS_FATAL("Bad interface name: %s", interface.c_str());
+    }
+    std::string package = interface.substr(0, loc);
+
+    // only block if this is supposed to be toggled
+    if (getTransportFromManifest(package) != vintf::Transport::TOGGLED) {
+        return;
+    }
+
     // Must wait for data to be mounted and persistant properties to be read,
     // but only delay the start of hals which require reading this property.
     bool enabled = blockingHalBinderizationEnabled();