mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 02:36:12 -04:00
fix: Address Codex review on auto-monitor-mode
- Seed connectedDevices flow with onStart so ALWAYS autolaunch fires before HEADSET profile binds - Gate UnavailableMissingPermission classification on Android 12+ (BLUETOOTH_CONNECT only exists from API 31) - Treat blank/empty profile.address as unpaired (matches AutoConnect) - Subscribe DeviceSettingsViewModel to nudgeCapabilityStore.availability so UI updates immediately on verdict change - Seed availability StateFlow with the persisted value via valueBlocking to close the cold-start race
This commit is contained in:
committed by
Matthias Urhahn
parent
1eeeb63a76
commit
0e6848d886
@@ -85,6 +85,20 @@ class MonitorModeResolverTest : BaseTest() {
|
||||
resolver.effectiveMode.first() shouldBe MonitorMode.MANUAL
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `case 4 variant - profile with blank address is treated as unpaired`() = runTest {
|
||||
profilesFlow.value = listOf(profile(address = "", autoConnect = true))
|
||||
|
||||
resolver.effectiveMode.first() shouldBe MonitorMode.MANUAL
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `case 4 variant - profile with whitespace address is treated as unpaired`() = runTest {
|
||||
profilesFlow.value = listOf(profile(address = " ", autoConnect = true))
|
||||
|
||||
resolver.effectiveMode.first() shouldBe MonitorMode.MANUAL
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `multi-profile primary-only - primary case 2 + secondary case 3 - AUTOMATIC`() = runTest {
|
||||
profilesFlow.value = listOf(
|
||||
|
||||
Reference in New Issue
Block a user