Repository navigation
[ai] smb: Handle optional Wi-Fi and unavailable local networks. - #4751
Merged
VishnuSanal merged 1 commit intoDec 2, 2026
Merged
VishnuSanal merged 1 commit into
VishnuSanal merged 1 commit into
Conversation
carrerasdarren-cell
force-pushed
the
fix/smb-optional-wifi-4708
branch
from
October 20, 2026 16:08
1635aa8 to
95abd50
Compare
Collaborator
|
May need rebase with the latest |
carrerasdarren-cell
force-pushed
the
fix/smb-optional-wifi-4708
branch
from
November 8, 2026 13:14
95abd50 to
2aeb7bb
Compare
VishnuSanal
reviewed
Nov 8, 2026
VishnuSanal
left a comment
Member
There was a problem hiding this comment.
code looks good, I also tested turning off the WiFi and it shows the dialog as expected. ran the tests locally and works as expected too. but I don't have an Android TV or something to test the actual error reported..
Member
|
maybe @EmmanuelMess can test this finally (if you still have the TV emulator setup) before merging.. |
VishnuSanal
approved these changes
Nov 8, 2026
Member
|
@carrerasdarren-cell oh, the tests fail - can you pls rebase this on top of current HEAD (one last time!) |
Treat the Wi-Fi multicast lock as optional so local-network discovery still works on Ethernet. Explain the network requirement when discovery cannot start and keep manual host entry and cancellation available. Initialize the discovery disposable so the offline dialog dismisses safely. Disambiguate the two MockK verifications against Android 36's NSD overloads without changing their assertions. Rebase on release/4.0 at 6535cf8, which includes the CI runner's higher inotify limit. Codex assisted with the change and validation. Fixes TeamAmaze#4708.
carrerasdarren-cell
force-pushed
the
fix/smb-optional-wifi-4708
branch
from
December 2, 2026 03:59
2aeb7bb to
6373059
Compare
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.
Fixes: #4708
Description
Opening SMB device search can fail while constructing its discovery strategies on a device without the optional Wi-Fi service. Treat the Wi-Fi multicast lock as optional so NSD discovery remains available over Ethernet. When the existing local-network check reports no connection, show an explanation and retain manual hostname entry and cancellation. Initialize the disposable so that this early dialog path can close safely.
The existing
NetworkUtilinterface-name fallback remains unchanged. This is not a universal offline detector; actual hardware discovery is outside the validation below.Issue tracker
Fixes #4708. The related Android TV manifest work in #4705 is already merged; this change handles the runtime SMB dialog and optional Wi-Fi service.
Automatic tests
Added unit tests for specific individual functions
Added headless tests for new app functionality
Added emulator tests for new UI elements
Reproduced the missing-service failure on exact original
94afab32: one selected realMainActivity/DialogFragmentcase fails withnull cannot be cast to non-null type android.net.wifi.WifiManagerthrough the NSD strategy and SMB search dialog.:app:testFdroidDebugUnitTest --tests '*SmbSearchDialogNetworkAvailabilityTest' --tests '*NsdManagerDiscoverDeviceStrategyTest' --tests '*SmbConnectDialogTest' --tests '*NetworkUtilTest' --tests '*SmbDeviceScannerObservableTest': 117 passed, 0 failures/errors/skips on the final source. This includes 15 new dialog cases and 102 existing cases across configured SDKs 21, 28 and 30: manual SMB 9, NetworkUtil 18, NSD 45, scanner 30.New real-dialog controls cover the unavailable-network explanation, manual entry, cancellation, Ethernet discovery without a Wi-Fi manager, and the normal Wi-Fi multicast-lock lifecycle. Services and addresses are synthetic; the other scanner strategies receive no local address, and no real discovery traffic is sent.
The local runner placed caches/reports on the SSD, serialized workers, and passed
--add-opens=java.base/java.net=ALL-UNNAMEDto the JDK 17 test JVM for the existing MockKNetworkInterfacetests. Owner build inputs, dependencies and fail-fast behavior were unchanged. An initial mock-setup mismatch and the initial JDK module-access failure are excluded from the passing evidence. The final message was refined to “local network” to include supported transports such as USB/rndis, then the same 117 cases were rerun successfully.Manual tests
Done
Device: Not performed; validation is headless Robolectric.
OS: No emulator or physical-device validation, screenshots or human review claimed. No device settings were changed.
Build tasks success
Successfully ran the following owner tasks locally on the same final source:
./gradlew assembleDebug— both F-Droid and Play debug APKs built; packaging readback confirms the debug package and optional Wi-Fi declaration../gradlew spotlessCheckGenerative code
This PR used generative code tools (GenAI, LLMs, etc.)
Model: OpenAI Codex coding assistant
Version: Exact runtime model version is not independently exposed in this session.
Provider: OpenAI