@@ -467,8 +467,7 @@ public class RtpSessionActivity extends XmppActivity
}
}
- private void putProximityWakeLockInProperState(- final CallIntegration.AudioDevice audioDevice) {
+ private void putProximityWakeLockInProperState(final CallIntegration.AudioDevice audioDevice) {
if (audioDevice == CallIntegration.AudioDevice.EARPIECE) {
acquireProximityWakeLock();
} else {
@@ -583,7 +582,8 @@ public class RtpSessionActivity extends XmppActivity
.getJingleConnectionManager()
.proposeJingleRtpSession(account, with, media);
} else {
- throw new IllegalStateException("We should not be initializing direct calls from the RtpSessionActivity. Go through CallIntegrationConnectionService.placeCall instead!");
+ throw new IllegalStateException(
+ "We should not be initializing direct calls from the RtpSessionActivity. Go through CallIntegrationConnectionService.placeCall instead!");
}
putScreenInCallMode(media);
}
@@ -1312,7 +1312,7 @@ public class RtpSessionActivity extends XmppActivity
final Set<Media> media = actionToMedia(lastAction == null ? action : lastAction);
this.rtpConnectionReference = null;
Log.d(Config.LOGTAG, "attempting retry with " + with.toEscapedString());
- CallIntegrationConnectionService.placeCall(this,account,with,media);
+ CallIntegrationConnectionService.placeCall(this, account, with, media);
}
private void exit(final View view) {
@@ -636,17 +636,16 @@ public class JingleConnectionManager extends AbstractConnectionManager {
}
public boolean fireJingleRtpConnectionStateUpdates() {
- boolean firedUpdates = false;
for (final AbstractJingleConnection connection : this.connections.values()) {
if (connection instanceof JingleRtpConnection jingleRtpConnection) {
if (jingleRtpConnection.isTerminated()) {
continue;
}
jingleRtpConnection.fireStateUpdate();
- firedUpdates = true;
+ return true;
}
}
- return firedUpdates;
+ return false;
}
public void retractSessionProposal(final Account account, final Jid with) {
@@ -745,8 +744,16 @@ public class JingleConnectionManager extends AbstractConnectionManager {
synchronized (this.rtpSessionProposals) {
for (Map.Entry<RtpSessionProposal, DeviceDiscoveryState> entry :
this.rtpSessionProposals.entrySet()) {
+ final var state = entry.getValue();
final RtpSessionProposal proposal = entry.getKey();
if (proposal.account == account && with.asBareJid().equals(proposal.with)) {
+ // CallIntegrationConnectionService starts RtpSessionActivity with ACTION_VIEW
+ // and an EXTRA_LAST_REPORTED_STATE of DISCOVERING devices. however due to
+ // possible race conditions the state might have already moved on so we are going
+ // to update the UI
+ final RtpEndUserState endUserState = state.toEndUserState();
+ mXmppConnectionService.notifyJingleRtpConnectionUpdate(
+ account, proposal.with, proposal.sessionId, endUserState);
return true;
}
}