Skip to content

Commit

Permalink
#12 - the usb broadcast receiver doesn't depend anymore on usbmanager
Browse files Browse the repository at this point in the history
  • Loading branch information
LIBERADO committed Dec 30, 2020
1 parent 7bdee52 commit 2f7ac69
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions MobileApplication/IHM/IHM.Android/Interfaces/DroidPandaVcom.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -31,15 +31,8 @@ public class USBBroadCastReceiver : BroadcastReceiver
/// </summary>
public event EventHandler<bool> NotifyUsbPermissionCompleted;

/// <summary>
/// We complete the opening device process in the brodcast receive
/// FIXME - don't do that, just send event and let the task that triggered the permission request complete its process
/// </summary>
private DroidPandaVcom _droidPandaVcom;

public USBBroadCastReceiver(DroidPandaVcom droidPandaVcom)
public USBBroadCastReceiver()
{
_droidPandaVcom = droidPandaVcom;
}

/// <summary>
Expand Down Expand Up @@ -129,7 +122,7 @@ public void Init(Object context)
_devHandle.usbManager = (UsbManager)_context.GetSystemService(Context.UsbService);
_usbPermissionIntent = PendingIntent.GetBroadcast(_context, 0, new Intent(USBBroadCastReceiver.ACTION_USB_PERMISSION), 0);
IntentFilter filter = new IntentFilter(USBBroadCastReceiver.ACTION_USB_PERMISSION);
_USBBroadCastReceiver = new USBBroadCastReceiver(this);
_USBBroadCastReceiver = new USBBroadCastReceiver();
_USBBroadCastReceiver.NotifyUsbPermissionCompleted += _USBBroadCastReceiver_NotifyUsbPermissionCompleted;
_context.RegisterReceiver(_USBBroadCastReceiver, filter);
}
Expand Down

0 comments on commit 2f7ac69

Please sign in to comment.