Conversation
The "Receive simple data" guide describes a two-step process: declare the intent filters, then route the incoming intent with Compose Navigation's deep link support, "instead of manually intercepting and parsing the Intent". No navDeepLink code appeared anywhere on the page, and the only snippet did the manual interception the prose tells the reader to avoid. Add the missing routing snippet so the code matches the prose. The deep links only route the user to the destination; they do not carry EXTRA_STREAM or EXTRA_TEXT, so SharesheetHandler stays as the step that reads the extras. Declare a link for ACTION_SEND_MULTIPLE too, which the manifest block already declares and the handler already handles. Extract the manifest block, which was still inline on the page. It lives in a stand-alone file under src/main/java so Gradle does not merge it: it declares .ui.MyActivity, which does not exist, and three live ACTION_SEND filters would put the snippets app into every share sheet on the device. Signed-off-by: Ivan Morgillo <imorgillo@gmail.com>
hamen
marked this pull request as ready for review
September 4, 2026 13:46
Collaborator
Author
|
@kkuan2011 this is ready for review |
kkuan2011
approved these changes
Sep 9, 2026
kkuan2011
left a comment
There was a problem hiding this comment.
Looks good once comments are addressed
**The manifest file is gone.** The reviewer's ruling is that manifest snippets are not migrated and stay hardcoded on the page, so extracting one was work in the wrong direction. That also settles an inconsistency this fork had in public: the shortcuts extraction left its manifest block inline on the same reasoning, and the two branches disagreed until now. Her second manifest note is for the page rather than for this branch, and it is a real defect there: the activity carries intent filters and no `android:exported`, so as printed it will not install on API level 31 or higher. That goes to the page owners with the receive.md edit. **The deep link region published code that does not compile.** The tags sat around `SharesheetNavHost()` with the `NavHost` frame inside silent excludes, so the rendered block was a `composable(...)` call floating in a `@Composable` function body with no `NavGraphBuilder` receiver, at eight spaces inside a four-space scope. The description claimed the page showed the `composable(...)` block alone; it did not, and nothing compared the tag, because the page has no block for it to claim yet. The tags now sit around the `composable(...)` call itself and both excludes are gone. Rendered, the block is that call and nothing else, at column zero. Three reviewers reached this independently and each rendered it to prove it. **One comment now matches its siblings.** The page edit reworded the three handlers to "Update UI state with the shared ...", and `android_handle_intent_handle_extra_text` was left on the old wording. It is a published region, so this moves it from 6/6 verbatim to 5/6 against the live page and the wording has to ship in receive.md with the rest. Two review questions are answered rather than changed. `Intent.ACTION_SEND` and `intent.type == "text/plain"` are both part of the rewrite that ships with the page edit, not local preferences: the file does import the bare constant, and `==` is null-safe in Kotlin, so neither is required by the compiler — the page is what decides them, and the page is changing to match. Claude-Session: https://claude.ai/code/session_01P9x2zonc8Jow9hajZw96pn
kkuan2011
approved these changes
Sep 11, 2026
Collaborator
Author
|
Closing — this is now upstream as android/snippets#1085, opened off The branch stays, so the rounds on this PR remain readable. |
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.
Snippets for Receiving simple data. The matching
receive.mdedit is up on the google3 staging environment.Both branches live in this fork. The base,
snapshot/android-snippets-main, is a copy ofandroid/snippets@14ba993, so this diff shows only the two files this change touches. This fork'smaindiverged atb026e52and would add six unrelated files to the view.Why
The routing block was written at the page owners' request, not invented here. A written brief went to them first, naming three findings on this page: the prose contradicting its only snippet, the two-step process being incomplete because
navDeepLinkroutes but does not deliverEXTRA_STREAMorEXTRA_TEXT, and two sentences of View system text with no snippet behind them. They were offered two ways out, the code following the prose or the prose following the code, and chose the first. This branch is that decision.The guide told the reader to route the incoming
ACTION_SENDintent with Compose Navigation's deep link support, "instead of manually intercepting and parsing the Intent". NonavDeepLinkcode appeared anywhere on the page, and the one snippet did exactly the manual interception the prose says to avoid. The manifest block was still inline rather than included from here.What changed
android_receive_data_nav_deeplinksharesheet/SharesheetSnippets.ktcomposable(...)call alone.android_handle_intent_action_data_sentsharesheet/SharesheetSnippets.ktb026e52#L35-L77.android_handle_intent_handle_extra_textsharesheet/SharesheetSnippets.ktThe manifest block stays on the page. An earlier revision of this branch extracted it into
sharesheet/AndroidManifest.xml. On review that was the wrong direction: manifest snippets are not migrated, so the file is deleted and the block stays hardcoded inreceive.md. That also settles an inconsistency this fork had in public, since the shortcuts extraction had left its own manifest block inline.One thing for the page while that block is being edited: the activity declares intent filters and no
android:exported, so as printed it will not install on API level 31 or higher. It wantsandroid:exported="true"to receive incoming share intents.Deviations from the published page
android_handle_intent_action_data_sentno longer matches the live page. It carries the rewrite that ships with thereceive.mdedit:privatehandlers,Intent.ACTION_SENDin place of the bare importedACTION_SEND,?.leton the nullable results, and reworded comments. The page and this region land together.ACTION_SEND_MULTIPLEwithimage/*. The manifest declares that filter andSharesheetHandlerhandles it, so leaving it out would give a reader who follows steps 1 and 2 no route for multiple images.android_handle_intent_handle_extra_textmoves from 6/6 verbatim to 5/6. Its comment is reworded to match the three the rewrite already changed, which collapses the page's two comment lines into one. That wording ships inreceive.mdwith the rest.composable(...)call itself, with no exclude blocks. Rendered, it publishes that call and nothing else. An earlier revision tagged the wholeSharesheetNavHost()function and hid theNavHostframe in silent excludes, which published acomposable(...)call with noNavGraphBuilderreceiver — code that does not compile.Checks
assembleDebugandspotlessCheckpass.check-snippets.mjsreports both remaining regions as differing from the live page by exactly the rewrite above, which lands with thereceive.mdedit.android_handle_intent_action_data_sentandroid_handle_intent_handle_extra_textandroid_receive_data_nav_deeplinkThe deep link region cannot be compared against the live page, and that is not an oversight. The page publishes no block for it — that is the gap this change exists to close — so the check lists the tag as unplaced and never compares it. It can only be checked against the staged
receive.md, and it should be, by whoever lands that edit. Every other region on the page is compared above. The mapping for this page is kept ingoogle-dac-teamso the comparison can be re-run by somebody who did not write it.