Add (un)linkToDeath to IBase.

With corresponding callback interfaces. hidl_death_recipient
is a transport-independent interface, used directly by clients
and servers. hidl_binder_death_recipient wraps a hidl_death_recipient
object and implements the Binder-specific death recipient. It
holds a weak reference to the callback interface, as well as the
interface it was called on (so we can include that in the callback).

Bug: 31632518
Test: mma, hidl_test
Change-Id: I0430efff24c2bfd3993438c6ed3fe007d9f9e3ef
diff --git a/transport/base/1.0/IBase.hal b/transport/base/1.0/IBase.hal
index 379213a..d696249 100644
--- a/transport/base/1.0/IBase.hal
+++ b/transport/base/1.0/IBase.hal
@@ -54,4 +54,21 @@
      * tags).
      */
     oneway notifySyspropsChanged();
+
+    /*
+     * Registers a death recipient, to be called when the process hosting this
+     * interface dies.
+     *
+     * @param recipient a hidl_death_recipient callback object
+     * @param cookie a cookie that must be returned with the callback
+     * @return success whether the death recipient was registered successfully.
+     */
+    linkToDeath(death_recipient recipient, uint64_t cookie) generates (bool success);
+
+    /*
+     * Unregisters a previously registered death recipient.
+     * @param recipient a previously registered hidl_death_recipient callback
+     * @return success whether the death recipient was unregistered successfully.
+     */
+    unlinkToDeath(death_recipient recipient) generates (bool success);
 };