forked from mirror/monocles_chat_clean
fix race condition when granting camera permission after request to switch to video
(cherry picked from commit 3f80a45997ad82dec9097a6556997a74f8a9ca01)
This commit is contained in:
parent
0830669e9d
commit
0f449bd057
1 changed files with 8 additions and 3 deletions
|
@ -312,10 +312,15 @@ public class RtpSessionActivity extends XmppActivity
|
|||
|
||||
private void acceptContentAdd() {
|
||||
try {
|
||||
requireRtpConnection()
|
||||
.acceptContentAdd(requireRtpConnection().getPendingContentAddition().summary);
|
||||
final ContentAddition pendingContentAddition =
|
||||
requireRtpConnection().getPendingContentAddition();
|
||||
if (pendingContentAddition == null) {
|
||||
Log.d(Config.LOGTAG, "content offer was gone after granting permission");
|
||||
return;
|
||||
}
|
||||
requireRtpConnection().acceptContentAdd(pendingContentAddition.summary);
|
||||
} catch (final IllegalStateException e) {
|
||||
Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, Strings.nullToEmpty(e.getMessage()), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue