Conversation
Increased the reconnect delay from 4 seconds to 8 seconds and modified network request capabilities.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a33d83085d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resolvedSsid = fallbackSsid | ||
| onSsidResolved?.invoke(fallbackSsid) | ||
| _state.value = WifiState( | ||
| status = WifiConnStatus.CONNECTED, |
There was a problem hiding this comment.
Resolve the Network before publishing fallback CONNECTED
In the Android 11 fallback path, this publishes CONNECTED from WifiManager.connectionInfo without ever assigning this@DashWifiManager.network. In the OEM/manual-join case this fallback is meant to cover, onAvailable may not have supplied a Network, so DashViewModel.confirmDiscoveredDash() later passes wifiManager.network as null and DashSocket cannot bind its UDP sockets to the dash Wi-Fi; auth/video traffic can then route over the default network instead of 192.168.1.1. Please resolve and store the Wi-Fi Network (or keep waiting) before reporting a usable connection.
Useful? React with 👍 / 👎.
| // with a valid SSID. We poll WifiManager.connectionInfo (deprecated but the only | ||
| // reliable path on API 30 with location permission) until we get the real SSID. | ||
| if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { | ||
| scope.launch { |
There was a problem hiding this comment.
Cancel the Android 11 SSID poll on release
This poll is launched in the ViewModel scope but is not retained or canceled by release()/disconnect(). If the user cancels or retries within the initial 5-second delay, the stale coroutine can still read the old/current active Wi-Fi, invoke onSsidResolved, and set the manager back to CONNECTED after the request was released. Track this job and cancel it alongside the network callback, or gate the update on the current request and wantConnected.
Useful? React with 👍 / 👎.
Overview
This PR improves OpenDash compatibility on Android 11 (API 30), particularly on ColorOS devices where
WifiNetworkSpecifierbehaves differently compared to newer Android versions.Root Cause
On Android 11 / ColorOS:
WifiNetworkSpecifieropens the system Wi-Fi Settings instead of the in-app pairing dialog.NetworkCapabilities.transportInfomay be unavailable or return<unknown ssid>.RE_) could be propagated into the authentication flow, resulting in authentication failure.Changes
RE_) SSIDs from being used during authentication.transportInfois unavailable.ConnectivityManager.requestNetwork()callback reliability by using an explicitHandler.Tested On
Result
Notes
This PR focuses only on improving Android 11 connectivity.
The following issues are intentionally not addressed in this PR and will be handled separately:
Request for Testing
Feedback from users running Android 12, Android 13, Android 14 and Android 15 would be appreciated to verify that the existing connection flow remains unaffected.