make sure intent is only set to retracted if something was retracted. fixes #3826

This commit is contained in:
Daniel Gultsch 2020-07-10 16:10:40 +02:00
parent 7ff56a5087
commit bab9dd4893

View file

@ -308,6 +308,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
return; return;
} }
final Account account = extractAccount(intent); final Account account = extractAccount(intent);
final String action = intent.getAction();
final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH)); final Jid with = Jid.ofEscaped(intent.getStringExtra(EXTRA_WITH));
final String sessionId = intent.getStringExtra(EXTRA_SESSION_ID); final String sessionId = intent.getStringExtra(EXTRA_SESSION_ID);
if (sessionId != null) { if (sessionId != null) {
@ -320,6 +321,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
requestPermissionsAndAcceptCall(); requestPermissionsAndAcceptCall();
resetIntent(intent.getExtras()); resetIntent(intent.getExtras());
} }
} else if (asList(ACTION_MAKE_VIDEO_CALL, ACTION_MAKE_VOICE_CALL).contains(action)) {
proposeJingleRtpSession(account, with, actionToMedia(action));
binding.with.setText(account.getRoster().getContact(with).getDisplayName());
} else { } else {
throw new IllegalStateException("received onNewIntent without sessionId"); throw new IllegalStateException("received onNewIntent without sessionId");
} }
@ -437,7 +441,11 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
return; return;
} }
} }
retractSessionProposal(); //TODO apparently this method is not getting called on Android 10 when using the task switcher
final boolean emptyReference = rtpConnectionReference == null || rtpConnectionReference.get() == null;
if (emptyReference && xmppConnectionService != null) {
retractSessionProposal();
}
} }
@RequiresApi(api = Build.VERSION_CODES.O) @RequiresApi(api = Build.VERSION_CODES.O)