8000 chore(samples): Add Custom Tabs screen by romtsn · Pull Request #4799 · getsentry/sentry-java · GitHub
[go: up one dir, main page]

Skip to content

Conversation

romtsn
Copy link
Member
@romtsn romtsn commented Oct 10, 2025

#skip-changelog

📜 Description

Useful to test Session Replay, e.g. for this issue: #3560

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

builder.setInstantAppsEnabled(true);

CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.launchUrl(this, Uri.parse(DEMO_URL));

Choose a reason for hiding this comment

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

Potential bug: The call to customTabsIntent.launchUrl() is not wrapped in a try-catch block, which will cause a crash if no suitable browser is found.
  • Description: The call to customTabsIntent.launchUrl() is not wrapped in a try-catch block to handle ActivityNotFoundException. This exception will be thrown, causing the app to crash, under a few conditions. On devices running Android 11 (API 30) or newer, the crash will occur because the AndroidManifest.xml file is missing the required <queries> element, which prevents the app from discovering installed browsers. The crash can also happen on any Android version if the device has no browser installed or if the installed browsers do not support Custom Tabs. Past Sentry issues (1, 2) confirm ActivityNotFoundException is a recurring problem.

  • Suggested fix: Wrap the customTabsIntent.launchUrl() call in a try-catch block to handle ActivityNotFoundException. In the catch block, you can fall back to a standard ACTION_VIEW intent or show an error message. Additionally, add the appropriate <queries> element to AndroidManifest.xml to ensure browser visibility on Android 11+ devices.
    severity: 0.85, confidence: 0.95

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 404.73 ms 466.37 ms 61.64 ms
Size 1.58 MiB 2.11 MiB 539.18 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3998a95 415.94 ms 478.54 ms 62.60 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
3d205d0 352.15 ms 432.53 ms 80.38 ms
ee747ae 554.98 ms 611.50 ms 56.52 ms
c8125f3 397.65 ms 485.14 ms 87.49 ms
23d6b12 354.10 ms 408.38 ms 54.28 ms
ee747ae 357.79 ms 421.84 ms 64.05 ms
d217708 411.22 ms 430.86 ms 19.63 ms
b3d8889 371.84 ms 447.49 ms 75.65 ms
d217708 375.27 ms 415.68 ms 40.41 ms

App size

Revision Plain With Sentry Diff
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
c8125f3 1.58 MiB 2.10 MiB 532.32 KiB
23d6b12 1.58 MiB 2.10 MiB 532.31 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB

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

0