Lines Matching refs:binder
43 static void attach(const sp<IBinder>& binder) { in attach() argument
44 binder->attachObject(kId, kValue, nullptr /*cookie*/, clean); in attach()
46 static bool has(const sp<IBinder>& binder) { in has() argument
47 return binder != nullptr && binder->findObject(kId) == kValue; in has()
57 wp<ABpBinder> binder; member
165 ABpBinder::ABpBinder(const ::android::sp<::android::IBinder>& binder) in ABpBinder() argument
166 : AIBinder(nullptr /*clazz*/), BpRefBase(binder) { in ABpBinder()
167 CHECK(binder != nullptr); in ABpBinder()
182 value->binder = nullptr; in onLastStrongRef()
189 sp<AIBinder> ABpBinder::lookupOrCreateFromBinder(const ::android::sp<::android::IBinder>& binder) { in lookupOrCreateFromBinder() argument
190 if (binder == nullptr) { in lookupOrCreateFromBinder()
193 if (ABBinderTag::has(binder)) { in lookupOrCreateFromBinder()
194 return static_cast<ABBinder*>(binder.get()); in lookupOrCreateFromBinder()
202 static_cast<ABpBinderTag::Value*>(binder->findObject(ABpBinderTag::kId)); in lookupOrCreateFromBinder()
205 binder->attachObject(ABpBinderTag::kId, static_cast<void*>(value), nullptr /*cookie*/, in lookupOrCreateFromBinder()
209 sp<ABpBinder> ret = value->binder.promote(); in lookupOrCreateFromBinder()
211 ret = new ABpBinder(binder); in lookupOrCreateFromBinder()
212 value->binder = ret; in lookupOrCreateFromBinder()
219 wp<AIBinder> binder; member
221 AIBinder_Weak* AIBinder_Weak_new(AIBinder* binder) { in AIBinder_Weak_new() argument
222 if (binder == nullptr) { in AIBinder_Weak_new()
226 return new AIBinder_Weak{wp<AIBinder>(binder)}; in AIBinder_Weak_new()
236 sp<AIBinder> binder = weakBinder->binder.promote(); in AIBinder_Weak_promote() local
237 AIBinder_incStrong(binder.get()); in AIBinder_Weak_promote()
238 return binder.get(); in AIBinder_Weak_promote()
300 binder_status_t AIBinder_DeathRecipient::linkToDeath(sp<IBinder> binder, void* cookie) { in linkToDeath() argument
301 CHECK(binder != nullptr); in linkToDeath()
306 new TransferDeathRecipient(binder, cookie, this, mOnDied); in linkToDeath()
308 status_t status = binder->linkToDeath(recipient, cookie, 0 /*flags*/); in linkToDeath()
319 binder_status_t AIBinder_DeathRecipient::unlinkToDeath(sp<IBinder> binder, void* cookie) { in unlinkToDeath() argument
320 CHECK(binder != nullptr); in unlinkToDeath()
327 if (recipient->getCookie() == cookie && recipient->getWho() == binder) { in unlinkToDeath()
330 status_t status = binder->unlinkToDeath(recipient, cookie, 0 /*flags*/); in unlinkToDeath()
359 bool AIBinder_isRemote(const AIBinder* binder) { in AIBinder_isRemote() argument
360 if (binder == nullptr) { in AIBinder_isRemote()
364 return binder->isRemote(); in AIBinder_isRemote()
367 bool AIBinder_isAlive(const AIBinder* binder) { in AIBinder_isAlive() argument
368 if (binder == nullptr) { in AIBinder_isAlive()
372 return const_cast<AIBinder*>(binder)->getBinder()->isBinderAlive(); in AIBinder_isAlive()
375 binder_status_t AIBinder_ping(AIBinder* binder) { in AIBinder_ping() argument
376 if (binder == nullptr) { in AIBinder_ping()
380 return PruneStatusT(binder->getBinder()->pingBinder()); in AIBinder_ping()
383 binder_status_t AIBinder_dump(AIBinder* binder, int fd, const char** args, uint32_t numArgs) { in AIBinder_dump() argument
384 if (binder == nullptr) { in AIBinder_dump()
388 ABBinder* bBinder = binder->asABBinder(); in AIBinder_dump()
390 AIBinder_onDump onDump = binder->getClass()->onDump; in AIBinder_dump()
403 status_t status = binder->getBinder()->dump(fd, utf16Args); in AIBinder_dump()
407 binder_status_t AIBinder_linkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, in AIBinder_linkToDeath() argument
409 if (binder == nullptr || recipient == nullptr) { in AIBinder_linkToDeath()
415 return recipient->linkToDeath(binder->getBinder(), cookie); in AIBinder_linkToDeath()
418 binder_status_t AIBinder_unlinkToDeath(AIBinder* binder, AIBinder_DeathRecipient* recipient, in AIBinder_unlinkToDeath() argument
420 if (binder == nullptr || recipient == nullptr) { in AIBinder_unlinkToDeath()
426 return recipient->unlinkToDeath(binder->getBinder(), cookie); in AIBinder_unlinkToDeath()
437 void AIBinder_incStrong(AIBinder* binder) { in AIBinder_incStrong() argument
438 if (binder == nullptr) { in AIBinder_incStrong()
443 binder->incStrong(nullptr); in AIBinder_incStrong()
445 void AIBinder_decStrong(AIBinder* binder) { in AIBinder_decStrong() argument
446 if (binder == nullptr) { in AIBinder_decStrong()
451 binder->decStrong(nullptr); in AIBinder_decStrong()
453 int32_t AIBinder_debugGetRefCount(AIBinder* binder) { in AIBinder_debugGetRefCount() argument
454 if (binder == nullptr) { in AIBinder_debugGetRefCount()
459 return binder->getStrongCount(); in AIBinder_debugGetRefCount()
462 bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz) { in AIBinder_associateClass() argument
463 if (binder == nullptr) { in AIBinder_associateClass()
467 return binder->associateClass(clazz); in AIBinder_associateClass()
470 const AIBinder_Class* AIBinder_getClass(AIBinder* binder) { in AIBinder_getClass() argument
471 if (binder == nullptr) { in AIBinder_getClass()
475 return binder->getClass(); in AIBinder_getClass()
478 void* AIBinder_getUserData(AIBinder* binder) { in AIBinder_getUserData() argument
479 if (binder == nullptr) { in AIBinder_getUserData()
483 ABBinder* bBinder = binder->asABBinder(); in AIBinder_getUserData()
491 binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) { in AIBinder_prepareTransaction() argument
492 if (binder == nullptr || in == nullptr) { in AIBinder_prepareTransaction()
496 const AIBinder_Class* clazz = binder->getClass(); in AIBinder_prepareTransaction()
504 if (!binder->isRemote()) { in AIBinder_prepareTransaction()
505 LOG(WARNING) << "A binder object at " << binder in AIBinder_prepareTransaction()
511 *in = new AParcel(binder); in AIBinder_prepareTransaction()
528 binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code, AParcel** in, in AIBinder_transact() argument
550 if (binder == nullptr || *in == nullptr || out == nullptr) { in AIBinder_transact()
555 if ((*in)->getBinder() != binder) { in AIBinder_transact()
556 LOG(ERROR) << __func__ << ": parcel is associated with binder object " << binder in AIBinder_transact()
561 *out = new AParcel(binder); in AIBinder_transact()
563 status_t status = binder->getBinder()->transact(code, *(*in)->get(), (*out)->get(), flags); in AIBinder_transact()