Add support for multiple parallel instances (or at least I hope so lol)
This commit is contained in:
parent
25fc67c67b
commit
90958e0d80
1 changed files with 4 additions and 3 deletions
|
@ -12,16 +12,17 @@ import androidx.core.app.NotificationCompat
|
||||||
import eu.depau.etchdroid.R
|
import eu.depau.etchdroid.R
|
||||||
import eu.depau.etchdroid.kotlin_exts.toHRSize
|
import eu.depau.etchdroid.kotlin_exts.toHRSize
|
||||||
import eu.depau.etchdroid.kotlin_exts.toHRTime
|
import eu.depau.etchdroid.kotlin_exts.toHRTime
|
||||||
|
import java.util.*
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
|
|
||||||
abstract class UsbWriteService(name: String) : IntentService(name) {
|
abstract class UsbWriteService(name: String) : IntentService(name) {
|
||||||
val TAG = name
|
val TAG = name
|
||||||
val FOREGROUND_ID = 1931
|
val FOREGROUND_ID = Random().nextInt()
|
||||||
val RESULT_NOTIFICATION_ID = 3829
|
val RESULT_NOTIFICATION_ID = Random().nextInt()
|
||||||
val WRITE_PROGRESS_CHANNEL_ID = "eu.depau.etchdroid.notifications.USB_WRITE_PROGRESS"
|
val WRITE_PROGRESS_CHANNEL_ID = "eu.depau.etchdroid.notifications.USB_WRITE_PROGRESS"
|
||||||
val WRITE_RESULT_CHANNEL_ID = "eu.depau.etchdroid.notifications.USB_WRITE_RESULT"
|
val WRITE_RESULT_CHANNEL_ID = "eu.depau.etchdroid.notifications.USB_WRITE_RESULT"
|
||||||
val WAKELOCK_TAG = "eu.depau.etchdroid.wakelocks.USB_WRITING"
|
val WAKELOCK_TAG = "eu.depau.etchdroid.wakelocks.USB_WRITING-$FOREGROUND_ID"
|
||||||
|
|
||||||
private var prevTime = System.currentTimeMillis()
|
private var prevTime = System.currentTimeMillis()
|
||||||
private var prevBytes = 0L
|
private var prevBytes = 0L
|
||||||
|
|
Loading…
Reference in a new issue