Skip to content

Commit a7dab6e

Browse files
committed
binder: ndk: add asBinderReference method to BpCInterface
This is more efficient than `asBinder` when the caller doesn't need to increment the ref count. Used in https://r.android.com/3211938 Test: m Bug: 338458975 Change-Id: I15dd9b5c1033c58760e1038f09190bbbafc4bf49
1 parent 07889b1 commit a7dab6e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

libs/binder/ndk/include_cpp/android/binder_interface_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ class BpCInterface : public INTERFACE {
225225

226226
SpAIBinder asBinder() override final;
227227

228+
const SpAIBinder& asBinderReference() { return mBinder; }
229+
228230
bool isRemote() override final { return AIBinder_isRemote(mBinder.get()); }
229231

230232
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override {

0 commit comments

Comments
 (0)