diff options
| author | 2023-01-19 00:27:34 +0000 | |
|---|---|---|
| committer | 2023-01-19 00:27:34 +0000 | |
| commit | c6f613332b80b4868bea308e9ca30a0756bd35e9 (patch) | |
| tree | e3a86315ed23bcbec14f45c6f4ccba020f326ea3 /libs | |
| parent | 87ca77083c13e2570a47553f3566fc45a5a0c76d (diff) | |
| parent | f0a0c0718c8090f0ed8d9a533314c63d153671c3 (diff) | |
Merge "libbinder: softer error for linkToDeath lack of threads" am: f0a0c0718c
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2392352
Change-Id: Icac8e6fde387e3954112360c73733faef18d1df7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/binder/BpBinder.cpp | 2 | ||||
| -rw-r--r-- | libs/binder/tests/binderRpcTest.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index 1c470a11d3..d03326eb04 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -388,7 +388,7 @@ status_t BpBinder::linkToDeath( { if (isRpcBinder()) { if (rpcSession()->getMaxIncomingThreads() < 1) { - LOG_ALWAYS_FATAL("Cannot register a DeathRecipient without any incoming connections."); + ALOGE("Cannot register a DeathRecipient without any incoming connections."); return INVALID_OPERATION; } } else if constexpr (!kEnableKernelIpc) { diff --git a/libs/binder/tests/binderRpcTest.cpp b/libs/binder/tests/binderRpcTest.cpp index 9be5b879d4..36c8d8cd50 100644 --- a/libs/binder/tests/binderRpcTest.cpp +++ b/libs/binder/tests/binderRpcTest.cpp @@ -683,7 +683,7 @@ TEST_P(BinderRpc, SingleDeathRecipientOnShutdown) { proc.expectAlreadyShutdown = true; } -TEST_P(BinderRpc, DeathRecipientFatalWithoutIncoming) { +TEST_P(BinderRpc, DeathRecipientFailsWithoutIncoming) { class MyDeathRec : public IBinder::DeathRecipient { public: void binderDied(const wp<IBinder>& /* who */) override {} @@ -693,8 +693,7 @@ TEST_P(BinderRpc, DeathRecipientFatalWithoutIncoming) { {.numThreads = 1, .numSessions = 1, .numIncomingConnections = 0}); auto dr = sp<MyDeathRec>::make(); - EXPECT_DEATH(proc.rootBinder->linkToDeath(dr, (void*)1, 0), - "Cannot register a DeathRecipient without any incoming connections."); + EXPECT_EQ(INVALID_OPERATION, proc.rootBinder->linkToDeath(dr, (void*)1, 0)); } TEST_P(BinderRpc, UnlinkDeathRecipient) { |