[fenix] For https://github.com/mozilla-mobile/fenix/issues/9887 - Respect screenshot setting when resetting window flags in logins

pull/600/head
ekager 4 years ago committed by Emily Kager
parent f35e5f3526
commit 6b4334b699

@ -32,7 +32,9 @@ import kotlinx.coroutines.withContext
import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.checkAndUpdateScreenshotPermission
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
/**
@ -50,7 +52,7 @@ class SavedLoginSiteInfoFragment : Fragment(R.layout.fragment_saved_login_site_i
override fun onPause() {
// If we pause this fragment, we want to pop users back to reauth
if (findNavController().currentDestination?.id != R.id.savedLoginsFragment) {
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
activity?.let { it.checkAndUpdateScreenshotPermission(it.settings()) }
findNavController().popBackStack(R.id.loginsFragment, false)
}
super.onPause()

@ -33,7 +33,9 @@ import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.StoreProvider
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.checkAndUpdateScreenshotPermission
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
import org.mozilla.fenix.settings.SupportUtils
@ -110,7 +112,7 @@ class SavedLoginsFragment : Fragment() {
*/
override fun onPause() {
if (findNavController().currentDestination?.id != R.id.savedLoginSiteInfoFragment) {
activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
activity?.let { it.checkAndUpdateScreenshotPermission(it.settings()) }
findNavController().popBackStack(R.id.loginsFragment, false)
}
super.onPause()

Loading…
Cancel
Save