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

Commit d2c9b944 authored by Steven Moreland's avatar Steven Moreland
Browse files

Binder: distinguish two 'mList'

These classes are mixed together in code, so use
a different name to refer to one of these variables.

Bug: 405737267
Test: N/A
Change-Id: I759f4bc91ec2dcb909cabf5210574b4ceb16eaa5
parent a9dde9df
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -585,7 +585,7 @@ class JavaRecipient;

template <typename T>
class RecipientList : public RefBase {
    List<sp<JavaRecipient<T> > > mList;
    List<sp<JavaRecipient<T>>> mInternalList;
    Mutex mLock;

public:
@@ -864,8 +864,8 @@ RecipientList<T>::~RecipientList() {
    // RecipientList recipients hold a weak reference to this object. If
    // this list is destroyed first, it means that unlinkToDeath is not
    // called. Warn them.
    if (mList.size() > 0) {
        for (auto iter = mList.begin(); iter != mList.end(); iter++) {
    if (mInternalList.size() > 0) {
        for (auto iter = mInternalList.begin(); iter != mInternalList.end(); iter++) {
            (*iter)->warnIfStillLive();
        }
    }
@@ -877,18 +877,18 @@ void RecipientList<T>::add(const sp<JavaRecipient<T> >& recipient) {

    LOG_DEATH_FREEZE("%s RecipientList @ %p : add JavaRecipient %p", logPrefix<T>(), this,
                     recipient.get());
    mList.push_back(recipient);
    mInternalList.push_back(recipient);
}

template <typename T>
void RecipientList<T>::remove(const sp<JavaRecipient<T> >& recipient) {
    AutoMutex _l(mLock);

    for (auto iter = mList.begin(); iter != mList.end(); iter++) {
    for (auto iter = mInternalList.begin(); iter != mInternalList.end(); iter++) {
        if (*iter == recipient) {
            LOG_DEATH_FREEZE("%s RecipientList @ %p : remove JavaRecipient %p", logPrefix<T>(),
                             this, recipient.get());
            mList.erase(iter);
            mInternalList.erase(iter);
            return;
        }
    }
@@ -898,7 +898,7 @@ template <typename T>
sp<JavaRecipient<T> > RecipientList<T>::find(jobject recipient) {
    AutoMutex _l(mLock);

    for (auto iter = mList.begin(); iter != mList.end(); iter++) {
    for (auto iter = mInternalList.begin(); iter != mInternalList.end(); iter++) {
        if ((*iter)->matches(recipient)) {
            return *iter;
        }