I'm trying to use self-managed ConnectivityService to manage calls in-app - https://developer.android.com/guide/topics/connectivity/telecom/selfManaged
It is poorly documented and there are hardly any examples on the web, however, I've managed to make it work quite well except for one scenario - getting "onUnhold" callback in one case.
So, we are in a self-managed VoIP call on my phone (A), then we receive a regular GSM call from the second phone (B), and when I answer this on phone A, I get "onHold()" callback in my Connection object where I can put my VoIP call on hold.
Then, when I end this GSM call from phone A, I got "onUnhold()" callback from where I can set my VoIP call to be active again, BUT when the call will be ended by phone B, there is no callback whatsoever, nothing in my Connection object or even in my ConnectionService.
There is even an issue in the Android tracker that describes the exact same thing and it's really well documented, with examples on GitHub and all: https://issuetracker.google.com/issues/223757078 but Google claims that this is an expected behavior.
How can I "unHold" my VoIP connection when the remote user will end the call then? I've tried to listen PhoneStateListener/TelephonyCallback, but there I get states also from my own call and I can't distinguish if the state was from my or GSM call...