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

Remove option to immediately commit pref changes on import #6531

Merged
merged 3 commits into from
Jul 14, 2021

Conversation

XiangRongLin
Copy link
Collaborator

@XiangRongLin XiangRongLin commented Jun 20, 2021

What is it?

  • Codebase improvement (dev facing)

Description of the changes in your PR

Follow up to #6495. See commit messages for detailed descriptions

  • Remove option to immediately commit pref changes on import
  • Resolve sonar issues in ContentSettingsFragment
  • Remove variable ContentSettingsFragment.lastImportExportDataUri

APK testing

On the website the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.

I tested it manually on API 28 emulator

  1. by exporting the settings
  2. moving the exported file somewhere else
  3. trying to import and verify that the file explorer opens the old correct path
  4. navigate to the moved file and import
  5. verify that another export now opens to the new file location.

Due diligence

System is now not restarted with `System.exit(0)`.
Instead it is done properly by finishing the activity and restarting the activity. This allows preference changes which are queued up asynchronously through `apply` to be applied.
Instead pass the value through the methods as parameter
@XiangRongLin XiangRongLin added the codequality Improvements to the codebase to improve the code quality label Jun 20, 2021
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.

For some reasons when the app is restarted I get the "The language will change once the app is restarted." toast, even though the language is correctly changed and updated throughout the app (I tried setting to a random language and then importing a database with "Use system language" language). Other than that I tested and it works well ;-)

@opusforlife2
Copy link
Collaborator

@Stypox I see the same thing on the 0.21.6 RC and all the current debug APKs, so it can't be due to this PR. See #3312 (comment).

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.

You are right @opusforlife2. Then I'm approving this :-)

@TobiGr TobiGr merged commit 1584028 into TeamNewPipe:dev Jul 14, 2021
@XiangRongLin XiangRongLin deleted the immediat_pref_commit branch July 17, 2021 08:41
This was referenced Aug 4, 2021
@opusforlife2 opusforlife2 changed the title Remove option to immediately commit pref changes on import Properly apply preference changes on database import Aug 11, 2021
@XiangRongLin XiangRongLin changed the title Properly apply preference changes on database import Remove option to immediately commit pref changes on import Aug 11, 2021
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.

4 participants