File tree Expand file tree Collapse file tree
app/src/main/java/com/nextcloud/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import androidx.core.app.NotificationCompat
1515import com.nextcloud.client.jobs.notification.WorkerNotificationManager
1616import com.nextcloud.client.jobs.upload.FileUploadHelper
1717import com.nextcloud.client.jobs.upload.UploadBroadcastAction
18+ import com.nextcloud.client.notifications.AppWideNotificationManager
1819import com.nextcloud.utils.extensions.isFileSpecificError
1920import com.owncloud.android.R
2021import com.owncloud.android.authentication.AuthenticatorActivity
@@ -143,9 +144,12 @@ object UploadErrorNotificationManager {
143144 )
144145 }
145146
146- if (result.code == ResultCode .UNAUTHORIZED ) {
147- setContentIntent(credentialPendingIntent(context, operation))
147+ val pendingIntent = if (result.code == ResultCode .UNAUTHORIZED ) {
148+ credentialPendingIntent(context, operation)
149+ } else {
150+ AppWideNotificationManager .getUploadListPendingIntent(context)
148151 }
152+ setContentIntent(pendingIntent)
149153 }.build()
150154 }
151155
Original file line number Diff line number Diff line change @@ -37,17 +37,21 @@ object AppWideNotificationManager {
3737
3838 private const val SYNC_CONFLICT_NOTIFICATION_ID = 112
3939
40- fun showSyncConflictNotification (context : Context ) {
40+ fun getUploadListPendingIntent (context : Context ): PendingIntent {
4141 val intent = Intent (context, UploadListActivity ::class .java).apply {
4242 flags = Intent .FLAG_ACTIVITY_NEW_TASK or Intent .FLAG_ACTIVITY_CLEAR_TOP
4343 }
4444
45- val pendingIntent = PendingIntent .getActivity(
45+ return PendingIntent .getActivity(
4646 context,
4747 SYNC_CONFLICT_NOTIFICATION_INTENT_REQ_CODE ,
4848 intent,
4949 PendingIntent .FLAG_UPDATE_CURRENT or PendingIntent .FLAG_IMMUTABLE
5050 )
51+ }
52+
53+ fun showSyncConflictNotification (context : Context ) {
54+ val pendingIntent = getUploadListPendingIntent(context)
5155
5256 val actionIntent = Intent (context, SyncConflictNotificationBroadcastReceiver ::class .java).apply {
5357 putExtra(SyncConflictNotificationBroadcastReceiver .NOTIFICATION_ID , SYNC_CONFLICT_NOTIFICATION_ID )
You can’t perform that action at this time.
0 commit comments