Merge pull request #6195 from vector-im/feature/bma/jitsi_5_1_0

Upgrade Jitsi SDK to 6.2.2
This commit is contained in:
ganfra 2022-11-02 12:10:25 +01:00 committed by GitHub
commit d954c9eae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 174 additions and 24 deletions

View file

@ -96,9 +96,9 @@ allprojects {
}
// Jitsi repo
maven {
url "https://github.com/vector-im/jitsi_libre_maven/raw/main/android-sdk-5.0.2"
url "https://github.com/vector-im/jitsi_libre_maven/raw/main/android-sdk-6.2.2"
// Note: to test Jitsi release you can use a local file like this:
// url "file:///Users/bmarty/workspaces/jitsi_libre_maven/android-sdk-3.10.0"
// url "file:///Users/bmarty/workspaces/jitsi_libre_maven/android-sdk-6.2.2"
content {
groups.jitsi.regex.each { includeGroupByRegex it }
groups.jitsi.group.each { includeGroup it }

1
changelog.d/6195.misc Normal file
View file

@ -0,0 +1 @@
Upgrade Jitsi SDK to 6.2.2 and WebRtc to 1.106.1-jitsi-12039821.

View file

@ -93,4 +93,4 @@ url "https://github.com/vector-im/jitsi_libre_maven/raw/master/android-sdk-3.10.
- Build the project and perform the sanity tests again.
- Update the file `/CHANGES.md` to notify about the library upgrade, and create a regular PR for project Element Android.
- Create a PR for project Element Android and add a changelog file `<PR_NUMBER>.misc` to notify about the library upgrade.

View file

@ -25,12 +25,8 @@ export LIBRE_BUILD=true
cd jitsi-meet
# This is commit after version 2.2.2, which does not compile
# git checkout 5a934c071a5cbe64de275a25d0ed62d8193cdd03
# Changelog: https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-MOBILE-SDKS.md
git checkout android-sdk-5.0.2
# Get the latest version from the changelog: https://github.com/jitsi/jitsi-meet-release-notes/blob/master/CHANGELOG-MOBILE-SDKS.md
git checkout android-sdk-6.2.2
echo
echo "##################################################"

View file

@ -4,6 +4,7 @@
<application>
<activity android:name="im.vector.app.features.debug.TestLinkifyActivity" />
<activity android:name="im.vector.app.features.debug.DebugPermissionActivity" />
<activity android:name="im.vector.app.features.debug.jitsi.DebugJitsiActivity" />
<activity android:name="im.vector.app.features.debug.analytics.DebugAnalyticsActivity" />
<activity android:name="im.vector.app.features.debug.settings.DebugPrivateSettingsActivity" />
<activity android:name="im.vector.app.features.debug.sas.DebugSasEmojiActivity" />

View file

@ -35,6 +35,7 @@ import im.vector.app.core.utils.registerForPermissionsResult
import im.vector.app.core.utils.toast
import im.vector.app.features.debug.analytics.DebugAnalyticsActivity
import im.vector.app.features.debug.features.DebugFeaturesSettingsActivity
import im.vector.app.features.debug.jitsi.DebugJitsiActivity
import im.vector.app.features.debug.leak.DebugMemoryLeaksActivity
import im.vector.app.features.debug.sas.DebugSasEmojiActivity
import im.vector.app.features.debug.settings.DebugPrivateSettingsActivity
@ -121,6 +122,9 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
views.debugPermission.setOnClickListener {
startActivity(Intent(this, DebugPermissionActivity::class.java))
}
views.debugJitsi.setOnClickListener {
startActivity(Intent(this, DebugJitsiActivity::class.java))
}
}
private fun openPrivateSettings() {
@ -175,7 +179,7 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
.setContentText("Content")
// No effect because it's a group summary notif
.setNumber(33)
.setSmallIcon(R.drawable.ic_status_bar)
.setSmallIcon(R.drawable.ic_notification)
// This provocate the badge issue: no badge for group notification
.setGroup("GroupKey")
.setGroupSummary(true)
@ -208,7 +212,7 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
// For shortcut on long press on launcher icon
.setBadgeIconType(NotificationCompat.BADGE_ICON_NONE)
.setStyle(messagingStyle1)
.setSmallIcon(R.drawable.ic_status_bar)
.setSmallIcon(R.drawable.ic_notification)
.setGroup("GroupKey")
.build()
)
@ -220,7 +224,7 @@ class DebugMenuActivity : VectorBaseActivity<ActivityDebugMenuBinding>() {
.setContentTitle("Title 2")
.setContentText("Content 2")
.setStyle(messagingStyle2)
.setSmallIcon(R.drawable.ic_status_bar)
.setSmallIcon(R.drawable.ic_notification)
.setGroup("GroupKey")
.build()
)

View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 2022 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package im.vector.app.features.debug.jitsi
import android.annotation.SuppressLint
import dagger.hilt.android.AndroidEntryPoint
import im.vector.app.core.platform.VectorBaseActivity
import im.vector.application.databinding.ActivityDebugJitsiBinding
import org.jitsi.meet.sdk.JitsiMeet
@AndroidEntryPoint
class DebugJitsiActivity : VectorBaseActivity<ActivityDebugJitsiBinding>() {
override fun getBinding() = ActivityDebugJitsiBinding.inflate(layoutInflater)
override fun getCoordinatorLayout() = views.coordinatorLayout
@SuppressLint("SetTextI18n")
override fun initUiAndData() {
val isCrashReportingDisabled = JitsiMeet.isCrashReportingDisabled(this)
views.status.text = "Jitsi crash reporting is disabled: $isCrashReportingDisabled"
views.splash.setOnClickListener {
JitsiMeet.showSplashScreen(this)
}
views.dev.setOnClickListener {
JitsiMeet.showDevOptions()
}
}
}

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="im.vector.app.features.debug.jitsi.DebugJitsiActivity"
tools:ignore="HardcodedText">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@drawable/linear_divider"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="@dimen/layout_horizontal_margin"
android:showDividers="middle">
<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Status" />
<Button
android:id="@+id/splash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Splash"
android:textAllCaps="false" />
<Button
android:id="@+id/dev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Dev options"
android:textAllCaps="false" />
</LinearLayout>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -186,6 +186,12 @@
android:layout_height="wrap_content"
android:text="Permissions" />
<Button
android:id="@+id/debug_jitsi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Jitsi" />
</LinearLayout>
</ScrollView>

View file

@ -246,10 +246,10 @@ dependencies {
// WebRTC
// org.webrtc:google-webrtc is for development purposes only
// implementation 'org.webrtc:google-webrtc:1.0.+'
implementation('com.facebook.react:react-native-webrtc:1.94.2-jitsi-10227332@aar')
implementation('com.facebook.react:react-native-webrtc:1.106.1-jitsi-12039821@aar')
// Jitsi
api('org.jitsi.react:jitsi-meet-sdk:5.0.2') {
// Note: version is 6.2.0, but built from the tag `android-sdk-6.2.2`.
api('org.jitsi.react:jitsi-meet-sdk:6.2.0') {
exclude group: 'com.google.firebase'
exclude group: 'com.google.android.gms'
exclude group: 'com.android.installreferrer'
@ -305,6 +305,11 @@ dependencies {
exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-debug"
}
// Fix issue with Jitsi. Inspired from https://github.com/android/android-test/issues/861#issuecomment-872067868
// Error was lots of `Duplicate class org.checkerframework.common.reflection.qual.MethodVal found in modules jetified-checker-3.1 (org.checkerframework:checker:3.1.1) and jetified-checker-qual-3.12.0 (org.checkerframework:checker-qual:3.12.0)
//noinspection GradleDependency Cannot use latest 3.15.0 since it required min API 26.
implementation "org.checkerframework:checker:3.11.0"
androidTestImplementation libs.androidx.testCore
androidTestImplementation libs.androidx.testRunner
androidTestImplementation libs.androidx.testRules

View file

@ -42,7 +42,7 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Jitsi SDK is now API23+ -->
<uses-sdk tools:overrideLibrary="org.jitsi.meet.sdk,com.oney.WebRTCModule,com.learnium.RNDeviceInfo,com.reactnativecommunity.asyncstorage,com.ocetnik.timer,com.calendarevents,com.reactnativecommunity.netinfo,com.kevinresol.react_native_default_preference,com.rnimmersive,com.corbt.keepawake,com.BV.LinearGradient,com.horcrux.svg,com.oblador.performance,com.reactnativecommunity.slider,com.brentvatne.react,com.reactnativecommunity.clipboard,com.swmansion.gesturehandler.react,org.linusu,org.reactnative.maskedview,com.reactnativepagerview,com.swmansion.reanimated,com.th3rdwave.safeareacontext,com.swmansion.rnscreens,org.devio.rn.splashscreen,com.reactnativecommunity.webview" />
<uses-sdk tools:overrideLibrary="org.jitsi.meet.sdk,com.oney.WebRTCModule,com.learnium.RNDeviceInfo,com.reactnativecommunity.asyncstorage,com.ocetnik.timer,com.calendarevents,com.reactnativecommunity.netinfo,com.kevinresol.react_native_default_preference,com.rnimmersive,com.corbt.keepawake,com.BV.LinearGradient,com.horcrux.svg,com.oblador.performance,com.reactnativecommunity.slider,com.brentvatne.react,com.reactnativecommunity.clipboard,com.swmansion.gesturehandler.react,org.linusu,org.reactnative.maskedview,com.reactnativepagerview,com.swmansion.reanimated,com.th3rdwave.safeareacontext,com.swmansion.rnscreens,org.devio.rn.splashscreen,com.reactnativecommunity.webview,org.wonday.orientation" />
<!-- Adding CAMERA permission prevents Chromebooks to see the application on the PlayStore -->
<!-- Tell that the Camera is not mandatory to install the application -->

View file

@ -24,6 +24,7 @@ import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.facebook.react.bridge.JavaOnlyMap
import im.vector.app.config.Config
import org.jitsi.meet.sdk.BroadcastEmitter
import org.jitsi.meet.sdk.BroadcastEvent
import org.jitsi.meet.sdk.JitsiMeet
@ -35,6 +36,7 @@ sealed class ConferenceEvent(open val data: Map<String, Any>) {
data class Terminated(override val data: Map<String, Any>) : ConferenceEvent(data)
data class WillJoin(override val data: Map<String, Any>) : ConferenceEvent(data)
data class Joined(override val data: Map<String, Any>) : ConferenceEvent(data)
object ReadyToClose : ConferenceEvent(emptyMap())
fun extractConferenceUrl(): String? {
return data[CONFERENCE_URL_DATA_KEY] as? String
@ -84,14 +86,24 @@ class ConferenceEventObserver(
private fun onBroadcastReceived(intent: Intent) {
val event = BroadcastEvent(intent)
safeLog("onBroadcastReceived: Event received (type ${event.type})", event.data)
val conferenceEvent = when (event.type) {
BroadcastEvent.Type.CONFERENCE_JOINED -> ConferenceEvent.Joined(event.data)
BroadcastEvent.Type.CONFERENCE_TERMINATED -> ConferenceEvent.Terminated(event.data)
BroadcastEvent.Type.CONFERENCE_WILL_JOIN -> ConferenceEvent.WillJoin(event.data)
BroadcastEvent.Type.READY_TO_CLOSE -> ConferenceEvent.ReadyToClose
else -> null
}
if (conferenceEvent != null) {
onBroadcastEvent(conferenceEvent)
}
}
private fun safeLog(message: String, sensitiveData: Any?) {
if (Config.LOW_PRIVACY_LOG_ENABLE) {
Timber.v("$message: $sensitiveData")
} else {
Timber.v(message)
}
}
}

View file

@ -19,6 +19,7 @@ package im.vector.app.features.call.conference
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
@ -28,6 +29,7 @@ import androidx.core.app.PictureInPictureModeChangedInfo
import androidx.core.util.Consumer
import androidx.core.view.isVisible
import androidx.lifecycle.Lifecycle
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.airbnb.mvrx.Fail
import com.airbnb.mvrx.Mavericks
import com.airbnb.mvrx.Success
@ -40,10 +42,12 @@ import im.vector.app.core.platform.VectorBaseActivity
import im.vector.app.databinding.ActivityJitsiBinding
import im.vector.lib.core.utils.compat.getParcelableExtraCompat
import kotlinx.parcelize.Parcelize
import org.jitsi.meet.sdk.BroadcastIntentHelper
import org.jitsi.meet.sdk.JitsiMeet
import org.jitsi.meet.sdk.JitsiMeetActivityDelegate
import org.jitsi.meet.sdk.JitsiMeetActivityInterface
import org.jitsi.meet.sdk.JitsiMeetConferenceOptions
import org.jitsi.meet.sdk.JitsiMeetOngoingConferenceService
import org.jitsi.meet.sdk.JitsiMeetView
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.util.JsonDict
@ -66,6 +70,13 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
private val jitsiViewModel: JitsiCallViewModel by viewModel()
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
val intent = Intent("onConfigurationChanged")
intent.putExtra("newConfig", newConfig)
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
addOnPictureInPictureModeChangedListener(pictureInPictureModeChangedInfoConsumer)
@ -105,17 +116,26 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
override fun onDestroy() {
val currentConf = JitsiMeet.getCurrentConference()
jitsiMeetView?.leave()
handleLeaveConference()
jitsiMeetView?.dispose()
// Fake emitting CONFERENCE_TERMINATED event when currentConf is not null (probably when closing the PiP screen).
if (currentConf != null) {
ConferenceEventEmitter(this).emitConferenceEnded()
}
JitsiMeetOngoingConferenceService.abort(this)
JitsiMeetActivityDelegate.onHostDestroy(this)
removeOnPictureInPictureModeChangedListener(pictureInPictureModeChangedInfoConsumer)
super.onDestroy()
}
// Activity lifecycle methods
//
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
@Suppress("DEPRECATION")
super.onActivityResult(requestCode, resultCode, data)
JitsiMeetActivityDelegate.onActivityResult(this, requestCode, resultCode, data)
}
override fun onBackPressed() {
JitsiMeetActivityDelegate.onBackPressed()
}
@ -128,7 +148,8 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
}
private fun handleLeaveConference() {
jitsiMeetView?.leave()
val leaveBroadcastIntent = BroadcastIntentHelper.buildHangUpIntent()
LocalBroadcastManager.getInstance(applicationContext).sendBroadcast(leaveBroadcastIntent)
}
private fun handleConfirmSwitching(action: JitsiCallViewEvents.ConfirmSwitchingConference) {
@ -222,10 +243,17 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
Timber.v("Broadcast received: $event")
when (event) {
is ConferenceEvent.Terminated -> onConferenceTerminated(event.data)
else -> Unit
is ConferenceEvent.Joined -> onConferenceJoined(event.data)
is ConferenceEvent.ReadyToClose -> onReadyToClose()
is ConferenceEvent.WillJoin -> Unit
}
}
private fun onConferenceJoined(extraData: Map<String, Any>) {
// Launch the service for the ongoing notification.
JitsiMeetOngoingConferenceService.launch(this, HashMap(extraData))
}
private fun onConferenceTerminated(data: JsonDict) {
Timber.v("JitsiMeetViewListener.onConferenceTerminated()")
// Do not finish if there is an error
@ -234,6 +262,11 @@ class VectorJitsiActivity : VectorBaseActivity<ActivityJitsiBinding>(), JitsiMee
}
}
private fun onReadyToClose() {
Timber.v("SDK is ready to close")
finish()
}
companion object {
fun newIntent(context: Context, roomId: String, widgetId: String, enableVideo: Boolean): Intent {
return Intent(context, VectorJitsiActivity::class.java).apply {

View file

@ -582,7 +582,7 @@ class NotificationUtils @Inject constructor(
val accentColor = ContextCompat.getColor(context, R.color.notification_accent_color)
// Build the pending intent for when the notification is clicked
val openRoomIntent = buildOpenRoomIntent(roomInfo.roomId)
val smallIcon = R.drawable.ic_status_bar
val smallIcon = R.drawable.ic_notification
val channelID = if (roomInfo.shouldBing) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID
return NotificationCompat.Builder(context, channelID)
@ -695,7 +695,7 @@ class NotificationUtils @Inject constructor(
): Notification {
val accentColor = ContextCompat.getColor(context, R.color.notification_accent_color)
// Build the pending intent for when the notification is clicked
val smallIcon = R.drawable.ic_status_bar
val smallIcon = R.drawable.ic_notification
val channelID = if (inviteNotifiableEvent.noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID
@ -775,7 +775,7 @@ class NotificationUtils @Inject constructor(
): Notification {
val accentColor = ContextCompat.getColor(context, R.color.notification_accent_color)
// Build the pending intent for when the notification is clicked
val smallIcon = R.drawable.ic_status_bar
val smallIcon = R.drawable.ic_notification
val channelID = if (simpleNotifiableEvent.noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID
@ -890,7 +890,7 @@ class NotificationUtils @Inject constructor(
lastMessageTimestamp: Long
): Notification {
val accentColor = ContextCompat.getColor(context, R.color.notification_accent_color)
val smallIcon = R.drawable.ic_status_bar
val smallIcon = R.drawable.ic_notification
return NotificationCompat.Builder(context, if (noisy) NOISY_NOTIFICATION_CHANNEL_ID else SILENT_NOTIFICATION_CHANNEL_ID)
.setOnlyAlertOnce(true)
@ -980,7 +980,7 @@ class NotificationUtils @Inject constructor(
NotificationCompat.Builder(context, NOISY_NOTIFICATION_CHANNEL_ID)
.setContentTitle(stringProvider.getString(R.string.app_name))
.setContentText(stringProvider.getString(R.string.settings_troubleshoot_test_push_notification_content))
.setSmallIcon(R.drawable.ic_status_bar)
.setSmallIcon(R.drawable.ic_notification)
.setLargeIcon(getBitmap(context, R.drawable.element_logo_green))
.setColor(ContextCompat.getColor(context, R.color.notification_accent_color))
.setPriority(NotificationCompat.PRIORITY_MAX)

View file

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

View file

Before

Width:  |  Height:  |  Size: 433 B

After

Width:  |  Height:  |  Size: 433 B

View file

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB