Skip to content

Commit

Permalink
Merge branch 'release/candidate' into feat/add_analytics_initial_events
Browse files Browse the repository at this point in the history
  • Loading branch information
yamilmedina authored Sep 11, 2024
2 parents 75b1cda + 7646333 commit 9d6b2b3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
24 changes: 22 additions & 2 deletions app/src/main/kotlin/com/wire/android/ui/WireActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package com.wire.android.ui
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.WindowManager
import android.widget.Toast
Expand Down Expand Up @@ -65,8 +66,8 @@ import com.wire.android.navigation.NavigationGraph
import com.wire.android.navigation.navigateToItem
import com.wire.android.navigation.rememberNavigator
import com.wire.android.ui.calling.getIncomingCallIntent
import com.wire.android.ui.calling.ongoing.getOngoingCallIntent
import com.wire.android.ui.calling.getOutgoingCallIntent
import com.wire.android.ui.calling.ongoing.getOngoingCallIntent
import com.wire.android.ui.common.snackbar.LocalSnackbarHostState
import com.wire.android.ui.common.topappbar.CommonTopAppBar
import com.wire.android.ui.common.topappbar.CommonTopAppBarViewModel
Expand Down Expand Up @@ -514,17 +515,26 @@ class WireActivity : AppCompatActivity() {

override fun onSaveInstanceState(outState: Bundle) {
outState.putBoolean(HANDLED_DEEPLINK_FLAG, true)
outState.putParcelable(ORIGINAL_SAVED_INTENT_FLAG, intent)
super.onSaveInstanceState(outState)
}

override fun onRestoreInstanceState(savedInstanceState: Bundle) {
super.onRestoreInstanceState(savedInstanceState)
savedInstanceState.getOriginalIntent()?.let {
this.intent = it
}
}

@Suppress("ComplexCondition")
private fun handleDeepLink(
intent: Intent?,
savedInstanceState: Bundle? = null
) {
val originalIntent = savedInstanceState.getOriginalIntent()
if (intent == null
|| intent.flags and Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY != 0
|| savedInstanceState?.getBoolean(HANDLED_DEEPLINK_FLAG, false) == true
|| originalIntent == intent // This is the case when the activity is recreated and already handled
|| intent.getBooleanExtra(HANDLED_DEEPLINK_FLAG, false)
) {
return
Expand Down Expand Up @@ -561,6 +571,15 @@ class WireActivity : AppCompatActivity() {
}
}

private fun Bundle?.getOriginalIntent(): Intent? {
return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
@Suppress("DEPRECATION") // API 33
this?.getParcelable(ORIGINAL_SAVED_INTENT_FLAG)
} else {
this?.getParcelable(ORIGINAL_SAVED_INTENT_FLAG, Intent::class.java)
}
}

private fun handleDeepLinkResult(result: DeepLinkResult) {
val navigate: (NavigationCommand) -> Unit = { lifecycleScope.launch { navigationCommands.emit(it) } }
when (result) {
Expand Down Expand Up @@ -598,6 +617,7 @@ class WireActivity : AppCompatActivity() {

companion object {
private const val HANDLED_DEEPLINK_FLAG = "deeplink_handled_flag_key"
private const val ORIGINAL_SAVED_INTENT_FLAG = "original_saved_intent"
private const val TAG = "WireActivity"
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ In group conversations, the group admin can overwrite this setting.</string>
<string name="cancel_login_dialog_title">Are you sure you want to cancel?</string>
<!-- Analytics Usage dialog -->
<string name="analytics_usage_dialog_title">Consent to share user data</string>
<string name="analytics_usage_dialog_text">Help to improve Wire by sharing your usage data via a pseudonymous ID. The data is neither linked to your personal information nor shared with third parties besides Zeta Project Germany GmbH. It includes, for example, when you use a feature, your app version, device type, or your operating system. This data will be deleted at the latest after 365 days.\n\nFind further details in our Privacy Policy. You can revoke your consent at any time.</string>
<string name="analytics_usage_dialog_text">Help to improve Wire by sharing your usage data via a pseudonymous ID. The data is neither linked to your personal information nor shared with third parties besides Wire Group. It includes, for example, when you use a feature, your app version, device type, or your operating system. This data will be deleted at the latest after 365 days.\n\nFind further details in our Privacy Policy. You can revoke your consent at any time.</string>
<string name="analytics_usage_dialog_button_agree">Agree</string>
<string name="analytics_usage_dialog_button_decline">Decline</string>
<string name="analytics_usage_dialog_button_privacy_policy">Privacy Policy</string>
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 33 files
+79 βˆ’0 build.gradle.kts
+4 βˆ’1 cryptography/src/appleMain/kotlin/com/wire/kalium/cryptography/ProteusClientCoreCryptoImpl.kt
+19 βˆ’9 cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/ProteusClientCoreCryptoImpl.kt
+3 βˆ’0 docs/notebooks/README.md
+5,158 βˆ’0 docs/notebooks/event-performance-investigation/PerformanceImprovements.ipynb
+152 βˆ’0 docs/notebooks/event-performance-investigation/logs/InitialData.txt
+156 βˆ’0 docs/notebooks/event-performance-investigation/logs/NotSavingSession.txt
+208 βˆ’0 docs/notebooks/event-performance-investigation/logs/WithExistingSessionCache.txt
+19 βˆ’1 gradle/wrapper/gradle-wrapper.properties
+35 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt
+4 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/Event.kt
+15 βˆ’2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/EventMapper.kt
+9 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+4 βˆ’6 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/ConversationEventReceiver.kt
+49 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/AccessUpdateEventHandler.kt
+1 βˆ’2 logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/MessageTextEditHandler.kt
+104 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapperTest.kt
+8 βˆ’7 logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestEvent.kt
+54 βˆ’12 logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/ConversationEventReceiverTest.kt
+37 βˆ’2 logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/MessageTextEditHandlerTest.kt
+118 βˆ’0 logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/AccessUpdateHandlerTest.kt
+5 βˆ’2 mocks/src/commonMain/kotlin/com/wire/kalium/mocks/responses/conversation/ConversationResponseJson.kt
+12 βˆ’10 mocks/src/commonMain/kotlin/com/wire/kalium/mocks/responses/conversation/CreateConversationRequestJson.kt
+7 βˆ’0 .../src/commonMain/kotlin/com/wire/kalium/network/api/authenticated/conversation/ConversationPagingResponse.kt
+5 βˆ’2 ...-model/src/commonMain/kotlin/com/wire/kalium/network/api/authenticated/conversation/ConversationResponse.kt
+1 βˆ’1 network-model/src/commonMain/kotlin/com/wire/kalium/network/api/model/ApiModelMapper.kt
+20 βˆ’0 network/src/commonMain/kotlin/com/wire/kalium/network/api/v3/authenticated/ConversationApiV3.kt
+1 βˆ’1 network/src/commonTest/kotlin/com/wire/kalium/api/v0/conversation/ConversationApiV0Test.kt
+209 βˆ’0 network/src/commonTest/kotlin/com/wire/kalium/api/v2/ConversationResponseTest.kt
+33 βˆ’4 network/src/commonTest/kotlin/com/wire/kalium/api/v3/ConversationApiV3Test.kt
+299 βˆ’0 network/src/commonTest/kotlin/com/wire/kalium/api/v3/ConversationV3ResponseTest.kt
+1 βˆ’1 network/src/commonTest/kotlin/com/wire/kalium/api/v4/ConversationApiV4Test.kt
+1 βˆ’1 network/src/commonTest/kotlin/com/wire/kalium/api/v5/ConversationApiV5Test.kt

0 comments on commit 9d6b2b3

Please sign in to comment.