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

Prefer injecting preferences instead of using PreferenceManager directly #2073

Merged

Conversation

adamszewe
Copy link
Contributor

Description

Prefer injecting preferences instead of using PreferenceManager.getDefaultSharedPreferences(context) directly.

Changes

  • replace PreferenceManager.getDefaultSharedPreferences(context) by injecting SharedPreferences instead

@adamszewe adamszewe force-pushed the prefer-injecting-default-shared-preferences branch from 79449d5 to a8d5f81 Compare April 3, 2024 22:08
@adamszewe adamszewe marked this pull request as ready for review April 3, 2024 22:14
@adamszewe adamszewe force-pushed the prefer-injecting-default-shared-preferences branch from a8d5f81 to e535149 Compare April 3, 2024 22:20
@adamszewe adamszewe force-pushed the prefer-injecting-default-shared-preferences branch from e535149 to fdd860a Compare April 3, 2024 22:30
@adamszewe adamszewe requested a review from imsodin April 4, 2024 13:13
@@ -240,7 +240,7 @@ private boolean shouldSkipSlide(Slide slide) {
case API_LEVEL_30:
// Skip if running as root, as that circumvents any Android FS restrictions.
return upgradedToApiLevel30()
|| PreferenceManager.getDefaultSharedPreferences(this).getBoolean(Constants.PREF_USE_ROOT, false);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there now be an unused import for PreferenceManager? Same on all other files.

@imsodin imsodin merged commit 7904afd into syncthing:main Apr 5, 2024
1 check passed
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.

None yet

2 participants