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()
|
}.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCreate(owner: LifecycleOwner) {
|
||||||
|
SecureActivityDelegate.onApplicationCreated()
|
||||||
|
}
|
||||||
|
|
||||||
private fun addAnalytics() {
|
private fun addAnalytics() {
|
||||||
if (syDebugVersion != "0") {
|
if (syDebugVersion != "0") {
|
||||||
Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
|
Firebase.analytics.setUserProperty("preview_version", syDebugVersion)
|
||||||
|
@ -46,6 +46,15 @@ interface SecureActivityDelegate {
|
|||||||
const val LOCK_ALL_DAYS = 0x7F
|
const val LOCK_ALL_DAYS = 0x7F
|
||||||
// SY <--
|
// 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() {
|
fun onApplicationStopped() {
|
||||||
val preferences = Injekt.get<PreferencesHelper>()
|
val preferences = Injekt.get<PreferencesHelper>()
|
||||||
if (!preferences.useAuthenticator().get()) return
|
if (!preferences.useAuthenticator().get()) return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user