Fixed kotlin boolean properties changes in Java wrapper + allow CPIM messages in basic chat rooms for sip.linphone.org accounts
This commit is contained in:
parent
2729916ce4
commit
5605e37121
32 changed files with 82 additions and 75 deletions
|
@ -16,6 +16,7 @@
|
|||
<entry name="realm" overwrite="true">sip.linphone.org</entry>
|
||||
<entry name="conference_factory_uri" overwrite="true">sip:conference-factory@sip.linphone.org</entry>
|
||||
<entry name="push_notification_allowed" overwrite="true">1</entry>
|
||||
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
|
||||
</section>
|
||||
<section name="nat_policy_default_values">
|
||||
<entry name="stun_server" overwrite="true">stun.linphone.org</entry>
|
||||
|
|
|
@ -76,14 +76,14 @@ class QrCodeFragment : GenericFragment<AssistantQrCodeFragmentBinding>() {
|
|||
super.onResume()
|
||||
|
||||
coreContext.core.nativePreviewWindowId = binding.qrCodeCaptureTexture
|
||||
coreContext.core.enableQrcodeVideoPreview(true)
|
||||
coreContext.core.enableVideoPreview(true)
|
||||
coreContext.core.isQrcodeVideoPreviewEnabled = true
|
||||
coreContext.core.isVideoPreviewEnabled = true
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
coreContext.core.nativePreviewWindowId = null
|
||||
coreContext.core.enableQrcodeVideoPreview(false)
|
||||
coreContext.core.enableVideoPreview(false)
|
||||
coreContext.core.isQrcodeVideoPreviewEnabled = false
|
||||
coreContext.core.isVideoPreviewEnabled = false
|
||||
|
||||
super.onPause()
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ class IncomingCallActivity : GenericActivity() {
|
|||
permissionsRequiredList.add(Manifest.permission.RECORD_AUDIO)
|
||||
}
|
||||
|
||||
if (viewModel.call.currentParams.videoEnabled() && !PermissionHelper.get().hasCameraPermission()) {
|
||||
if (viewModel.call.currentParams.isVideoEnabled && !PermissionHelper.get().hasCameraPermission()) {
|
||||
Log.i("[Incoming Call Activity] Asking for CAMERA permission")
|
||||
permissionsRequiredList.add(Manifest.permission.CAMERA)
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ class OutgoingCallActivity : ProximitySensorActivity() {
|
|||
Log.i("[Outgoing Call Activity] Asking for RECORD_AUDIO permission")
|
||||
permissionsRequiredList.add(Manifest.permission.RECORD_AUDIO)
|
||||
}
|
||||
if (viewModel.call.currentParams.videoEnabled() && !PermissionHelper.get().hasCameraPermission()) {
|
||||
if (viewModel.call.currentParams.isVideoEnabled && !PermissionHelper.get().hasCameraPermission()) {
|
||||
Log.i("[Outgoing Call Activity] Asking for CAMERA permission")
|
||||
permissionsRequiredList.add(Manifest.permission.CAMERA)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ class CallStatisticsData(val call: Call) : GenericContactData(call.remoteAddress
|
|||
private val listener = object : CoreListenerStub() {
|
||||
override fun onCallStatsUpdated(core: Core, call: Call, stats: CallStats) {
|
||||
if (call == this@CallStatisticsData.call) {
|
||||
isVideoEnabled.value = call.currentParams.videoEnabled()
|
||||
isVideoEnabled.value = call.currentParams.isVideoEnabled
|
||||
updateCallStats(stats)
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class CallStatisticsData(val call: Call) : GenericContactData(call.remoteAddress
|
|||
|
||||
initCallStats()
|
||||
|
||||
val videoEnabled = call.currentParams.videoEnabled()
|
||||
val videoEnabled = call.currentParams.isVideoEnabled
|
||||
isVideoEnabled.value = videoEnabled
|
||||
|
||||
isExpanded.value = coreContext.core.currentCall == call
|
||||
|
|
|
@ -126,8 +126,8 @@ class ControlsFragment : GenericFragment<CallControlsFragmentBinding>() {
|
|||
if (call.state == Call.State.StreamsRunning) {
|
||||
dialog?.dismiss()
|
||||
} else if (call.state == Call.State.UpdatedByRemote) {
|
||||
if (coreContext.core.videoCaptureEnabled() || coreContext.core.videoDisplayEnabled()) {
|
||||
if (call.currentParams.videoEnabled() != call.remoteParams?.videoEnabled()) {
|
||||
if (coreContext.core.isVideoCaptureEnabled || coreContext.core.isVideoDisplayEnabled) {
|
||||
if (call.currentParams.isVideoEnabled != call.remoteParams?.isVideoEnabled) {
|
||||
showCallVideoUpdateDialog(call)
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -139,7 +139,7 @@ open class CallViewModel(val call: Call) : GenericContactViewModel(call.remoteAd
|
|||
}
|
||||
|
||||
fun takeScreenshot() {
|
||||
if (call.currentParams.videoEnabled()) {
|
||||
if (call.currentParams.isVideoEnabled) {
|
||||
val fileName = System.currentTimeMillis().toString() + ".jpeg"
|
||||
call.takeVideoSnapshot(FileUtils.getFileStoragePath(fileName).absolutePath)
|
||||
}
|
||||
|
|
|
@ -75,11 +75,11 @@ class CallsViewModel : ViewModel() {
|
|||
} else if (call.state == Call.State.UpdatedByRemote) {
|
||||
// If the correspondent asks to turn on video while audio call,
|
||||
// defer update until user has chosen whether to accept it or not
|
||||
val remoteVideo = call.remoteParams?.videoEnabled() ?: false
|
||||
val localVideo = call.currentParams.videoEnabled()
|
||||
val remoteVideo = call.remoteParams?.isVideoEnabled ?: false
|
||||
val localVideo = call.currentParams.isVideoEnabled
|
||||
val autoAccept = call.core.videoActivationPolicy.automaticallyAccept
|
||||
if (remoteVideo && !localVideo && !autoAccept) {
|
||||
if (coreContext.core.videoCaptureEnabled() || coreContext.core.videoDisplayEnabled()) {
|
||||
if (coreContext.core.isVideoCaptureEnabled || coreContext.core.isVideoDisplayEnabled) {
|
||||
call.deferUpdate()
|
||||
callUpdateEvent.value = Event(call)
|
||||
} else {
|
||||
|
|
|
@ -253,8 +253,8 @@ class ControlsViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
somethingClickedEvent.value = Event(true)
|
||||
val micEnabled = coreContext.core.micEnabled()
|
||||
coreContext.core.enableMic(!micEnabled)
|
||||
val micEnabled = coreContext.core.isMicEnabled
|
||||
coreContext.core.isMicEnabled = !micEnabled
|
||||
updateMuteMicState()
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ class ControlsViewModel : ViewModel() {
|
|||
|
||||
isVideoUpdateInProgress.value = true
|
||||
val params = core.createCallParams(currentCall)
|
||||
params?.enableVideo(!currentCall.currentParams.videoEnabled())
|
||||
params?.isVideoEnabled = !currentCall.currentParams.isVideoEnabled
|
||||
currentCall.update(params)
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ class ControlsViewModel : ViewModel() {
|
|||
somethingClickedEvent.value = Event(true)
|
||||
|
||||
val core = coreContext.core
|
||||
val currentCallVideoEnabled = core.currentCall?.currentParams?.videoEnabled() ?: false
|
||||
val currentCallVideoEnabled = core.currentCall?.currentParams?.isVideoEnabled ?: false
|
||||
|
||||
val params = core.createConferenceParams()
|
||||
params.isVideoEnabled = currentCallVideoEnabled
|
||||
|
@ -419,7 +419,7 @@ class ControlsViewModel : ViewModel() {
|
|||
}
|
||||
|
||||
fun updateMuteMicState() {
|
||||
isMicrophoneMuted.value = !PermissionHelper.get().hasRecordAudioPermission() || !coreContext.core.micEnabled()
|
||||
isMicrophoneMuted.value = !PermissionHelper.get().hasRecordAudioPermission() || !coreContext.core.isMicEnabled
|
||||
isMuteMicrophoneEnabled.value = coreContext.core.currentCall != null || coreContext.core.conference?.isIn == true
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ class ControlsViewModel : ViewModel() {
|
|||
private fun updateVideoAvailable() {
|
||||
val core = coreContext.core
|
||||
val currentCall = core.currentCall
|
||||
isVideoAvailable.value = (core.videoCaptureEnabled() || core.videoPreviewEnabled()) &&
|
||||
isVideoAvailable.value = (core.isVideoCaptureEnabled || core.isVideoPreviewEnabled) &&
|
||||
(
|
||||
(currentCall != null && !currentCall.mediaInProgress()) ||
|
||||
core.conference?.isIn == true
|
||||
|
|
|
@ -60,10 +60,10 @@ class IncomingCallViewModel(call: Call) : CallViewModel(call) {
|
|||
coreContext.core.addListener(listener)
|
||||
|
||||
screenLocked.value = false
|
||||
inviteWithVideo.value = call.remoteParams?.videoEnabled() == true && coreContext.core.videoActivationPolicy.automaticallyAccept
|
||||
inviteWithVideo.value = call.remoteParams?.isVideoEnabled == true && coreContext.core.videoActivationPolicy.automaticallyAccept
|
||||
earlyMediaVideoEnabled.value = corePreferences.acceptEarlyMedia &&
|
||||
call.state == Call.State.IncomingEarlyMedia &&
|
||||
call.currentParams.videoEnabled()
|
||||
call.currentParams.isVideoEnabled
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
|
|
|
@ -173,7 +173,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
|
||||
Compatibility.setLocusIdInContentCaptureSession(binding.root, chatRoom)
|
||||
|
||||
isSecure = chatRoom.currentParams.encryptionEnabled()
|
||||
isSecure = chatRoom.currentParams.isEncryptionEnabled
|
||||
|
||||
viewModel = ViewModelProvider(
|
||||
this,
|
||||
|
@ -391,7 +391,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
|||
|
||||
if (corePreferences.useInAppFileViewerForNonEncryptedFiles || content.isFileEncrypted) {
|
||||
val preventScreenshots =
|
||||
viewModel.chatRoom.currentParams.encryptionEnabled()
|
||||
viewModel.chatRoom.currentParams.isEncryptionEnabled
|
||||
when {
|
||||
FileUtils.isExtensionImage(path) -> navigateToImageFileViewer(
|
||||
preventScreenshots
|
||||
|
|
|
@ -54,7 +54,7 @@ class DevicesFragment : SecureFragment<ChatRoomDevicesFragmentBinding>() {
|
|||
return
|
||||
}
|
||||
|
||||
isSecure = chatRoom.currentParams.encryptionEnabled()
|
||||
isSecure = chatRoom.currentParams.isEncryptionEnabled
|
||||
|
||||
listViewModel = ViewModelProvider(
|
||||
this,
|
||||
|
|
|
@ -61,7 +61,7 @@ class GroupInfoFragment : SecureFragment<ChatRoomGroupInfoFragmentBinding>() {
|
|||
}
|
||||
|
||||
val chatRoom: ChatRoom? = sharedViewModel.selectedGroupChatRoom.value
|
||||
isSecure = chatRoom?.currentParams?.encryptionEnabled() ?: false
|
||||
isSecure = chatRoom?.currentParams?.isEncryptionEnabled ?: false
|
||||
|
||||
viewModel = ViewModelProvider(
|
||||
this,
|
||||
|
|
|
@ -61,7 +61,7 @@ class ImdnFragment : SecureFragment<ChatRoomImdnFragmentBinding>() {
|
|||
return
|
||||
}
|
||||
|
||||
isSecure = chatRoom.currentParams.encryptionEnabled()
|
||||
isSecure = chatRoom.currentParams.isEncryptionEnabled
|
||||
|
||||
if (arguments != null) {
|
||||
val messageId = arguments?.getString("MessageId")
|
||||
|
|
|
@ -160,9 +160,9 @@ class ChatRoomCreationViewModel : ErrorReportingViewModel() {
|
|||
val encrypted = isEncrypted.value == true
|
||||
val params: ChatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
||||
params.backend = ChatRoomBackend.Basic
|
||||
params.enableGroup(false)
|
||||
params.isGroupEnabled = false
|
||||
if (encrypted) {
|
||||
params.enableEncryption(true)
|
||||
params.isEncryptionEnabled = true
|
||||
params.backend = ChatRoomBackend.FlexisipChat
|
||||
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode)
|
||||
ChatRoomEphemeralMode.DeviceManaged
|
||||
|
|
|
@ -203,7 +203,7 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
|
|||
}
|
||||
|
||||
override fun onEphemeralEvent(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||
ephemeralEnabled.value = chatRoom.ephemeralEnabled()
|
||||
ephemeralEnabled.value = chatRoom.isEphemeralEnabled
|
||||
}
|
||||
|
||||
override fun onParticipantAdminStatusChanged(chatRoom: ChatRoom, eventLog: EventLog) {
|
||||
|
@ -222,7 +222,7 @@ class ChatRoomViewModel(val chatRoom: ChatRoom) : ViewModel(), ContactDataInterf
|
|||
subject.value = chatRoom.subject
|
||||
updateSecurityIcon()
|
||||
meAdmin.value = chatRoom.me?.isAdmin ?: false
|
||||
ephemeralEnabled.value = chatRoom.ephemeralEnabled()
|
||||
ephemeralEnabled.value = chatRoom.isEphemeralEnabled
|
||||
|
||||
contactLookup()
|
||||
updateParticipants()
|
||||
|
|
|
@ -50,8 +50,8 @@ class EphemeralViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
|||
}
|
||||
|
||||
init {
|
||||
Log.i("[Ephemeral Messages] Current lifetime is ${chatRoom.ephemeralLifetime}, ephemeral enabled? ${chatRoom.ephemeralEnabled()}")
|
||||
currentSelectedDuration = if (chatRoom.ephemeralEnabled()) chatRoom.ephemeralLifetime else 0
|
||||
Log.i("[Ephemeral Messages] Current lifetime is ${chatRoom.ephemeralLifetime}, ephemeral enabled? ${chatRoom.isEphemeralEnabled}")
|
||||
currentSelectedDuration = if (chatRoom.isEphemeralEnabled) chatRoom.ephemeralLifetime else 0
|
||||
computeEphemeralDurationValues()
|
||||
}
|
||||
|
||||
|
@ -65,13 +65,13 @@ class EphemeralViewModel(private val chatRoom: ChatRoom) : ViewModel() {
|
|||
Log.i("[Ephemeral Messages] Configured lifetime for ephemeral messages was already $currentSelectedDuration")
|
||||
}
|
||||
|
||||
if (!chatRoom.ephemeralEnabled()) {
|
||||
if (!chatRoom.isEphemeralEnabled) {
|
||||
Log.i("[Ephemeral Messages] Ephemeral messages were disabled, enable them")
|
||||
chatRoom.enableEphemeral(true)
|
||||
chatRoom.isEphemeralEnabled = true
|
||||
}
|
||||
} else if (chatRoom.ephemeralEnabled()) {
|
||||
} else if (chatRoom.isEphemeralEnabled) {
|
||||
Log.i("[Ephemeral Messages] Ephemeral messages were enabled, disable them")
|
||||
chatRoom.enableEphemeral(false)
|
||||
chatRoom.isEphemeralEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ class GroupInfoViewModel(val chatRoom: ChatRoom?) : ErrorReportingViewModel() {
|
|||
fun createChatRoom() {
|
||||
waitForChatRoomCreation.value = true
|
||||
val params: ChatRoomParams = coreContext.core.createDefaultChatRoomParams()
|
||||
params.enableEncryption(isEncrypted.value == true)
|
||||
params.enableGroup(true)
|
||||
params.isEncryptionEnabled = isEncrypted.value == true
|
||||
params.isGroupEnabled = true
|
||||
if (isEncrypted.value == true) {
|
||||
params.ephemeralMode = if (corePreferences.useEphemeralPerDeviceMode)
|
||||
ChatRoomEphemeralMode.DeviceManaged
|
||||
|
|
|
@ -160,7 +160,7 @@ class DialerViewModel : LogsUploadViewModel() {
|
|||
fun updateShowVideoPreview() {
|
||||
val videoPreview = corePreferences.videoPreview
|
||||
showPreview.value = videoPreview
|
||||
coreContext.core.enableVideoPreview(videoPreview)
|
||||
coreContext.core.isVideoPreviewEnabled = videoPreview
|
||||
}
|
||||
|
||||
fun eraseLastChar() {
|
||||
|
|
|
@ -315,7 +315,7 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
val iceListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
val params = account.params.clone()
|
||||
params.natPolicy?.enableIce(newValue)
|
||||
params.natPolicy?.isIceEnabled = newValue
|
||||
account.params = params
|
||||
}
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
proxy.value = params.serverAddress?.asStringUriOnly()
|
||||
outboundProxy.value = params.isOutboundProxyEnabled
|
||||
stunServer.value = params.natPolicy?.stunServer
|
||||
ice.value = params.natPolicy?.iceEnabled()
|
||||
ice.value = params.natPolicy?.isIceEnabled
|
||||
avpf.value = params.avpfMode == AVPFMode.Enabled
|
||||
avpfRrInterval.value = params.avpfRrInterval
|
||||
expires.value = params.expires
|
||||
|
|
|
@ -41,7 +41,7 @@ class AudioSettingsViewModel : GenericSettingsViewModel() {
|
|||
|
||||
val echoCancellationListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableEchoCancellation(newValue)
|
||||
core.isEchoCancellationEnabled = newValue
|
||||
}
|
||||
}
|
||||
val echoCancellation = MutableLiveData<Boolean>()
|
||||
|
@ -81,7 +81,7 @@ class AudioSettingsViewModel : GenericSettingsViewModel() {
|
|||
|
||||
val adaptiveRateControlListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableAdaptiveRateControl(newValue)
|
||||
core.isAdaptiveRateControlEnabled = newValue
|
||||
}
|
||||
}
|
||||
val adaptiveRateControl = MutableLiveData<Boolean>()
|
||||
|
@ -153,9 +153,9 @@ class AudioSettingsViewModel : GenericSettingsViewModel() {
|
|||
val audioCodecs = MutableLiveData<ArrayList<ViewDataBinding>>()
|
||||
|
||||
init {
|
||||
echoCancellation.value = core.echoCancellationEnabled()
|
||||
adaptiveRateControl.value = core.adaptiveRateControlEnabled()
|
||||
echoCalibration.value = if (core.echoCancellationEnabled()) {
|
||||
echoCancellation.value = core.isEchoCancellationEnabled
|
||||
adaptiveRateControl.value = core.isAdaptiveRateControlEnabled
|
||||
echoCalibration.value = if (core.isEchoCancellationEnabled) {
|
||||
prefs.getString(R.string.audio_settings_echo_cancellation_calibration_value).format(prefs.echoCancellerCalibration)
|
||||
} else {
|
||||
prefs.getString(R.string.audio_settings_echo_canceller_calibration_summary)
|
||||
|
|
|
@ -33,7 +33,7 @@ class ContactsSettingsViewModel : GenericSettingsViewModel() {
|
|||
|
||||
val friendListSubscribeListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableFriendListSubscription(newValue)
|
||||
core.isFriendListSubscriptionEnabled = newValue
|
||||
}
|
||||
}
|
||||
val friendListSubscribe = MutableLiveData<Boolean>()
|
||||
|
|
|
@ -26,14 +26,14 @@ import org.linphone.activities.main.settings.SettingListenerStub
|
|||
class NetworkSettingsViewModel : GenericSettingsViewModel() {
|
||||
val wifiOnlyListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableWifiOnly(newValue)
|
||||
core.isWifiOnlyEnabled = newValue
|
||||
}
|
||||
}
|
||||
val wifiOnly = MutableLiveData<Boolean>()
|
||||
|
||||
val allowIpv6Listener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableIpv6(newValue)
|
||||
core.isIpv6Enabled = newValue
|
||||
}
|
||||
}
|
||||
val allowIpv6 = MutableLiveData<Boolean>()
|
||||
|
@ -59,8 +59,8 @@ class NetworkSettingsViewModel : GenericSettingsViewModel() {
|
|||
val sipPort = MutableLiveData<Int>()
|
||||
|
||||
init {
|
||||
wifiOnly.value = core.wifiOnlyEnabled()
|
||||
allowIpv6.value = core.ipv6Enabled()
|
||||
wifiOnly.value = core.isWifiOnlyEnabled
|
||||
allowIpv6.value = core.isIpv6Enabled
|
||||
randomPorts.value = getTransportPort() == -1
|
||||
sipPort.value = getTransportPort()
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class TunnelSettingsViewModel : GenericSettingsViewModel() {
|
|||
val useDualModeListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
val tunnel = core.tunnel
|
||||
tunnel?.enableDualMode(newValue)
|
||||
tunnel?.isDualModeEnabled = newValue
|
||||
}
|
||||
}
|
||||
val useDualMode = MutableLiveData<Boolean>()
|
||||
|
@ -96,7 +96,7 @@ class TunnelSettingsViewModel : GenericSettingsViewModel() {
|
|||
|
||||
hostnameUrl.value = config.host
|
||||
port.value = config.port
|
||||
useDualMode.value = tunnel?.dualModeEnabled()
|
||||
useDualMode.value = tunnel?.isDualModeEnabled
|
||||
hostnameUrl2.value = config.host2
|
||||
port2.value = config.port2
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ import org.linphone.core.tools.Log
|
|||
class VideoSettingsViewModel : GenericSettingsViewModel() {
|
||||
val enableVideoListener = object : SettingListenerStub() {
|
||||
override fun onBoolValueChanged(newValue: Boolean) {
|
||||
core.enableVideoCapture(newValue)
|
||||
core.enableVideoDisplay(newValue)
|
||||
core.isVideoCaptureEnabled = newValue
|
||||
core.isVideoDisplayEnabled = newValue
|
||||
if (!newValue) {
|
||||
tabletPreview.value = false
|
||||
initiateCall.value = false
|
||||
|
@ -115,7 +115,7 @@ class VideoSettingsViewModel : GenericSettingsViewModel() {
|
|||
val videoCodecs = MutableLiveData<ArrayList<ViewDataBinding>>()
|
||||
|
||||
init {
|
||||
enableVideo.value = core.videoEnabled() && core.videoSupported()
|
||||
enableVideo.value = core.isVideoEnabled && core.videoSupported()
|
||||
tabletPreview.value = prefs.videoPreview
|
||||
isTablet.value = coreContext.context.resources.getBoolean(R.bool.isTablet)
|
||||
initiateCall.value = core.videoActivationPolicy.automaticallyInitiate
|
||||
|
|
|
@ -206,7 +206,7 @@ class Api26Compatibility {
|
|||
}
|
||||
Call.State.OutgoingRinging, Call.State.OutgoingProgress, Call.State.OutgoingInit, Call.State.OutgoingEarlyMedia -> {
|
||||
stringResourceId = R.string.call_notification_outgoing
|
||||
iconResourceId = if (call.params.videoEnabled()) {
|
||||
iconResourceId = if (call.params.isVideoEnabled) {
|
||||
R.drawable.topbar_videocall_notification
|
||||
} else {
|
||||
R.drawable.topbar_call_notification
|
||||
|
@ -214,7 +214,7 @@ class Api26Compatibility {
|
|||
}
|
||||
else -> {
|
||||
stringResourceId = R.string.call_notification_active
|
||||
iconResourceId = if (call.currentParams.videoEnabled()) {
|
||||
iconResourceId = if (call.currentParams.isVideoEnabled) {
|
||||
R.drawable.topbar_videocall_notification
|
||||
} else {
|
||||
R.drawable.topbar_call_notification
|
||||
|
|
|
@ -96,7 +96,7 @@ class Api31Compatibility {
|
|||
val roundPicture = ImageUtils.getRoundBitmapFromUri(context, pictureUri)
|
||||
val displayName = contact?.fullName ?: LinphoneUtils.getDisplayName(call.remoteAddress)
|
||||
|
||||
val isVideo = call.currentParams.videoEnabled()
|
||||
val isVideo = call.currentParams.isVideoEnabled
|
||||
val iconResourceId: Int = when (call.state) {
|
||||
Call.State.Paused, Call.State.Pausing, Call.State.PausedByRemote -> {
|
||||
R.drawable.topbar_call_paused_notification
|
||||
|
|
|
@ -192,7 +192,7 @@ class NativeContact(val nativeId: String, private val lookupKey: String? = null)
|
|||
var created = false
|
||||
if (friend == null) {
|
||||
val friend = coreContext.core.createFriend()
|
||||
friend.enableSubscribes(false)
|
||||
friend.isSubscribesEnabled = false
|
||||
friend.incSubscribePolicy = SubscribePolicy.SPDeny
|
||||
friend.refKey = nativeId
|
||||
friend.userData = this
|
||||
|
|
|
@ -189,7 +189,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
}
|
||||
|
||||
if (corePreferences.routeAudioToSpeakerWhenVideoIsEnabled && call.currentParams.videoEnabled()) {
|
||||
if (corePreferences.routeAudioToSpeakerWhenVideoIsEnabled && call.currentParams.isVideoEnabled) {
|
||||
// Do not turn speaker on when video is enabled if headset or bluetooth is used
|
||||
if (!AudioRouteUtils.isHeadsetAudioRouteAvailable() && !AudioRouteUtils.isBluetoothAudioRouteCurrentlyUsed(
|
||||
call
|
||||
|
@ -380,6 +380,12 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
core.limeX3DhServerUrl = url
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure we allow CPIM messages in basic chat rooms
|
||||
val newParams = account.params.clone()
|
||||
newParams.isCpimInBasicChatRoomEnabled = true
|
||||
account.params = newParams
|
||||
Log.i("[Context] CPIM allowed in basic chat rooms for account ${newParams.identityAddress?.asStringUriOnly()}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -455,11 +461,11 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
val params = core.createCallParams(call)
|
||||
|
||||
if (accept) {
|
||||
params?.enableVideo(true)
|
||||
core.enableVideoCapture(true)
|
||||
core.enableVideoDisplay(true)
|
||||
params?.isVideoEnabled = true
|
||||
core.isVideoCaptureEnabled = true
|
||||
core.isVideoDisplayEnabled = true
|
||||
} else {
|
||||
params?.enableVideo(false)
|
||||
params?.isVideoEnabled = false
|
||||
}
|
||||
|
||||
call.acceptUpdate(params)
|
||||
|
@ -471,7 +477,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
params?.recordFile = LinphoneUtils.getRecordingFilePathForAddress(call.remoteAddress)
|
||||
if (LinphoneUtils.checkIfNetworkHasLowBandwidth(context)) {
|
||||
Log.w("[Context] Enabling low bandwidth mode!")
|
||||
params?.enableLowBandwidth(true)
|
||||
params?.isLowBandwidthEnabled = true
|
||||
}
|
||||
call.acceptWithParams(params)
|
||||
}
|
||||
|
@ -548,7 +554,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
if (LinphoneUtils.checkIfNetworkHasLowBandwidth(context)) {
|
||||
Log.w("[Context] Enabling low bandwidth mode!")
|
||||
params.enableLowBandwidth(true)
|
||||
params.isLowBandwidthEnabled = true
|
||||
}
|
||||
params.recordFile = LinphoneUtils.getRecordingFilePathForAddress(address)
|
||||
|
||||
|
@ -562,7 +568,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
}
|
||||
|
||||
if (corePreferences.sendEarlyMedia) {
|
||||
params.enableEarlyMediaSending(true)
|
||||
params.isEarlyMediaSendingEnabled = true
|
||||
}
|
||||
|
||||
val call = core.inviteAddressWithParams(address, params)
|
||||
|
@ -601,7 +607,7 @@ class CoreContext(val context: Context, coreConfig: Config) {
|
|||
return if (conference != null && conference.isIn) {
|
||||
conference.currentParams.isVideoEnabled
|
||||
} else {
|
||||
core.currentCall?.currentParams?.videoEnabled() ?: false
|
||||
core.currentCall?.currentParams?.isVideoEnabled ?: false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class LinphoneUtils {
|
|||
|
||||
fun isLimeAvailable(): Boolean {
|
||||
val core = coreContext.core
|
||||
return core.limeX3DhAvailable() && core.limeX3DhEnabled() &&
|
||||
return core.limeX3DhAvailable() && core.isLimeX3DhEnabled &&
|
||||
core.limeX3DhServerUrl != null &&
|
||||
core.defaultAccount?.params?.conferenceFactoryUri != null
|
||||
}
|
||||
|
@ -81,11 +81,11 @@ class LinphoneUtils {
|
|||
val defaultAccount = core.defaultAccount
|
||||
|
||||
val params = core.createDefaultChatRoomParams()
|
||||
params.enableGroup(false)
|
||||
params.isGroupEnabled = false
|
||||
params.backend = ChatRoomBackend.Basic
|
||||
if (isSecured) {
|
||||
params.subject = AppUtils.getString(R.string.chat_room_dummy_subject)
|
||||
params.enableEncryption(true)
|
||||
params.isEncryptionEnabled = true
|
||||
params.backend = ChatRoomBackend.FlexisipChat
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
android:src="@drawable/chat_send_message" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{viewModel.chatRoom.ephemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:visibility="@{viewModel.chatRoom.isEphemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled && !chatSendingViewModel.isReadOnly}"
|
||||
android:contentDescription="@string/content_description_ephemeral_message"
|
||||
android:clickable="false"
|
||||
|
|
|
@ -258,7 +258,7 @@
|
|||
android:src="@drawable/chat_send_message" />
|
||||
|
||||
<ImageView
|
||||
android:visibility="@{viewModel.chatRoom.ephemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:visibility="@{viewModel.chatRoom.isEphemeralEnabled() ? View.VISIBLE : View.GONE, default=gone}"
|
||||
android:enabled="@{chatSendingViewModel.sendMessageEnabled}"
|
||||
android:contentDescription="@string/content_description_ephemeral_message"
|
||||
android:clickable="false"
|
||||
|
|
Loading…
Reference in a new issue