Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a system chooser when opening links in browser in the case there is no browser available #9968

Conversation

AudricV
Copy link
Member

@AudricV AudricV commented Mar 25, 2023

What is it?

  • Bugfix (user facing)

Description of the changes in your PR

This PR makes the app using the behavior when there is no default browser on Android 11 and lower, by opening a system chooser when there is no browser available (on all Android versions).

Also catch any exception when the system chooser cannot be opened and show the "No app on your device can open this" toast in this case, as an ActivityNotFoundException would be thrown if no app is available to open a web link.

These changes have been tested on an Android 14 developer preview 2 emulator and a system chooser is now displayed where there is no browser available, no default app set to open the requested link and an available app.
They also work fine on my physical device running Android 10 when there is no app available to open a web link (the "No app on your device can open this" toast is still shown with this change).

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

…is no browser available

This change makes the app using the behavior when there is no default browser
on Android 11 and lower, by opening a system chooser when there is no browser
available (on all Android versions).

Also catch any exception when the system chooser cannot be opened and show the
"No app on your device can open this" toast in this case, as an
`ActivityNotFoundException` could be thrown if no app is available to open a
given web link.
@AudricV AudricV added bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software labels Mar 25, 2023
Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

code lgtm

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@AudricV AudricV merged commit fb1b1c5 into TeamNewPipe:release-0.25.1 Mar 26, 2023
@AudricV AudricV deleted the fix-open-in-browser-without-browser branch March 26, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug device/software specific Issues that only happen on some devices or with some specific hardware/software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants