-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with SDK > 31 on Android 12 #360
Comments
I have managed to recompile the library and it works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: