1
0
Fork 0

For #4780: remove previous fix for leaking private mode status

This didn't function when 'open links in a private tab' was set.  Rather than adding another sketchy fix for the edge case, following commits will change `usePrivateMode` to be maintained in memory, instead of in Settings.
master
Severin Rudie 2019-10-07 10:45:32 -07:00 committed by Emily Kager
parent 47f952a2a2
commit 10f334303d
2 changed files with 0 additions and 17 deletions

View File

@ -117,10 +117,6 @@ open class FenixApplication : Application() {
if ((System.currentTimeMillis() - settings().lastPlacesStorageMaintenance) > ONE_DAY_MILLIS) {
runStorageMaintenance()
}
// This needs to be called before the theme is set. No BrowsingModeManager is available
// at this point, which is why this is set directly
maybeClearPrivateMode()
}
private fun runStorageMaintenance() {
@ -132,14 +128,6 @@ open class FenixApplication : Application() {
settings().lastPlacesStorageMaintenance = System.currentTimeMillis()
}
/**
* Clears private mode. This is done in order to avoid leaking the fact that
* private mode was in use during the previous session.
*/
fun maybeClearPrivateMode(settings: Settings = settings()) {
if (!settings.openLinksInAPrivateTab) settings.usePrivateMode = false
}
private fun registerRxExceptionHandling() {
RxJavaPlugins.setErrorHandler {
throw it.cause ?: it

View File

@ -63,11 +63,6 @@ class SessionNotificationService : Service() {
override fun onTaskRemoved(rootIntent: Intent) {
components.core.sessionManager.removeAndCloseAllPrivateSessions()
// This is currently safe because we remove this service while destroying activities. If
// this service is ever removed while HomeActivity is still active, this could cause
// theming issues. See usePrivateMode kdoc
baseContext.application.maybeClearPrivateMode()
stopForeground(true)
stopSelf()
}