Remove uses of toBinder in auto-generated code.

It's templated, and it costs space.

Bug: N/A
Test: boot/hidl_test
Change-Id: I76feae3b4bb6f41a4d70fbd591e649f34f6a7b2a
diff --git a/transport/include/hidl/HidlTransportSupport.h b/transport/include/hidl/HidlTransportSupport.h
index 368c2c5..db1974c 100644
--- a/transport/include/hidl/HidlTransportSupport.h
+++ b/transport/include/hidl/HidlTransportSupport.h
@@ -93,7 +93,7 @@
         return left == right;
     }
 
-    return toBinder<ILeft>(left) == toBinder<IRight>(right);
+    return getOrCreateCachedBinder(left.get()) == getOrCreateCachedBinder(right.get());
 }
 
 namespace details {
@@ -129,7 +129,7 @@
     // TODO b/32001926 Needs to be fixed for socket mode.
     if (parent->isRemote()) {
         // binderized mode. Got BpChild. grab the remote and wrap it.
-        return sp<IChild>(new BpChild(toBinder<IParent>(parent)));
+        return sp<IChild>(new BpChild(getOrCreateCachedBinder(parent.get())));
     }
     // Passthrough mode. Got BnChild or BsChild.
     return sp<IChild>(static_cast<IChild *>(parent.get()));
@@ -149,7 +149,7 @@
 
     if (base->isRemote()) {
         // getRawServiceInternal guarantees we get the proper class
-        return sp<IType>(new BpType(toBinder<IBase>(base)));
+        return sp<IType>(new BpType(getOrCreateCachedBinder(base.get())));
     }
 
     return IType::castFrom(base);