Repository navigation
gpui-mobile: pin the #29 review follow-up, draft the reply #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Reply to huacnlee's review of longbridge/gpui-mobile#29 | ||
|
|
||
| Draft, to be posted by hand. All changes are in | ||
| [773e5ad](https://github.com/longbridge/gpui-mobile/pull/29/commits/773e5ade2353399a3bac9f848c8dfd4b4c9a1e19). | ||
|
|
||
| --- | ||
|
|
||
| Thanks for the careful review! All three points are addressed in 773e5ad: | ||
|
|
||
| 1. **Call order / load once.** I went with the lazy option, plus the other two. | ||
| If `AndroidPlatform::new` finds no AssetManager, it logs a `warn!` and keeps | ||
| its text system pending; the next `set_host_activity` that gets an | ||
| AssetManager loads the font into it. This covers `start` running first and a | ||
| failed `getApplicationContext()`/`getAssets()` on the first `onCreate`. A | ||
| mutex is held across the check so a concurrent `set_host_activity` can't slip | ||
| in between. The "What the host has to do" section in `host.rs` now says | ||
| `set_host_activity` comes before `start`, and what happens if it doesn't. | ||
| 2. **Local refs.** `host_assets` now runs inside `env.with_local_frame(2, …)`, | ||
| so `context` and `assets` are freed even if the caller stays in native code. | ||
| 3. **Pending exceptions.** `set_host_activity` is now a thin wrapper that clears | ||
| any pending exception whenever the inner function returns `Err`, so the | ||
| `new_global_ref` / `get_java_vm` paths behave like the asset branch. | ||
|
|
||
| On the suggestions: | ||
|
|
||
| - **Night mode:** #30 covers this. It reads `uiMode` from the application | ||
| context's `Configuration` over JNI on the host path, so it doesn't depend on | ||
| this PR. I'd rather keep the two PRs independent; once both are in, switching | ||
| it to `with_asset_manager(Configuration::from_asset_manager)` is a small | ||
| follow-up if you prefer that. | ||
| - **`to_vec()` copy:** done here, since it was small: `load_asset_bytes` now | ||
| reads the asset into one `Vec::with_capacity(asset.length())` instead of | ||
| mapping it and copying. | ||
|
|
||
| Checked with `cargo clippy --target aarch64-linux-android` (no new warnings). |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this dependency is pinned to
2456b8e,GPUI_MOBILE_REVISIONinsrc/lib.rsstill namesdc07d18; consequently, both the app summary and Diagnostics screen report that newly built APKs use the previous dependency revision. Update that constant alongside this pin so diagnostic reports retain accurate build provenance.Useful? React with 👍 / 👎.