USBPrinterService #6
Conversation
usbDevice.deviceName could be null resulted in app crash immediately
|
E/AndroidRuntime(10736): FATAL EXCEPTION: main |
|
[Update USBPrinterService.kt, use use an explicit intent with a packageName] Fix bug that intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED always return false even when accepted permission when connect USB device From https://developer.android.com/about/versions/14/behavior-changes-14#safer-intents I used an Explicit Intent that passed in context.packageName, also changed PendingIntent.FLAG_IMMUTABLE to PendingIntent.FLAG_MUTABLE |
|
One more issue is that on android 14 printer list show but when click on device it does not print.This works for android 13 but in android 14 it give issues. |
usbDevice.deviceName could be null and resulted in app crash immediately