…lines 1–15 unchanged (15 lines)
16import com.nextcloud.client.database.entity.toOCUpload
17import com.nextcloud.client.database.entity.toUploadEntity
18import com.nextcloud.client.device.BatteryStatus
19import com.nextcloud.client.device.PowerManagementService
20import com.nextcloud.client.jobs.BackgroundJobManager
21import com.nextcloud.client.jobs.upload.FileUploadWorker.Companion.currentUploadFileOperation
22import com.nextcloud.client.notifications.AppWideNotificationManager
23import com.nextcloud.client.network.Connectivity
24import com.nextcloud.client.network.ConnectivityService
25import com.nextcloud.utils.extensions.getUploadIds
26import com.owncloud.android.MainApp
27import com.owncloud.android.R
28import com.owncloud.android.datamodel.FileDataStorageManager
…lines 29–167 unchanged (139 lines)
168 connectivityService: ConnectivityService,
169 accountManager: UserAccountManager,
170 powerManagementService: PowerManagementService,
171 uploads: Array<OCUpload>
172 ): Boolean {
173 var showNotExistMessage = false
174 var showSyncConflictNotification = false
175 val isOnline = checkConnectivity(connectivityService)
176 val connectivity = connectivityService.connectivity
177 val batteryStatus = powerManagementService.battery
178
179 val uploadsToRetry = mutableListOf<Long>()
180
181 for (upload in uploads) {
182 if (upload.lastResult == UploadResult.SYNC_CONFLICT) {
183 Log_OC.d(TAG, "retry upload skipped, sync conflict: ${upload.remotePath}")
184 showSyncConflictNotification = true
185 continue
186 }
187
188 val uploadResult = checkUploadConditions(
189 upload,
190 connectivity,
191 batteryStatus,
192 powerManagementService,
…lines 193–218 unchanged (26 lines)
219 accountManager.user,
220 uploadsToRetry.toLongArray(),
221 false
222 )
223 }
224
225 if (showSyncConflictNotification) {
226 AppWideNotificationManager.showSyncConflictNotification(MainApp.getAppContext())
227 }
228
229 return showNotExistMessage
230 }
231
232 @JvmOverloads
233 @Suppress("LongParameterList")
…lines 234–531 unchanged (298 lines)