Remove static wakelock
This commit is contained in:
parent
2ba1d35c66
commit
4cda3d9f8d
@ -36,7 +36,7 @@ class RegisterBroadcastReceiver : BroadcastReceiver() {
|
|||||||
|
|
||||||
override fun onReceive(rContext: Context, intent: Intent?) {
|
override fun onReceive(rContext: Context, intent: Intent?) {
|
||||||
val context = rContext.applicationContext
|
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)
|
newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK_TAG)
|
||||||
}
|
}
|
||||||
wakeLock?.acquire(30000L /*30 secs*/)
|
wakeLock?.acquire(30000L /*30 secs*/)
|
||||||
@ -129,8 +129,4 @@ class RegisterBroadcastReceiver : BroadcastReceiver() {
|
|||||||
list.remove(token)
|
list.remove(token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
|
||||||
private var wakeLock: PowerManager.WakeLock? = null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user