mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-24 23:01:22 -04:00
fix(discovery): unregister packet collector on success, use string resources in settings
- Fix resource leak: collectorRegistry.collector was never cleared in the successful scan completion path (only in stop/abort paths) - Replace hardcoded 'Local Mesh Discovery' strings in both Settings screens with stringResource(Res.string.discovery_local_mesh) - Add missing explicit imports for the CMP string accessor - Remove redundant .gitkeep files from directories with content Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -307,7 +307,8 @@ class DiscoveryScanEngine(
|
||||
persistCurrentDwellResults()
|
||||
}
|
||||
|
||||
// All presets scanned
|
||||
// All presets scanned — unregister packet collector before analysis
|
||||
collectorRegistry.collector = null
|
||||
_scanState.value = DiscoveryScanState.Analysis
|
||||
restoreHomePreset()
|
||||
generateAiSummaries()
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.meshtastic.core.navigation.SettingsRoute
|
||||
import org.meshtastic.core.navigation.WifiProvisionRoute
|
||||
import org.meshtastic.core.resources.Res
|
||||
import org.meshtastic.core.resources.bottom_nav_settings
|
||||
import org.meshtastic.core.resources.discovery_local_mesh
|
||||
import org.meshtastic.core.resources.export_configuration
|
||||
import org.meshtastic.core.resources.filter_settings
|
||||
import org.meshtastic.core.resources.help_and_documentation
|
||||
@@ -242,8 +243,11 @@ fun SettingsScreen(
|
||||
onShowThemePicker = { showThemePickerDialog = true },
|
||||
)
|
||||
|
||||
ExpressiveSection(title = "Local Mesh Discovery") {
|
||||
ListItem(text = "Local Mesh Discovery", leadingIcon = MeshtasticIcons.PermScanWifi) {
|
||||
ExpressiveSection(title = stringResource(Res.string.discovery_local_mesh)) {
|
||||
ListItem(
|
||||
text = stringResource(Res.string.discovery_local_mesh),
|
||||
leadingIcon = MeshtasticIcons.PermScanWifi,
|
||||
) {
|
||||
onNavigate(DiscoveryRoute.DiscoveryGraph)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ import org.meshtastic.core.resources.app_version
|
||||
import org.meshtastic.core.resources.bottom_nav_settings
|
||||
import org.meshtastic.core.resources.device_db_cache_limit
|
||||
import org.meshtastic.core.resources.device_db_cache_limit_summary
|
||||
import org.meshtastic.core.resources.discovery_local_mesh
|
||||
import org.meshtastic.core.resources.help_and_documentation
|
||||
import org.meshtastic.core.resources.info
|
||||
import org.meshtastic.core.resources.modules_already_unlocked
|
||||
@@ -204,8 +205,11 @@ fun DesktopSettingsScreen(
|
||||
)
|
||||
}
|
||||
|
||||
ExpressiveSection(title = "Local Mesh Discovery") {
|
||||
ListItem(text = "Local Mesh Discovery", leadingIcon = MeshtasticIcons.PermScanWifi) {
|
||||
ExpressiveSection(title = stringResource(Res.string.discovery_local_mesh)) {
|
||||
ListItem(
|
||||
text = stringResource(Res.string.discovery_local_mesh),
|
||||
leadingIcon = MeshtasticIcons.PermScanWifi,
|
||||
) {
|
||||
onNavigate(DiscoveryRoute.DiscoveryGraph)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user