Handle ActivityNotFoundException in launchCustomChromeTab#2118
Open
saadkhalidkhan wants to merge 1 commit into
Open
Handle ActivityNotFoundException in launchCustomChromeTab#2118saadkhalidkhan wants to merge 1 commit into
saadkhalidkhan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request centralizes the LocalSnackbarHostState into the core design system and implements error handling for opening links via Chrome Custom Tabs. If no browser is available on the device, a snackbar message is now displayed to the user. The review feedback suggests providing a default value for the CompositionLocal to prevent Composable Previews from crashing and requests the removal of a local utility script (do-commit.ps1) that was inadvertently included.
Catch ActivityNotFoundException when launching a Chrome Custom Tab on devices without a browser installed. Show a Snackbar instead of crashing. Also moves LocalSnackbarHostState from feature/bookmarks/impl to core/designsystem so all modules can access it (resolves existing TODO). Fixes android#1068
329f0fa to
1847fee
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.
Summary
ActivityNotFoundExceptioninlaunchCustomChromeTabto prevent crashes on devices without a browser installedLocalSnackbarHostStatefromfeature/bookmarks/impltocore/designsystemso all modules can access it (resolves existing// TODO: Why is this here?)Fixes #1068
Context
A previous fix (#1090) was closed because it used
Toastinstead ofSnackbar. This PR uses the existingSnackbarHostStateinfrastructure to show a Material-compliant error message.Test plan
./gradlew assembleDemoDebugpasses./gradlew spotlessApplypasses