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

Commit 8c961ac8 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Check for the disable add call extra in canAddCall" into nyc-mr1-dev

parents 4c9140c8 140c8403
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -1470,8 +1470,6 @@ public class CallsManager extends Call.ListenerBase
        }

        int count = 0;
        boolean hasVideoCall = false;
        boolean disableAddCallDuringVideoCall = false;
        for (Call call : mCalls) {
            if (call.isEmergencyCall()) {
                // We never support add call if one of the calls is an emergency call.
@@ -1479,11 +1477,11 @@ public class CallsManager extends Call.ListenerBase
            } else if (call.getParentCall() == null) {
                count++;
            }
            hasVideoCall |= call.getVideoState() != VideoProfile.STATE_AUDIO_ONLY;
            Bundle extras = call.getExtras();
            if (extras != null) {
                disableAddCallDuringVideoCall |= extras.getBoolean(
                        Connection.EXTRA_DISABLE_ADD_CALL_DURING_VIDEO_CALL, false);
                if (extras.getBoolean(Connection.EXTRA_DISABLE_ADD_CALL, false)) {
                    return false;
                }
            }

            // We do not check states for canAddCall. We treat disconnected calls the same
@@ -1496,10 +1494,6 @@ public class CallsManager extends Call.ListenerBase
            }
        }

        if (hasVideoCall && disableAddCallDuringVideoCall) {
            return false;
        }

        return true;
    }