mapaiva / react-native-usbserial

A USB serial React Native bridge
MIT License
57 stars 35 forks source link

Better permission request handler #1

Closed mapaiva closed 7 years ago

mapaiva commented 8 years ago

When the module requests USB_PERMISSION the application that is using the module freezes.

Improve this:

if (connection == null) {
            PendingIntent mPermissionIntent = PendingIntent.getBroadcast(reactContext,
                    0,
                    new Intent("com.android.example.USB_PERMISSION"),
                    0);

            manager.requestPermission(driver.getDevice(), mPermissionIntent);
        }
mapaiva commented 7 years ago

Solved by https://github.com/mapaiva/react-native-usbserial/commit/80bb32baf8a2685ec94c5e95224d3566e76fc249