Remove old app suspending logic

This commit is contained in:
Jonas Lochmann 2019-10-14 00:00:00 +00:00
parent d80a7ce878
commit e83de74f6a
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
4 changed files with 0 additions and 35 deletions

View file

@ -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)

View file

@ -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)
}
}
}
}
}

View file

@ -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()!!

View file

@ -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(