@@ -121,6 +121,7 @@ class UploadWorker(
121
121
private var notificationFinishingTitle : String? ,
122
122
var contribution : Contribution ? ,
123
123
) {
124
+ @SuppressLint(" MissingPermission" )
124
125
fun onProgress (
125
126
transferred : Long ,
126
127
total : Long ,
@@ -175,6 +176,7 @@ class UploadWorker(
175
176
.setProgress(100 , 0 , true )
176
177
.setOngoing(true )
177
178
179
+ @SuppressLint(" MissingPermission" )
178
180
override suspend fun doWork (): Result {
179
181
try {
180
182
var totalUploadsStarted = 0
@@ -298,7 +300,7 @@ class UploadWorker(
298
300
* Upload the contribution
299
301
* @param contribution
300
302
*/
301
- @SuppressLint(" StringFormatInvalid" , " CheckResult" )
303
+ @SuppressLint(" StringFormatInvalid" , " CheckResult" , " MissingPermission " )
302
304
private suspend fun uploadContribution (contribution : Contribution ) {
303
305
if (contribution.localUri == null || contribution.localUri.path == null ) {
304
306
Timber .e(""" upload: ${contribution.media.filename} failed, file path is null""" )
@@ -439,7 +441,7 @@ class UploadWorker(
439
441
username,
440
442
)
441
443
CommonsApplication
442
- .instance!!
444
+ .instance
443
445
.clearApplicationData(appContext, logoutListener)
444
446
}
445
447
}
@@ -581,7 +583,7 @@ class UploadWorker(
581
583
* Notify that the current upload has succeeded
582
584
* @param contribution
583
585
*/
584
- @SuppressLint(" StringFormatInvalid" )
586
+ @SuppressLint(" StringFormatInvalid" , " MissingPermission " )
585
587
private fun showSuccessNotification (contribution : Contribution ) {
586
588
val displayTitle = contribution.media.displayTitle
587
589
contribution.state = Contribution .STATE_COMPLETED
@@ -606,7 +608,7 @@ class UploadWorker(
606
608
* Notify that the current upload has failed
607
609
* @param contribution
608
610
*/
609
- @SuppressLint(" StringFormatInvalid" )
611
+ @SuppressLint(" StringFormatInvalid" , " MissingPermission " )
610
612
private fun showFailedNotification (contribution : Contribution ) {
611
613
val displayTitle = contribution.media.displayTitle
612
614
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity ::class .java))
@@ -626,7 +628,7 @@ class UploadWorker(
626
628
)
627
629
}
628
630
629
- @SuppressLint(" StringFormatInvalid" )
631
+ @SuppressLint(" StringFormatInvalid" , " MissingPermission " )
630
632
private fun showInvalidLoginNotification (contribution : Contribution ) {
631
633
val displayTitle = contribution.media.displayTitle
632
634
currentNotification
@@ -648,7 +650,7 @@ class UploadWorker(
648
650
/* *
649
651
* Shows a notification for a failed contribution upload.
650
652
*/
651
- @SuppressLint(" StringFormatInvalid" )
653
+ @SuppressLint(" StringFormatInvalid" , " MissingPermission " )
652
654
private fun showErrorNotification (contribution : Contribution ) {
653
655
val displayTitle = contribution.media.displayTitle
654
656
currentNotification
@@ -671,6 +673,7 @@ class UploadWorker(
671
673
* Notify that the current upload is paused
672
674
* @param contribution
673
675
*/
676
+ @SuppressLint(" MissingPermission" )
674
677
private fun showPausedNotification (contribution : Contribution ) {
675
678
val displayTitle = contribution.media.displayTitle
676
679
@@ -695,6 +698,7 @@ class UploadWorker(
695
698
* Notify that the current upload is cancelled
696
699
* @param contribution
697
700
*/
701
+ @SuppressLint(" MissingPermission" )
698
702
private fun showCancelledNotification (contribution : Contribution ) {
699
703
val displayTitle = contribution.media.displayTitle
700
704
currentNotification.setContentIntent(getPendingIntent(UploadProgressActivity ::class .java))
0 commit comments