You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like it does not request the permission correctly on Android 12.
You might be able to fix it like this
This is on line 155 on file SerialPortBuilder.java
//PendingIntent mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
PendingIntent mPendingIntent = null;
if(android.os.Build.VERSION.SDK_INT >= 31) {
mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), PendingIntent.FLAG_IMMUTABLE);
} else {
mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
}
Unfortunately I am having trouble to build the library so I cannot really test it.
I am quite happy to confirm if it works if someone explain how to build the lib
Regards
Boris
The text was updated successfully, but these errors were encountered:
I have managed to recompile the library and it works
however I have had to add the following dependency for lib serial to work
implementation 'com.squareup.okio:okio:3.3.0'
Looks like it does not request the permission correctly on Android 12.
You might be able to fix it like this
This is on line 155 on file SerialPortBuilder.java
//PendingIntent mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
PendingIntent mPendingIntent = null;
if(android.os.Build.VERSION.SDK_INT >= 31) {
mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), PendingIntent.FLAG_IMMUTABLE);
} else {
mPendingIntent = PendingIntent.getBroadcast(context, 0, new Intent(ACTION_USB_PERMISSION), 0);
}
Unfortunately I am having trouble to build the library so I cannot really test it.
I am quite happy to confirm if it works if someone explain how to build the lib
Regards
Boris
The text was updated successfully, but these errors were encountered: