mirror of
https://codeberg.org/NextPush/nextpush-android.git
synced 2025-01-15 11:26:09 +01:00
Add wakeLock for the registration Receiver
This commit is contained in:
parent
1ab3eaa83a
commit
8db0e41628
@ -11,6 +11,7 @@ import org.unifiedpush.distributor.nextpush.api.createQueue
|
||||
import org.unifiedpush.distributor.nextpush.api.delQueue
|
||||
import org.unifiedpush.distributor.nextpush.api.apiCreateApp
|
||||
import org.unifiedpush.distributor.nextpush.api.apiDeleteApp
|
||||
import org.unifiedpush.distributor.nextpush.services.wakeLock
|
||||
import java.lang.Exception
|
||||
|
||||
/**
|
||||
@ -22,6 +23,9 @@ private const val TAG = "RegisterBroadcastReceiver"
|
||||
class RegisterBroadcastReceiver : BroadcastReceiver() {
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent?) {
|
||||
wakeLock?.let {
|
||||
it.acquire()
|
||||
}
|
||||
when (intent!!.action) {
|
||||
ACTION_REGISTER ->{
|
||||
Log.i(TAG,"REGISTER")
|
||||
@ -85,5 +89,10 @@ class RegisterBroadcastReceiver : BroadcastReceiver() {
|
||||
}
|
||||
}
|
||||
}
|
||||
wakeLock?.let {
|
||||
if (it.isHeld) {
|
||||
it.release()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user