Unverified Commit 666c839e authored by Mugurell's avatar Mugurell Committed by GitHub
Browse files

For #24040: App should not crash when the search widget is clicked while PIP...


For #24040: App should not crash when the search widget is clicked while PIP mode is active (#25410)

When the search event is from the search widget while PIP is active, the search fragment opens after the screen is unlocked. This avoids the issue of the search page opening in landscape mode and also the app doesn't crash.

Co-Authored-By: default avatarMugurell <Mugurell@users.noreply.github.com>

Co-authored-by: default avatarindu <indu@ramkystech.com>
parent ab36146e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import mozilla.components.concept.storage.BookmarkNode
import mozilla.components.concept.storage.BookmarkNodeType
import mozilla.components.concept.storage.HistoryMetadataKey
import mozilla.components.feature.contextmenu.DefaultSelectionActionDelegate
import mozilla.components.feature.media.ext.findActiveMediaTab
import mozilla.components.feature.privatemode.notification.PrivateNotificationFeature
import mozilla.components.feature.search.BrowserStoreSearchAdapter
import mozilla.components.service.fxa.sync.SyncReason
@@ -511,6 +512,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
            )
        )

        val tab = components.core.store.state.findActiveMediaTab()
        if (tab != null) {
            components.useCases.sessionUseCases.exitFullscreen(tab.id)
        }

        val intentProcessors =
            listOf(
                CrashReporterIntentProcessor(components.appStore)
+1 −1
Original line number Diff line number Diff line
@@ -1321,7 +1321,7 @@ abstract class BaseBrowserFragment :
     * Exit fullscreen mode when exiting PIP mode
     */
    private fun pipModeChanged(session: SessionState) {
        if (!session.content.pictureInPictureEnabled && session.content.fullScreen) {
        if (!session.content.pictureInPictureEnabled && session.content.fullScreen && isAdded) {
            onBackPressed()
            fullScreenChanged(false)
        }