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

Directly startActivity without querying for default app #9817

Closed
wants to merge 1 commit into from

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Feb 15, 2023

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

getDefaultAppPackageName does not work on Android 12: it always returns an empty string. We would need the permission to query all packages for that to work, but we definitely don't want to add such an invasive permission in NewPipe. This PR does not query getDefaultAppPackageName anymore before opening an intent, which fixes the "No app can open this" messages.

I also removed the toast_no_player string ("No app installed to play this file"), because it was basically a duplicate of no_app_to_open_intent ("No app on your device can open this").

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

getDefaultAppPackageName does not work on Android 12. This fixes "No app can open this" messages.
@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 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Redirion
Copy link
Member

what about the remaining usages of "getDefaultAppPackageName "? shouldn't this method be removed completely?

@AudricV
Copy link
Member

AudricV commented Feb 18, 2023

Closing in favor of #9833, which completely refactors the external intents code and address @Redirion's point.

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.

[Android 11+] Cannot open downloads from the app ("No app installed to play this file" toast)
3 participants