add a short wakelock at creating the reminder
This commit is contained in:
parent
5c33927754
commit
33d9f02cc7
|
@ -10,6 +10,7 @@
|
|||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR"/>
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR"/>
|
||||
<uses-permission android:name='android.permission.WAKE_LOCK'/>
|
||||
<uses-permission
|
||||
android:name="android.permission.USE_FINGERPRINT"
|
||||
tools:node="remove"/>
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.simplemobiletools.calendar.receivers
|
|||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.PowerManager
|
||||
import com.simplemobiletools.calendar.extensions.dbHelper
|
||||
import com.simplemobiletools.calendar.extensions.notifyEvent
|
||||
import com.simplemobiletools.calendar.extensions.scheduleAllEvents
|
||||
|
@ -12,6 +13,10 @@ import com.simplemobiletools.calendar.helpers.Formatter
|
|||
|
||||
class NotificationReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
|
||||
val wakelock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Simple Calendar")
|
||||
wakelock.acquire(5000)
|
||||
|
||||
context.updateListWidget()
|
||||
val id = intent.getIntExtra(EVENT_ID, -1)
|
||||
if (id == -1)
|
||||
|
|
Loading…
Reference in New Issue