Пример #1
0
        virtual void binderDied(const wp<IBinder>& who) {
            uint32_t size = mItem.mConsumerList.size();
            GUIEXT_LOGI("consumer died, list size=%d, binder ptr=[%p]", size, who.unsafe_get());

            if (size == 0) {
                GUIEXT_LOGV("consumer died [%p], pool size is zero", who.unsafe_get());
            } else {
                for (uint32_t i = 0 ; i < size ; i++) {
                    GUIEXT_LOGV("   [c] compare index[%d], p=[%p], usage=%d, type=%d, id=%d", i,
                        mItem.mConsumerList[i]->token.get(),
                        mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                    if (mItem.mConsumerList[i]->token.get() == who.unsafe_get()) {
                        GUIEXT_LOGW("   [c] found index[%d], p=[%p], usage=%d, type=%d, id=%d", i,
                            mItem.mConsumerList[i]->token.get(),
                            mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);

                        mItem.release(mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                        mItem.mConsumerList[i]->token = NULL;
                        mItem.mConsumerList[i]->pid = -1;
                        mItem.mConsumerList[i]->observer = NULL;
                    }
                }

                for (uint32_t i = 0; i < GUI_EXT_USAGE_MAX; i++) {
                    mItem.mIsDisconnected[i] = true;
                }
                bool isDisconnect = true;
                for (uint32_t i = 0 ; i < size ; i++) {
                    if (mItem.mConsumerList[i]->token != NULL) {
                        mItem.mIsDisconnected[mItem.mConsumerList[i]->usage] = false;
                        isDisconnect = false;
                        GUIEXT_LOGV("   [c] still have consumer, idx=%d, token=%p, pid=%d, usage=%d, type=%d, id=%d", i,
                            mItem.mConsumerList[i]->token.get(), mItem.mConsumerList[i]->pid,
                            mItem.mConsumerList[i]->usage, mItem.mConsumerList[i]->type, mItem.mConsumerList[i]->idx);
                    }
                }

                if (isDisconnect) {
                    mItem.mConsumerDeathListener->binderDied(mItem.mId);
                }

                GUIEXT_LOGV("consumer died done");
            }
        }
Пример #2
0
        virtual void binderDied(const wp<IBinder>& who) {
            uint32_t size = mPool.mPoolList.size();
            GUIEXT_LOGI("producer died, pool size=%d, binder ptr=[%p]", size, who.unsafe_get());

            if (size == 0) {
                GUIEXT_LOGV("producer died [%p], pool size is zero", who.unsafe_get());
            } else {
                for (uint32_t i = size-1 ;; i--) {
                    GUIEXT_LOGV("   [p] compare index[%d], p=[%p]", i, mPool.mPoolList[i]->mProducerToken.get());
                    if (mPool.mPoolList[i]->mProducerToken.get() == who.unsafe_get()) {
                        GUIEXT_LOGW("   [p] found index[%d], p=[%p], id=%d", i, mPool.mPoolList[i]->mProducerToken.get(), mPool.mPoolList[i]->mId);
                        mPool.mPoolList[i]->mProducerToken = NULL;
                        mPool.mPoolList[i]->mProducerPid = -1;
                        mPool.removePoolItem(mPool.mPoolList[i]->mId);
                    }

                    if (i == 0)
                        break;
                }

                GUIEXT_LOGV("producer died done");
            }
        }
Пример #3
0
void HeapCache::free_heap(const wp<IBinder>& binder)
{
    sp<IMemoryHeap> rel;
    {
        Mutex::Autolock _l(mHeapCacheLock);
        ssize_t i = mHeapCache.indexOfKey(binder);
        if (i>=0) {
            heap_info_t& info(mHeapCache.editValueAt(i));
            int32_t c = android_atomic_dec(&info.count);
            if (c == 1) {
                ALOGD_IF(VERBOSE,
                        "removing binder=%p, heap=%p, size=%d, fd=%d, count=%d",
                        binder.unsafe_get(), info.heap.get(),
                        static_cast<BpMemoryHeap*>(info.heap.get())->mSize,
                        static_cast<BpMemoryHeap*>(info.heap.get())->mHeapId,
                        info.count);
                rel = mHeapCache.valueAt(i).heap;
                mHeapCache.removeItemsAt(i);
            }
        } else {
            ALOGE("free_heap binder=%p not found!!!", binder.unsafe_get());
        }
    }
}
Пример #4
0
// IBinder::DeathRecipient
void        ChatSession::binderDied(const wp<IBinder>& who){
    LOGV("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(), IPCThreadState::self()->getCallingPid());
    Mutex::Autolock _l(m_csAdviseLock);
/*
    IBinder *binder = who.unsafe_get();

    if (binder != NULL) {
        int index = mNotificationClients.indexOf(binder);
        if (index >= 0) {
            LOGV("Removing notification client %p", binder);
            mNotificationClients.removeAt(index);
        }
    }
*/    
	pid_t callerPid = IPCThreadState::self()->getCallingPid();
     	LOGV("Removing notification client %d", callerPid);
	 m_Listeners.removeItem(callerPid);

}
 virtual void binderDied(const wp<IBinder>& who) {
     ALOGW("ComposerService remote (surfaceflinger) died [%p]",
           who.unsafe_get());
     mComposerService.composerServiceDied();
 }
Пример #6
0
 virtual void binderDied(const wp<IBinder>& who) {
     ALOGW("sensorservice died [%p]", who.unsafe_get());
     mSensorManger.sensorManagerDied();
 }
void AudioPolicyService::binderDied(const wp<IBinder>& who) {
    LOGW("binderDied() %p, tid %d, calling tid %d", who.unsafe_get(), gettid(), IPCThreadState::self()->getCallingPid());
}