mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 05:45:06 +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 {
|
open class App : Application(), LifecycleObserver {
|
||||||
|
|
||||||
|
val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
|
||||||
@ -52,12 +54,15 @@ open class App : Application(), LifecycleObserver {
|
|||||||
|
|
||||||
LocaleHelper.updateConfiguration(this, resources.configuration)
|
LocaleHelper.updateConfiguration(this, resources.configuration)
|
||||||
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
|
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
|
||||||
|
|
||||||
|
// Reset Incognito Mode on relaunch
|
||||||
|
preferences.incognitoMode().set(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
|
||||||
|
@Suppress("unused")
|
||||||
fun onAppBackgrounded() {
|
fun onAppBackgrounded() {
|
||||||
// App in background
|
// App in background
|
||||||
val preferences: PreferencesHelper by injectLazy()
|
|
||||||
if (preferences.lockAfter().getOrDefault() >= 0) {
|
if (preferences.lockAfter().getOrDefault() >= 0) {
|
||||||
SecureActivityDelegate.locked = true
|
SecureActivityDelegate.locked = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user