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