fix: asking for app protection only once
This commit is contained in:
parent
5bfc76fe6f
commit
cfa64162b0
1 changed files with 8 additions and 5 deletions
|
@ -89,7 +89,7 @@ class MainActivity : NoSplashAppCompatActivity() {
|
||||||
private var pluginPreferencesMenuItem: MenuItem? = null
|
private var pluginPreferencesMenuItem: MenuItem? = null
|
||||||
private var menu: Menu? = null
|
private var menu: Menu? = null
|
||||||
private var menuOpen = false
|
private var menuOpen = false
|
||||||
|
private var isProtectionCheckActive = false
|
||||||
private lateinit var binding: ActivityMainBinding
|
private lateinit var binding: ActivityMainBinding
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -168,10 +168,13 @@ class MainActivity : NoSplashAppCompatActivity() {
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.APPLICATION, null,
|
if (!isProtectionCheckActive) {
|
||||||
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { finish() } },
|
isProtectionCheckActive = true
|
||||||
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { finish() } }
|
protectionCheck.queryProtection(this, ProtectionCheck.Protection.APPLICATION, UIRunnable { isProtectionCheckActive = false },
|
||||||
)
|
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { isProtectionCheckActive = false; finish() } },
|
||||||
|
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { isProtectionCheckActive = false; finish() } }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setWakeLock() {
|
private fun setWakeLock() {
|
||||||
|
|
Loading…
Reference in a new issue