PoC: Fix external Custom Tab auth callbacks #7399
Draft
+78
−10
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.
Avoid prompting on non-HTTP(s) callback intents when running as an external Custom Tab to prevent OAuth/app-link flows from looping back to the start. Also preserve original Custom Tabs extras when routing into CustomTabActivity and fix incorrect flag bitmasking.
Task/Issue URL: https://app.asana.com/1/137249556945/project/715106103902962/task/1211773313492727?focus=true
Description
Steps to test this PR
Feature 1
UI changes
Note
Avoid prompts for non-HTTP(s) app-link callbacks in external Custom Tabs, preserve original Custom Tabs extras when launching, and fix intent flag composition.
Command.HandleNonHttpAppLink, when in an active external Custom Tab, launch non-HTTP(s) intents directly vialaunchNonHttpAppLinkFromExternalCustomTab(...)(with fallback intent/URL handling and chooser) instead of prompting.BrowserTabFragment.launchNonHttpAppLinkFromExternalCustomTab(...)to handle direct launches and fallbacks.CustomTabActivity.intent(...)to acceptoriginalIntentand copy Custom Tabs extras (e.g., session) before routing toCustomTabActivity.IntentDispatcherActivity.showCustomTab, passoriginalIntent = intentand fix flags from bitwise AND to OR:FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_CLEAR_TASK | FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.Written by Cursor Bugbot for commit 502ddd2. This will update automatically on new commits. Configure here.