Skip to content

Commit

Permalink
Add dismissAll notification
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Jan 5, 2024
1 parent ae52107 commit be332e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import android.content.Context
import android.content.Intent
import android.graphics.BitmapFactory
import android.os.Build
import android.os.Handler
import android.os.Looper
import androidx.core.app.NotificationCompat
import com.nextcloud.client.account.User
import com.owncloud.android.R
Expand Down Expand Up @@ -197,7 +199,9 @@ class DownloadNotificationManager(private val context: Context, private val view
}

fun dismissAll() {
notificationManager.cancelAll()
Handler(Looper.getMainLooper()).postDelayed({
notificationManager.cancelAll()
}, 2000)
}

fun setCredentialContentIntent(user: User) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class FileDownloadWorker(
notificationManager.init()
addAccountUpdateListener()

setWorkerState(user)
requestDownloads.forEach {
downloadFile(it)
}
Expand Down Expand Up @@ -284,6 +283,7 @@ class FileDownloadWorker(
return
}

setWorkerState(user)
Log_OC.e(TAG, "FilesDownloadWorker downloading: $downloadKey")

val isAccountExist = accountManager.exists(currentDownload?.user?.toPlatformAccount())
Expand Down

0 comments on commit be332e7

Please sign in to comment.