mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-05 10:49:26 +02:00
Remove old app suspending logic
This commit is contained in:
parent
d80a7ce878
commit
e83de74f6a
4 changed files with 0 additions and 35 deletions
|
@ -335,14 +335,6 @@ class BackgroundTaskLogic(val appLogic: AppLogic) {
|
|||
if (category == null) {
|
||||
usedTimeUpdateHelper?.commit(appLogic)
|
||||
|
||||
if (
|
||||
AndroidIntegrationApps.ignoredApps[foregroundAppPackageName] == null &&
|
||||
AndroidIntegrationApps.appsToNotSuspend.contains(foregroundAppPackageName) == false
|
||||
) {
|
||||
// don't suspend system apps which are whitelisted in any version
|
||||
appLogic.platformIntegration.setSuspendedApps(listOf(foregroundAppPackageName), true)
|
||||
}
|
||||
|
||||
openLockscreen(foregroundAppPackageName, foregroundAppActivityName)
|
||||
} else if (category.temporarilyBlocked or (parentCategory?.temporarilyBlocked == true)) {
|
||||
usedTimeUpdateHelper?.commit(appLogic)
|
||||
|
|
|
@ -390,14 +390,6 @@ object ApplyServerDataStatus {
|
|||
categoryId = item.categoryId,
|
||||
assignedAppsVersion = item.version
|
||||
)
|
||||
|
||||
if (!database.config().isExperimentalFlagsSetSync(ExperimentalFlags.SYSTEM_LEVEL_BLOCKING)) {
|
||||
if (thisDeviceUserCategoryIds.contains(item.categoryId)) {
|
||||
runAsync {
|
||||
platformIntegration.setSuspendedApps(item.assignedApps, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import io.timelimit.android.async.Threads
|
|||
import io.timelimit.android.coroutines.executeAndWait
|
||||
import io.timelimit.android.crypto.Sha512
|
||||
import io.timelimit.android.data.Database
|
||||
import io.timelimit.android.data.model.ExperimentalFlags
|
||||
import io.timelimit.android.data.model.PendingSyncAction
|
||||
import io.timelimit.android.data.model.PendingSyncActionType
|
||||
import io.timelimit.android.data.model.UserType
|
||||
|
@ -164,22 +163,6 @@ object ApplyActionUtil {
|
|||
|
||||
LocalDatabaseParentActionDispatcher.dispatchParentActionSync(action, database)
|
||||
|
||||
// disable suspending the assigned app
|
||||
if (!database.config().isExperimentalFlagsSetSync(ExperimentalFlags.SYSTEM_LEVEL_BLOCKING)) {
|
||||
if (action is AddCategoryAppsAction) {
|
||||
val thisDeviceId = database.config().getOwnDeviceIdSync()!!
|
||||
val thisDeviceEntry = database.device().getDeviceByIdSync(thisDeviceId)!!
|
||||
|
||||
if (thisDeviceEntry.currentUserId != "") {
|
||||
val userCategories = database.category().getCategoriesByChildIdSync(thisDeviceEntry.currentUserId)
|
||||
|
||||
if (userCategories.find { category -> category.id == action.categoryId } != null) {
|
||||
platformIntegration.setSuspendedApps(action.packageNames, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (action is SetDeviceUserAction) {
|
||||
val thisDeviceId = database.config().getOwnDeviceIdSync()!!
|
||||
|
||||
|
|
|
@ -324,8 +324,6 @@ class LockFragment : Fragment() {
|
|||
val deviceId = deviceIdLive.waitForNullableValue()
|
||||
|
||||
if (deviceId != null) {
|
||||
logic.platformIntegration.setSuspendedApps(listOf(packageName), false)
|
||||
|
||||
Threads.database.executeAndWait(Runnable {
|
||||
try {
|
||||
database.temporarilyAllowedApp().addTemporarilyAllowedAppSync(TemporarilyAllowedApp(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue