Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Replace getContext() with requireContext().
Browse files Browse the repository at this point in the history
PreferenceManager.getDefaultSharedPreferences now expects a NonNull context as a param.
  • Loading branch information
mcarare authored and mergify[bot] committed Nov 21, 2022
1 parent e9ac0fa commit 31f2c13
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AddToHomescreenDialogFragment : DialogFragment() {

TelemetryWrapper.addToHomescreenShortcutEvent()

PreferenceManager.getDefaultSharedPreferences(context).edit()
PreferenceManager.getDefaultSharedPreferences(requireContext()).edit()
.putBoolean(
requireContext().getString(R.string.has_added_to_home_screen),
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ class BrowserFragment :

private fun setShouldRequestDesktop(enabled: Boolean) {
if (enabled) {
PreferenceManager.getDefaultSharedPreferences(context).edit()
PreferenceManager.getDefaultSharedPreferences(requireContext()).edit()
.putBoolean(
requireContext().getString(R.string.has_requested_desktop),
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class GeneralSettingsFragment :
}

private fun getLocaleSummary(): CharSequence? {
val sharedConfig: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
val sharedConfig: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
val value: String? =
sharedConfig.getString(
resources.getString(R.string.pref_key_locale),
Expand Down

0 comments on commit 31f2c13

Please sign in to comment.