From d5210a86f7c90ec99c1c3a746540a58312453a79 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 31 Oct 2023 22:09:47 +0200 Subject: [PATCH] Update MavericksMockPrinter.kt --- .../com/airbnb/mvrx/mocking/printer/MavericksMockPrinter.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mvrx-mocking/src/main/kotlin/com/airbnb/mvrx/mocking/printer/MavericksMockPrinter.kt b/mvrx-mocking/src/main/kotlin/com/airbnb/mvrx/mocking/printer/MavericksMockPrinter.kt index 0801efda..030a84ee 100644 --- a/mvrx-mocking/src/main/kotlin/com/airbnb/mvrx/mocking/printer/MavericksMockPrinter.kt +++ b/mvrx-mocking/src/main/kotlin/com/airbnb/mvrx/mocking/printer/MavericksMockPrinter.kt @@ -7,6 +7,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.AsyncTask +import android.os.Build import android.util.Log import android.view.View import androidx.fragment.app.Fragment @@ -204,6 +205,11 @@ internal abstract class MavericksPrintStateBroadcastReceiver : BroadcastReceiver fun register(context: Context) { check(!isRegistered) { "Already registered" } isRegistered = true + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + context.registerReceiver(networkInfoReceiver, filter, Context.RECEIVER_NOT_EXPORTED) + } else { + context.registerReceiver(networkInfoReceiver, filter) + } context.registerReceiver(this, IntentFilter(ACTION_COPY_MAVERICKS_STATE)) }