Repository navigation
Add Android Wi-Fi Direct browser companion - #11
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acae2c9b13
ℹ️ 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".
| } | ||
| out.flush() | ||
| // shortcut: resumed ranges do not complete transfer history; track coverage if resume completion reporting is needed. | ||
| if (start == 0L && count == f.size) engine.browserDownloaded(t.id, f.id) |
There was a problem hiding this comment.
Complete transfers after a successful resumed download
When an interrupted download is resumed with Range: bytes=N-, the server successfully streams the remaining bytes but this condition prevents browserDownloaded from ever marking the file complete because start != 0. The transfer therefore remains TRANSFERRING after the browser has received the whole file and is eventually recorded as cancelled when the companion session closes; track acknowledged range coverage or otherwise complete a successfully resumed file.
Useful? React with 👍 / 👎.
The home screen now shows a "Share with a phone without the app" button, which shifts every screen built on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d9b1523d5
ℹ️ 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".
| if (ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED) { | ||
| AirBridgeService.start(context); controller.start() | ||
| } else request.launch(permission) | ||
| onDispose { controller.dispose() } |
There was a problem hiding this comment.
Restore the prior receiving state when leaving
When a user whose normal receiving service is disabled opens this screen, AirBridgeService.start() sets the persistent settings.receiving flag to true, but onDispose only disposes the Wi-Fi Direct controller. Returning home therefore leaves AirBridge visible and its foreground service running indefinitely, rather than limiting service lifetime to this companion session; preserve the previous setting and stop or restore the service when the screen closes.
Useful? React with 👍 / 👎.
| if (!res.ok) throw new Error(data.message || "The computer refused"); | ||
| let sentBefore = 0; | ||
| const loaded = files.map(() => 0); | ||
| const started = performance.now(); |
There was a problem hiding this comment.
Settle or cancel every parallel upload after a failure
If any one of the three concurrent XHRs rejects, Promise.all immediately enters the catch/finally path and clears session.busy, while the other worker loops continue uploading and may start additional queued files. The UI then reports failure and permits another send even though the receiver still has an active transfer, so a retry is rejected as busy and data continues moving in the background; abort the remaining XHRs or wait for all workers to settle before clearing the busy state.
Useful? React with 👍 / 👎.
- Wrap the handle around display cutouts - Animate its pull, fade it while idle, and dim it in fullscreen
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d4e81d39d
ℹ️ 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".
| if (Build.VERSION.SDK_INT >= 33) context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED) else context.registerReceiver(receiver, filter) | ||
| registered = true | ||
| scope.launch { delay(30 * 60_000L); stop("Session timed out") } | ||
| scope.launch { delay(30_000); if (active && companion == null) stop("Could not create network. Enable Location on Android 12 or older, then retry.") } |
There was a problem hiding this comment.
Fall back when no peer joins the 5 GHz group
When 5 GHz group creation succeeds but the other phone cannot see or join that band, companion is initialized as soon as the owner group forms, so this timeout no longer runs and the auto-band retry is never attempted; the only fallback is on createGroup failure. Such phones remain unable to connect for the entire session, so keep the timeout active until a peer/browser actually connects and then recreate the group with automatic band selection.
Useful? React with 👍 / 👎.
Summary
Testing
cargo test: 46 passed.