Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Create Folder When Device Don't Have Internet Connection #13408

Merged
merged 104 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
e0776d8
Check internet connection on MainApp
alperozturk96 Aug 12, 2024
cb7c47e
Add global boolean value to observe network status
alperozturk96 Aug 12, 2024
8c2750a
rebase to master
alperozturk96 Aug 27, 2024
e5dcf45
Add OfflineOperationEntity
alperozturk96 Aug 12, 2024
231b354
Add OfflineOperationEntity dao
alperozturk96 Aug 12, 2024
8fb6710
Add TypeConverters for Offline Operations
alperozturk96 Aug 12, 2024
bc12270
Add addCreateFolderOfflineOperation
alperozturk96 Aug 12, 2024
d5f8513
Complete addCreateFolderOfflineOperation
alperozturk96 Aug 12, 2024
9b64d7b
Check visibility of buttons depends on remote id
alperozturk96 Aug 12, 2024
b2a8481
Simplify extension
alperozturk96 Aug 12, 2024
bdfa64e
Simplify extension
alperozturk96 Aug 13, 2024
9a47b05
Refresh folder after offline folder creation
alperozturk96 Aug 13, 2024
efbd820
applyVisualsForOfflineOperations
alperozturk96 Aug 13, 2024
4ab29f0
applyVisualsForOfflineOperations for grid mode
alperozturk96 Aug 13, 2024
570984a
add filterActionsForOfflineOperations
alperozturk96 Aug 13, 2024
3dd21f8
add filterActionsForOfflineOperations
alperozturk96 Aug 13, 2024
016b0fd
Add OfflineOperationsWorker
alperozturk96 Aug 13, 2024
2a9b995
Use non-static variables
alperozturk96 Aug 13, 2024
e43c29f
not use type converter
alperozturk96 Aug 13, 2024
6f8d4ba
fix color filter
alperozturk96 Aug 13, 2024
bf19839
Add startPeriodicallyOfflineOperation
alperozturk96 Aug 15, 2024
2789795
Change interval time
alperozturk96 Aug 15, 2024
c8a6d81
Remove network constrait for periodically offline operation
alperozturk96 Aug 15, 2024
1af6b4b
Remove network constrait for periodically offline operation
alperozturk96 Aug 15, 2024
f44d89c
Use async await for better handling operations
alperozturk96 Aug 15, 2024
2dbc464
Refactor async await logic
alperozturk96 Aug 15, 2024
976187c
Better approach to check table columns
alperozturk96 Aug 15, 2024
8b170c7
Refresh folder after worker completed
alperozturk96 Aug 15, 2024
ea8d987
Fix Refresh folder after worker completed
alperozturk96 Aug 15, 2024
9968a6e
add folder conflict check
alperozturk96 Aug 15, 2024
b3e71bd
add folder conflict check
alperozturk96 Aug 15, 2024
6b77f06
add remove feature for offline operations
alperozturk96 Aug 15, 2024
e8ad814
Simplify
alperozturk96 Aug 15, 2024
5dab3e8
Use dagger for file data storage manager
alperozturk96 Aug 15, 2024
8f0da11
Rename view holder interface for prevent confusion
alperozturk96 Aug 15, 2024
957bca4
Simplify oc file list adapter
alperozturk96 Aug 15, 2024
02c4968
Prevent copy and move for offline operation
alperozturk96 Aug 16, 2024
c2a6f5d
Add rename logic for create offline operations
alperozturk96 Aug 16, 2024
a83c511
Fix code analytics
alperozturk96 Aug 16, 2024
0d8a44f
solve git conflicts
alperozturk96 Aug 19, 2024
7381889
Fix nested folder creation
alperozturk96 Aug 16, 2024
22732c9
Add notifications
alperozturk96 Aug 16, 2024
5b85d6d
Add notifications
alperozturk96 Aug 16, 2024
33e2257
Fix code analytics
alperozturk96 Aug 16, 2024
e247cf1
Fix code analytics
alperozturk96 Aug 16, 2024
12e47bb
Remove unnecessary update function
alperozturk96 Aug 19, 2024
0b5736e
Handle error case and notification for it
alperozturk96 Aug 19, 2024
5fa1168
Add retry button for offline operations
alperozturk96 Aug 19, 2024
2aa5312
Add RemoteOperationResultExtensions
alperozturk96 Aug 19, 2024
230f65a
Add folderSyncConflictEventReceiver
alperozturk96 Aug 19, 2024
26b0e68
Add notification for conflict resolve
alperozturk96 Aug 19, 2024
a9f847e
Remove static network checker function use connectivity service
alperozturk96 Aug 20, 2024
95599bc
Handle offline operations better
alperozturk96 Aug 20, 2024
1f8ca36
Remove global scope
alperozturk96 Aug 20, 2024
3401386
Add OfflineFolderConflictManager
alperozturk96 Aug 20, 2024
d5747ab
Use hashmap rather than pair of arraylist string
alperozturk96 Aug 20, 2024
5382c89
Prevent multiple action and unnecessary folder check
alperozturk96 Aug 20, 2024
05f6aaa
Add folder conflict UI for ConflictResolveDialog
alperozturk96 Aug 20, 2024
2f4ee1f
Add handleFolderConflict
alperozturk96 Aug 20, 2024
986d084
Add KEEP_BOTH_FOLDER click
alperozturk96 Aug 21, 2024
7aac89d
Add KEEP_SERVER_FOLDER click
alperozturk96 Aug 21, 2024
dfd1365
Add KEEP_OFFLINE_FOLDER click
alperozturk96 Aug 21, 2024
1599794
Rename conflict dialog resolver binding variables
alperozturk96 Aug 21, 2024
ae5064d
Simplify usage of ConflictResolveDialog
alperozturk96 Aug 21, 2024
9dcdb7d
Simplify ConflictResolveDialog
alperozturk96 Aug 21, 2024
98bab61
Fix tests
alperozturk96 Aug 21, 2024
153fd9b
Add FileOperationHelper
alperozturk96 Aug 21, 2024
8deb506
Add FileOperationHelper
alperozturk96 Aug 21, 2024
7b6a659
Fix delete behaviour
alperozturk96 Aug 21, 2024
0a87eeb
Fix nested folder creation
alperozturk96 Aug 22, 2024
501f139
updatePathsIfParentPathMatches
alperozturk96 Aug 22, 2024
efaaaba
Fix parent path for keep_both decision
alperozturk96 Aug 22, 2024
e470b55
Fix nested folder creation inside the existed folder
alperozturk96 Aug 22, 2024
9879e17
Fixes
alperozturk96 Aug 22, 2024
3a8ebaf
Fix git conflicts for converted kt file
alperozturk96 Aug 26, 2024
ef5520f
Fix code analytics
alperozturk96 Aug 26, 2024
514a022
Remove unused resource
alperozturk96 Aug 27, 2024
a71593a
Remove unused resource
alperozturk96 Aug 27, 2024
a83ab21
Fix code analytics
alperozturk96 Aug 27, 2024
03ea98c
deleteSubDirIfParentPathMatches
alperozturk96 Aug 27, 2024
85582d4
Dont show if any file is offline
alperozturk96 Aug 27, 2024
a9e3ef9
Fix parent path finding
alperozturk96 Aug 27, 2024
5fcebae
Update sub-directories after rename
alperozturk96 Aug 27, 2024
d779ee1
Cleanup extensions
alperozturk96 Aug 27, 2024
883897e
try id
alperozturk96 Aug 28, 2024
25679b3
Add getAllSubdirectories
alperozturk96 Aug 28, 2024
07db2f0
Remove top dir checks
alperozturk96 Aug 28, 2024
dd36d0b
Remove path checks for deleteOperation
alperozturk96 Aug 28, 2024
1f58ef1
Remove extension tests
alperozturk96 Aug 28, 2024
2011f6a
Remove path manipulation for rename
alperozturk96 Aug 28, 2024
9913519
Fix duplicated old dir recreation after rename
alperozturk96 Aug 28, 2024
ed7a1bf
Use repository instead extensions
alperozturk96 Aug 28, 2024
f0179d8
Faster currentDir refresh
alperozturk96 Aug 28, 2024
3812f8c
Fix keep both without path manipulation
alperozturk96 Aug 28, 2024
c748184
Fix listDirectory call
alperozturk96 Aug 28, 2024
6af4c3c
Only update necessary sub-dirs
alperozturk96 Aug 30, 2024
4eda0ef
apply KT Spotless
alperozturk96 Aug 30, 2024
05b0ab0
performance optimization
alperozturk96 Aug 30, 2024
c59a3ea
Fix code analytics
alperozturk96 Aug 30, 2024
212edbf
handle while loop better
alperozturk96 Sep 1, 2024
abc85a8
Fix kotlin spotless check
alperozturk96 Sep 2, 2024
3a93e37
Fix kotlin spotless check
alperozturk96 Sep 3, 2024
39728f5
Fix wrong interface name
alperozturk96 Sep 3, 2024
b02e46a
Fix NPE for info box
alperozturk96 Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,301 changes: 1,301 additions & 0 deletions app/schemas/com.nextcloud.client.database.NextcloudDatabase/84.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/src/androidTest/java/com/owncloud/android/AbstractIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.NetworkOnMainThreadException;
import android.text.TextUtils;
import android.view.View;

