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 SparseArrayCompat. #8895

Merged
merged 2 commits into from
Dec 28, 2022
Merged

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Aug 28, 2022

What is it?

  • Codebase improvement (dev facing)

Description of the changes in your PR

  • Use SparseArrayCompat to reduce memory usage in the thumbnail preview, search and download functionality by avoiding integer boxing.
  • Make some additional minor code improvements in StreamItemAdapter.

Fixes the following issue(s)

  • Fixes #

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

@Isira-Seneviratne Isira-Seneviratne force-pushed the SparseArrayCompat branch 6 times, most recently from 9b8c250 to cbc363a Compare August 28, 2022 13:23
@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

@AudricV AudricV added feature request Issue is related to a feature in the app codequality Improvements to the codebase to improve the code quality labels Sep 2, 2022
@AudricV AudricV removed the feature request Issue is related to a feature in the app label Nov 8, 2022
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

This PR is not just about SparseArrayCompat. It contains a lot of other refactorings. Please document them properly in the PR description, otherwise it's difficult to understand why you made some changes.

Have you tested these changes? This is what I'm getting...

Log.d(TAG, "Clearing seekbarPreviewData");
seekbarPreviewData.clear();
synchronized (seekbarPreviewData) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is synchronized now needed?

Copy link
Member Author

@Isira-Seneviratne Isira-Seneviratne Nov 22, 2022

Choose a reason for hiding this comment

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

Android's sparse arrays are not thread-safe, so I added that to avoid potential issues.

@Isira-Seneviratne
Copy link
Member Author

This PR is not just about SparseArrayCompat. It contains a lot of other refactorings. Please document them properly in the PR description, otherwise it's difficult to understand why you made some changes.

Sorry about that, will do.

Have you tested these changes? This is what I'm getting...

My bad again, I'll restore the text. Thanks for the review!

@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

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thank you! I tested thoroughly and it works

@Stypox Stypox merged commit 231e677 into TeamNewPipe:dev Dec 28, 2022
@Isira-Seneviratne Isira-Seneviratne deleted the SparseArrayCompat branch December 28, 2022 23:25
@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
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants