BnFoo class cleanup.
BnFoo objects wrap an IFoo implementation, which
is stored in mImpl. But, BnFoo previously also
inherited from IFoo, and the implementation of those
methods just did a call-through on the wrapped
implementation.
What's wrong with this is that BnFoo is a transport
object, that we don't want to expose to clients
directly. This change fixes that by removing the
IFoo inheritance from BnFoo. A consequence of this
is also that, if A passed an IFoo to B, and B passes
this IFoo back to A, A will receive the exact same
IFoo object (its local service implementation).
Additionally, all BnFoo objects now inherit from
BnBase; BnBase is a common base class all BnFoo
objects share, so we can safely cast generic
IBinder objects back to BnFoo objects.
Test: mma, hidl_test, hidl_test_java
Bug: 33173166
Bug: 33492405
Change-Id: I6d6dd0db4810fa47af5a428547a1f7d2f0904d43
diff --git a/AST.h b/AST.h
index aab3040..ffd63b1 100644
--- a/AST.h
+++ b/AST.h
@@ -187,8 +187,6 @@
status_t generateStubImplSource(const std::string &outputPath) const;
status_t generateMethods(Formatter &out, MethodGenerator gen) const;
- status_t generateStubMethod(Formatter &out,
- const Method *method) const;
status_t generateStubImplMethod(Formatter &out,
const std::string &className,
const Method *method) const;
@@ -205,7 +203,7 @@
Formatter &out, const std::string &baseName) const;
status_t generateStubSource(
- Formatter &out, const std::string &baseName) const;
+ Formatter &out, const Interface *iface, const std::string &baseName) const;
status_t generateStubSourceForMethod(
Formatter &out, const Interface *iface, const Method *method) const;