[tbb-commits] [Git][tpo/applications/firefox-android][firefox-android-115.2.1-13.0-1] fixup! Modify UI/UX

Dan Ballard (@dan) git at gitlab.torproject.org
Tue Oct 10 16:07:25 UTC 2023



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/3b34325f2fb5b93b0df953942124220bcd837098

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/firefox-android/-/commit/3b34325f2fb5b93b0df953942124220bcd837098
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20231010/92fbb3f4/attachment-0001.htm>


More information about the tbb-commits mailing list