Lines Matching refs:binder

48 static void attach(const sp<IBinder>& binder) {  in attach()  argument
49 binder->attachObject(kId, kValue, nullptr /*cookie*/, clean); in attach()
51 static bool has(const sp<IBinder>& binder) { in has() argument
52 return binder != nullptr && binder->findObject(kId) == kValue; in has()
62 wp<ABpBinder> binder; member
215 ABpBinder::ABpBinder(const ::android::sp<::android::IBinder>& binder) in ABpBinder() argument
216 : AIBinder(nullptr /*clazz*/), BpRefBase(binder) { in ABpBinder()
217 CHECK(binder != nullptr); in ABpBinder()
232 value->binder = nullptr; in onLastStrongRef()
239 sp<AIBinder> ABpBinder::lookupOrCreateFromBinder(const ::android::sp<::android::IBinder>& binder) { in lookupOrCreateFromBinder() argument
240 if (binder == nullptr) { in lookupOrCreateFromBinder()
243 if (ABBinderTag::has(binder)) { in lookupOrCreateFromBinder()
244 return static_cast<ABBinder*>(binder.get()); in lookupOrCreateFromBinder()
252 static_cast<ABpBinderTag::Value*>(binder->findObject(ABpBinderTag::kId)); in lookupOrCreateFromBinder()
255 binder->attachObject(ABpBinderTag::kId, static_cast<void*>(value), nullptr /*cookie*/, in lookupOrCreateFromBinder()
259 sp<ABpBinder> ret = value->binder.promote(); in lookupOrCreateFromBinder()
261 ret = new ABpBinder(binder); in lookupOrCreateFromBinder()
262 value->binder = ret; in lookupOrCreateFromBinder()
269 wp<AIBinder> binder; member
271 AIBinder_Weak* AIBinder_Weak_new(AIBinder* binder) { in AIBinder_Weak_new() argument
272 if (binder == nullptr) { in AIBinder_Weak_new()
276 return new AIBinder_Weak{wp<AIBinder>(binder)}; in AIBinder_Weak_new()
286 sp<AIBinder> binder = weakBinder->binder.promote(); in AIBinder_Weak_promote() local
287 AIBinder_incStrong(binder.get()); in AIBinder_Weak_promote()
288 return binder.get(); in AIBinder_Weak_promote()
357 binder_status_t AIBinder_DeathRecipient::linkToDeath(sp<IBinder> binder, void* cookie) { in linkToDeath() argument
358 CHECK(binder != nullptr); in linkToDeath()
363 new TransferDeathRecipient(binder, cookie, this, mOnDied); in linkToDeath()
365 status_t status = binder->linkToDeath(recipient, cookie, 0 /*flags*/); in linkToDeath()
376 binder_status_t AIBinder_DeathRecipient::unlinkToDeath(sp<IBinder> binder, void* cookie) { in unlinkToDeath() argument
377 CHECK(binder != nullptr); in unlinkToDeath()
384 if (recipient->getCookie() == cookie && recipient->getWho() == binder) { in unlinkToDeath()
387 status_t status = binder->unlinkToDeath(recipient, cookie, 0 /*flags*/); in unlinkToDeath()
416 bool AIBinder_isRemote(const AIBinder* binder) { in AIBinder_isRemote() argument
417 if (binder == nullptr) { in AIBinder_isRemote()
421 return binder->isRemote(); in AIBinder_isRemote()
424 bool AIBinder_isAlive(const AIBinder* binder) { in AIBinder_isAlive() argument
425 if (binder == nullptr) { in AIBinder_isAlive()
429 return const_cast<AIBinder*>(binder)->getBinder()->isBinderAlive(); in AIBinder_isAlive()
432 binder_status_t AIBinder_ping(AIBinder* binder) { in AIBinder_ping() argument
433 if (binder == nullptr) { in AIBinder_ping()
437 return PruneStatusT(binder->getBinder()->pingBinder()); in AIBinder_ping()
440 binder_status_t AIBinder_dump(AIBinder* binder, int fd, const char** args, uint32_t numArgs) { in AIBinder_dump() argument
441 if (binder == nullptr) { in AIBinder_dump()
445 ABBinder* bBinder = binder->asABBinder(); in AIBinder_dump()
447 AIBinder_onDump onDump = binder->getClass()->onDump; in AIBinder_dump()
460 status_t status = binder->getBinder()->dump(fd, utf16Args); in AIBinder_dump()
464 binder_status_t AIBinder_linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, in AIBinder_linkToDeath() argument
466 if (binder == nullptr || recipient == nullptr) { in AIBinder_linkToDeath()
472 return recipient->linkToDeath(binder->getBinder(), cookie); in AIBinder_linkToDeath()
475 binder_status_t AIBinder_unlinkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, in AIBinder_unlinkToDeath() argument
477 if (binder == nullptr || recipient == nullptr) { in AIBinder_unlinkToDeath()
483 return recipient->unlinkToDeath(binder->getBinder(), cookie); in AIBinder_unlinkToDeath()
494 void AIBinder_incStrong(AIBinder* binder) { in AIBinder_incStrong() argument
495 if (binder == nullptr) { in AIBinder_incStrong()
499 binder->incStrong(nullptr); in AIBinder_incStrong()
501 void AIBinder_decStrong(AIBinder* binder) { in AIBinder_decStrong() argument
502 if (binder == nullptr) { in AIBinder_decStrong()
507 binder->decStrong(nullptr); in AIBinder_decStrong()
509 int32_t AIBinder_debugGetRefCount(AIBinder* binder) { in AIBinder_debugGetRefCount() argument
510 if (binder == nullptr) { in AIBinder_debugGetRefCount()
515 return binder->getStrongCount(); in AIBinder_debugGetRefCount()
518 bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz) { in AIBinder_associateClass() argument
519 if (binder == nullptr) { in AIBinder_associateClass()
523 return binder->associateClass(clazz); in AIBinder_associateClass()
526 const AIBinder_Class* AIBinder_getClass(AIBinder* binder) { in AIBinder_getClass() argument
527 if (binder == nullptr) { in AIBinder_getClass()
531 return binder->getClass(); in AIBinder_getClass()
534 void* AIBinder_getUserData(AIBinder* binder) { in AIBinder_getUserData() argument
535 if (binder == nullptr) { in AIBinder_getUserData()
539 ABBinder* bBinder = binder->asABBinder(); in AIBinder_getUserData()
547 binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) { in AIBinder_prepareTransaction() argument
548 if (binder == nullptr || in == nullptr) { in AIBinder_prepareTransaction()
552 const AIBinder_Class* clazz = binder->getClass(); in AIBinder_prepareTransaction()
560 if (!binder->isRemote()) { in AIBinder_prepareTransaction()
561 LOG(WARNING) << "A binder object at " << binder in AIBinder_prepareTransaction()
567 *in = new AParcel(binder); in AIBinder_prepareTransaction()
584 binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, AParcel** in, in AIBinder_transact() argument
607 if (binder == nullptr || *in == nullptr || out == nullptr) { in AIBinder_transact()
612 if ((*in)->getBinder() != binder) { in AIBinder_transact()
613 LOG(ERROR) << __func__ << ": parcel is associated with binder object " << binder in AIBinder_transact()
618 *out = new AParcel(binder); in AIBinder_transact()
620 status_t status = binder->getBinder()->transact(code, *(*in)->get(), (*out)->get(), flags); in AIBinder_transact()
650 binder_status_t AIBinder_getExtension(AIBinder* binder, AIBinder** outExt) { in AIBinder_getExtension() argument
651 if (binder == nullptr || outExt == nullptr) { in AIBinder_getExtension()
659 status_t res = binder->getBinder()->getExtension(&ext); in AIBinder_getExtension()
667 if (ret != nullptr) ret->incStrong(binder); in AIBinder_getExtension()
673 binder_status_t AIBinder_setExtension(AIBinder* binder, AIBinder* ext) { in AIBinder_setExtension() argument
674 if (binder == nullptr || ext == nullptr) { in AIBinder_setExtension()
678 ABBinder* rawBinder = binder->asABBinder(); in AIBinder_setExtension()
689 void AIBinder_setRequestingSid(AIBinder* binder, bool requestingSid) { in AIBinder_setRequestingSid() argument
690 ABBinder* localBinder = binder->asABBinder(); in AIBinder_setRequestingSid()
702 android::sp<android::IBinder> AIBinder_toPlatformBinder(AIBinder* binder) { in AIBinder_toPlatformBinder() argument
703 if (binder == nullptr) return nullptr; in AIBinder_toPlatformBinder()
704 return binder->getBinder(); in AIBinder_toPlatformBinder()
707 AIBinder* AIBinder_fromPlatformBinder(const android::sp<android::IBinder>& binder) { in AIBinder_fromPlatformBinder() argument
708 sp<AIBinder> ndkBinder = ABpBinder::lookupOrCreateFromBinder(binder); in AIBinder_fromPlatformBinder()