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

Commit ac0cab0f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Synchronize on mImsPhone to avoid NPE"

parents 48dc9587 4a7b8ec0
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
@@ -418,9 +418,11 @@ public class ImsPhoneConnection extends Connection implements
            } else {
                Rlog.d(LOG_TAG, "onDisconnect: no parent");
            }
            synchronized (this) {
                if (mImsCall != null) mImsCall.close();
                mImsCall = null;
            }
        }
        releaseWakeLock();
        return changed;
    }
@@ -616,7 +618,7 @@ public class ImsPhoneConnection extends Connection implements
    }

    @Override
    public boolean isMultiparty() {
    public synchronized boolean isMultiparty() {
        return mImsCall != null && mImsCall.isMultiparty();
    }

@@ -629,11 +631,8 @@ public class ImsPhoneConnection extends Connection implements
     *      {@code false} otherwise.
     */
    @Override
    public boolean isConferenceHost() {
        if (mImsCall == null) {
            return false;
        }
        return mImsCall.isConferenceHost();
    public synchronized boolean isConferenceHost() {
        return mImsCall != null && mImsCall.isConferenceHost();
    }

    @Override
@@ -641,11 +640,11 @@ public class ImsPhoneConnection extends Connection implements
        return !isConferenceHost();
    }

    public ImsCall getImsCall() {
    public synchronized ImsCall getImsCall() {
        return mImsCall;
    }

    public void setImsCall(ImsCall imsCall) {
    public synchronized void setImsCall(ImsCall imsCall) {
        mImsCall = imsCall;
    }

@@ -1060,11 +1059,13 @@ public class ImsPhoneConnection extends Connection implements
        sb.append(" address: ");
        sb.append(Rlog.pii(LOG_TAG, getAddress()));
        sb.append(" ImsCall: ");
        synchronized (this) {
            if (mImsCall == null) {
                sb.append("null");
            } else {
                sb.append(mImsCall);
            }
        }
        sb.append("]");
        return sb.toString();
    }