When dismissing the CFR, if the caller fragment of the anchor was also dismissed immediately, a crash would occur.
The crash was due to the combination of the manual dismiss in this Composable as well as the dismiss that happens as part of the normal logic flow when the user triggers a dismiss. The second `onDismiss` call before the first one finished caused a fatal crash (stack trace in bug).
There was also a bug where clicking on the CFR would take the user to Settings but NOT dismiss the tabs tray. This was solved by providing a callback to dismiss the CFR when the `action` is invoked.
Differential Revision: https://phabricator.services.mozilla.com/D209842
Previously when using talkback and a CFR was displayed, the
dictated caption was wrong. This patch makes the Popup focusable
so talkback will dictate Pop-Up window once it appears.
Since we migrated the `privateBrowsingRecommend` to CFRPopup,
this popup has a `No thanks` dismiss button, therefore not
requiring the classic X dismiss button. This change adds
a parameter with which we are able to control if we
want to show the X button or not in a CFRPopup.
Because previously the `privateBrowsingRecommend` Popup was using
PopupWindow from android widget, it could not be modified to
respect to PopupWindow behaviors. Therefore, we decided to migrate
it to the CFRPopup.
CFRPopup default properties have been changed so a popup does not
dismiss anymore on a click outside or a back press.
Additionally, popups will reappear if the screen is rotated and
the popup was not dismissed.
Seems like on Android 33 the current orientation detection calls do not report
valid results.
As such on newer Android versions we'll use another way to infer the current
rotation based on the configuration read from Resources.
In testing it was seen that the display orientation change could get reported
even without a screen rotation and because of the previous UNSPECIFIED default
this would trigger the "onDisplayRotationChanged" callback.
This was incorrectly adding the popup padding - invisible space allowing to
extend close button's touch interaction area.
Since it's an invisible space it should not affect placing.
It had issues on devices with under display cameras which would report
different insets.
Also refactor how we compute popup bounds for more control and better results.