Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.core.app.NotificationCompat
import com.nextcloud.client.jobs.notification.WorkerNotificationManager
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.jobs.upload.UploadBroadcastAction
import com.nextcloud.client.notifications.AppWideNotificationManager
import com.nextcloud.utils.extensions.isConflict
import com.nextcloud.utils.extensions.isFileSpecificError
import com.owncloud.android.R
Expand Down Expand Up @@ -144,9 +145,12 @@ object UploadErrorNotificationManager {
)
}

if (result.code == ResultCode.UNAUTHORIZED) {
setContentIntent(credentialPendingIntent(context, operation))
val pendingIntent = if (result.code == ResultCode.UNAUTHORIZED) {
credentialPendingIntent(context, operation)
} else {
AppWideNotificationManager.getUploadListPendingIntent(context)
}
setContentIntent(pendingIntent)
}.build()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,21 @@ object AppWideNotificationManager {

private const val SYNC_CONFLICT_NOTIFICATION_ID = 112

fun showSyncConflictNotification(context: Context) {
fun getUploadListPendingIntent(context: Context): PendingIntent {
val intent = Intent(context, UploadListActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}

val pendingIntent = PendingIntent.getActivity(
return PendingIntent.getActivity(
context,
SYNC_CONFLICT_NOTIFICATION_INTENT_REQ_CODE,
intent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
}

fun showSyncConflictNotification(context: Context) {
val pendingIntent = getUploadListPendingIntent(context)

val actionIntent = Intent(context, SyncConflictNotificationBroadcastReceiver::class.java).apply {
putExtra(SyncConflictNotificationBroadcastReceiver.NOTIFICATION_ID, SYNC_CONFLICT_NOTIFICATION_ID)
Expand Down
Loading