mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Updated gradle, fixed configuration migration
This commit is contained in:
parent
afc2017e1e
commit
b0a05b5905
6 changed files with 22 additions and 15 deletions
|
|
@ -124,11 +124,11 @@ android {
|
|||
dataBinding true
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
namespace 'org.linphone'
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,9 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
if (!addedDevices.isNullOrEmpty()) {
|
||||
Log.i("$TAG [${addedDevices.size}] new device(s) have been added:")
|
||||
for (device in addedDevices) {
|
||||
Log.i("$TAG Added device [${device.id}][${device.productName}][${device.type}]")
|
||||
Log.i(
|
||||
"$TAG Added device [${device.productName}] with ID [${device.id}] and type [${device.type}]"
|
||||
)
|
||||
}
|
||||
core.reloadSoundDevices()
|
||||
}
|
||||
|
|
@ -250,10 +252,12 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
core.videoCodecPriorityPolicy = CodecPriorityPolicy.Auto
|
||||
|
||||
val oldVersion = corePreferences.linphoneConfigurationVersion
|
||||
val newVersion = "6.0.0"
|
||||
if (oldVersion == "5.2") {
|
||||
Log.i("$TAG Migrating configuration from [$oldVersion] to [$newVersion]")
|
||||
if (oldVersion < CorePreferences.CURRENT_VERSION) {
|
||||
Log.i(
|
||||
"$TAG Migrating configuration from [$oldVersion] to [${CorePreferences.CURRENT_VERSION}]"
|
||||
)
|
||||
val policy = core.videoActivationPolicy.clone()
|
||||
policy.automaticallyInitiate = false
|
||||
policy.automaticallyAccept = true
|
||||
policy.automaticallyAcceptDirection = MediaDirection.RecvOnly
|
||||
core.videoActivationPolicy = policy
|
||||
|
|
@ -272,7 +276,7 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||
audioManager.registerAudioDeviceCallback(audioDeviceCallback, coreThread)
|
||||
|
||||
corePreferences.linphoneConfigurationVersion = newVersion
|
||||
corePreferences.linphoneConfigurationVersion = CorePreferences.CURRENT_VERSION
|
||||
|
||||
Log.i("$TAG Report Core created and started")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
|||
class CorePreferences @UiThread constructor(private val context: Context) {
|
||||
companion object {
|
||||
private const val TAG = "[Preferences]"
|
||||
|
||||
const val CURRENT_VERSION = 60000
|
||||
}
|
||||
|
||||
private var _config: Config? = null
|
||||
|
|
@ -127,10 +129,10 @@ class CorePreferences @UiThread constructor(private val context: Context) {
|
|||
}
|
||||
|
||||
@get:WorkerThread @set:WorkerThread
|
||||
var linphoneConfigurationVersion: String
|
||||
get() = config.getString("app", "linphonerc_version", "5.2")!!
|
||||
var linphoneConfigurationVersion: Int
|
||||
get() = config.getInt("app", "config_version", 50200)
|
||||
set(value) {
|
||||
config.setString("app", "linphonerc_version", value)
|
||||
config.setInt("app", "config_version", value)
|
||||
}
|
||||
|
||||
@get:WorkerThread
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ import org.linphone.core.ChatRoom
|
|||
import org.linphone.core.Core
|
||||
import org.linphone.core.CoreForegroundService
|
||||
import org.linphone.core.CoreListenerStub
|
||||
import org.linphone.core.CorePreferences
|
||||
import org.linphone.core.Friend
|
||||
import org.linphone.core.MediaDirection
|
||||
import org.linphone.core.tools.Log
|
||||
|
|
@ -421,7 +422,7 @@ class NotificationsManager @MainThread constructor(private val context: Context)
|
|||
Log.i("$TAG Core has been started")
|
||||
|
||||
val rcVersion = corePreferences.linphoneConfigurationVersion
|
||||
val clearPreviousChannels = rcVersion == "5.2"
|
||||
val clearPreviousChannels = rcVersion < CorePreferences.CURRENT_VERSION
|
||||
coreContext.postOnMainThread {
|
||||
createChannels(clearPreviousChannels)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ class ConferenceViewModel {
|
|||
Log.i(
|
||||
"$TAG Configuring conference with subject [$confSubject] from call [${call.callLog.callId}]"
|
||||
)
|
||||
sipUri.postValue(conference.conferenceAddress.asStringUriOnly())
|
||||
sipUri.postValue(conference.conferenceAddress?.asStringUriOnly())
|
||||
subject.postValue(confSubject)
|
||||
|
||||
if (conference.state == Conference.State.Created) {
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ buildscript {
|
|||
}
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.3.1' apply false
|
||||
id 'com.android.library' version '8.3.1' apply false
|
||||
id 'com.android.application' version '8.3.2' apply false
|
||||
id 'com.android.library' version '8.3.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.9.0-RC' apply false
|
||||
id 'com.google.gms.google-services' version '4.4.0' apply false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue