handle read and send sms separately
This commit is contained in:
parent
956e798558
commit
fce6ed2640
|
@ -36,7 +36,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.simplemobiletools:commons:5.25.9'
|
implementation 'com.simplemobiletools:commons:5.25.11'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
|
||||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||||
implementation 'com.klinkerapps:android-smsmms:5.2.6'
|
implementation 'com.klinkerapps:android-smsmms:5.2.6'
|
||||||
|
|
|
@ -116,9 +116,11 @@ class MainActivity : SimpleActivity() {
|
||||||
storedTextColor = config.textColor
|
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() {
|
private fun askPermissions() {
|
||||||
handlePermission(PERMISSION_READ_SMS) {
|
handlePermission(PERMISSION_READ_SMS) {
|
||||||
|
if (it) {
|
||||||
|
handlePermission(PERMISSION_SEND_SMS) {
|
||||||
if (it) {
|
if (it) {
|
||||||
handlePermission(PERMISSION_READ_CONTACTS) {
|
handlePermission(PERMISSION_READ_CONTACTS) {
|
||||||
bus = EventBus.getDefault()
|
bus = EventBus.getDefault()
|
||||||
|
@ -129,6 +131,10 @@ class MainActivity : SimpleActivity() {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initMessenger() {
|
private fun initMessenger() {
|
||||||
|
|
Loading…
Reference in New Issue