Description

As another data point, following on #28507, we're also violating the disk avoidance goal because Fennec saves information about open tabs (and recently closed tabs) on disk in case the app is killed (see the ​SessionStore). This allows for restoring the browser state when the app is next opened.

I hesitate saying we should rip this out because if we want a usable browser on Android, then we'll need something like this. If the app doesn't save state, then when the user switches to another app Android may kill the browser (because it is now running in the background) and the user will lose their entire browser session.

Given the available options, I think we should keep the SessionStore enabled and rely on the #28507 preferences for clearing saved state when the user explicitly closes the app.

I think we can be a little clever with encrypting the session file on disk, but it'll require some experimentation.

I think we can modify SessionStore so it doesn't write the state on disk, and then we can try reverting the patch for #28507 where we sanitize the tabs during startup. This should solve part of the problem with #30573.

Okay, the SessionStore does not write private tab data on disk, it only saves normal tabs. We used #28507 as a mitigation for normal tabs being restored when the app is restarted. This brings us back to #24920 because Fennec doesn't have an easy browser.privatebrowsing.autostart pref like we have on desktop.

Closing this because #24920 is a better solution. SessionStore does not save information about private tabs on disk. It does rely on Android for saving some state, and there is an assumption Android only retains this information in memory as long as it's needed. I don't know if this assumption is correct (that it is only kept in memory, and not written to a cache on disk).