mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-09 15:39:22 +01:00
Reset Incognito Mode on app relaunch
From tachiyomiorg/tachiyomi@f407e30b6e Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
parent
f574cfcbf7
commit
0b4f83d83e
@ -34,6 +34,8 @@ import java.security.Security
|
||||
)
|
||||
open class App : Application(), LifecycleObserver {
|
||||
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
||||
@ -52,12 +54,15 @@ open class App : Application(), LifecycleObserver {
|
||||
|
||||
LocaleHelper.updateConfiguration(this, resources.configuration)
|
||||
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
|
||||
|
||||
// Reset Incognito Mode on relaunch
|
||||
preferences.incognitoMode().set(false)
|
||||
}
|
||||
|
||||
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
||||
@Suppress("unused")
|
||||
fun onAppBackgrounded() {
|
||||
// App in background
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
if (preferences.lockAfter().getOrDefault() >= 0) {
|
||||
SecureActivityDelegate.locked = true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user