[devices] Use fidl::ServerEnd for protocol connectors

Use fidl::SeverEnd for protocol connectors in DriverHost.

Bug: 33183
Change-Id: I41a757d137b29d01c04839aa2b5a742819305bb1
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/526541
Fuchsia-Auto-Submit: Abdulla Kamar <abdulla@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Reviewed-by: Suraj Malhotra <surajmalhotra@google.com>
diff --git a/src/devices/bin/driver_host2/driver_host_test_driver.cc b/src/devices/bin/driver_host2/driver_host_test_driver.cc
index 9d0d536..30165fe 100644
--- a/src/devices/bin/driver_host2/driver_host_test_driver.cc
+++ b/src/devices/bin/driver_host2/driver_host_test_driver.cc
@@ -38,11 +38,11 @@
     }
 
     // Setup the outgoing service.
-    zx_status_t status =
-        outgoing_.svc_dir()->AddEntry(fidl::DiscoverableProtocolName<ftest::Outgoing>,
-                                      fbl::MakeRefCounted<fs::Service>([](zx::channel request) {
-                                        return fidl_epitaph_write(request.get(), ZX_ERR_STOP);
-                                      }));
+    zx_status_t status = outgoing_.svc_dir()->AddEntry(
+        fidl::DiscoverableProtocolName<ftest::Outgoing>,
+        fbl::MakeRefCounted<fs::Service>([](fidl::ServerEnd<ftest::Outgoing> request) {
+          return fidl_epitaph_write(request.channel().get(), ZX_ERR_STOP);
+        }));
     if (status != ZX_OK) {
       return zx::error(status);
     }
diff --git a/src/devices/bin/driver_host2/main.cc b/src/devices/bin/driver_host2/main.cc
index 8bbc93b..e6c0fde 100644
--- a/src/devices/bin/driver_host2/main.cc
+++ b/src/devices/bin/driver_host2/main.cc
@@ -15,6 +15,7 @@
 #include "src/sys/lib/stdout-to-debuglog/cpp/stdout-to-debuglog.h"
 
 namespace fdf = fuchsia_driver_framework;
+namespace fi = fuchsia::inspect;
 
 constexpr char kDiagnosticsDir[] = "diagnostics";
 constexpr size_t kNumDriverLoopThreads = 2;
@@ -43,14 +44,14 @@
   }
   auto tree_handler = inspect::MakeTreeHandler(&inspector, loop.dispatcher());
   auto tree_service = fbl::MakeRefCounted<fs::Service>(
-      [tree_handler = std::move(tree_handler)](zx::channel request) {
-        tree_handler(fidl::InterfaceRequest<fuchsia::inspect::Tree>(std::move(request)));
+      [tree_handler = std::move(tree_handler)](fidl::ServerEnd<fi::Tree> request) {
+        tree_handler(fidl::InterfaceRequest<fi::Tree>(request.TakeChannel()));
         return ZX_OK;
       });
   auto diagnostics_dir = fbl::MakeRefCounted<fs::PseudoDir>();
-  status = diagnostics_dir->AddEntry(fuchsia::inspect::Tree::Name_, std::move(tree_service));
+  status = diagnostics_dir->AddEntry(fi::Tree::Name_, std::move(tree_service));
   if (status != ZX_OK) {
-    LOGF(ERROR, "Failed to add directory entry '%s': %s", fuchsia::inspect::Tree::Name_,
+    LOGF(ERROR, "Failed to add directory entry '%s': %s", fi::Tree::Name_,
          zx_status_get_string(status));
     return status;
   }