mirror of https://github.com/x13a/Wasted.git
parent
f7247c43a0
commit
36c2d99e43
|
@ -31,6 +31,10 @@ class DeviceAdminManager(private val ctx: Context) {
|
|||
return ok
|
||||
}
|
||||
|
||||
fun setMaximumFailedPasswordsForWipe(num: Int) {
|
||||
dpm?.setMaximumFailedPasswordsForWipe(deviceAdmin, num)
|
||||
}
|
||||
|
||||
fun wipeData() {
|
||||
var flags = 0
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||
|
|
|
@ -107,7 +107,9 @@ open class MainActivity : AppCompatActivity() {
|
|||
prefs.isWipeESIM = isChecked
|
||||
}
|
||||
maxFailedPasswordAttempts.addOnChangeListener { _, value, _ ->
|
||||
prefs.maxFailedPasswordAttempts = value.toInt()
|
||||
val num = value.toInt()
|
||||
prefs.maxFailedPasswordAttempts = num
|
||||
admin.setMaximumFailedPasswordsForWipe(num.shl(1))
|
||||
}
|
||||
wipeOnInactivitySwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!setWipeOnInactivityComponentsState(prefs.isServiceEnabled && isChecked)) {
|
||||
|
|
Loading…
Reference in New Issue