Skip to content

Commit

Permalink
perf: 优化shizuku获取间隔
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 27, 2023
1 parent d4408e5 commit a06a140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/li/songe/gkd/service/GkdAbService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class GkdAbService : CompositionAbService({
lastTriggerShizukuTime =
if (newActivityId.startsWith("android.view.") || newActivityId.startsWith("android.widget.")) {
val t = System.currentTimeMillis()
if (t - lastTriggerShizukuTime < if (currentRulesFlow.value.isNotEmpty()) 100 else 200) {
if (t - lastTriggerShizukuTime < if (currentRulesFlow.value.isNotEmpty()) 200 else 400) {
return@onAccessibilityEvent
}
t
Expand Down Expand Up @@ -157,7 +157,7 @@ class GkdAbService : CompositionAbService({
if (rightAppId != topActivityFlow.value?.appId) {
topActivityFlow.value = topActivityFlow.value?.copy(
appId = rightAppId,
activityId = getActivityIdByShizuku() ?: topActivityFlow.value?.activityId
activityId = getActivityIdByShizuku() ?: launcherActivityIdFlow.value
)
return@launchWhile
} else if (topActivityFlow.value?.activityId == null) {
Expand Down

0 comments on commit a06a140

Please sign in to comment.