Camera: work with vintf toggle.

Camera is currently compiled separately in passthrough and binderized
modes. Until that is resolved, adding a call to internal hidl logic.

Bug: 34817742
Test: camera starts up and works and respects binderization toggle in
both modes on marlin.
Change-Id: I20733cbc82a68a1da1c4f1b3754aef2887ca718a
diff --git a/camera/provider/2.4/default/service.cpp b/camera/provider/2.4/default/service.cpp
index 2723dee..9600559 100644
--- a/camera/provider/2.4/default/service.cpp
+++ b/camera/provider/2.4/default/service.cpp
@@ -20,6 +20,7 @@
 #include <CameraProvider.h>
 
 #include <hidl/HidlTransportSupport.h>
+#include <hidl/LegacySupport.h>
 #include <utils/StrongPointer.h>
 
 using android::hardware::configureRpcThreadpool;
@@ -32,6 +33,11 @@
 {
     const char instance[] = "legacy/0";
 
+    // TODO(b/34817742): use defaultServicePassthroughImplementation
+    // so that the toggle is implemented correctly
+    using ::android::hardware::details::blockIfBinderizationDisabled;
+    blockIfBinderizationDisabled(ICameraProvider::descriptor, instance);
+
     ALOGI("Camera provider Service is starting.");
 
     configureRpcThreadpool(1, true /* callerWillJoin */);