Expand Down Expand Up @@ -375,6 +376,11 @@ public void uploadFile(File file, String remotePath) {

public void uploadOCUpload(OCUpload ocUpload) {
ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isNetworkAndServerAvailable() throws NetworkOnMainThreadException {
return false;
}

@Override
public boolean isConnected() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.content.ActivityNotFoundException;
import android.net.Uri;
import android.os.Bundle;
import android.os.NetworkOnMainThreadException;

import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
Expand Down Expand Up @@ -187,6 +188,11 @@ public void uploadOCUpload(OCUpload ocUpload) {

public void uploadOCUpload(OCUpload ocUpload, int localBehaviour) {
ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isNetworkAndServerAvailable() throws NetworkOnMainThreadException {
return false;
}

@Override
public boolean isConnected() {
return false;
Expand Down
17 changes: 17 additions & 0 deletions app/src/androidTest/java/com/owncloud/android/UploadIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/
package com.owncloud.android;

import android.os.NetworkOnMainThreadException;

import com.nextcloud.client.account.UserAccountManagerImpl;
import com.nextcloud.client.device.BatteryStatus;
import com.nextcloud.client.device.PowerManagementService;
Expand Down Expand Up @@ -56,6 +58,11 @@ public class UploadIT extends AbstractOnServerIT {
targetContext.getContentResolver());

private ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isNetworkAndServerAvailable() throws NetworkOnMainThreadException {
return false;
}

@Override
public boolean isConnected() {
return false;
Expand Down Expand Up @@ -274,6 +281,11 @@ public BatteryStatus getBattery() {
@Test
public void testUploadOnWifiOnlyButNoWifi() {
ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isNetworkAndServerAvailable() throws NetworkOnMainThreadException {
return false;
}

@Override
public boolean isConnected() {
return false;
Expand Down Expand Up @@ -358,6 +370,11 @@ public void testUploadOnWifiOnlyAndWifi() {
@Test
public void testUploadOnWifiOnlyButMeteredWifi() {
ConnectivityService connectivityServiceMock = new ConnectivityService() {
@Override
public boolean isNetworkAndServerAvailable() throws NetworkOnMainThreadException {
return false;
}

@Override
public boolean isConnected() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ abstract class FileUploaderIT : AbstractOnServerIT() {
private var uploadsStorageManager: UploadsStorageManager? = null

private val connectivityServiceMock: ConnectivityService = object : ConnectivityService {
override fun isNetworkAndServerAvailable(): Boolean {
return false
}

override fun isConnected(): Boolean {
return false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public void screenshotTextFiles() {

ConflictsResolveActivity sut = activityRule.launchActivity(intent);

ConflictsResolveDialog dialog = ConflictsResolveDialog.newInstance(existingFile,
ConflictsResolveDialog dialog = ConflictsResolveDialog.newInstance(targetContext,
existingFile,
newFile,
UserAccountManagerImpl
.fromContext(targetContext)
Expand Down Expand Up @@ -209,7 +210,7 @@ public void keepExisting() {

getInstrumentation().waitForIdleSync();

onView(withId(R.id.existing_checkbox)).perform(click());
onView(withId(R.id.right_checkbox)).perform(click());

DialogFragment dialog = (DialogFragment) sut.getSupportFragmentManager().findFragmentByTag("conflictDialog");
screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView());
Expand Down Expand Up @@ -255,7 +256,7 @@ public void keepNew() {

getInstrumentation().waitForIdleSync();

onView(withId(R.id.new_checkbox)).perform(click());
onView(withId(R.id.left_checkbox)).perform(click());

DialogFragment dialog = (DialogFragment) sut.getSupportFragmentManager().findFragmentByTag("conflictDialog");
screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView());
Expand Down Expand Up @@ -300,8 +301,8 @@ public void keepBoth() {

getInstrumentation().waitForIdleSync();

onView(withId(R.id.existing_checkbox)).perform(click());
onView(withId(R.id.new_checkbox)).perform(click());
onView(withId(R.id.right_checkbox)).perform(click());
onView(withId(R.id.left_checkbox)).perform(click());

DialogFragment dialog = (DialogFragment) sut.getSupportFragmentManager().findFragmentByTag("conflictDialog");
screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView());
Expand Down
4 changes: 4 additions & 0 deletions app/src/debug/java/com/nextcloud/test/TestActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class TestActivity :
override fun getConnectivity(): Connectivity {
return Connectivity.CONNECTED_WIFI
}

override fun isNetworkAndServerAvailable(): Boolean {
return false
}
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@
</intent-filter>
</activity>

<receiver
android:name="com.nextcloud.receiver.OfflineOperationActionReceiver"
android:exported="false" />
<receiver
android:name="com.nextcloud.client.jobs.MediaFoldersDetectionWork$NotificationReceiver"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.content.Context
import com.nextcloud.client.core.Clock
import com.nextcloud.client.database.dao.ArbitraryDataDao
import com.nextcloud.client.database.dao.FileDao
import com.nextcloud.client.database.dao.OfflineOperationDao
import dagger.Module
import dagger.Provides
import javax.inject.Singleton
Expand All @@ -33,4 +34,9 @@ class DatabaseModule {
fun fileDao(nextcloudDatabase: NextcloudDatabase): FileDao {
return nextcloudDatabase.fileDao()
}

@Provides
fun offlineOperationsDao(nextcloudDatabase: NextcloudDatabase): OfflineOperationDao {
return nextcloudDatabase.offlineOperationDao()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import com.nextcloud.client.core.Clock
import com.nextcloud.client.core.ClockImpl
import com.nextcloud.client.database.dao.ArbitraryDataDao
import com.nextcloud.client.database.dao.FileDao
import com.nextcloud.client.database.dao.OfflineOperationDao
import com.nextcloud.client.database.entity.ArbitraryDataEntity
import com.nextcloud.client.database.entity.CapabilityEntity
import com.nextcloud.client.database.entity.ExternalLinkEntity
import com.nextcloud.client.database.entity.FileEntity
import com.nextcloud.client.database.entity.FilesystemEntity
import com.nextcloud.client.database.entity.OfflineOperationEntity
import com.nextcloud.client.database.entity.ShareEntity
import com.nextcloud.client.database.entity.SyncedFolderEntity
import com.nextcloud.client.database.entity.UploadEntity
Expand All @@ -41,7 +43,8 @@ import com.owncloud.android.db.ProviderMeta
ShareEntity::class,
SyncedFolderEntity::class,
UploadEntity::class,
VirtualEntity::class
VirtualEntity::class,
OfflineOperationEntity::class
],
version = ProviderMeta.DB_VERSION,
autoMigrations = [
Expand All @@ -61,7 +64,8 @@ import com.owncloud.android.db.ProviderMeta
AutoMigration(from = 79, to = 80),
AutoMigration(from = 80, to = 81),
AutoMigration(from = 81, to = 82),
AutoMigration(from = 82, to = 83)
AutoMigration(from = 82, to = 83),
AutoMigration(from = 83, to = 84)
],
exportSchema = true
)
Expand All @@ -70,6 +74,7 @@ abstract class NextcloudDatabase : RoomDatabase() {

abstract fun arbitraryDataDao(): ArbitraryDataDao
abstract fun fileDao(): FileDao
abstract fun offlineOperationDao(): OfflineOperationDao

companion object {
const val FIRST_ROOM_DB_VERSION = 65
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.nextcloud.client.database.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.nextcloud.client.database.entity.OfflineOperationEntity

@Dao
interface OfflineOperationDao {
@Query("SELECT * FROM offline_operations")
fun getAll(): List<OfflineOperationEntity>

@Insert
fun insert(vararg entity: OfflineOperationEntity)

@Update
fun update(entity: OfflineOperationEntity)

@Delete
fun delete(entity: OfflineOperationEntity)

@Query("DELETE FROM offline_operations WHERE offline_operations_path = :path")
fun deleteByPath(path: String)

@Query("SELECT * FROM offline_operations WHERE offline_operations_path = :path LIMIT 1")
fun getByPath(path: String): OfflineOperationEntity?

@Query("SELECT * FROM offline_operations WHERE offline_operations_parent_oc_file_id = :parentOCFileId")
fun getSubDirectoriesByParentOCFileId(parentOCFileId: Long): List<OfflineOperationEntity>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

package com.nextcloud.client.database.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.nextcloud.model.OfflineOperationType
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta

@Entity(tableName = ProviderTableMeta.OFFLINE_OPERATION_TABLE_NAME)
data class OfflineOperationEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = ProviderTableMeta._ID)
val id: Int? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PARENT_OC_FILE_ID)
var parentOCFileId: Long? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PARENT_PATH)
var parentPath: String? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_TYPE)
var type: OfflineOperationType? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_PATH)
var path: String? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_FILE_NAME)
var filename: String? = null,

@ColumnInfo(name = ProviderTableMeta.OFFLINE_OPERATION_CREATED_AT)
var createdAt: Long? = null
)
6 changes: 6 additions & 0 deletions app/src/main/java/com/nextcloud/client/di/AppModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.nextcloud.client.core.ThreadPoolAsyncRunner;
import com.nextcloud.client.database.dao.ArbitraryDataDao;
import com.nextcloud.client.device.DeviceInfo;
import com.nextcloud.client.jobs.operation.FileOperationHelper;
import com.nextcloud.client.logger.FileLogHandler;
import com.nextcloud.client.logger.Logger;
import com.nextcloud.client.logger.LoggerImpl;
Expand Down Expand Up @@ -250,6 +251,11 @@ PassCodeManager passCodeManager(AppPreferences preferences, Clock clock) {
return new PassCodeManager(preferences, clock);
}

@Provides
FileOperationHelper fileOperationHelper(CurrentAccountProvider currentAccountProvider, Context context) {
return new FileOperationHelper(currentAccountProvider.getUser(), context, fileDataStorageManager(currentAccountProvider, context));
}

@Provides
@Singleton
UsersAndGroupsSearchConfig userAndGroupSearchConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.nextcloud.client.widget.DashboardWidgetConfigurationActivity;
import com.nextcloud.client.widget.DashboardWidgetProvider;
import com.nextcloud.client.widget.DashboardWidgetService;
import com.nextcloud.receiver.NetworkChangeReceiver;
import com.nextcloud.ui.ChooseAccountDialogFragment;
import com.nextcloud.ui.ImageDetailFragment;
import com.nextcloud.ui.SetStatusDialogFragment;
Expand Down Expand Up @@ -313,6 +314,9 @@ abstract class ComponentsModule {
@ContributesAndroidInjector
abstract BootupBroadcastReceiver bootupBroadcastReceiver();

@ContributesAndroidInjector
abstract NetworkChangeReceiver networkChangeReceiver();

@ContributesAndroidInjector
abstract NotificationWork.NotificationReceiver notificationWorkBroadcastReceiver();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.nextcloud.client.documentscan.GeneratePDFUseCase
import com.nextcloud.client.documentscan.GeneratePdfFromImagesWork
import com.nextcloud.client.integrations.deck.DeckApi
import com.nextcloud.client.jobs.download.FileDownloadWorker
import com.nextcloud.client.jobs.offlineOperations.OfflineOperationsWorker
import com.nextcloud.client.jobs.upload.FileUploadWorker
import com.nextcloud.client.logger.Logger
import com.nextcloud.client.network.ConnectivityService
Expand Down Expand Up @@ -95,12 +96,17 @@ class BackgroundJobFactory @Inject constructor(
GeneratePdfFromImagesWork::class -> createPDFGenerateWork(context, workerParameters)
HealthStatusWork::class -> createHealthStatusWork(context, workerParameters)
TestJob::class -> createTestJob(context, workerParameters)
OfflineOperationsWorker::class -> createOfflineOperationsWorker(context, workerParameters)
InternalTwoWaySyncWork::class -> createInternalTwoWaySyncWork(context, workerParameters)
else -> null // caller falls back to default factory
}
}
}

private fun createOfflineOperationsWorker(context: Context, params: WorkerParameters): ListenableWorker {
return OfflineOperationsWorker(accountManager.user, context, connectivityService, viewThemeUtils.get(), params)
}

private fun createFilesExportWork(context: Context, params: WorkerParameters): ListenableWorker {
return FilesExportWork(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,7 @@ interface BackgroundJobManager {
fun schedulePeriodicHealthStatus()
fun startHealthStatus()
fun bothFilesSyncJobsRunning(syncedFolderID: Long): Boolean
fun startOfflineOperations()
fun startPeriodicallyOfflineOperation()
fun scheduleInternal2WaySync()
}
Loading
Loading