优化:监听`Screen`事件细分`On/Off/Locked/Unlocked` #399
This commit is contained in:
parent
f4f6080b9a
commit
ccd98ab2da
|
@ -43,6 +43,8 @@ data class LockScreenSetting(
|
|||
|
||||
timeAfterScreenOff = timeAfterOff
|
||||
timeAfterScreenOn = timeAfterOn
|
||||
timeAfterScreenLocked = timeAfterLocked
|
||||
timeAfterScreenUnlocked = timeAfterUnlocked
|
||||
}
|
||||
|
||||
fun getActionCheckId(): Int {
|
||||
|
|
|
@ -74,6 +74,7 @@ class LockScreenWorker(context: Context, params: WorkerParameters) : CoroutineWo
|
|||
Intent.ACTION_USER_PRESENT -> lockScreenSetting.timeAfterScreenUnlocked
|
||||
else -> lockScreenSetting.timeAfterScreenLocked
|
||||
}
|
||||
Log.d(TAG, "TASK-${task.id}:duration = $duration minutes")
|
||||
val actionRequest = OneTimeWorkRequestBuilder<ActionWorker>()
|
||||
.setInitialDelay(duration.toLong(), TimeUnit.MINUTES)
|
||||
.setInputData(actionData).build()
|
||||
|
|
Loading…
Reference in New Issue