Skip to content
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

Open
bdureau opened this issue Feb 4, 2023 · 1 comment
Open

Issue with SDK > 31 on Android 12 #360

bdureau opened this issue Feb 4, 2023 · 1 comment

Comments

@bdureau
Copy link

bdureau commented Feb 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant