Skip to content

Commit bc9aba6

Browse files
committed
feat: cross platform backup feature flag (#WPB-10579)
2 parents 89c1ef4 + 16c8252 commit bc9aba6

File tree

239 files changed

+4004
-1169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+4004
-1169
lines changed

.github/workflows/crowdin-translations-updater.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
steps:
3636
- name: Checkout
3737
uses: actions/checkout@v4
38+
with:
39+
token: ${{ secrets.ANDROID_BOB_GH_TOKEN }}
3840

3941
- name: "Set base branch from input"
4042
env:

.github/workflows/publish-test-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
path: artifacts
4343

4444
- name: Publish Test Results
45-
uses: EnricoMi/publish-unit-test-result-action@v2
45+
uses: EnricoMi/publish-unit-test-result-action/linux@v2
4646
with:
4747
commit: ${{ github.event.workflow_run.head_sha }}
4848
event_file: artifacts/Event File/event.json

app/build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ plugins {
4040
id(libs.plugins.wire.kover.get().pluginId)
4141
id(libs.plugins.wire.versionizer.get().pluginId)
4242
alias(libs.plugins.screenshot)
43+
id(libs.plugins.wire.android.navigation.get().pluginId)
4344
}
4445

4546
repositories {
@@ -148,7 +149,6 @@ dependencies {
148149
implementation(project(":features:cells"))
149150
implementation(project(":features:sketch"))
150151
implementation(project(":core:ui-common"))
151-
implementation(project(":core:navigation"))
152152

153153
// kover
154154
kover(project(":features:sketch"))
@@ -204,11 +204,8 @@ dependencies {
204204
implementation(libs.compose.material.ripple)
205205
implementation(libs.compose.ui.preview)
206206
implementation(libs.compose.activity)
207-
implementation(libs.compose.navigation)
208207
implementation(libs.compose.constraintLayout)
209208
implementation(libs.compose.runtime.liveData)
210-
implementation(libs.compose.destinations.core)
211-
ksp(libs.compose.destinations.ksp)
212209

213210
// Accompanist
214211
implementation(libs.accompanist.placeholder)

app/src/main/kotlin/com/wire/android/di/accountScoped/BackupModule.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
*/
1818
package com.wire.android.di.accountScoped
1919

20+
import com.wire.android.BuildConfig
2021
import com.wire.android.di.CurrentAccount
2122
import com.wire.android.di.KaliumCoreLogic
23+
import com.wire.android.ui.home.settings.backup.MPBackupSettings
2224
import com.wire.kalium.logic.CoreLogic
2325
import com.wire.kalium.logic.data.user.UserId
2426
import com.wire.kalium.logic.feature.backup.BackupScope
@@ -53,6 +55,13 @@ class BackupModule {
5355
fun provideRestoreBackupUseCase(backupScope: BackupScope) =
5456
backupScope.restore
5557

58+
@Provides
59+
fun provideMpBackupSettings() = if (BuildConfig.ENABLE_CROSSPLATFORM_BACKUP) {
60+
MPBackupSettings.Enabled
61+
} else {
62+
MPBackupSettings.Disabled
63+
}
64+
5665
@OptIn(DelicateKaliumApi::class)
5766
@ViewModelScoped
5867
@Provides

app/src/main/kotlin/com/wire/android/di/accountScoped/CellsModule.kt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@ import com.wire.android.di.KaliumCoreLogic
2222
import com.wire.kalium.cells.CellsScope
2323
import com.wire.kalium.cells.domain.CellUploadManager
2424
import com.wire.kalium.cells.domain.usecase.AddAttachmentDraftUseCase
25+
import com.wire.kalium.cells.domain.usecase.CreateFolderUseCase
2526
import com.wire.kalium.cells.domain.usecase.DeleteCellAssetUseCase
2627
import com.wire.kalium.cells.domain.usecase.DownloadCellFileUseCase
27-
import com.wire.kalium.cells.domain.usecase.GetNodesUseCase
28+
import com.wire.kalium.cells.domain.usecase.GetFoldersUseCase
29+
import com.wire.kalium.cells.domain.usecase.GetPaginatedNodesUseCase
2830
import com.wire.kalium.cells.domain.usecase.GetPaginatedFilesFlowUseCase
31+
import com.wire.kalium.cells.domain.usecase.MoveNodeUseCase
2932
import com.wire.kalium.cells.domain.usecase.ObserveAttachmentDraftsUseCase
3033
import com.wire.kalium.cells.domain.usecase.PublishAttachmentsUseCase
3134
import com.wire.kalium.cells.domain.usecase.RefreshCellAssetStateUseCase
3235
import com.wire.kalium.cells.domain.usecase.RemoveAttachmentDraftUseCase
3336
import com.wire.kalium.cells.domain.usecase.RemoveAttachmentDraftsUseCase
37+
import com.wire.kalium.cells.domain.usecase.RestoreNodeFromRecycleBinUseCase
3438
import com.wire.kalium.cells.domain.usecase.RetryAttachmentUploadUseCase
3539
import com.wire.kalium.cells.domain.usecase.SetWireCellForConversationUseCase
3640
import com.wire.kalium.cells.domain.usecase.publiclink.CreatePublicLinkUseCase
@@ -83,7 +87,7 @@ class CellsModule {
8387

8488
@ViewModelScoped
8589
@Provides
86-
fun provideObserveFilesUseCase(cellsScope: CellsScope): GetNodesUseCase = cellsScope.observeFiles
90+
fun provideObserveFilesUseCase(cellsScope: CellsScope): GetPaginatedNodesUseCase = cellsScope.observeFiles
8791

8892
@ViewModelScoped
8993
@Provides
@@ -120,4 +124,21 @@ class CellsModule {
120124
@ViewModelScoped
121125
@Provides
122126
fun provideRetryAttachmentUploadUseCase(cellsScope: CellsScope): RetryAttachmentUploadUseCase = cellsScope.retryAttachmentUpload
127+
128+
@ViewModelScoped
129+
@Provides
130+
fun provideCreateFolderUseCase(cellsScope: CellsScope): CreateFolderUseCase = cellsScope.createFolderUseCase
131+
132+
@ViewModelScoped
133+
@Provides
134+
fun provideMoveNodeUseCase(cellsScope: CellsScope): MoveNodeUseCase = cellsScope.moveNodeUseCase
135+
136+
@ViewModelScoped
137+
@Provides
138+
fun provideGetFoldersUseCase(cellsScope: CellsScope): GetFoldersUseCase = cellsScope.getFoldersUseCase
139+
140+
@ViewModelScoped
141+
@Provides
142+
fun provideRestoreNodeFromRecycleBinUseCase(cellsScope: CellsScope): RestoreNodeFromRecycleBinUseCase =
143+
cellsScope.restoreNodeFromRecycleBin
123144
}

app/src/main/kotlin/com/wire/android/media/audiomessage/AudioWavesMaskHelper.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class AudioWavesMaskHelper @Inject constructor(
4141
@Suppress("TooGenericExceptionCaught")
4242
private fun getAmplituda(): Amplituda? = try {
4343
amplituda.get()
44+
} catch (e: UnsatisfiedLinkError) {
45+
null
4446
} catch (e: NullPointerException) {
4547
null
4648
}

app/src/main/kotlin/com/wire/android/navigation/MainNavHost.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fun MainNavHost(
6262
)
6363
)
6464

65+
adjustDestinationStylesForTablets()
6566
DestinationsNavHost(
6667
modifier = modifier,
6768
navGraph = WireMainNavGraph,

app/src/main/kotlin/com/wire/android/navigation/NavigationUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ internal fun NavController.navigateToItem(command: NavigationCommand) {
7777
BackStackMode.NONE -> {
7878
}
7979
}
80-
launchSingleTop = true
80+
launchSingleTop = command.launchSingleTop
8181
restoreState = true
8282
}
8383
}

app/src/main/kotlin/com/wire/android/navigation/Navigator.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ class Navigator(
5656
if (onlyIfResumed && !isResumed) return
5757
if (!navController.popBackStack()) finish()
5858
}
59+
60+
override fun navigateBackAndRemoveAllConsecutive(currentRoute: String) {
61+
while (navController.currentBackStackEntry?.destination?.route == currentRoute) {
62+
navController.popBackStack()
63+
}
64+
}
5965
}
6066

6167
@Composable
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Wire
3+
* Copyright (C) 2025 Wire Swiss GmbH
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see http://www.gnu.org/licenses/.
17+
*/
18+
package com.wire.android.navigation
19+
20+
import androidx.compose.runtime.Composable
21+
import com.wire.android.navigation.style.DialogNavigation
22+
import com.wire.android.navigation.style.PopUpNavigationAnimation
23+
import com.wire.android.navigation.style.SlideNavigationAnimation
24+
import com.wire.android.ui.destinations.AvatarPickerScreenDestination
25+
import com.wire.android.ui.destinations.ChangeDisplayNameScreenDestination
26+
import com.wire.android.ui.destinations.ChangeEmailScreenDestination
27+
import com.wire.android.ui.destinations.ChangeHandleScreenDestination
28+
import com.wire.android.ui.destinations.EditConversationNameScreenDestination
29+
import com.wire.android.ui.destinations.GroupConversationDetailsScreenDestination
30+
import com.wire.android.ui.destinations.OtherUserProfileScreenDestination
31+
import com.wire.android.ui.destinations.SelfUserProfileScreenDestination
32+
import com.wire.android.ui.destinations.ServiceDetailsScreenDestination
33+
import com.wire.android.ui.theme.isTablet
34+
35+
@Composable
36+
fun adjustDestinationStylesForTablets() {
37+
ServiceDetailsScreenDestination.style = if (isTablet) DialogNavigation else PopUpNavigationAnimation
38+
OtherUserProfileScreenDestination.style = if (isTablet) DialogNavigation else PopUpNavigationAnimation
39+
SelfUserProfileScreenDestination.style = if (isTablet) DialogNavigation else PopUpNavigationAnimation
40+
ChangeDisplayNameScreenDestination.style = if (isTablet) DialogNavigation else SlideNavigationAnimation
41+
ChangeHandleScreenDestination.style = if (isTablet) DialogNavigation else SlideNavigationAnimation
42+
ChangeEmailScreenDestination.style = if (isTablet) DialogNavigation else SlideNavigationAnimation
43+
AvatarPickerScreenDestination.style = if (isTablet) DialogNavigation else SlideNavigationAnimation
44+
GroupConversationDetailsScreenDestination.style = if (isTablet) DialogNavigation else PopUpNavigationAnimation
45+
EditConversationNameScreenDestination.style = if (isTablet) DialogNavigation else SlideNavigationAnimation
46+
}

0 commit comments

Comments
 (0)