You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iceraven-browser/app/src/main/java/org/mozilla/fenix/compose
Jonathan Almeida 7a8b0a91c0 Bug 1799996 - Speculative fix checks CFRPopup.anchor is attached to window
We're seeing crashes in the Fenix copy of the `CFRPopup` that are
happening when our activity has already been destroyed, and then we are
trying to add a view to it with the WindowManager.

Our guess from looking at the traces are that the
`BrowserToolbarCFRPresenter` is receiving the `collect call on the main
thread, but further down the event loop. As well as the Runnable in
`CFRPopup#show` that is posting to the end event loop - both of these
calls are putting us in a state where the activity we want has already
been destroyed before we get to the moment where we want to use it.

This is a crash that is difficult to synthesize or write a test for.
As a result, our fix is rather speculative but still straight-forward
and safe to uplift, should it work.

There are three remaining follow-ups to do when fix is confirmed:
1. There is a CFRPopup that was upstreamed which is based on the Fenix
   implementation. We should upstream this patch to that component as
   well.
2. We should remove this copy of the CFRPopup and use the upstreamed
   version to avoid confusion between the two copies.
3. With this change, we are now gracefully failing when our users get
   into this state, however our telemtry and onboarding flows are
   unaware that the CFR was never shown.
   We need to to correct telemetry for `TrackingProtection.tcpCfrShown`
   to stop incorrectly reporting false positives and reset our
   `shouldShowTotalCookieProtectionCFR` pref to false so that we can
   try again at the appropriate time.

Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
2 years ago
..
button Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
cfr Bug 1799996 - Speculative fix checks CFRPopup.anchor is attached to window 2 years ago
ext For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
home Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
list Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
tabstray Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
ClickableSubstringLink.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
ComposeUtils.kt For #24219 - Refactor Favicon to fix previews 2 years ago
ComposeViewHolder.kt For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
Divider.kt For #27459 - Add divider composable (#27544) 2 years ago
Favicon.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
HorizontalFadingEdgeBox.kt For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
Image.kt For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
ImagesPlaceholder.kt For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
LazyListEagerFlingBehavior.kt For #26844: Fix ktlint issues and remove them from baseline. 2 years ago
ListItemTabLarge.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
ListItemTabLargePlaceholder.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
MessageCard.kt For #27578 - Add optional color parameters to MessageCard 2 years ago
SelectableChip.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
StaggeredHorizontalGrid.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
TabSubtitleWithInterdot.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago
ThumbnailCard.kt Closes #27854: Remove unnecessary Theme.getTheme() calls from FirefoxTheme usages 2 years ago