Keep listener active for direct alert control
This commit is contained in:
+20
@@ -47,4 +47,24 @@ class AlertListenerPolicyDeviceTest {
|
||||
context.packageManager.getComponentEnabledSetting(component),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun directAlertControlKeepsListenerEnabledWithoutRules() {
|
||||
LoggingType.entries.forEach { LoggingRuleStore(context).save(it, LoggingRule(enabled = false)) }
|
||||
|
||||
AlertConfigurationStore(context).save(
|
||||
AlertConfiguration(appSettings = listOf(AlertAppSettings("example.app", directAlertControl = true))),
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
context.packageManager.getComponentEnabledSetting(component),
|
||||
)
|
||||
|
||||
AlertConfigurationStore(context).save(AlertConfiguration())
|
||||
assertEquals(
|
||||
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
context.packageManager.getComponentEnabledSetting(component),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user