handle read and send sms separately

This commit is contained in:
tibbi 2020-04-13 11:58:44 +02:00
parent 956e798558
commit fce6ed2640
2 changed files with 12 additions and 6 deletions

View file

@ -116,14 +116,20 @@ class MainActivity : SimpleActivity() {
storedTextColor = config.textColor
}
// while READ_SMS permission is mandatory, READ_CONTACTS is optional. If we don't have it, we just won't be able to show the contact name in some cases
// while SEND_SMS and READ_SMS permissions are mandatory, READ_CONTACTS is optional. If we don't have it, we just won't be able to show the contact name in some cases
private fun askPermissions() {
handlePermission(PERMISSION_READ_SMS) {
if (it) {
handlePermission(PERMISSION_READ_CONTACTS) {
bus = EventBus.getDefault()
bus!!.register(this)
initMessenger()
handlePermission(PERMISSION_SEND_SMS) {
if (it) {
handlePermission(PERMISSION_READ_CONTACTS) {
bus = EventBus.getDefault()
bus!!.register(this)
initMessenger()
}
} else {
finish()
}
}
} else {
finish()