altera2015 / usbserial

Flutter Android USB Serial plugin
BSD 3-Clause "New" or "Revised" License
119 stars 83 forks source link

fix: Android 14 compability #110

Closed Foxushka closed 2 months ago

Foxushka commented 2 months ago

Android 14 introduced some changes to intents: https://developer.android.com/about/versions/14/behavior-changes-14#safer-intents

If you will build app that targets Android 14 (SDK 34) it will throw error on connection: java.lang.IllegalArgumentException: Targeting U+ (version 34 and above) disallows creating or retrieving a PendingIntent with FLAG_MUTABLE, an implicit Intent within and without FLAG_NO_CREATE and FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT for security reasons. To retrieve an already existing PendingIntent, use FLAG_NO_CREATE, however, to create a new PendingIntent with an implicit Intent use FLAG_IMMUTABLE.

altera2015 commented 2 months ago

@Foxushka Thanks for your contribution!