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

Commit a73a292a 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...

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2392352



Change-Id: I1f29e20118938f5a1bd20dc12101b582fd890684
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3b0e7ff7 e55ea995
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) {