Request SMS permission when sending message

This commit is contained in:
Moez Bhatti
2018-09-04 22:08:40 -04:00
parent 1b0ed86c7a
commit c42de6f827
11 changed files with 28 additions and 14 deletions
@@ -66,7 +66,7 @@ class CursorToConversationImpl @Inject constructor(
}
override fun getConversationsCursor(lastSync: Long): Cursor? {
return when (permissionManager.hasSms()) {
return when (permissionManager.hasReadSms()) {
true -> context.contentResolver.query(URI, PROJECTION,
"date > $lastSync", null,
"date desc")
@@ -141,7 +141,7 @@ class CursorToMessageImpl @Inject constructor(
false -> this.projection
}
return when (permissionManager.hasSms()) {
return when (permissionManager.hasReadSms()) {
true -> SqliteWrapper.query(context, uri, projection, sortOrder = "normalized_date desc")
false -> null
}
@@ -44,7 +44,7 @@ class CursorToRecipientImpl @Inject constructor(
}
override fun getRecipientCursor(): Cursor? {
return when (permissionManager.hasSms()) {
return when (permissionManager.hasReadSms()) {
true -> context.contentResolver.query(URI, null, null, null, null)
false -> null
}