diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 00e4c9393..33aaad640 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -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 diff --git a/app/src/main/java/org/mozilla/fenix/session/SessionNotificationService.kt b/app/src/main/java/org/mozilla/fenix/session/SessionNotificationService.kt index 60ebf6db4..f1e4db812 100644 --- a/app/src/main/java/org/mozilla/fenix/session/SessionNotificationService.kt +++ b/app/src/main/java/org/mozilla/fenix/session/SessionNotificationService.kt @@ -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() }