For #16442 - Check if fragment is still attached before updating site permissions rules (#16954)

upstream-sync
ekager 4 years ago committed by GitHub
parent 459f1e970f
commit dd2615b554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -86,6 +86,7 @@ import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.IntentReceiverActivity
import org.mozilla.fenix.NavGraphDirections
import org.mozilla.fenix.OnBackLongPressedListener
import org.mozilla.fenix.addons.runIfFragmentIsAttached
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.browser.readermode.DefaultReaderModeController
@ -636,7 +637,9 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler,
context.settings().setSitePermissionSettingListener(viewLifecycleOwner) {
// If the user connects to WIFI while on the BrowserFragment, this will update the
// SitePermissionsRules (specifically autoplay) accordingly
assignSitePermissionsRules()
runIfFragmentIsAttached {
assignSitePermissionsRules()
}
}
assignSitePermissionsRules()

Loading…
Cancel
Save