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

Commit 4f97a8ca authored by Jiyong Park's avatar Jiyong Park
Browse files

binder_ndk: fix performance-unnecessary-value-param

Bug: 162909698
Test: m libbinder

Change-Id: I89779ab38a28972c1ad15733aff34a51e7e7fa8a
parent 16c6e707
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -98,6 +98,14 @@ cc_library {
            "30",
        ],
    },
    tidy: true,
    tidy_flags: [
        // Only check our headers
        "--header-filter=^.*frameworks/native/libs/binder/.*.h$",
    ],
    tidy_checks_as_errors: [
        "*",
    ],
}

ndk_headers {
+2 −2
Original line number Diff line number Diff line
@@ -367,7 +367,7 @@ void AIBinder_DeathRecipient::pruneDeadTransferEntriesLocked() {
                           mDeathRecipients.end());
}

binder_status_t AIBinder_DeathRecipient::linkToDeath(sp<IBinder> binder, void* cookie) {
binder_status_t AIBinder_DeathRecipient::linkToDeath(const sp<IBinder>& binder, void* cookie) {
    CHECK(binder != nullptr);

    std::lock_guard<std::mutex> l(mDeathRecipientsMutex);
@@ -386,7 +386,7 @@ binder_status_t AIBinder_DeathRecipient::linkToDeath(sp<IBinder> binder, void* c
    return STATUS_OK;
}

binder_status_t AIBinder_DeathRecipient::unlinkToDeath(sp<IBinder> binder, void* cookie) {
binder_status_t AIBinder_DeathRecipient::unlinkToDeath(const sp<IBinder>& binder, void* cookie) {
    CHECK(binder != nullptr);

    std::lock_guard<std::mutex> l(mDeathRecipientsMutex);
+2 −2
Original line number Diff line number Diff line
@@ -161,8 +161,8 @@ struct AIBinder_DeathRecipient : ::android::RefBase {
    };

    explicit AIBinder_DeathRecipient(AIBinder_DeathRecipient_onBinderDied onDied);
    binder_status_t linkToDeath(::android::sp<::android::IBinder>, void* cookie);
    binder_status_t unlinkToDeath(::android::sp<::android::IBinder> binder, void* cookie);
    binder_status_t linkToDeath(const ::android::sp<::android::IBinder>&, void* cookie);
    binder_status_t unlinkToDeath(const ::android::sp<::android::IBinder>& binder, void* cookie);

   private:
    // When the user of this API deletes a Bp object but not the death recipient, the