Skip to content

Commit

Permalink
perf: 降低轮询 shizuku 频率
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Dec 30, 2023
1 parent 3e945be commit 6039f8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/service/GkdAbService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class GkdAbService : CompositionAbService({
onAccessibilityEvent { // 借助无障碍轮询校验 shizuku 权限
if (storeFlow.value.enableShizuku && it.eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {// 筛选降低判断频率
val t = System.currentTimeMillis()
if (t - lastCheckShizukuTime > 5000L) {
if (t - lastCheckShizukuTime > 30_000L) {
lastCheckShizukuTime = t
scope.launchTry(Dispatchers.IO) {
shizukuGrantFlow.value = if (shizukuAliveFlow.value) {
Expand Down

0 comments on commit 6039f8c

Please sign in to comment.