Skip to content

Commit bd1afba

Browse files
committed
refactor(AppUpdateWorker): Use Update worker from Core
1 parent 1e7718d commit bd1afba

File tree

7 files changed

+13
-116
lines changed

7 files changed

+13
-116
lines changed

app/src/main/java/com/infomaniak/mail/MainApplication.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ import com.infomaniak.lib.core.utils.clearStack
4343
import com.infomaniak.lib.core.utils.hasPermissions
4444
import com.infomaniak.lib.core.utils.showToast
4545
import com.infomaniak.lib.login.ApiToken
46+
import com.infomaniak.lib.stores.AppUpdateWorker
4647
import com.infomaniak.mail.MatomoMail.buildTracker
4748
import com.infomaniak.mail.data.LocalSettings
4849
import com.infomaniak.mail.data.api.UrlTraceInterceptor
4950
import com.infomaniak.mail.di.IoDispatcher
5051
import com.infomaniak.mail.di.MainDispatcher
5152
import com.infomaniak.mail.ui.LaunchActivity
5253
import com.infomaniak.mail.utils.*
53-
import com.infomaniak.mail.workers.AppUpdateWorker
5454
import com.infomaniak.mail.workers.SyncMailboxesWorker
5555
import dagger.hilt.android.HiltAndroidApp
5656
import io.sentry.SentryEvent

app/src/main/java/com/infomaniak/mail/di/ActivityModule.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package com.infomaniak.mail.di
1919

2020
import androidx.fragment.app.FragmentActivity
21-
import com.infomaniak.lib.stores.InAppUpdateManager
21+
import com.infomaniak.lib.stores.updatemanagers.InAppUpdateManager
2222
import com.infomaniak.mail.BuildConfig
2323
import com.infomaniak.mail.MatomoMail.DISCOVER_LATER
2424
import com.infomaniak.mail.MatomoMail.DISCOVER_NOW

app/src/main/java/com/infomaniak/mail/di/ApplicationModule.kt

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import android.app.Application
2121
import android.content.Context
2222
import androidx.core.app.NotificationManagerCompat
2323
import androidx.work.WorkManager
24+
import com.infomaniak.lib.stores.AppUpdateWorker
2425
import com.infomaniak.lib.stores.StoresLocalSettings
2526
import com.infomaniak.mail.MainApplication
2627
import com.infomaniak.mail.data.LocalSettings
@@ -66,4 +67,11 @@ object ApplicationModule {
6667
@Provides
6768
@Singleton
6869
fun providesStoresLocalSettings(appContext: Context): StoresLocalSettings = StoresLocalSettings.getInstance(appContext)
70+
71+
@Provides
72+
@Singleton
73+
fun providesAppUpdateWorkerScheduler(
74+
appContext: Context,
75+
workManager: WorkManager,
76+
): AppUpdateWorker.Scheduler = AppUpdateWorker.Scheduler(appContext, workManager)
6977
}

app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ import com.infomaniak.lib.core.utils.*
4343
import com.infomaniak.lib.core.utils.Utils
4444
import com.infomaniak.lib.core.utils.Utils.toEnumOrThrow
4545
import com.infomaniak.lib.core.utils.UtilsUi.openUrl
46-
import com.infomaniak.lib.stores.InAppUpdateManager
4746
import com.infomaniak.lib.stores.StoreUtils
4847
import com.infomaniak.lib.stores.StoreUtils.launchInAppReview
48+
import com.infomaniak.lib.stores.updatemanagers.InAppUpdateManager
4949
import com.infomaniak.mail.BuildConfig
5050
import com.infomaniak.mail.MatomoMail.trackAppReviewEvent
5151
import com.infomaniak.mail.MatomoMail.trackDestination

app/src/main/java/com/infomaniak/mail/ui/main/folder/ThreadListFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import com.ernestoyaquello.dragdropswiperecyclerview.listener.OnListScrollListen
4747
import com.infomaniak.lib.core.MatomoCore.TrackerAction
4848
import com.infomaniak.lib.core.utils.*
4949
import com.infomaniak.lib.core.utils.Utils
50-
import com.infomaniak.lib.stores.InAppUpdateManager
50+
import com.infomaniak.lib.stores.updatemanagers.InAppUpdateManager
5151
import com.infomaniak.mail.MatomoMail.trackEvent
5252
import com.infomaniak.mail.MatomoMail.trackMenuDrawerEvent
5353
import com.infomaniak.mail.MatomoMail.trackMultiSelectionEvent

app/src/main/java/com/infomaniak/mail/workers/AppUpdateWorker.kt

-111
This file was deleted.

0 commit comments

Comments
 (0)