Skip to content

Commit

Permalink
Fixing java.lang.SecurityException
Browse files Browse the repository at this point in the history
By adding Context.RECEIVER_NOT_EXPORTED
  • Loading branch information
danpe committed Nov 2, 2023
1 parent ebbcd0d commit 4aa5e77
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -206,11 +206,10 @@ internal abstract class MavericksPrintStateBroadcastReceiver : BroadcastReceiver
check(!isRegistered) { "Already registered" }
isRegistered = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(networkInfoReceiver, filter, Context.RECEIVER_NOT_EXPORTED)
context.registerReceiver(this, IntentFilter(ACTION_COPY_MAVERICKS_STATE), Context.RECEIVER_NOT_EXPORTED)
} else {
context.registerReceiver(networkInfoReceiver, filter)
context.registerReceiver(this, IntentFilter(ACTION_COPY_MAVERICKS_STATE))
}
context.registerReceiver(this, IntentFilter(ACTION_COPY_MAVERICKS_STATE))
}

fun unregister(context: Context) {
Expand Down

0 comments on commit 4aa5e77

Please sign in to comment.