Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-android
Commits
7f05c768
Commit
7f05c768
authored
Sep 24, 2021
by
Adrien Béraud
Browse files
call: cleanup
Change-Id: I9e155b55e94844bdc32be5a4cbfdc60b3907c565
parent
a1fca572
Changes
4
Hide whitespace changes
Inline
Side-by-side
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.kt
View file @
7f05c768
...
...
@@ -671,7 +671,6 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
}
override
fun
onPrepareOptionsMenu
(
menu
:
Menu
)
{
Log
.
w
(
CallPresenter
.
TAG
,
"DEBUG onPrepareOptionsMenu"
)
presenter
.
prepareOptionMenu
()
}
...
...
@@ -700,7 +699,6 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
}
override
fun
displayContactBubble
(
display
:
Boolean
)
{
Log
.
w
(
TAG
,
"DEBUG fn displayContactBubble -> $display"
)
binding
?.
apply
{
contactBubbleLayout
.
visibility
=
if
(
display
)
View
.
VISIBLE
else
View
.
GONE
}
...
...
@@ -929,7 +927,6 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
isSpeakerOn
:
Boolean
,
hasMultipleCamera
:
Boolean
,
canDial
:
Boolean
,
showPluginBtn
:
Boolean
,
onGoingCall
:
Boolean
,
hasActiveVideo
:
Boolean
)
{
Log
.
w
(
CallPresenter
.
TAG
,
"DEBUG initMenu hasActiveVideo: $hasActiveVideo; hasMultipleCamera: $hasMultipleCamera"
)
binding
?.
apply
{
callSpeakerBtn
.
visibility
=
if
(
hasActiveVideo
)
View
.
GONE
else
View
.
VISIBLE
callCameraSwitchBtn
.
isChecked
=
!
hasActiveVideo
...
...
@@ -949,7 +946,7 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
callRefuseBtn
.
visibility
=
View
.
GONE
callControlGroup
.
visibility
=
View
.
VISIBLE
callHangupBtn
.
visibility
=
View
.
VISIBLE
contactBubbleLayout
.
visibility
=
View
.
VISIBLE
contactBubbleLayout
.
visibility
=
View
.
VISIBLE
callMicBtn
.
isChecked
=
isMuted
}
requireActivity
().
invalidateOptionsMenu
()
...
...
@@ -1013,12 +1010,10 @@ class CallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView,
val
oldH
=
params
.
height
if
(
videoRatio
>=
screenRatio
)
{
params
.
width
=
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
params
.
height
=
(
videoHeight
*
rootView
.
width
.
toDouble
()
/
videoWidth
.
toDouble
()).
toInt
()
params
.
height
=
(
videoHeight
*
rootView
.
width
.
toDouble
()
/
videoWidth
.
toDouble
()).
toInt
()
}
else
{
params
.
height
=
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
params
.
width
=
(
videoWidth
*
rootView
.
height
.
toDouble
()
/
videoHeight
.
toDouble
()).
toInt
()
params
.
width
=
(
videoWidth
*
rootView
.
height
.
toDouble
()
/
videoHeight
.
toDouble
()).
toInt
()
}
if
(
oldW
!=
params
.
width
||
oldH
!=
params
.
height
)
{
binding
!!
.
videoSurface
.
layoutParams
=
params
...
...
ring-android/libjamiclient/src/main/kotlin/net/jami/call/CallPresenter.kt
View file @
7f05c768
...
...
@@ -189,7 +189,6 @@ class CallPresenter @Inject constructor(
}
fun
prepareOptionMenu
()
{
Log
.
w
(
TAG
,
"DEBUG prepareOptionMenu"
)
val
isSpeakerOn
:
Boolean
=
mHardwareService
.
isSpeakerphoneOn
//boolean hasContact = mSipCall != null && null != mSipCall.getContact() && mSipCall.getContact().isUnknown();
val
conference
=
mConference
...
...
@@ -356,7 +355,7 @@ class CallPresenter @Inject constructor(
private
fun
confUpdate
(
call
:
Conference
)
{
mConference
=
call
Log
.
w
(
TAG
,
"
DEBUG
confUpdate "
+
call
.
id
+
" "
+
call
.
state
)
Log
.
w
(
TAG
,
"confUpdate "
+
call
.
id
+
" "
+
call
.
state
)
val
status
=
call
.
state
if
(
status
===
CallStatus
.
HOLD
)
{
if
(
call
.
isSimpleCall
)
mCallService
.
unhold
(
call
.
id
)
else
JamiService
.
addMainParticipant
(
call
.
id
)
...
...
@@ -364,10 +363,8 @@ class CallPresenter @Inject constructor(
val
hasVideo
=
call
.
hasVideo
()
val
hasActiveVideo
=
call
.
hasActiveVideo
()
videoIsMuted
=
!
hasActiveVideo
val
view
=
view
?:
return
view
.
updateMenu
()
if
(
call
.
isOnGoing
)
{
mOnGoingCall
=
true
view
.
initNormalStateDisplay
(
isMicrophoneMuted
)
...
...
@@ -436,11 +433,10 @@ class CallPresenter @Inject constructor(
}
private
fun
onVideoEvent
(
event
:
VideoEvent
)
{
Log
.
w
(
TAG
,
"
DEBUG
onVideoEvent $event"
)
Log
.
w
(
TAG
,
"onVideoEvent $event"
)
val
view
=
view
?:
return
val
conference
=
mConference
if
(
event
.
callId
==
null
)
{
Log
.
w
(
TAG
,
"DEBUG onVideoEvent $event; callId == null; event.start: ${event.start}, event.started: ${event.started}"
)
if
(
event
.
start
)
{
view
.
displayLocalVideo
(
true
)
}
...
...
@@ -450,7 +446,6 @@ class CallPresenter @Inject constructor(
view
.
resetPreviewVideoSize
(
previewWidth
,
previewHeight
,
event
.
rot
)
}
}
else
if
(
conference
!=
null
&&
conference
.
id
==
event
.
callId
)
{
Log
.
w
(
TAG
,
"DEBUG onVideoEvent $event; onference != null && conference.id: ${conference.id} == event.callId: ${event.callId}; event.start: ${event.start}, event.started: ${event.started}"
)
if
(
event
.
start
)
{
view
.
displayPeerVideo
(
true
)
}
else
if
(
event
.
started
)
{
...
...
ring-android/libjamiclient/src/main/kotlin/net/jami/services/CallService.kt
View file @
7f05c768
...
...
@@ -521,7 +521,7 @@ class CallService(
val
conversation
=
account
.
getByUri
(
contact
.
conversationUri
.
blockingFirst
())
call
.
contact
=
contact
call
.
conversation
=
conversation
Log
.
w
(
TAG
,
"parseCallState "
+
contact
+
" "
+
contact
.
conversationUri
.
blockingFirst
()
+
" "
+
conversation
+
" "
+
conversation
!!
.
participant
)
Log
.
w
(
TAG
,
"parseCallState "
+
contact
+
" "
+
contact
.
conversationUri
.
blockingFirst
()
+
" "
+
conversation
+
" "
+
conversation
?
.
participant
)
currentCalls
[
callId
]
=
call
updateConnectionCount
()
}
...
...
ring-android/libjamiclient/src/main/kotlin/net/jami/services/ConversationFacade.kt
View file @
7f05c768
...
...
@@ -493,7 +493,7 @@ class ConversationFacade(
val
account
=
mAccountService
.
getAccount
(
call
.
account
!!
)
?:
return
val
contact
=
call
.
contact
val
conversationId
=
call
.
conversationId
Log
.
w
(
TAG
,
"CallStateChange "
+
call
.
daemonIdString
+
" conversationId:"
+
conversationId
)
Log
.
w
(
TAG
,
"CallStateChange "
+
call
.
daemonIdString
+
" conversationId:"
+
conversationId
+
" contact:"
+
contact
+
" "
+
contact
?.
conversationUri
?.
blockingFirst
()
)
val
conversation
=
if
(
conversationId
==
null
)
if
(
contact
==
null
)
null
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment