From c28502fc8a886856a8b74a5971ff05569d7377ea Mon Sep 17 00:00:00 2001 From: darken Date: Tue, 14 Apr 2026 14:34:23 +0200 Subject: [PATCH] refactor(device-settings): Fold Conversation Awareness and Sleep Detection into Reactions AAP vs BLE is an implementation detail. From a user perspective these are 'when X happens, do Y' toggles like Auto Play/Pause. Gate them on device.isAapConnected so they stay hidden on phones without L2CAP support, avoiding confusion. The separate 'Smart features' section and its string resource are removed. --- .../ui/devicesettings/DeviceSettingsScreen.kt | 60 ++++++++----------- app/src/main/res/values/strings.xml | 1 - 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/main/ui/devicesettings/DeviceSettingsScreen.kt b/app/src/main/java/eu/darken/capod/main/ui/devicesettings/DeviceSettingsScreen.kt index 82fa14c6..14f8b654 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/devicesettings/DeviceSettingsScreen.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/devicesettings/DeviceSettingsScreen.kt @@ -353,6 +353,32 @@ fun DeviceSettingsScreen( ) } } + if (device.isAapConnected) { + val convAwareness = device.conversationalAwareness + if (features.hasConversationAwareness && convAwareness != null) { + SettingsSwitchItem( + icon = Icons.TwoTone.Hearing, + title = stringResource(R.string.conversation_awareness_label), + subtitle = stringResource(R.string.device_settings_conversation_awareness_description), + checked = convAwareness.enabled, + onCheckedChange = onConversationalAwarenessChange, + enabled = enabled, + ) + } + if (features.hasSleepDetection) { + val sleepDet = device.sleepDetection + ?: AapSetting.SleepDetection(enabled = true) + SettingsSwitchItem( + icon = Icons.TwoTone.Nightlight, + title = stringResource(R.string.device_settings_sleep_detection_label), + subtitle = stringResource(R.string.device_settings_sleep_detection_description), + checked = sleepDet.enabled, + onCheckedChange = onSleepDetectionChange, + enabled = enabled, + requiresUpgrade = !isPro, + ) + } + } SettingsSwitchItem( icon = Icons.TwoTone.BluetoothConnected, title = stringResource(R.string.settings_autoconnect_label), @@ -517,40 +543,6 @@ fun DeviceSettingsScreen( } } - // ── Smart Features ─────────────────────────── - val convAwareness = device.conversationalAwareness - val showSmartFeaturesSection = - (features.hasConversationAwareness && convAwareness != null) || features.hasSleepDetection - if (showSmartFeaturesSection) { - item("smart_features_section") { - SettingsSection(title = stringResource(R.string.device_settings_category_smart_features_label)) { - if (features.hasConversationAwareness && convAwareness != null) { - SettingsSwitchItem( - icon = Icons.TwoTone.Hearing, - title = stringResource(R.string.conversation_awareness_label), - subtitle = stringResource(R.string.device_settings_conversation_awareness_description), - checked = convAwareness.enabled, - onCheckedChange = onConversationalAwarenessChange, - enabled = enabled, - ) - } - if (features.hasSleepDetection) { - val sleepDet = device.sleepDetection - ?: AapSetting.SleepDetection(enabled = true) - SettingsSwitchItem( - icon = Icons.TwoTone.Nightlight, - title = stringResource(R.string.device_settings_sleep_detection_label), - subtitle = stringResource(R.string.device_settings_sleep_detection_description), - checked = sleepDet.enabled, - onCheckedChange = onSleepDetectionChange, - enabled = enabled, - requiresUpgrade = !isPro, - ) - } - } - } - } - // ── Controls ───────────────────────────────── val pressSpd = device.pressSpeed val pressHold = device.pressHoldDuration diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d2098778..e5a9f72f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -444,7 +444,6 @@ This phone\'s Bluetooth does not support the connection required for advanced AirPods settings. Sound Controls - Smart features Noise Cancellation with One AirPod Keep noise cancellation active with only one AirPod Personalized Volume