diff options
author | 2022-07-07 21:42:10 +0000 | |
---|---|---|
committer | 2022-07-20 22:55:49 +0000 | |
commit | 66d5b7ac5c78330dd7ad38f0319d432e2df7230f (patch) | |
tree | e9db7afafe4ca5617667e7bca8504b2ed5680972 /libs/binder/RpcSession.cpp | |
parent | 857cd25e3da169f31e985d38919c7313be05aaf1 (diff) |
Add linkToDeath support for RPC binder so a client can act on disconnect
This requires an incoming thread to be listening to the connection in
order to be notified.
Test: atest binderRpcTest
Test: atest binderRpcTestSingleThreaded
Bug: 182939380
Change-Id: I3746de6e8cff99bb267867c5dc60a6815b19fb92
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index 80f6a37f51..e6dbd79ffb 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -223,6 +223,11 @@ bool RpcSession::shutdownAndWait(bool wait) { _l.unlock(); + if (status_t res = state()->sendObituaries(sp<RpcSession>::fromExisting(this)); res != OK) { + ALOGE("Failed to send obituaries as the RpcSession is shutting down: %s", + statusToString(res).c_str()); + } + mRpcBinderState->clear(); return true; |