mirror of https://github.com/x13a/Wasted.git
ref
This commit is contained in:
parent
6bf789e31b
commit
b58e83213c
|
@ -23,7 +23,7 @@ open class MainActivity : AppCompatActivity() {
|
||||||
private val shortcut by lazy { ShortcutManager(this) }
|
private val shortcut by lazy { ShortcutManager(this) }
|
||||||
private val job by lazy { WipeJobManager(this) }
|
private val job by lazy { WipeJobManager(this) }
|
||||||
|
|
||||||
private val requestAdminPolicy =
|
private val registerForDeviceAdmin =
|
||||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||||
when (result.resultCode) {
|
when (result.resultCode) {
|
||||||
RESULT_OK -> setOn()
|
RESULT_OK -> setOn()
|
||||||
|
@ -238,7 +238,7 @@ open class MainActivity : AppCompatActivity() {
|
||||||
admin.remove()
|
admin.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun requestAdmin() = requestAdminPolicy.launch(admin.makeRequestIntent())
|
private fun requestAdmin() = registerForDeviceAdmin.launch(admin.makeRequestIntent())
|
||||||
private fun makeCode(): String = UUID.randomUUID().toString()
|
private fun makeCode(): String = UUID.randomUUID().toString()
|
||||||
private fun setCodeReceiverState(value: Boolean) =
|
private fun setCodeReceiverState(value: Boolean) =
|
||||||
setComponentState(CodeReceiver::class.java, value)
|
setComponentState(CodeReceiver::class.java, value)
|
||||||
|
|
Loading…
Reference in New Issue