From c17355dc714616dfc167e9b6c8e16b2108f7aea2 Mon Sep 17 00:00:00 2001 From: Michael Uray <25169478+MichaelUray@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:58:21 +0000 Subject: [PATCH] [client] expose LazyConnectionEnabled in Android Preferences bridge Mirrors the existing BlockInbound bridge: the new GetLazyConnectionEnabled / SetLazyConnectionEnabled methods read/write the field via the same configInput-buffer-then-Commit pattern, so the Android UI can manage the LazyConnectionEnabled setting that the engine already understands. --- client/android/preferences.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/client/android/preferences.go b/client/android/preferences.go index c3c8eb3fbc9..26687ec8386 100644 --- a/client/android/preferences.go +++ b/client/android/preferences.go @@ -307,6 +307,24 @@ func (p *Preferences) SetBlockInbound(block bool) { p.configInput.BlockInbound = &block } +// GetLazyConnectionEnabled reads the lazy-connection setting from the config file +func (p *Preferences) GetLazyConnectionEnabled() (bool, error) { + if p.configInput.LazyConnectionEnabled != nil { + return *p.configInput.LazyConnectionEnabled, nil + } + + cfg, err := profilemanager.ReadConfig(p.configInput.ConfigPath) + if err != nil { + return false, err + } + return cfg.LazyConnectionEnabled, err +} + +// SetLazyConnectionEnabled stores the given value and waits for commit +func (p *Preferences) SetLazyConnectionEnabled(enabled bool) { + p.configInput.LazyConnectionEnabled = &enabled +} + // Commit writes out the changes to the config file func (p *Preferences) Commit() error { _, err := profilemanager.UpdateOrCreateConfig(p.configInput)