feat: implement Android connectivity detection#14
Open
gabref wants to merge 5 commits into
Open
Conversation
added 5 commits
June 2, 2026 11:13
Linux needs a passive backend that works with NetworkManager when available. Smaller systems without NetworkManager should still get a predictable answer. Use cached NetworkManager properties for connectivity, metering, and transport. Fall back to the kernel route table and sysfs instead of active probes.
Update the Linux support matrix and API docs to describe how the backend maps NetworkManager connectivity, portal state, metering, transport, and constrained fallback behavior.
Manual Linux testing is easier when the example app emits plugin debug logs. Install a debug-friendly tracing subscriber in the example app. Refresh its lockfile for logging and the Linux backend dependency graph.
Document tested Linux scenarios, expected responses, and setup commands. Note that ModemManager cellular and roaming scenarios remain untested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10.
Adds Android support for
connection_status()using Tauri's mobile plugin bridge and Android'sConnectivityManager/NetworkCapabilitiesAPIs.Changes
android/src/main/.src/mobile.rs.ConnectionStatusfields:connected: active network withNET_CAPABILITY_INTERNETandNET_CAPABILITY_VALIDATEDmetered: absence ofNET_CAPABILITY_NOT_METERED, withNET_CAPABILITY_TEMPORARILY_NOT_METEREDtreated as unmetered while presentconstrained: Data Saver /RESTRICT_BACKGROUND_STATUS_ENABLEDconnectionType: Wi-Fi, Ethernet, Cellular, or Unknownandroid.permission.ACCESS_NETWORK_STATEto the Android manifest.src/platform.rsand added a separate mobile bridge path for Android and future mobile platforms.adbcommands and tested scenarios.Testing
Automated:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningsnpm testnpm run eslintnpm run type-checknpm run markdownlintCOMMITLINT_FROM=HEAD~1 COMMITLINT_TO=HEAD npm run commitlint:tauri-plugin-connectivity:testDebugUnitTestManual Android testing with the example app:
Android debug build was also verified with: