Fenix: [Bug] Private mode homescreen is not updated after opening an external link or private browsing shorcut

Created on 19 Feb 2020  ·  6Comments  ·  Source: mozilla-mobile/fenix

Steps to reproduce

  1. Set Fenix as default browser. Open a custom tab.
  2. From a custom tab, open the link in Fenix.
  3. After the page is loaded in Fenix, go to home screen, switch to Private mode.

    Expected behavior

The Private mode theme is updated.

Actual behavior

The Private mode theme is not udpated, still showing the light theme from normal mode.

Device information

  • Android device: Pixel 3(Android 9), Xiaomi Mi Pad 2 (Android 5.1)
  • Fenix version: Beta 4.0
PrivateBrowsing S1 engverified 🐞 bug

All 6 comments

@mcarare I've also found these steps:
Add private browsing shortcut.
Open the shortcut and perform a search.
Switch to normal browsing.
Result: it will keep the Private browsing theme on normal browsing.

@mcarare I've also found these steps:
Add private browsing shortcut.
Open the shortcut and perform a search.
Switch to normal browsing.
Result: it will keep the Private browsing theme on normal browsing.

@psymoon At a first glance, it looks like this change: #8292 introduced this behaviour. Can you take a look at this? TY!

@psymoon I think the problems lies in the registering of the browsingModeListener:

When you open Fenix from the private browsing shortcut you open a new activity that registers the observer:
org.mozilla.fenix.debug E/mihai-c: registred by activity = org.mozilla.fenix.HomeActivity@f2e0ea9

when you hit the back button, the current activity is stopped, and a new one is started. The problem is that the onStart of the new activity is called before the onStop of the old one, notice the activity id:

org.mozilla.fenix.debug E/mihai-c: registred  by activity =
     org.mozilla.fenix.HomeActivity@1a1268f
org.mozilla.fenix.debug E/mihai-c: unregistred  by activity = 
    org.mozilla.fenix.HomeActivity@f2e0ea9

that leaves us with no registered browsingModeListener

This looks like a problem with the theming not working properly between PBM and Normal mode, see #8498

@sv-ohorvath @mcarare The fix was merged yesterday, can you please verify this?

This and #8498 are verified as fixed on Nightly 2/24, checked from different entry-points.

Was this page helpful?
0 / 5 - 0 ratings