GoogleChrome / GoogleChrome/android-browser-helper
Chrome or samsung browser not find or not detected as custom tab compatible
- Dominant language
- Java
- Stars
- 832
- Forks
- 370
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
**Describe the bug**
Users are experiencing issues with our twa app.
Device that are using chrome cannot open chrome.
The issue:
It seems that the package manager is unable to get the installed browser on the phone.
Sometimes it returns that chrome browser is installed but it fails to detected it as a custom tab compatible browser.
It is not a consistent bug. Most of the user are able to use the app for some times and suddenly the app is unable to find the browsers.
Uninstalling the app does not fix the issue.
A clone app (by changing the appID) will work even if the original one is not.
**Expected behavior**
Browser & custom tab browser should be find
**Did this ever used to work**
Use to have incompatibility with some phones, but the issue start to increase a lot mostly on samsung phones
**Code Snippets**
Class: Token.class : PackageIdentityUtils.getFingerprintsForPackage(packageName, packageManager);
Class from lib, does not find any app even if installed on the phone.
https://github.com/GoogleChrome/android-browser-helper/blob/7a2953b33daf921a6fe5e576d22e2af7664a2743/androidbrowserhelper/src/main/java/com/google/androidbrowserhelper/trusted/TwaProviderPicker.java#L49
"pm.queryIntentActivities(queryBrowsersIntent, PackageManager.MATCH_DEFAULT_ONLY);" returns nothing
There is no way to reproduce it, it's completely random. A working device can suddenly stop working.
**Smartphone (please complete the following information):**
- Device: Mostly samsung
- OS: all but 13 & 14 are most represented
- Browsers Installed: chrome, or samsung browser
- Browser Versions: chrome 123 or samsung browser 24
- android-browser-helper: 2.3.0
Contributor guide
Research direction
Start with Token.class, PackageIdentityUtils.getFingerprintsForPackage, and TwaProviderPicker.java around line 49, where PackageManager.MATCH_DEFAULT_ONLY returns no activities. Investigate detection on Samsung devices running Chrome 123 or Samsung Browser 24, then verify that installed browsers are reliably found and recognized as Custom Tabs compatible; reproduction is currently unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100