attempt to fix cancel button
This commit is contained in:
parent
7175f4e6bc
commit
925f47034c
|
@ -56,15 +56,7 @@
|
|||
|
||||
</provider>
|
||||
|
||||
<receiver
|
||||
android:name=".core.downloader.DownloadBroadcastReceiver"
|
||||
android:exported="false">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="cancel" />
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
<receiver android:name=".core.downloader.DownloadBroadcastReceiver"/>
|
||||
|
||||
<service android:name=".core.installer.SplitInstallerService" />
|
||||
<service android:name=".core.installer.RootSplitInstallerService" />
|
||||
|
|
|
@ -3,14 +3,14 @@ package com.vanced.manager.core.downloader
|
|||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.downloader.PRDownloader
|
||||
|
||||
class DownloadBroadcastReceiver: BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
when (intent?.action) {
|
||||
"cancel" -> PRDownloader.cancel(intent.getStringExtra("dwnldId"))
|
||||
}
|
||||
PRDownloader.cancel(intent?.getStringExtra("dwnldId"))
|
||||
Log.d("VMNotification", "Canceled ${intent?.getStringExtra("dwnldId")} download")
|
||||
|
||||
}
|
||||
}
|
|
@ -32,7 +32,6 @@ object NotificationHelper {
|
|||
Notification.Builder(context).setPriority(Notification.PRIORITY_LOW)
|
||||
|
||||
val cancelDownload = Intent(context, DownloadBroadcastReceiver::class.java).apply {
|
||||
action = "cancel"
|
||||
putExtra("dwnldId", downTag)
|
||||
}
|
||||
val cancelPendingIntent = PendingIntent.getBroadcast(context, 0, cancelDownload, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
|
|
Loading…
Reference in New Issue