Skip to content

Commit

Permalink
Merge branch 'release/2.13.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Sep 19, 2024
2 parents dc680b1 + af27c7e commit 7a262ad
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 17 deletions.
12 changes: 12 additions & 0 deletions TCHAP_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Changes in Tchap 2.13.4 (2024-09-19)
====================================

Features ✨
----------
- Activation des appels vidéos pour Éducation. ([#1106](https://github.com/tchapgouv/tchap-android/issues/1106))

Bugfixes 🐛
----------
- Activation du module analytics sur l'instance de dev. ([#1101](https://github.com/tchapgouv/tchap-android/issues/1101))
- Correction du problème de microphone sur Android 14. ([#1108](https://github.com/tchapgouv/tchap-android/issues/1108))

Changes in Tchap 2.13.3 (2024-08-02)
====================================

Expand Down
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.towncrier]
version = "2.13.3"
version = "2.13.4"
directory = "changelog.d"
filename = "TCHAP_CHANGES.md"
name = "Changes in Tchap"
Expand Down
2 changes: 1 addition & 1 deletion vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ext.versionMinor = 13
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
ext.versionPatch = 3
ext.versionPatch = 4

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down
8 changes: 7 additions & 1 deletion vector-config/src/main/java/im/vector/app/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ object Config {
* The analytics configuration to use for the Debug build type.
* Can be disabled by providing Analytics.Disabled
*/
val DEBUG_ANALYTICS_CONFIG = Analytics.Disabled // TCHAP No analytics
val DEBUG_ANALYTICS_CONFIG = Analytics.Enabled(
postHogHost = "https://us.i.posthog.com", // TCHAP dev posthog
postHogApiKey = "phc_eQOeaQiaIxdX9kaQmqYTD7RJLyFubYmGYKUI9czqqQD", // TCHAP dev posthog
policyLink = "https://tchap.beta.gouv.fr/politique-de-confidentialite", // TCHAP dev posthog
sentryDSN = "",
sentryEnvironment = "DEBUG"
)

/**
* The analytics configuration to use for the Release build type.
Expand Down
1 change: 1 addition & 0 deletions vector-config/src/tchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

<string-array name="tchap_is_visio_supported_homeservers" translatable="false">
<item>agent.dinum.tchap.gouv.fr</item>
<item>agent.education.tchap.gouv.fr</item>
</string-array>
</resources>
3 changes: 2 additions & 1 deletion vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<!-- For CallAndroidService -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />

<!-- For VectorSyncAndroidService -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
Expand Down Expand Up @@ -362,7 +363,7 @@

<service
android:name=".core.services.CallAndroidService"
android:foregroundServiceType="phoneCall"
android:foregroundServiceType="microphone|phoneCall"
android:exported="false">
<!-- in order to get headset button events -->
<intent-filter>
Expand Down
10 changes: 10 additions & 0 deletions vector/src/main/java/im/vector/app/features/home/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ import im.vector.app.features.MainActivityArgs
import im.vector.app.features.analytics.accountdata.AnalyticsAccountDataViewModel
import im.vector.app.features.analytics.plan.MobileScreen
import im.vector.app.features.analytics.plan.ViewRoom
import im.vector.app.features.analytics.ui.consent.AnalyticsConsentViewActions
import im.vector.app.features.analytics.ui.consent.AnalyticsConsentViewModel
import im.vector.app.features.crypto.recover.SetupMode
import im.vector.app.features.home.room.list.actions.RoomListSharedAction
import im.vector.app.features.home.room.list.actions.RoomListSharedActionViewModel
Expand Down Expand Up @@ -134,6 +136,8 @@ class HomeActivity :

private val serverBackupStatusViewModel: ServerBackupStatusViewModel by viewModel()

private val analyticsConsentViewModel: AnalyticsConsentViewModel by viewModel()

@Inject lateinit var vectorUncaughtExceptionHandler: VectorUncaughtExceptionHandler
@Inject lateinit var notificationDrawerManager: NotificationDrawerManager
@Inject lateinit var popupAlertManager: PopupAlertManager
Expand Down Expand Up @@ -280,6 +284,7 @@ class HomeActivity :
}
is HomeActivityViewEvents.OnCrossSignedInvalidated -> handleCrossSigningInvalidated(it)
HomeActivityViewEvents.ShowAnalyticsOptIn -> handleShowAnalyticsOptIn()
HomeActivityViewEvents.SetAnalyticsOptIn -> handleSetAnalyticsOptIn()
HomeActivityViewEvents.ShowNotificationDialog -> handleShowNotificationDialog()
HomeActivityViewEvents.ShowReleaseNotes -> handleShowReleaseNotes()
HomeActivityViewEvents.NotifyUserForThreadsMigration -> handleNotifyUserForThreadsMigration()
Expand Down Expand Up @@ -340,6 +345,11 @@ class HomeActivity :
navigator.openAnalyticsOptIn(this)
}

// TCHAP user already consented about analytics in the private policy
private fun handleSetAnalyticsOptIn() {
analyticsConsentViewModel.handle(AnalyticsConsentViewActions.SetUserConsent(true))
}

/**
* Migrating from old threads io.element.thread to new m.thread needs an initial sync to
* sync and display existing messages appropriately.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sealed interface HomeActivityViewEvents : VectorViewEvents {
data class OnCrossSignedInvalidated(val userItem: MatrixItem.UserItem) : HomeActivityViewEvents
object PromptToEnableSessionPush : HomeActivityViewEvents
object ShowAnalyticsOptIn : HomeActivityViewEvents
object SetAnalyticsOptIn : HomeActivityViewEvents
object ShowNotificationDialog : HomeActivityViewEvents
object ShowReleaseNotes : HomeActivityViewEvents
object NotifyUserForThreadsMigration : HomeActivityViewEvents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class HomeActivityViewModel @AssistedInject constructor(
.onEach { didAskUser ->
Timber.v("DidAskUserConsent: $didAskUser")
if (!didAskUser) {
_viewEvents.post(HomeActivityViewEvents.ShowAnalyticsOptIn)
// TCHAP user already consented about analytics in the private policy
// _viewEvents.post(HomeActivityViewEvents.ShowAnalyticsOptIn)
_viewEvents.post(HomeActivityViewEvents.SetAnalyticsOptIn)
} else {
_viewEvents.post(HomeActivityViewEvents.ShowNotificationDialog)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,15 @@ class VectorSettingsSecurityPrivacyFragment :

analyticsConsent.setOnPreferenceChangeListener { _, newValue ->
val newValueBool = newValue as? Boolean ?: false
if (newValueBool) {
// User wants to enable analytics, display the opt in screen
navigator.openAnalyticsOptIn(requireContext())
} else {
// Just disable analytics
analyticsConsentViewModel.handle(AnalyticsConsentViewActions.SetUserConsent(false))
}
// TCHAP user already consented about analytics in the private policy
analyticsConsentViewModel.handle(AnalyticsConsentViewActions.SetUserConsent(newValueBool))
// if (newValueBool) {
// // User wants to enable analytics, display the opt in screen
// navigator.openAnalyticsOptIn(requireContext())
// } else {
// // Just disable analytics
// analyticsConsentViewModel.handle(AnalyticsConsentViewActions.SetUserConsent(false))
// }
true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class WebRtcCall(
}
}
}
var durationMillis = 0
private set

private var inviteTimeout: Deferred<Unit>? = null

Expand Down Expand Up @@ -274,10 +276,6 @@ class WebRtcCall(
}
}

fun durationMillis(): Int {
return timer.elapsedTime().toInt()
}

fun formattedDuration(): String {
return formatDuration(
Duration.ofMillis(timer.elapsedTime())
Expand Down Expand Up @@ -914,6 +912,7 @@ class WebRtcCall(
inviteTimeout?.cancel()
inviteTimeout = null
mxCall.state = CallState.Ended(reason ?: EndCallReason.USER_HANGUP)
durationMillis = timer.elapsedTime().toInt()
release()
onCallEnded(callId, reason ?: EndCallReason.USER_HANGUP, rejected)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class WebRtcCallManager @Inject constructor(
private fun WebRtcCall.trackCallEnded() {
analyticsTracker.capture(
CallEnded(
durationMs = durationMillis(),
durationMs = durationMillis,
isVideo = mxCall.isVideoCall,
numParticipants = 2,
placed = mxCall.isOutgoing
Expand Down

0 comments on commit 7a262ad

Please sign in to comment.