Support (un)linkToDeath in Java.
Test: mma, hidl_test_java
Bug: 31632518
Change-Id: Ic324deb5b0b17340328a08e736e07b47a7bea59b
diff --git a/Interface.cpp b/Interface.cpp
index 29afee1..1e40bd2 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -97,11 +97,7 @@
<< " == ::android::OK);\n";
}
},
- {IMPL_STUB,
- [](auto &/*out*/) {
- // Do nothing
- }
- }
+ {IMPL_STUB, nullptr}
}, /*cppImpl*/
{
{IMPL_HEADER,
@@ -111,15 +107,10 @@
},
{IMPL_PROXY,
[this](auto &out) {
- // TODO (b/31632518)
- out << "return false;";
+ out << "return mRemote.linkToDeath(recipient, cookie);\n";
}
},
- {IMPL_STUB,
- [this](auto &/*out*/) {
- // Do nothing
- }
- }
+ {IMPL_STUB, nullptr}
} /*javaImpl*/
);
}
@@ -159,29 +150,20 @@
out << "return false;\n";
}
},
- {IMPL_STUB,
- [](auto &/*out*/) {
- // Do nothing
- }
- }
+ {IMPL_STUB, nullptr /* don't generate code */}
}, /*cppImpl*/
{
{IMPL_HEADER,
[this](auto &out) {
- out << "return true;";
+ out << "return true;\n";
}
},
{IMPL_PROXY,
[this](auto &out) {
- // TODO (b/31632518)
- out << "return false;";
+ out << "return mRemote.unlinkToDeath(recipient);\n";
}
},
- {IMPL_STUB,
- [this](auto &/*out*/) {
- // Do nothing
- }
- }
+ {IMPL_STUB, nullptr /* don't generate code */}
} /*javaImpl*/
);
}