mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-05 10:49:26 +02:00
Improve applying list of suspended apps
This commit is contained in:
parent
9cfe14fbaa
commit
422e823c29
4 changed files with 15 additions and 3 deletions
|
@ -147,8 +147,15 @@ class SuspendAppsLogic(private val appLogic: AppLogic) {
|
|||
}
|
||||
|
||||
private fun applySuspendedApps(packageNames: List<String>) {
|
||||
appLogic.platformIntegration.stopSuspendingForAllApps()
|
||||
appLogic.platformIntegration.setSuspendedApps(packageNames, true)
|
||||
if (packageNames.isEmpty()) {
|
||||
appLogic.platformIntegration.stopSuspendingForAllApps()
|
||||
} else {
|
||||
val allApps = appLogic.platformIntegration.getLocalAppPackageNames()
|
||||
val appsToNotBlock = allApps.subtract(packageNames)
|
||||
|
||||
appLogic.platformIntegration.setSuspendedApps(appsToNotBlock.toList(), false)
|
||||
appLogic.platformIntegration.setSuspendedApps(packageNames, true)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue