Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): register state receivers as REGISTER_EXPORTED #663 #667

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS
import android.provider.Settings.ACTION_BLUETOOTH_SETTINGS
import android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS
import androidx.activity.result.ActivityResult
import androidx.core.content.ContextCompat
import androidx.core.location.LocationManagerCompat
import com.getcapacitor.JSArray
import com.getcapacitor.JSObject
Expand Down Expand Up @@ -240,7 +241,9 @@ class BluetoothLe : Plugin() {
}
}
val intentFilter = IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED)
context.registerReceiver(stateReceiver, intentFilter)
ContextCompat.registerReceiver(context, stateReceiver, intentFilter,
ContextCompat.RECEIVER_EXPORTED
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.os.Handler
import android.os.HandlerThread
import android.os.Looper
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import com.getcapacitor.Logger
import java.util.UUID
import java.util.concurrent.ConcurrentLinkedQueue
Expand Down Expand Up @@ -415,7 +416,9 @@ class Device(
}
}
val intentFilter = IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED)
context.registerReceiver(bondStateReceiver, intentFilter)
ContextCompat.registerReceiver(context, bondStateReceiver, intentFilter,
ContextCompat.RECEIVER_EXPORTED
)
}
}

Expand Down
Loading