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

Commit 23eb57a6 authored by Sanket Agarwal's avatar Sanket Agarwal
Browse files

Synchronize onCallAdded with onCallRemoved.

In cases of very quick call and hangup we can sometimes get call
disconnected (and onCallRemoved) status chagned before we get
onCallAdded. This is because onCallAdded currently does not hold the
lock.

Bug: b/28969591
Change-Id: Ic2f291dff9dd61c54b1ada3b21c61e24bca65ebc
parent 62cc9e6a
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ public final class InCallController extends CallsManagerListenerBase {
            @Override
            public void onServiceConnected(ComponentName name, IBinder service) {
                Log.startSession("ICSBC.oSC");
                synchronized (mLock) {
                    try {
                        Log.d(this, "onServiceConnected: %s %b %b", name, mIsBound, mIsConnected);
                        mIsBound = true;
@@ -95,10 +96,12 @@ public final class InCallController extends CallsManagerListenerBase {
                        Log.endSession();
                    }
                }
            }

            @Override
            public void onServiceDisconnected(ComponentName name) {
                Log.startSession("ICSBC.oSD");
                synchronized (mLock) {
                    try {
                        Log.d(this, "onDisconnected: %s", name);
                        mIsBound = false;
@@ -107,6 +110,7 @@ public final class InCallController extends CallsManagerListenerBase {
                        Log.endSession();
                    }
                }
            }
        };

        private final ComponentName mComponentName;