In addition to updating the target SDK versions, also updates USBMonitor to always use the FLAG_IMMUTABLE when attempting to request device permissions.
This fixes an issue when using the library with apps targeting 34, where CameraHelper would be unable to open devices due to USBMonitor attempting to build the device permissions intent using FLAG_MUTABLE. This is no longer allowed, and will throw a RemoteException with the message:
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.
Camera device attach/detach events were not being received due to a SecurityException:
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
In addition to updating the target SDK versions, also updates USBMonitor to always use the FLAG_IMMUTABLE when attempting to request device permissions.
This fixes an issue when using the library with apps targeting 34, where CameraHelper would be unable to open devices due to USBMonitor attempting to build the device permissions intent using FLAG_MUTABLE. This is no longer allowed, and will throw a RemoteException with the message:
Camera device attach/detach events were not being received due to a SecurityException: