From 44e93ff0d163c1fb8efcecb2a1c18ecd98afde09 Mon Sep 17 00:00:00 2001 From: Jesus Recio Date: Tue, 8 Oct 2024 10:59:36 +0200 Subject: [PATCH] feat: replace references to camera uploads with automatic uploads in the source code --- .../dependecyinjection/RepositoryModule.kt | 2 +- .../dependecyinjection/UseCaseModule.kt | 16 +++++----- .../dependecyinjection/ViewModelModule.kt | 4 +-- .../accounts/ManageAccountsDialogFragment.kt | 2 +- .../accounts/ManageAccountsViewModel.kt | 16 +++++----- .../presentation/settings/SettingsActivity.kt | 4 +-- .../SettingsPictureUploadsFragment.kt | 4 +-- .../SettingsPictureUploadsViewModel.kt | 16 +++++----- .../SettingsVideoUploadsFragment.kt | 4 +-- .../SettingsVideoUploadsViewModel.kt | 16 +++++----- .../android/providers/FileContentProvider.kt | 18 +++++------ .../android/providers/WorkManagerProvider.kt | 14 ++++----- .../ui/activity/FileDisplayActivity.kt | 2 +- .../usecases/accounts/RemoveAccountUseCase.kt | 10 +++---- .../UploadFileFromContentUriUseCase.kt | 2 +- .../uploads/UploadFileFromSystemUseCase.kt | 2 +- .../uploads/UploadFileInConflictUseCase.kt | 2 +- .../UploadFilesFromContentUriUseCase.kt | 2 +- .../uploads/UploadFilesFromSystemUseCase.kt | 2 +- .../android/utils/NotificationUtils.kt | 2 +- ...adsWorker.kt => AutomaticUploadsWorker.kt} | 30 +++++++++---------- .../workers/UploadFileFromContentUriWorker.kt | 2 +- .../workers/UploadFileFromFileSystemWorker.kt | 2 +- .../folderbackup/OCFolderBackupRepository.kt | 10 +++---- .../LocalFolderBackupDataSource.kt | 6 ++-- .../OCLocalFolderBackupDataSource.kt | 14 ++++----- .../android/data/migrations/Migration_34.kt | 8 ++--- .../OCLocalTransferDataSource.kt | 2 +- .../OCLocalFolderBackupDataSourceTest.kt | 12 ++++---- .../FolderBackupRepository.kt | 8 ++--- .../model/AutomaticUploadsConfiguration.kt} | 6 ++-- .../model/FolderBackUpConfiguration.kt | 2 +- ...etAutomaticUploadsConfigurationUseCase.kt} | 14 ++++----- ...ictureUploadsConfigurationStreamUseCase.kt | 6 ++-- ...tVideoUploadsConfigurationStreamUseCase.kt | 8 ++--- .../usecases/ResetPictureUploadsUseCase.kt | 6 ++-- .../usecases/ResetVideoUploadsUseCase.kt | 6 ++-- .../SavePictureUploadsConfigurationUseCase.kt | 6 ++-- .../SaveVideoUploadsConfigurationUseCase.kt | 6 ++-- .../domain/transfers/model/OCTransfer.kt | 2 +- .../transfers/model/UploadEnqueuedBy.kt | 4 +-- .../testutil/OCFolderBackUpConfiguration.kt | 4 +-- .../owncloud/android/testutil/OCTransfer.kt | 2 +- 43 files changed, 153 insertions(+), 153 deletions(-) rename owncloudApp/src/main/java/com/owncloud/android/presentation/settings/{autouploads => automaticuploads}/SettingsPictureUploadsFragment.kt (98%) rename owncloudApp/src/main/java/com/owncloud/android/presentation/settings/{autouploads => automaticuploads}/SettingsPictureUploadsViewModel.kt (93%) rename owncloudApp/src/main/java/com/owncloud/android/presentation/settings/{autouploads => automaticuploads}/SettingsVideoUploadsFragment.kt (98%) rename owncloudApp/src/main/java/com/owncloud/android/presentation/settings/{autouploads => automaticuploads}/SettingsVideoUploadsViewModel.kt (93%) rename owncloudApp/src/main/java/com/owncloud/android/workers/{CameraUploadsWorker.kt => AutomaticUploadsWorker.kt} (91%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/FolderBackupRepository.kt (77%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads/model/CameraUploadsConfiguration.kt => automaticuploads/model/AutomaticUploadsConfiguration.kt} (79%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/model/FolderBackUpConfiguration.kt (97%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads/usecases/GetCameraUploadsConfigurationUseCase.kt => automaticuploads/usecases/GetAutomaticUploadsConfigurationUseCase.kt} (63%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/GetPictureUploadsConfigurationStreamUseCase.kt (83%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/GetVideoUploadsConfigurationStreamUseCase.kt (77%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/ResetPictureUploadsUseCase.kt (80%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/ResetVideoUploadsUseCase.kt (80%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/SavePictureUploadsConfigurationUseCase.kt (84%) rename owncloudDomain/src/main/java/com/owncloud/android/domain/{camerauploads => automaticuploads}/usecases/SaveVideoUploadsConfigurationUseCase.kt (84%) diff --git a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt index 13200c659e8..1272ad5e08a 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/RepositoryModule.kt @@ -38,7 +38,7 @@ import com.owncloud.android.data.webfinger.repository.OCWebFingerRepository import com.owncloud.android.domain.appregistry.AppRegistryRepository import com.owncloud.android.domain.authentication.AuthenticationRepository import com.owncloud.android.domain.authentication.oauth.OAuthRepository -import com.owncloud.android.domain.camerauploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository import com.owncloud.android.domain.capabilities.CapabilityRepository import com.owncloud.android.domain.files.FileRepository import com.owncloud.android.domain.server.ServerInfoRepository diff --git a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/UseCaseModule.kt b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/UseCaseModule.kt index 6deadfc06f0..15666123522 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/UseCaseModule.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/UseCaseModule.kt @@ -39,13 +39,13 @@ import com.owncloud.android.domain.availableoffline.usecases.GetFilesAvailableOf import com.owncloud.android.domain.availableoffline.usecases.GetFilesAvailableOfflineFromEveryAccountUseCase import com.owncloud.android.domain.availableoffline.usecases.SetFilesAsAvailableOfflineUseCase import com.owncloud.android.domain.availableoffline.usecases.UnsetFilesAsAvailableOfflineUseCase -import com.owncloud.android.domain.camerauploads.usecases.GetCameraUploadsConfigurationUseCase -import com.owncloud.android.domain.camerauploads.usecases.GetPictureUploadsConfigurationStreamUseCase -import com.owncloud.android.domain.camerauploads.usecases.GetVideoUploadsConfigurationStreamUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetPictureUploadsUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetVideoUploadsUseCase -import com.owncloud.android.domain.camerauploads.usecases.SavePictureUploadsConfigurationUseCase -import com.owncloud.android.domain.camerauploads.usecases.SaveVideoUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.GetAutomaticUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.GetPictureUploadsConfigurationStreamUseCase +import com.owncloud.android.domain.automaticuploads.usecases.GetVideoUploadsConfigurationStreamUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetPictureUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetVideoUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SavePictureUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SaveVideoUploadsConfigurationUseCase import com.owncloud.android.domain.capabilities.usecases.GetCapabilitiesAsLiveDataUseCase import com.owncloud.android.domain.capabilities.usecases.GetStoredCapabilitiesUseCase import com.owncloud.android.domain.capabilities.usecases.RefreshCapabilitiesFromServerAsyncUseCase @@ -261,7 +261,7 @@ val useCaseModule = module { factoryOf(::GetServerInfoAsyncUseCase) // Camera Uploads - factoryOf(::GetCameraUploadsConfigurationUseCase) + factoryOf(::GetAutomaticUploadsConfigurationUseCase) factoryOf(::GetPictureUploadsConfigurationStreamUseCase) factoryOf(::GetVideoUploadsConfigurationStreamUseCase) factoryOf(::ResetPictureUploadsUseCase) diff --git a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/ViewModelModule.kt b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/ViewModelModule.kt index 24ce6e5d21f..5a5abd60001 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/ViewModelModule.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/dependecyinjection/ViewModelModule.kt @@ -47,8 +47,8 @@ import com.owncloud.android.presentation.security.passcode.PasscodeAction import com.owncloud.android.presentation.security.pattern.PatternViewModel import com.owncloud.android.presentation.settings.SettingsViewModel import com.owncloud.android.presentation.settings.advanced.SettingsAdvancedViewModel -import com.owncloud.android.presentation.settings.autouploads.SettingsPictureUploadsViewModel -import com.owncloud.android.presentation.settings.autouploads.SettingsVideoUploadsViewModel +import com.owncloud.android.presentation.settings.automaticuploads.SettingsPictureUploadsViewModel +import com.owncloud.android.presentation.settings.automaticuploads.SettingsVideoUploadsViewModel import com.owncloud.android.presentation.settings.logging.SettingsLogsViewModel import com.owncloud.android.presentation.settings.more.SettingsMoreViewModel import com.owncloud.android.presentation.settings.security.SettingsSecurityViewModel diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsDialogFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsDialogFragment.kt index ed7dfc27a6b..b46d00b4ae3 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsDialogFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsDialogFragment.kt @@ -99,7 +99,7 @@ class ManageAccountsDialogFragment : DialogFragment(), ManageAccountsAdapter.Acc override fun removeAccount(account: Account) { dialogView.isVisible = false - val hasAccountAttachedCameraUploads = manageAccountsViewModel.hasCameraUploadsAttached(account.name) + val hasAccountAttachedCameraUploads = manageAccountsViewModel.hasAutomaticUploadsAttached(account.name) val dialog = AlertDialog.Builder(requireContext()) .setMessage(getString( if (hasAccountAttachedCameraUploads) R.string.confirmation_remove_account_alert_camera_uploads diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsViewModel.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsViewModel.kt index 341159355e4..677d47b1870 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsViewModel.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/accounts/ManageAccountsViewModel.kt @@ -25,8 +25,8 @@ package com.owncloud.android.presentation.accounts import android.accounts.Account import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration -import com.owncloud.android.domain.camerauploads.usecases.GetCameraUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.usecases.GetAutomaticUploadsConfigurationUseCase import com.owncloud.android.domain.utils.Event import com.owncloud.android.extensions.ViewModelExt.runUseCaseWithResult import com.owncloud.android.presentation.common.UIResult @@ -40,18 +40,18 @@ import kotlinx.coroutines.launch class ManageAccountsViewModel( private val accountProvider: AccountProvider, private val removeLocalFilesForAccountUseCase: RemoveLocalFilesForAccountUseCase, - private val getCameraUploadsConfigurationUseCase: GetCameraUploadsConfigurationUseCase, + private val getAutomaticUploadsConfigurationUseCase: GetAutomaticUploadsConfigurationUseCase, private val coroutinesDispatcherProvider: CoroutinesDispatcherProvider, ) : ViewModel() { private val _cleanAccountLocalStorageFlow = MutableStateFlow>?>(null) val cleanAccountLocalStorageFlow: StateFlow>?> = _cleanAccountLocalStorageFlow - private var cameraUploadsConfiguration: CameraUploadsConfiguration? = null + private var automaticUploadsConfiguration: AutomaticUploadsConfiguration? = null init { viewModelScope.launch(coroutinesDispatcherProvider.io) { - cameraUploadsConfiguration = getCameraUploadsConfigurationUseCase(Unit).getDataOrNull() + automaticUploadsConfiguration = getAutomaticUploadsConfigurationUseCase(Unit).getDataOrNull() } } @@ -73,8 +73,8 @@ class ManageAccountsViewModel( ) } - fun hasCameraUploadsAttached(accountName: String): Boolean { - return accountName == cameraUploadsConfiguration?.pictureUploadsConfiguration?.accountName || - accountName == cameraUploadsConfiguration?.videoUploadsConfiguration?.accountName + fun hasAutomaticUploadsAttached(accountName: String): Boolean { + return accountName == automaticUploadsConfiguration?.pictureUploadsConfiguration?.accountName || + accountName == automaticUploadsConfiguration?.videoUploadsConfiguration?.accountName } } diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/SettingsActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/SettingsActivity.kt index 8ff8a258350..ee5424c1515 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/SettingsActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/SettingsActivity.kt @@ -31,8 +31,8 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isVisible import com.owncloud.android.R import com.owncloud.android.presentation.settings.advanced.SettingsAdvancedFragment -import com.owncloud.android.presentation.settings.autouploads.SettingsPictureUploadsFragment -import com.owncloud.android.presentation.settings.autouploads.SettingsVideoUploadsFragment +import com.owncloud.android.presentation.settings.automaticuploads.SettingsPictureUploadsFragment +import com.owncloud.android.presentation.settings.automaticuploads.SettingsVideoUploadsFragment import com.owncloud.android.presentation.settings.logging.SettingsLogsFragment import com.owncloud.android.presentation.settings.more.SettingsMoreFragment import com.owncloud.android.presentation.settings.security.SettingsSecurityFragment diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsFragment.kt similarity index 98% rename from owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsFragment.kt rename to owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsFragment.kt index 789ee7677b4..edb74b12ca4 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsFragment.kt @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -package com.owncloud.android.presentation.settings.autouploads +package com.owncloud.android.presentation.settings.automaticuploads import android.app.Activity import android.content.DialogInterface @@ -47,7 +47,7 @@ import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_PICTURE_UPLOADS_LA import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_PICTURE_UPLOADS_PATH import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_PICTURE_UPLOADS_SOURCE import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_PICTURE_UPLOADS_WIFI_ONLY -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.extensions.showAlertDialog import com.owncloud.android.ui.activity.FolderPickerActivity import com.owncloud.android.utils.DisplayUtils diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsViewModel.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsViewModel.kt similarity index 93% rename from owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsViewModel.kt rename to owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsViewModel.kt index b9657e632b3..256c28e7a90 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsPictureUploadsViewModel.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsPictureUploadsViewModel.kt @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -package com.owncloud.android.presentation.settings.autouploads +package com.owncloud.android.presentation.settings.automaticuploads import android.content.Intent import android.net.Uri @@ -27,12 +27,12 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.owncloud.android.R import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_UPLOADS_DEFAULT_PATH -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName -import com.owncloud.android.domain.camerauploads.model.UploadBehavior -import com.owncloud.android.domain.camerauploads.usecases.GetPictureUploadsConfigurationStreamUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetPictureUploadsUseCase -import com.owncloud.android.domain.camerauploads.usecases.SavePictureUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.usecases.GetPictureUploadsConfigurationStreamUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetPictureUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SavePictureUploadsConfigurationUseCase import com.owncloud.android.domain.files.model.OCFile import com.owncloud.android.domain.spaces.model.OCSpace import com.owncloud.android.domain.spaces.usecases.GetPersonalSpaceForAccountUseCase @@ -189,7 +189,7 @@ class SettingsPictureUploadsViewModel( } fun schedulePictureUploads() { - workManagerProvider.enqueueCameraUploadsWorker() + workManagerProvider.enqueueAutomaticUploadsWorker() } private fun composePictureUploadsConfiguration( diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsFragment.kt similarity index 98% rename from owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsFragment.kt rename to owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsFragment.kt index 47dfd70b51c..2fbf963fba1 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsFragment.kt @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -package com.owncloud.android.presentation.settings.autouploads +package com.owncloud.android.presentation.settings.automaticuploads import android.app.Activity import android.content.DialogInterface @@ -47,7 +47,7 @@ import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_VIDEO_UPLOADS_ENAB import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_VIDEO_UPLOADS_PATH import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_VIDEO_UPLOADS_SOURCE import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_VIDEO_UPLOADS_WIFI_ONLY -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.extensions.showAlertDialog import com.owncloud.android.ui.activity.FolderPickerActivity import com.owncloud.android.utils.DisplayUtils diff --git a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsViewModel.kt b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsViewModel.kt similarity index 93% rename from owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsViewModel.kt rename to owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsViewModel.kt index 95990c28cce..e205bd0477c 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/autouploads/SettingsVideoUploadsViewModel.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/presentation/settings/automaticuploads/SettingsVideoUploadsViewModel.kt @@ -19,7 +19,7 @@ * along with this program. If not, see . */ -package com.owncloud.android.presentation.settings.autouploads +package com.owncloud.android.presentation.settings.automaticuploads import android.content.Intent import android.net.Uri @@ -27,12 +27,12 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.owncloud.android.R import com.owncloud.android.db.PreferenceManager.PREF__CAMERA_UPLOADS_DEFAULT_PATH -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.videoUploadsName -import com.owncloud.android.domain.camerauploads.model.UploadBehavior -import com.owncloud.android.domain.camerauploads.usecases.GetVideoUploadsConfigurationStreamUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetVideoUploadsUseCase -import com.owncloud.android.domain.camerauploads.usecases.SaveVideoUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.videoUploadsName +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.usecases.GetVideoUploadsConfigurationStreamUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetVideoUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SaveVideoUploadsConfigurationUseCase import com.owncloud.android.domain.files.model.OCFile import com.owncloud.android.domain.spaces.model.OCSpace import com.owncloud.android.domain.spaces.usecases.GetPersonalSpaceForAccountUseCase @@ -189,7 +189,7 @@ class SettingsVideoUploadsViewModel( } fun scheduleVideoUploads() { - workManagerProvider.enqueueCameraUploadsWorker() + workManagerProvider.enqueueAutomaticUploadsWorker() } private fun composeVideoUploadsConfiguration( diff --git a/owncloudApp/src/main/java/com/owncloud/android/providers/FileContentProvider.kt b/owncloudApp/src/main/java/com/owncloud/android/providers/FileContentProvider.kt index 6c81a2a3434..f00709fa4f8 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/providers/FileContentProvider.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/providers/FileContentProvider.kt @@ -62,7 +62,7 @@ import com.owncloud.android.data.providers.SharedPreferencesProvider import com.owncloud.android.data.providers.implementation.OCSharedPreferencesProvider import com.owncloud.android.data.transfers.db.OCTransferEntity import com.owncloud.android.db.ProviderMeta.ProviderTableMeta -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.files.model.LIST_MIME_DIR import com.owncloud.android.domain.transfers.model.TransferStatus import com.owncloud.android.domain.transfers.model.UploadEnqueuedBy @@ -358,7 +358,7 @@ class FileContentProvider(val executors: Executors = Executors()) : ContentProvi if (uri.pathSegments.size > 1) { sqlQuery.appendWhere(ProviderTableMeta._ID + "=" + uri.pathSegments[1]) } - sqlQuery.projectionMap = cameraUploadSyncProjectionMap + sqlQuery.projectionMap = automaticUploadSyncProjectionMap } QUOTAS -> { sqlQuery.tables = ProviderTableMeta.USER_QUOTAS_TABLE_NAME @@ -981,7 +981,7 @@ class FileContentProvider(val executors: Executors = Executors()) : ContentProvi videoUploadsConfiguration?.let { backupLocalDataSource.saveFolderBackupConfiguration(it) } if (pictureUploadsConfiguration != null || videoUploadsConfiguration != null) { val workManagerProvider = WorkManagerProvider(context!!) - workManagerProvider.enqueueCameraUploadsWorker() + workManagerProvider.enqueueAutomaticUploadsWorker() } } cursor.close() @@ -1052,8 +1052,8 @@ class FileContentProvider(val executors: Executors = Executors()) : ContentProvi for (upload in uploads) { ocTransferDao.insertOrReplace(upload) if (upload.status == TransferStatus.TRANSFER_QUEUED.value && - upload.createdBy != UploadEnqueuedBy.ENQUEUED_AS_CAMERA_UPLOAD_PICTURE.ordinal && - upload.createdBy != UploadEnqueuedBy.ENQUEUED_AS_CAMERA_UPLOAD_VIDEO.ordinal + upload.createdBy != UploadEnqueuedBy.ENQUEUED_AS_AUTOMATIC_UPLOAD_PICTURE.ordinal && + upload.createdBy != UploadEnqueuedBy.ENQUEUED_AS_AUTOMATIC_UPLOAD_VIDEO.ordinal ) { val localFile = File(upload.localPath) val uploadFileFromSystemUseCase = UploadFileFromSystemUseCase(WorkManager.getInstance(context!!)) @@ -1499,13 +1499,13 @@ class FileContentProvider(val executors: Executors = Executors()) : ContentProvi uploadProjectionMap[ProviderTableMeta.UPLOADS_TRANSFER_ID] = ProviderTableMeta.UPLOADS_TRANSFER_ID } - private val cameraUploadSyncProjectionMap = HashMap() + private val automaticUploadSyncProjectionMap = HashMap() init { - cameraUploadSyncProjectionMap[ProviderTableMeta._ID] = ProviderTableMeta._ID - cameraUploadSyncProjectionMap[ProviderTableMeta.PICTURES_LAST_SYNC_TIMESTAMP] = + automaticUploadSyncProjectionMap[ProviderTableMeta._ID] = ProviderTableMeta._ID + automaticUploadSyncProjectionMap[ProviderTableMeta.PICTURES_LAST_SYNC_TIMESTAMP] = ProviderTableMeta.PICTURES_LAST_SYNC_TIMESTAMP - cameraUploadSyncProjectionMap[ProviderTableMeta.VIDEOS_LAST_SYNC_TIMESTAMP] = + automaticUploadSyncProjectionMap[ProviderTableMeta.VIDEOS_LAST_SYNC_TIMESTAMP] = ProviderTableMeta.VIDEOS_LAST_SYNC_TIMESTAMP } diff --git a/owncloudApp/src/main/java/com/owncloud/android/providers/WorkManagerProvider.kt b/owncloudApp/src/main/java/com/owncloud/android/providers/WorkManagerProvider.kt index 08a0796720f..fac429a5949 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/providers/WorkManagerProvider.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/providers/WorkManagerProvider.kt @@ -35,7 +35,7 @@ import com.owncloud.android.extensions.getRunningWorkInfosLiveData import com.owncloud.android.workers.AccountDiscoveryWorker import com.owncloud.android.workers.AvailableOfflinePeriodicWorker import com.owncloud.android.workers.AvailableOfflinePeriodicWorker.Companion.AVAILABLE_OFFLINE_PERIODIC_WORKER -import com.owncloud.android.workers.CameraUploadsWorker +import com.owncloud.android.workers.AutomaticUploadsWorker import com.owncloud.android.workers.OldLogsCollectorWorker import com.owncloud.android.workers.RemoveLocallyFilesWithLastUsageOlderThanGivenTimeWorker import com.owncloud.android.workers.UploadFileFromContentUriWorker @@ -44,15 +44,15 @@ import com.owncloud.android.workers.UploadFileFromFileSystemWorker class WorkManagerProvider( val context: Context ) { - fun enqueueCameraUploadsWorker() { - val cameraUploadsWorker = PeriodicWorkRequestBuilder( - repeatInterval = CameraUploadsWorker.repeatInterval, - repeatIntervalTimeUnit = CameraUploadsWorker.repeatIntervalTimeUnit - ).addTag(CameraUploadsWorker.CAMERA_UPLOADS_WORKER) + fun enqueueAutomaticUploadsWorker() { + val automaticUploadsWorker = PeriodicWorkRequestBuilder( + repeatInterval = AutomaticUploadsWorker.repeatInterval, + repeatIntervalTimeUnit = AutomaticUploadsWorker.repeatIntervalTimeUnit + ).addTag(AutomaticUploadsWorker.AUTOMATIC_UPLOADS_WORKER) .build() WorkManager.getInstance(context) - .enqueueUniquePeriodicWork(CameraUploadsWorker.CAMERA_UPLOADS_WORKER, ExistingPeriodicWorkPolicy.KEEP, cameraUploadsWorker) + .enqueueUniquePeriodicWork(AutomaticUploadsWorker.AUTOMATIC_UPLOADS_WORKER, ExistingPeriodicWorkPolicy.KEEP, automaticUploadsWorker) } fun enqueueOldLogsCollectorWorker() { diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt index 78da8b0b7c3..a881ac53ee9 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt @@ -62,7 +62,7 @@ import com.owncloud.android.MainApp import com.owncloud.android.R import com.owncloud.android.data.providers.SharedPreferencesProvider import com.owncloud.android.databinding.ActivityMainBinding -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.capabilities.model.OCCapability import com.owncloud.android.domain.exceptions.AccountNotFoundException import com.owncloud.android.domain.exceptions.DeepLinkException diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/accounts/RemoveAccountUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/accounts/RemoveAccountUseCase.kt index e41d703ce69..37db06d97e8 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/accounts/RemoveAccountUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/accounts/RemoveAccountUseCase.kt @@ -27,9 +27,9 @@ import com.owncloud.android.data.sharing.shares.datasources.LocalShareDataSource import com.owncloud.android.data.spaces.datasources.LocalSpacesDataSource import com.owncloud.android.data.user.datasources.LocalUserDataSource import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.usecases.GetCameraUploadsConfigurationUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetPictureUploadsUseCase -import com.owncloud.android.domain.camerauploads.usecases.ResetVideoUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.GetAutomaticUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetPictureUploadsUseCase +import com.owncloud.android.domain.automaticuploads.usecases.ResetVideoUploadsUseCase import com.owncloud.android.usecases.transfers.uploads.CancelTransfersFromAccountUseCase /* @@ -38,7 +38,7 @@ import com.owncloud.android.usecases.transfers.uploads.CancelTransfersFromAccoun * need an OwncloudAccount that there is not at this point. */ class RemoveAccountUseCase( - private val getCameraUploadsConfigurationUseCase: GetCameraUploadsConfigurationUseCase, + private val getAutomaticUploadsConfigurationUseCase: GetAutomaticUploadsConfigurationUseCase, private val resetPictureUploadsUseCase: ResetPictureUploadsUseCase, private val resetVideoUploadsUseCase: ResetVideoUploadsUseCase, private val cancelTransfersFromAccountUseCase: CancelTransfersFromAccountUseCase, @@ -52,7 +52,7 @@ class RemoveAccountUseCase( override fun run(params: Params) { // Reset camera uploads if they were enabled for the removed account - val cameraUploadsConfiguration = getCameraUploadsConfigurationUseCase(Unit) + val cameraUploadsConfiguration = getAutomaticUploadsConfigurationUseCase(Unit) if (params.accountName == cameraUploadsConfiguration.getDataOrNull()?.pictureUploadsConfiguration?.accountName) { resetPictureUploadsUseCase(Unit) } diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt index ab4a0475000..322ff4eb4a7 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromContentUriUseCase.kt @@ -29,7 +29,7 @@ import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkManager import androidx.work.workDataOf import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.workers.RemoveSourceFileWorker import com.owncloud.android.workers.UploadFileFromContentUriWorker import timber.log.Timber diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt index 6a219462de0..8af54f8abb7 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileFromSystemUseCase.kt @@ -27,7 +27,7 @@ import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkManager import androidx.work.workDataOf import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.workers.RemoveSourceFileWorker import com.owncloud.android.workers.UploadFileFromContentUriWorker import com.owncloud.android.workers.UploadFileFromFileSystemWorker diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileInConflictUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileInConflictUseCase.kt index 40ea3501ce6..5e3bca52620 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileInConflictUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFileInConflictUseCase.kt @@ -27,7 +27,7 @@ import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkManager import androidx.work.workDataOf import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.transfers.TransferRepository import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferStatus diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromContentUriUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromContentUriUseCase.kt index 7ff0cdd7bfa..963231aaf8b 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromContentUriUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromContentUriUseCase.kt @@ -25,7 +25,7 @@ import android.net.Uri import androidx.documentfile.provider.DocumentFile import com.owncloud.android.MainApp import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.transfers.TransferRepository import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferStatus diff --git a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromSystemUseCase.kt b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromSystemUseCase.kt index 337526cea72..d446a554383 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromSystemUseCase.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/usecases/transfers/uploads/UploadFilesFromSystemUseCase.kt @@ -22,7 +22,7 @@ package com.owncloud.android.usecases.transfers.uploads import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.transfers.TransferRepository import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferStatus diff --git a/owncloudApp/src/main/java/com/owncloud/android/utils/NotificationUtils.kt b/owncloudApp/src/main/java/com/owncloud/android/utils/NotificationUtils.kt index 53254e35ad1..b7872b282a8 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/utils/NotificationUtils.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/utils/NotificationUtils.kt @@ -123,7 +123,7 @@ object NotificationUtils { return PendingIntent.getActivity(context, System.currentTimeMillis().toInt(), showUploadListIntent, pendingIntentFlags) } - fun composePendingIntentToCameraUploads(context: Context, notificationKey: String): PendingIntent { + fun composePendingIntentToAutomaticUploads(context: Context, notificationKey: String): PendingIntent { val openSettingsActivity = Intent(context, SettingsActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) putExtra(KEY_NOTIFICATION_INTENT, notificationKey) diff --git a/owncloudApp/src/main/java/com/owncloud/android/workers/CameraUploadsWorker.kt b/owncloudApp/src/main/java/com/owncloud/android/workers/AutomaticUploadsWorker.kt similarity index 91% rename from owncloudApp/src/main/java/com/owncloud/android/workers/CameraUploadsWorker.kt rename to owncloudApp/src/main/java/com/owncloud/android/workers/AutomaticUploadsWorker.kt index dcb7b353b2c..1508b89a0e9 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/workers/CameraUploadsWorker.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/workers/AutomaticUploadsWorker.kt @@ -30,11 +30,11 @@ import androidx.work.WorkManager import androidx.work.WorkerParameters import com.owncloud.android.R import com.owncloud.android.domain.UseCaseResult -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.UploadBehavior -import com.owncloud.android.domain.camerauploads.usecases.GetCameraUploadsConfigurationUseCase -import com.owncloud.android.domain.camerauploads.usecases.SavePictureUploadsConfigurationUseCase -import com.owncloud.android.domain.camerauploads.usecases.SaveVideoUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.usecases.GetAutomaticUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SavePictureUploadsConfigurationUseCase +import com.owncloud.android.domain.automaticuploads.usecases.SaveVideoUploadsConfigurationUseCase import com.owncloud.android.domain.transfers.TransferRepository import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferStatus @@ -52,7 +52,7 @@ import java.io.File import java.util.Date import java.util.concurrent.TimeUnit -class CameraUploadsWorker( +class AutomaticUploadsWorker( val appContext: Context, workerParameters: WorkerParameters ) : CoroutineWorker( @@ -70,16 +70,16 @@ class CameraUploadsWorker( } } - private val getCameraUploadsConfigurationUseCase: GetCameraUploadsConfigurationUseCase by inject() + private val getAutomaticUploadsConfigurationUseCase: GetAutomaticUploadsConfigurationUseCase by inject() private val transferRepository: TransferRepository by inject() override suspend fun doWork(): Result { - Timber.i("Starting CameraUploadsWorker with UUID ${this.id}") - when (val useCaseResult = getCameraUploadsConfigurationUseCase(Unit)) { + Timber.i("Starting AutomaticUploadsWorker with UUID ${this.id}") + when (val useCaseResult = getAutomaticUploadsConfigurationUseCase(Unit)) { is UseCaseResult.Success -> { val cameraUploadsConfiguration = useCaseResult.data - if (cameraUploadsConfiguration == null || cameraUploadsConfiguration.areCameraUploadsDisabled()) { + if (cameraUploadsConfiguration == null || cameraUploadsConfiguration.areAutomaticUploadsDisabled()) { cancelWorker() return Result.success() } @@ -117,7 +117,7 @@ class CameraUploadsWorker( } private fun cancelWorker() { - WorkManager.getInstance(appContext).cancelUniqueWork(CAMERA_UPLOADS_WORKER) + WorkManager.getInstance(appContext).cancelUniqueWork(AUTOMATIC_UPLOADS_WORKER) } private fun syncFolder(folderBackUpConfiguration: FolderBackUpConfiguration?) { @@ -148,8 +148,8 @@ class CameraUploadsWorker( accountName = folderBackUpConfiguration.accountName, behavior = folderBackUpConfiguration.behavior, createdByWorker = when (syncType) { - SyncType.PICTURE_UPLOADS -> UploadEnqueuedBy.ENQUEUED_AS_CAMERA_UPLOAD_PICTURE - SyncType.VIDEO_UPLOADS -> UploadEnqueuedBy.ENQUEUED_AS_CAMERA_UPLOAD_VIDEO + SyncType.PICTURE_UPLOADS -> UploadEnqueuedBy.ENQUEUED_AS_AUTOMATIC_UPLOAD_PICTURE + SyncType.VIDEO_UPLOADS -> UploadEnqueuedBy.ENQUEUED_AS_AUTOMATIC_UPLOAD_VIDEO }, spaceId = folderBackUpConfiguration.spaceId ) @@ -207,7 +207,7 @@ class CameraUploadsWorker( contentText = appContext.getString(contentText), notificationChannelId = UPLOAD_NOTIFICATION_CHANNEL_ID, notificationId = syncType.getNotificationId(), - intent = NotificationUtils.composePendingIntentToCameraUploads(appContext, notificationKey), + intent = NotificationUtils.composePendingIntentToAutomaticUploads(appContext, notificationKey), onGoing = false, timeOut = null ) @@ -309,7 +309,7 @@ class CameraUploadsWorker( } companion object { - const val CAMERA_UPLOADS_WORKER = "CAMERA_UPLOADS_WORKER" + const val AUTOMATIC_UPLOADS_WORKER = "AUTOMATIC_UPLOADS_WORKER" const val repeatInterval: Long = 15L val repeatIntervalTimeUnit: TimeUnit = TimeUnit.MINUTES private const val pictureUploadsNotificationId = 101 diff --git a/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromContentUriWorker.kt b/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromContentUriWorker.kt index 120fc336caf..a655a2c97ce 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromContentUriWorker.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromContentUriWorker.kt @@ -33,7 +33,7 @@ import androidx.work.workDataOf import com.owncloud.android.R import com.owncloud.android.data.executeRemoteOperation import com.owncloud.android.data.providers.LocalStorageProvider -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.capabilities.usecases.GetStoredCapabilitiesUseCase import com.owncloud.android.domain.exceptions.LocalFileNotFoundException import com.owncloud.android.domain.exceptions.UnauthorizedException diff --git a/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromFileSystemWorker.kt b/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromFileSystemWorker.kt index 1942d2674be..c57054bbec4 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromFileSystemWorker.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/workers/UploadFileFromFileSystemWorker.kt @@ -28,7 +28,7 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import com.owncloud.android.R import com.owncloud.android.data.executeRemoteOperation -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.capabilities.usecases.GetStoredCapabilitiesUseCase import com.owncloud.android.domain.exceptions.LocalFileNotFoundException import com.owncloud.android.domain.exceptions.UnauthorizedException diff --git a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/OCFolderBackupRepository.kt b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/OCFolderBackupRepository.kt index a88c5b00659..338686c5499 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/OCFolderBackupRepository.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/OCFolderBackupRepository.kt @@ -19,17 +19,17 @@ package com.owncloud.android.data.folderbackup import com.owncloud.android.data.folderbackup.datasources.LocalFolderBackupDataSource -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration import kotlinx.coroutines.flow.Flow class OCFolderBackupRepository( private val localFolderBackupDataSource: LocalFolderBackupDataSource ) : FolderBackupRepository { - override fun getCameraUploadsConfiguration(): CameraUploadsConfiguration? = - localFolderBackupDataSource.getCameraUploadsConfiguration() + override fun getAutomaticUploadsConfiguration(): AutomaticUploadsConfiguration? = + localFolderBackupDataSource.getAutomaticUploadsConfiguration() override fun getFolderBackupConfigurationByNameAsFlow(name: String): Flow = localFolderBackupDataSource.getFolderBackupConfigurationByNameAsFlow(name) diff --git a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/LocalFolderBackupDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/LocalFolderBackupDataSource.kt index fcdcd1aa06f..a0229eaba28 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/LocalFolderBackupDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/LocalFolderBackupDataSource.kt @@ -18,12 +18,12 @@ */ package com.owncloud.android.data.folderbackup.datasources -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration import kotlinx.coroutines.flow.Flow interface LocalFolderBackupDataSource { - fun getCameraUploadsConfiguration(): CameraUploadsConfiguration? + fun getAutomaticUploadsConfiguration(): AutomaticUploadsConfiguration? fun getFolderBackupConfigurationByNameAsFlow(name: String): Flow diff --git a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSource.kt index 66d1a8b4821..591a558c1d5 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSource.kt @@ -22,11 +22,11 @@ import androidx.annotation.VisibleForTesting import com.owncloud.android.data.folderbackup.datasources.LocalFolderBackupDataSource import com.owncloud.android.data.folderbackup.db.FolderBackUpEntity import com.owncloud.android.data.folderbackup.db.FolderBackupDao -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.videoUploadsName -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.videoUploadsName +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @@ -34,13 +34,13 @@ class OCLocalFolderBackupDataSource( private val folderBackupDao: FolderBackupDao, ) : LocalFolderBackupDataSource { - override fun getCameraUploadsConfiguration(): CameraUploadsConfiguration? { + override fun getAutomaticUploadsConfiguration(): AutomaticUploadsConfiguration? { val pictureUploadsConfiguration = folderBackupDao.getFolderBackUpConfigurationByName(pictureUploadsName) val videoUploadsConfiguration = folderBackupDao.getFolderBackUpConfigurationByName(videoUploadsName) if (pictureUploadsConfiguration == null && videoUploadsConfiguration == null) return null - return CameraUploadsConfiguration( + return AutomaticUploadsConfiguration( pictureUploadsConfiguration = pictureUploadsConfiguration?.toModel(), videoUploadsConfiguration = videoUploadsConfiguration?.toModel(), ) diff --git a/owncloudData/src/main/java/com/owncloud/android/data/migrations/Migration_34.kt b/owncloudData/src/main/java/com/owncloud/android/data/migrations/Migration_34.kt index 763e8dd7b9a..f58b2d83e4a 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/migrations/Migration_34.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/migrations/Migration_34.kt @@ -23,10 +23,10 @@ import androidx.room.migration.Migration import androidx.sqlite.db.SupportSQLiteDatabase import com.owncloud.android.data.ProviderMeta.ProviderTableMeta.FOLDER_BACKUP_TABLE_NAME import com.owncloud.android.data.providers.SharedPreferencesProvider -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.videoUploadsName -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.videoUploadsName +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import java.io.File val MIGRATION_33_34 = object : Migration(33, 34) { diff --git a/owncloudData/src/main/java/com/owncloud/android/data/transfers/datasources/implementation/OCLocalTransferDataSource.kt b/owncloudData/src/main/java/com/owncloud/android/data/transfers/datasources/implementation/OCLocalTransferDataSource.kt index e149545590a..df80edfc2da 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/transfers/datasources/implementation/OCLocalTransferDataSource.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/transfers/datasources/implementation/OCLocalTransferDataSource.kt @@ -25,7 +25,7 @@ import androidx.annotation.VisibleForTesting import com.owncloud.android.data.transfers.datasources.LocalTransferDataSource import com.owncloud.android.data.transfers.db.OCTransferEntity import com.owncloud.android.data.transfers.db.TransferDao -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferResult import com.owncloud.android.domain.transfers.model.TransferStatus diff --git a/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSourceTest.kt b/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSourceTest.kt index 81aa2d2eeac..227b5246b1d 100644 --- a/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSourceTest.kt +++ b/owncloudData/src/test/java/com/owncloud/android/data/folderbackup/datasources/implementation/OCLocalFolderBackupDataSourceTest.kt @@ -22,7 +22,7 @@ package com.owncloud.android.data.folderbackup.datasources.implementation import com.owncloud.android.data.folderbackup.datasources.implementation.OCLocalFolderBackupDataSource.Companion.toModel import com.owncloud.android.data.folderbackup.db.FolderBackupDao -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration import com.owncloud.android.testutil.OC_BACKUP import com.owncloud.android.testutil.OC_BACKUP_ENTITY import io.mockk.every @@ -47,11 +47,11 @@ class OCLocalFolderBackupDataSourceTest { } @Test - fun `getCameraUploadsConfiguration returns a CameraUploadsConfiguration when having valid configurations`() { + fun `getAutomaticUploadsConfiguration returns an AutomaticUploadsConfiguration when having valid configurations`() { every { folderBackupDao.getFolderBackUpConfigurationByName(FolderBackUpConfiguration.pictureUploadsName) } returns OC_BACKUP_ENTITY every { folderBackupDao.getFolderBackUpConfigurationByName(FolderBackUpConfiguration.videoUploadsName) } returns OC_BACKUP_ENTITY - val resultCurrent = ocLocalFolderBackupDataSource.getCameraUploadsConfiguration() + val resultCurrent = ocLocalFolderBackupDataSource.getAutomaticUploadsConfiguration() assertEquals(OC_BACKUP_ENTITY.toModel(), resultCurrent?.pictureUploadsConfiguration) assertEquals(OC_BACKUP_ENTITY.toModel(), resultCurrent?.videoUploadsConfiguration) @@ -63,11 +63,11 @@ class OCLocalFolderBackupDataSourceTest { } @Test - fun `getCameraUploadsConfiguration returns null when there are not configurations`() { + fun `getAutomaticUploadsConfiguration returns null when there are not configurations`() { every { folderBackupDao.getFolderBackUpConfigurationByName(FolderBackUpConfiguration.pictureUploadsName) } returns null every { folderBackupDao.getFolderBackUpConfigurationByName(FolderBackUpConfiguration.videoUploadsName) } returns null - val resultCurrent = ocLocalFolderBackupDataSource.getCameraUploadsConfiguration() + val resultCurrent = ocLocalFolderBackupDataSource.getAutomaticUploadsConfiguration() assertNull(resultCurrent) @@ -78,7 +78,7 @@ class OCLocalFolderBackupDataSourceTest { } @Test - fun `getFolderBackupConfigurationByNameAsFlow returns a Flow of CameraUploadsConfiguration when having valid configurations`() = runBlocking { + fun `getFolderBackupConfigurationByNameAsFlow returns a Flow of AutomaticUploadsConfiguration when having valid configurations`() = runBlocking { every { folderBackupDao.getFolderBackUpConfigurationByNameAsFlow(FolderBackUpConfiguration.pictureUploadsName) } returns flowOf( OC_BACKUP_ENTITY ) diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/FolderBackupRepository.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/FolderBackupRepository.kt similarity index 77% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/FolderBackupRepository.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/FolderBackupRepository.kt index cb1ed5dee58..a3481a55c2f 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/FolderBackupRepository.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/FolderBackupRepository.kt @@ -16,14 +16,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads +package com.owncloud.android.domain.automaticuploads -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration import kotlinx.coroutines.flow.Flow interface FolderBackupRepository { - fun getCameraUploadsConfiguration(): CameraUploadsConfiguration? + fun getAutomaticUploadsConfiguration(): AutomaticUploadsConfiguration? fun getFolderBackupConfigurationByNameAsFlow(name: String): Flow diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/CameraUploadsConfiguration.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/AutomaticUploadsConfiguration.kt similarity index 79% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/CameraUploadsConfiguration.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/AutomaticUploadsConfiguration.kt index 7fccecc74f7..ffaba8ab557 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/CameraUploadsConfiguration.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/AutomaticUploadsConfiguration.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.model +package com.owncloud.android.domain.automaticuploads.model -data class CameraUploadsConfiguration( +data class AutomaticUploadsConfiguration( val pictureUploadsConfiguration: FolderBackUpConfiguration?, val videoUploadsConfiguration: FolderBackUpConfiguration? ) { - fun areCameraUploadsDisabled() = pictureUploadsConfiguration == null && videoUploadsConfiguration == null + fun areAutomaticUploadsDisabled() = pictureUploadsConfiguration == null && videoUploadsConfiguration == null } diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/FolderBackUpConfiguration.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/FolderBackUpConfiguration.kt similarity index 97% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/FolderBackUpConfiguration.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/FolderBackUpConfiguration.kt index 1163ba84952..6b2821b821a 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/model/FolderBackUpConfiguration.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/model/FolderBackUpConfiguration.kt @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.model +package com.owncloud.android.domain.automaticuploads.model data class FolderBackUpConfiguration( val accountName: String, diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetCameraUploadsConfigurationUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetAutomaticUploadsConfigurationUseCase.kt similarity index 63% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetCameraUploadsConfigurationUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetAutomaticUploadsConfigurationUseCase.kt index 73497f5cc43..0c21ee6fc28 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetCameraUploadsConfigurationUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetAutomaticUploadsConfigurationUseCase.kt @@ -16,16 +16,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCaseWithResult -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.CameraUploadsConfiguration +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.AutomaticUploadsConfiguration -class GetCameraUploadsConfigurationUseCase( +class GetAutomaticUploadsConfigurationUseCase( private val folderBackupRepository: FolderBackupRepository -) : BaseUseCaseWithResult() { +) : BaseUseCaseWithResult() { - override fun run(params: Unit): CameraUploadsConfiguration? = - folderBackupRepository.getCameraUploadsConfiguration() + override fun run(params: Unit): AutomaticUploadsConfiguration? = + folderBackupRepository.getAutomaticUploadsConfiguration() } diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt similarity index 83% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt index fe6f89754af..8892b135ca8 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetPictureUploadsConfigurationStreamUseCase.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration import kotlinx.coroutines.flow.Flow class GetPictureUploadsConfigurationStreamUseCase( diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt similarity index 77% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt index a6b1bd1d3cb..62548274659 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/GetVideoUploadsConfigurationStreamUseCase.kt @@ -16,12 +16,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.videoUploadsName +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.videoUploadsName import kotlinx.coroutines.flow.Flow class GetVideoUploadsConfigurationStreamUseCase( diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetPictureUploadsUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetPictureUploadsUseCase.kt similarity index 80% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetPictureUploadsUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetPictureUploadsUseCase.kt index 615b8828bbe..a3c774eb716 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetPictureUploadsUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetPictureUploadsUseCase.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.pictureUploadsName class ResetPictureUploadsUseCase( private val folderBackupRepository: FolderBackupRepository diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetVideoUploadsUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetVideoUploadsUseCase.kt similarity index 80% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetVideoUploadsUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetVideoUploadsUseCase.kt index 78b908bf546..4fbc684d8c2 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/ResetVideoUploadsUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/ResetVideoUploadsUseCase.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCase -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration.Companion.videoUploadsName +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration.Companion.videoUploadsName class ResetVideoUploadsUseCase( private val folderBackupRepository: FolderBackupRepository diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SavePictureUploadsConfigurationUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SavePictureUploadsConfigurationUseCase.kt similarity index 84% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SavePictureUploadsConfigurationUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SavePictureUploadsConfigurationUseCase.kt index 198bdec59d4..08e3029bd79 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SavePictureUploadsConfigurationUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SavePictureUploadsConfigurationUseCase.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCaseWithResult -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration class SavePictureUploadsConfigurationUseCase( private val folderBackupRepository: FolderBackupRepository diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SaveVideoUploadsConfigurationUseCase.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SaveVideoUploadsConfigurationUseCase.kt similarity index 84% rename from owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SaveVideoUploadsConfigurationUseCase.kt rename to owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SaveVideoUploadsConfigurationUseCase.kt index 7759101de0d..afa185b4f0a 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/camerauploads/usecases/SaveVideoUploadsConfigurationUseCase.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/automaticuploads/usecases/SaveVideoUploadsConfigurationUseCase.kt @@ -16,11 +16,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.owncloud.android.domain.camerauploads.usecases +package com.owncloud.android.domain.automaticuploads.usecases import com.owncloud.android.domain.BaseUseCaseWithResult -import com.owncloud.android.domain.camerauploads.FolderBackupRepository -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.FolderBackupRepository +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration class SaveVideoUploadsConfigurationUseCase( private val folderBackupRepository: FolderBackupRepository diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/OCTransfer.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/OCTransfer.kt index aa4733f6d8d..d6e82d41f49 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/OCTransfer.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/OCTransfer.kt @@ -22,7 +22,7 @@ package com.owncloud.android.domain.transfers.model import android.os.Parcelable -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import kotlinx.parcelize.Parcelize import java.io.File diff --git a/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/UploadEnqueuedBy.kt b/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/UploadEnqueuedBy.kt index 016e2192d7c..a124f0ce517 100644 --- a/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/UploadEnqueuedBy.kt +++ b/owncloudDomain/src/main/java/com/owncloud/android/domain/transfers/model/UploadEnqueuedBy.kt @@ -29,6 +29,6 @@ package com.owncloud.android.domain.transfers.model */ enum class UploadEnqueuedBy { ENQUEUED_BY_USER, - ENQUEUED_AS_CAMERA_UPLOAD_PICTURE, - ENQUEUED_AS_CAMERA_UPLOAD_VIDEO; + ENQUEUED_AS_AUTOMATIC_UPLOAD_PICTURE, + ENQUEUED_AS_AUTOMATIC_UPLOAD_VIDEO; } diff --git a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCFolderBackUpConfiguration.kt b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCFolderBackUpConfiguration.kt index 68f22b7879a..8dd9c97e92b 100644 --- a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCFolderBackUpConfiguration.kt +++ b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCFolderBackUpConfiguration.kt @@ -20,8 +20,8 @@ package com.owncloud.android.testutil -import com.owncloud.android.domain.camerauploads.model.FolderBackUpConfiguration -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.FolderBackUpConfiguration +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.data.folderbackup.db.FolderBackUpEntity val OC_BACKUP = FolderBackUpConfiguration( diff --git a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCTransfer.kt b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCTransfer.kt index e66031b5a78..9bca9a6a6dd 100644 --- a/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCTransfer.kt +++ b/owncloudTestUtil/src/main/java/com/owncloud/android/testutil/OCTransfer.kt @@ -20,7 +20,7 @@ package com.owncloud.android.testutil -import com.owncloud.android.domain.camerauploads.model.UploadBehavior +import com.owncloud.android.domain.automaticuploads.model.UploadBehavior import com.owncloud.android.domain.transfers.model.OCTransfer import com.owncloud.android.domain.transfers.model.TransferStatus import com.owncloud.android.domain.transfers.model.UploadEnqueuedBy