mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 19:57:15 +08:00
perf: 优化shizuku获取间隔
This commit is contained in:
parent
d4408e5678
commit
a06a14024c
|
@ -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
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user