Skip to content

Commit

Permalink
Fix reported firebase issues (#157)
Browse files Browse the repository at this point in the history
Co-authored-by: Mario Bodemann <mario.bodemann@gmail.com>
  • Loading branch information
LethalMaus and mariobodemann committed Jul 11, 2023
1 parent 7776278 commit fcabf27
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ class ZeBadgeUploader @Inject constructor(
): Unit = suspendCancellableCoroutine { continuation ->
class BoundUsbReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (ACTION_USB_PERMISSION == intent.action) {
if (ACTION_USB_PERMISSION == intent.action && continuation.isActive) {
val boundDevice: UsbDevice? = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE)

if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
if (boundDevice != null) {
Timber.d("USB Permission", "Permission granted.")
Expand Down

0 comments on commit fcabf27

Please sign in to comment.