Skip to content

Conversation

@RasaCosmin
Copy link

This PR adds validation for the packages selected as browsers.

I encountered an issue on a device with Google Chrome disabled and another browser set as the default. Also, that device has an application installed that appears when querying for ACTION_CUSTOM_TABS_CONNECTION but is not a browser. This app is listed first and is returned as a valid browser, but it cannot be used to open a URL.

To address this, each package is checked for validity as a browser using the isBrowserPackage function.

Copilot AI review requested due to automatic review settings October 16, 2025 12:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves browser selection in WebAuthenticationProvider by adding validation to ensure selected packages are actual browsers capable of opening URLs. The change addresses an issue where non-browser apps that support Custom Tabs connections could be incorrectly selected, causing launch failures.

Key changes:

  • Added a new isBrowserPackage function to validate that a package can handle VIEW intents with BROWSABLE category
  • Updated browser selection logic to validate both preferred and available Custom Tabs providers before returning them
  • Enhanced test coverage with a new test case for Custom Tabs providers that aren't browsers

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
WebAuthenticationProvider.kt Implemented browser validation logic and refactored browser selection to check packages before returning them
DefaultWebAuthenticationProviderTest.kt Added test for non-browser Custom Tabs providers and updated helper method to support this scenario

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RasaCosmin RasaCosmin requested a review from Copilot October 20, 2025 14:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant