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 menu: Menu? = null
|
||||
private var menuOpen = false
|
||||
|
||||
private var isProtectionCheckActive = false
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
@ -168,10 +168,13 @@ class MainActivity : NoSplashAppCompatActivity() {
|
|||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
protectionCheck.queryProtection(this, ProtectionCheck.Protection.APPLICATION, null,
|
||||
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { finish() } },
|
||||
UIRunnable { OKDialog.show(this, "", rh.gs(R.string.authorizationfailed)) { finish() } }
|
||||
)
|
||||
if (!isProtectionCheckActive) {
|
||||
isProtectionCheckActive = true
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue