Skip to content

Commit

Permalink
fix: app can't be set to default sms app
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Sep 20, 2023
1 parent d1d1b05 commit 5d843f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
android:permission="android.permission.BROADCAST_SMS">

<intent-filter android:priority="999">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<action android:name="android.provider.Telephony.SMS_DELIVER" />
</intent-filter>
</receiver>

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/bnyro/contacts/receivers/SmsReceiver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.bnyro.contacts.util.SmsUtil
class SmsReceiver : BroadcastReceiver() {

override fun onReceive(context: Context, intent: Intent) {
if (intent.action != SMS_RECEIVED) return
if (intent.action != SMS_DELIVER) return

Telephony.Sms.Intents.getMessagesFromIntent(intent).forEach { message ->
val notificationId = message.timestampMillis.hashCode()
Expand Down Expand Up @@ -101,7 +101,7 @@ class SmsReceiver : BroadcastReceiver() {
}

companion object {
private const val SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"
private const val SMS_DELIVER = "android.provider.Telephony.SMS_DELIVER"
const val KEY_TEXT_REPLY = "key_text_reply"
const val KEY_EXTRA_ADDRESS = "key_extra_address"
const val KEY_EXTRA_NOTIFICATION_ID = "notification_id"
Expand Down

0 comments on commit 5d843f6

Please sign in to comment.