[3/n] Handle USB permission responses properly
Some checks failed
/ build-debug (push) Failing after 14m40s

This commit is contained in:
Peter Cai 2024-06-30 17:06:58 -04:00
parent 87fc1cd2f8
commit ccf21675d6

View file

@ -52,7 +52,7 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker {
private val usbPermissionReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
if (intent?.action == ACTION_USB_PERMISSION) {
if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) {
if (usbDevice != null && usbManager.hasPermission(usbDevice)) {
lifecycleScope.launch(Dispatchers.Main) {
switchToUsbFragmentIfPossible()
}