mirror of https://github.com/x13a/Wasted.git
fix security exception
This commit is contained in:
parent
dd91805742
commit
1d34123e7b
|
@ -16,7 +16,9 @@ class ControlReceiver : BroadcastReceiver() {
|
||||||
!prefs.isServiceEnabled ||
|
!prefs.isServiceEnabled ||
|
||||||
intent.getStringExtra("code") != prefs.code) return
|
intent.getStringExtra("code") != prefs.code) return
|
||||||
val dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
val dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE) as DevicePolicyManager
|
||||||
|
try {
|
||||||
dpm.lockNow()
|
dpm.lockNow()
|
||||||
dpm.wipeData(0)
|
dpm.wipeData(0)
|
||||||
|
} catch (exc: SecurityException) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue