diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/receivers/RegisterBroadcastReceiver.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/receivers/RegisterBroadcastReceiver.kt index 6c98abe..1601805 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/receivers/RegisterBroadcastReceiver.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/receivers/RegisterBroadcastReceiver.kt @@ -36,7 +36,7 @@ class RegisterBroadcastReceiver : BroadcastReceiver() { override fun onReceive(rContext: Context, intent: Intent?) { val context = rContext.applicationContext - wakeLock = (context.getSystemService(Context.POWER_SERVICE) as PowerManager).run { + val wakeLock = (context.getSystemService(Context.POWER_SERVICE) as PowerManager).run { newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK_TAG) } wakeLock?.acquire(30000L /*30 secs*/) @@ -129,8 +129,4 @@ class RegisterBroadcastReceiver : BroadcastReceiver() { list.remove(token) } } - - companion object { - private var wakeLock: PowerManager.WakeLock? = null - } }