Fix issue with auto disconnect on empty conference.
Some carriers do not automatically disconnect a conference when the number
of participants drops to 0 and instead rely on the device to detect when
the CEP reports an empty conference and to then subsequently disconnect
the conference.
When the number of participants in a conference drops to 1, a device can
pretend that this is actually just a standalone call instead. There was a
logic error in the code that auto-disconnects the conference; it was
looking at "newParticipantCount", which is a count of the number of
children we are tracking for the conference call. This is a problem when
emulating a single party call as the "newParticipantCount" would be zero.
It also turns out that "testLocalDisconnectOnEmptySinglePartyConference"
had a bug where it was NOT actually using single party call emulation.
Hence the test that was specifically designed to test empty disconnect
was not even running.
This CL changes the logic used to perform the auto-disconnect to look
at the number of participants reported in the newest incoming CEP to
determine if an auto-disconnect is warranted, rather than relying on the
number of children this conference has. This ensures that if we're in
single-party emulation mode we aren't going to disconnect the conference.
Also fixed the unit test that had a bug.
Test: Added new unit tests for this particular case; ran existing unit test suite.
Fixes: 269569833
Change-Id: I16127f16f3a79ad4b42e16996a94b1b5533d62a7
2 files changed