mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
Child-process check: read the Developer options toggle too
Developer options' "Disable child process restrictions" writes only the feature-flag property persist.sys.fflag.override.settings_enable_monitor_phantom_procs, never the global setting. Android (FeatureFlagUtils.isEnabled) uses the global setting when it is set and that property otherwise, but the check read only the global setting, so a device switched off in Developer options stayed flagged as unset however often Check again was pressed. The check now follows Android's order, and the Setup card no longer says "On" for a setting that is unset or unreadable.
This commit is contained in:
1 parent
1d6827a4dc
commit
63db6fe9b7
3 files changed
+60
-4
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class PhantomProcessLimitTest {
|
||||
@Test
|
||||
fun developerOptionsToggleAloneCountsAsOff() {
|
||||
assertEquals(PhantomProcessStatus.DISABLED, PhantomProcessLimit.status(null, "false"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun globalSettingWinsOverTheProperty() {
|
||||
assertEquals(PhantomProcessStatus.DISABLED, PhantomProcessLimit.status("false", "true"))
|
||||
assertEquals(PhantomProcessStatus.ENABLED, PhantomProcessLimit.status("true", "false"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun emptyGlobalFallsThroughToTheProperty() {
|
||||
assertEquals(PhantomProcessStatus.ENABLED, PhantomProcessLimit.status("", "true"))
|
||||
assertEquals(PhantomProcessStatus.DISABLED, PhantomProcessLimit.status(" ", "0"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun neitherSetIsUnset() {
|
||||
assertEquals(PhantomProcessStatus.UNSET, PhantomProcessLimit.status(null, null))
|
||||
assertEquals(PhantomProcessStatus.UNSET, PhantomProcessLimit.status("", ""))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user