Code review comment for lp:~boiko/telephony-service/preserve_call_status

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

> I think there might be a case where this logic fails.
> Correct me if I am wrong, but consider the case where we are on a call and
> switch to another app, then while dialer-app is in background the remote party
> hangs up. When you bring the dialer-app to foreground again and register the
> observer, onCallChannelAvailable() wont be called as there are no active calls
> at the moment, so we will end up in an inconsistent state.
>
>
> 139 void CallManager::onCallChannelAvailable(Tp::CallChannelPtr channel)
> 140 {
> 141 + // if this is the first call after re-registering the observer,
> clear the data

At first I also thought this case was not covered, but it is: the Tp::CallChannel has already introspected the DBus object for the call, so even after the observer is unregistered, the correct signals from the channel are still emitted.
So even if dialer-app is in background (sigstopped), when it comes back to life it is going to receive the notifications for the existing calls even before registering the observer again.

« Back to merge proposal