[PR #5994] [client] expose LazyConnectionEnabled in Android Preferences bridge #24532

Open
opened 2026-08-05 06:08:48 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5994
Author: @MichaelUray
Created: 4/25/2026
Status: 🔄 Open

Base: mainHead: feat/android-lazy-connection-toggle-upstream


📝 Commits (2)

  • c17355d [client] expose LazyConnectionEnabled in Android Preferences bridge
  • 5ddcb32 Merge upstream/main into feat/android-lazy-connection-toggle-upstream

📊 Changes

1 file changed (+18 additions, -0 deletions)

View changed files

📝 client/android/preferences.go (+18 -0)

📄 Description

Describe your changes

Adds two methods to the Android Preferences bridge so the Android UI can read and write the existing LazyConnectionEnabled engine setting:

  • GetLazyConnectionEnabled() (bool, error)
  • SetLazyConnectionEnabled(enabled bool)

The implementation mirrors the adjacent BlockInbound bridge: it returns the in-memory configInput value first if set, otherwise falls back to reading the persisted config; the setter buffers the value in configInput and waits for Commit().

N/A — bridge addition only, no behavior change in the engine.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

This is an internal Go-mobile bridge addition with no user-facing surface in this repo. The LazyConnectionEnabled setting itself is already honored by the engine and presumably already documented at the engine level. The Android UI that consumes these methods is filed at netbirdio/android-client#171; if user docs are needed for the toggle, they belong with that UI change.

Docs PR URL (required if "docs added" is checked)

N/A.

Notes

  • The LazyConnectionEnabled field already exists in client/internal/profilemanager/config.go and is honored by the engine; this change only exposes it through the gomobile bridge.
  • Companion UI work that consumes these methods is filed at netbirdio/android-client#171.
  • Verified locally with go build ./client/android/... and go test ./client/android/... (existing tests pass; no new test added because the new methods are pure passthroughs to the well-tested configInput / ReadConfig / UpdateOrCreateConfig code paths). Tested end-to-end on a Galaxy S21 (Android 15) — toggle in the Android UI persists LazyConnectionEnabled to the config file and the engine activates the lazy-connection manager (setup lazy connection service, per-peer activity listeners on 127.0.0.1:N, 15-minute inactivity threshold) as expected.

Documentation

  • Documentation is not needed

These changes are internal lifecycle / behavioural improvements; no user-visible API or CLI flag added that warrants new public docs. Existing flags/Settings already documented at netbirdio/docs cover the surface area.

Summary by CodeRabbit

  • New Features
    • Added lazy-connection preference setting for Android devices, enabling users to configure this option through the app's preferences interface.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5994 **Author:** [@MichaelUray](https://github.com/MichaelUray) **Created:** 4/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/android-lazy-connection-toggle-upstream` --- ### 📝 Commits (2) - [`c17355d`](https://github.com/netbirdio/netbird/commit/c17355dc714616dfc167e9b6c8e16b2108f7aea2) [client] expose LazyConnectionEnabled in Android Preferences bridge - [`5ddcb32`](https://github.com/netbirdio/netbird/commit/5ddcb32d1d1f1e766a7b653113272cb4907e0325) Merge upstream/main into feat/android-lazy-connection-toggle-upstream ### 📊 Changes **1 file changed** (+18 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/android/preferences.go` (+18 -0) </details> ### 📄 Description ## Describe your changes Adds two methods to the Android `Preferences` bridge so the Android UI can read and write the existing `LazyConnectionEnabled` engine setting: - `GetLazyConnectionEnabled() (bool, error)` - `SetLazyConnectionEnabled(enabled bool)` The implementation mirrors the adjacent `BlockInbound` bridge: it returns the in-memory `configInput` value first if set, otherwise falls back to reading the persisted config; the setter buffers the value in `configInput` and waits for `Commit()`. ## Issue ticket number and link N/A — bridge addition only, no behavior change in the engine. ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) This is an internal Go-mobile bridge addition with no user-facing surface in this repo. The `LazyConnectionEnabled` setting itself is already honored by the engine and presumably already documented at the engine level. The Android UI that consumes these methods is filed at netbirdio/android-client#171; if user docs are needed for the toggle, they belong with that UI change. ### Docs PR URL (required if "docs added" is checked) N/A. ## Notes - The `LazyConnectionEnabled` field already exists in `client/internal/profilemanager/config.go` and is honored by the engine; this change only exposes it through the gomobile bridge. - Companion UI work that consumes these methods is filed at netbirdio/android-client#171. - Verified locally with `go build ./client/android/...` and `go test ./client/android/...` (existing tests pass; no new test added because the new methods are pure passthroughs to the well-tested `configInput` / `ReadConfig` / `UpdateOrCreateConfig` code paths). Tested end-to-end on a Galaxy S21 (Android 15) — toggle in the Android UI persists `LazyConnectionEnabled` to the config file and the engine activates the lazy-connection manager (`setup lazy connection service`, per-peer activity listeners on 127.0.0.1:N, 15-minute inactivity threshold) as expected. ## Documentation - [x] Documentation is **not needed** These changes are internal lifecycle / behavioural improvements; no user-visible API or CLI flag added that warrants new public docs. Existing flags/Settings already documented at netbirdio/docs cover the surface area. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added lazy-connection preference setting for Android devices, enabling users to configure this option through the app's preferences interface. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/netbird/pull/5994?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 06:08:48 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#24532