mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 17:59:51 +02:00
Extend connected mode migration routine
This commit is contained in:
parent
b03f3910de
commit
214e62a5ae
1 changed files with 37 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* TimeLimit Copyright <C> 2019 Jonas Lochmann
|
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -144,6 +144,35 @@ data class OfflineModeStatus(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (category.minBatteryLevelMobile > 0 || category.minBatteryLevelWhileCharging > 0) {
|
||||||
|
apply(
|
||||||
|
UpdateCategoryBatteryLimit(
|
||||||
|
categoryId = category.id,
|
||||||
|
mobileLimit = category.minBatteryLevelMobile,
|
||||||
|
chargingLimit = category.minBatteryLevelWhileCharging
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category.timeWarnings != 0) {
|
||||||
|
apply(
|
||||||
|
UpdateCategoryTimeWarningsAction(
|
||||||
|
categoryId = category.id,
|
||||||
|
enable = true,
|
||||||
|
flags = category.timeWarnings
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category.blockAllNotifications) {
|
||||||
|
apply(
|
||||||
|
UpdateCategoryBlockAllNotificationsAction(
|
||||||
|
categoryId = category.id,
|
||||||
|
blocked = true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// add category apps
|
// add category apps
|
||||||
val thisCategoryApps = categoryApps.filter { it.categoryId == category.id }
|
val thisCategoryApps = categoryApps.filter { it.categoryId == category.id }
|
||||||
if (thisCategoryApps.isNotEmpty()) {
|
if (thisCategoryApps.isNotEmpty()) {
|
||||||
|
@ -219,5 +248,12 @@ data class OfflineModeStatus(
|
||||||
considerRebootManipulation = true
|
considerRebootManipulation = true
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.enableActivityLevelBlocking) {
|
||||||
|
apply(UpdateEnableActivityLevelBlocking(
|
||||||
|
deviceId = newDeviceId,
|
||||||
|
enable = true
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue