Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits: 3b34325f by clairehurst at 2023-10-05T17:45:17-06:00 fixup! Modify UI/UX
Bug 42156: Screenshot allowing still blocks homescreen (android)
- - - - -
1 changed file:
- fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
Changes:
===================================== fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt ===================================== @@ -14,6 +14,7 @@ import android.os.Bundle import android.os.Handler import android.os.Looper import android.view.LayoutInflater +import android.view.WindowManager import android.widget.Toast import androidx.annotation.VisibleForTesting import androidx.appcompat.app.AlertDialog @@ -471,7 +472,16 @@ class SettingsFragment : PreferenceFragmentCompat() { requirePreference<DefaultBrowserPreference>(R.string.pref_key_make_default_browser)
requirePreference<Preference>(R.string.pref_key_allow_screenshots_in_private_mode).apply { - onPreferenceChangeListener = SharedPreferenceUpdater() + onPreferenceChangeListener = object : SharedPreferenceUpdater() { + override fun onPreferenceChange(preference: Preference, newValue: Any?): Boolean { + if (newValue == false) { + activity?.window?.addFlags(WindowManager.LayoutParams.FLAG_SECURE) + } else { + activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) + } + return super.onPreferenceChange(preference, newValue) + } + } }
preferencePrioritizeOnions?.setOnPreferenceChangeListener<Boolean> { preference, newValue ->
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/3b34...
tor-commits@lists.torproject.org