Skip to content

Commit

Permalink
perf: reset topActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 5, 2024
1 parent f30dda4 commit 4694290
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/src/main/kotlin/li/songe/gkd/service/GkdAbService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ class GkdAbService : CompositionAbService({
topActivityFlow.value = TopActivity(appId = rightAppId)
}
getAndUpdateCurrentRules()
if (queryTaskJob?.isActive != true) {
Thread.sleep(300)
newQueryTask()
scope.launch(actionThread) {
delay(300)
if (queryTaskJob?.isActive != true) {
newQueryTask()
}
}
}
}
Expand All @@ -206,7 +208,7 @@ class GkdAbService : CompositionAbService({
}
if (activityRule !== getAndUpdateCurrentRules()) break
if (rule.checkDelay() && rule.actionDelayJob == null) {
rule.actionDelayJob = scope.launch(queryThread) {
rule.actionDelayJob = scope.launch(actionThread) {
delay(rule.actionDelay)
rule.actionDelayJob = null
newQueryTask()
Expand Down

0 comments on commit 4694290

Please sign in to comment.