mirror of https://github.com/x13a/Wasted.git
ref
This commit is contained in:
parent
0f45d789e7
commit
71befde9fe
|
@ -34,7 +34,7 @@ class DeviceAdminReceiver : DeviceAdminReceiver() {
|
||||||
|
|
||||||
private fun onPasswordFailedInternal(ctx: Context) {
|
private fun onPasswordFailedInternal(ctx: Context) {
|
||||||
val prefs = Preferences(ctx)
|
val prefs = Preferences(ctx)
|
||||||
if (!prefs.isServiceEnabled || prefs.maxFailedPasswordAttempts == 0) return
|
if (!prefs.isServiceEnabled || prefs.maxFailedPasswordAttempts <= 0) return
|
||||||
val admin = DeviceAdminManager(ctx)
|
val admin = DeviceAdminManager(ctx)
|
||||||
if (admin.getCurrentFailedPasswordAttempts() >= prefs.maxFailedPasswordAttempts)
|
if (admin.getCurrentFailedPasswordAttempts() >= prefs.maxFailedPasswordAttempts)
|
||||||
admin.wipeData()
|
admin.wipeData()
|
||||||
|
|
|
@ -31,7 +31,7 @@ class PanicConnectionActivity : MainActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialAlertDialogBuilder(this)
|
MaterialAlertDialogBuilder(this)
|
||||||
.setTitle(getString(R.string.panic_app_dialog_title))
|
.setTitle(R.string.panic_app_dialog_title)
|
||||||
.setMessage(String.format(getString(R.string.panic_app_dialog_message), app))
|
.setMessage(String.format(getString(R.string.panic_app_dialog_message), app))
|
||||||
.setNegativeButton(R.string.allow) { _, _ ->
|
.setNegativeButton(R.string.allow) { _, _ ->
|
||||||
PanicResponder.setTriggerPackageName(this@PanicConnectionActivity)
|
PanicResponder.setTriggerPackageName(this@PanicConnectionActivity)
|
||||||
|
|
Loading…
Reference in New Issue