Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e55ea995 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "libbinder: softer error for linkToDeath lack of threads" am: f0a0c071 am: c6f61333

parents 4d0aa765 c6f61333
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+2 −3
Original line number Diff line number Diff line
@@ -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) {