Fix always-on app lock on cold start (#8018)
# Conflicts: # app/src/main/java/eu/kanade/tachiyomi/App.kt # app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt
This commit is contained in:
parent
a27b25f7c6
commit
5d5cc22020
@ -210,6 +210,10 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
|
||||
}.build()
|
||||
}
|
||||
|
||||
override fun onCreate(owner: LifecycleOwner) {
|
||||
SecureActivityDelegate.onApplicationCreated()
|
||||
}
|
||||
|
||||
private fun addAnalytics() {
|
||||
if (syDebugVersion != "0") {
|
||||
Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
|
||||
|
@ -46,6 +46,15 @@ interface SecureActivityDelegate {
|
||||
const val LOCK_ALL_DAYS = 0x7F
|
||||
// SY <--
|
||||
|
||||
fun onApplicationCreated() {
|
||||
val lockDelay = Injekt.get<PreferencesHelper>().lockAppAfter().get()
|
||||
if (lockDelay == 0) {
|
||||
// Restore always active app lock
|
||||
// Delayed lock will be restored later on activity resume
|
||||
lockState = LockState.ACTIVE
|
||||
}
|
||||
}
|
||||
|
||||
fun onApplicationStopped() {
|
||||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
if (!preferences.useAuthenticator().get()) return
|
||||
|
Loading…
x
Reference in New Issue
Block a user