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

Fix popup enablement toast crash on API 33 #9671

Merged
merged 1 commit into from
Jan 15, 2023

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jan 12, 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

Calling getView() is forbidden (returns null) on API 33. That method was used to center the text in the toast, but I think that was not useful anyway so I just removed the centering completely and now the popup enablement toast shows normally.
I also simplified some duplicate code, since each time the popup permission was checked, the toast would also be shown, so I merged those.
Related to #9306.

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

You shouldn't call getView() on toasts.
Also simplified some duplicate code.
@Stypox Stypox changed the title Fix toast crash on API 33 Fix popup enablement toast crash on API 33 Jan 12, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jan 12, 2023

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

@Stypox Stypox merged commit abe6dfb into TeamNewPipe:dev Jan 15, 2023
@Stypox Stypox mentioned this pull request Jan 22, 2023
3 tasks
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.

2 participants