Skip to content

Commit

Permalink
Change registerReceiver RECEIVER_NOT_EXPORTED to RECEIVER_EXPORTED
Browse files Browse the repository at this point in the history
  • Loading branch information
SM2A authored and hannesa2 committed Jan 17, 2024
1 parent 7fbde75 commit e2345b0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ class MqttAndroidClient @JvmOverloads constructor(
private fun registerReceiver(receiver: BroadcastReceiver) {
val filter = IntentFilter()
filter.addAction(MqttServiceConstants.CALLBACK_TO_ACTIVITY)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(receiver, filter, Context.RECEIVER_NOT_EXPORTED)
} else
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
context.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED)
else
context.registerReceiver(receiver, filter)
receiverRegistered = true
}
Expand Down

0 comments on commit e2345b0

Please sign in to comment.