Remove static wakelock

This commit is contained in:
sim 2023-08-31 01:47:08 +02:00
parent 2ba1d35c66
commit 4cda3d9f8d
1 changed files with 1 additions and 5 deletions

View File

@ -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
}
}