Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Conversations
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Android-smartphones
Conversations
Commits
d7a8519a
Commit
d7a8519a
authored
4 years ago
by
Daniel Gultsch
Browse files
Options
Downloads
Patches
Plain Diff
do not continue to accept call if reinit() caused activity to finish
parent
cfb9368e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
+10
-6
10 additions, 6 deletions
...in/java/eu/siacs/conversations/ui/RtpSessionActivity.java
with
10 additions
and
6 deletions
src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java
+
10
−
6
View file @
d7a8519a
...
...
@@ -220,7 +220,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
final
String
sessionId
=
intent
.
getStringExtra
(
EXTRA_SESSION_ID
);
if
(
sessionId
!=
null
)
{
Log
.
d
(
Config
.
LOGTAG
,
"reinitializing from onNewIntent()"
);
initializeActivityWithRunningRtpSession
(
account
,
with
,
sessionId
);
if
(
initializeActivityWithRunningRtpSession
(
account
,
with
,
sessionId
))
{
return
;
}
if
(
ACTION_ACCEPT_CALL
.
equals
(
intent
.
getAction
()))
{
Log
.
d
(
Config
.
LOGTAG
,
"accepting call from onNewIntent()"
);
requestPermissionsAndAcceptCall
();
...
...
@@ -239,8 +241,9 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
final
Jid
with
=
Jid
.
of
(
intent
.
getStringExtra
(
EXTRA_WITH
));
final
String
sessionId
=
intent
.
getStringExtra
(
EXTRA_SESSION_ID
);
if
(
sessionId
!=
null
)
{
//TODO this should probably return true/false so we don’t continue to accept the call after calling finish()
initializeActivityWithRunningRtpSession
(
account
,
with
,
sessionId
);
if
(
initializeActivityWithRunningRtpSession
(
account
,
with
,
sessionId
))
{
return
;
}
if
(
ACTION_ACCEPT_CALL
.
equals
(
intent
.
getAction
()))
{
Log
.
d
(
Config
.
LOGTAG
,
"intent action was accept"
);
requestPermissionsAndAcceptCall
();
...
...
@@ -357,18 +360,18 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
}
}
private
void
initializeActivityWithRunningRtpSession
(
final
Account
account
,
Jid
with
,
String
sessionId
)
{
private
boolean
initializeActivityWithRunningRtpSession
(
final
Account
account
,
Jid
with
,
String
sessionId
)
{
final
WeakReference
<
JingleRtpConnection
>
reference
=
xmppConnectionService
.
getJingleConnectionManager
()
.
findJingleRtpConnection
(
account
,
with
,
sessionId
);
if
(
reference
==
null
||
reference
.
get
()
==
null
)
{
finish
();
return
;
return
true
;
}
this
.
rtpConnectionReference
=
reference
;
final
RtpEndUserState
currentState
=
requireRtpConnection
().
getEndUserState
();
if
(
currentState
==
RtpEndUserState
.
ENDED
)
{
finish
();
return
;
return
true
;
}
if
(
currentState
==
RtpEndUserState
.
INCOMING_CALL
)
{
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
...
...
@@ -381,6 +384,7 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
updateStateDisplay
(
currentState
);
updateButtonConfiguration
(
currentState
);
updateProfilePicture
(
currentState
);
return
false
;
}
private
void
reInitializeActivityWithRunningRapSession
(
final
Account
account
,
Jid
with
,
String
sessionId
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment