Erro ao chamar PendingIntent sdk 31
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
SOLUÇÃO ALTERAR
this.mPermissionIntent = PendingIntent.getBroadcast(this.context, 0, new Intent("com.android.example.USB_PERMISSION"), 0);
*para *
mPermissionIntent = PendingIntent.getBroadcast(this.context, 0, new Intent("com.android.example.USB_PERMISSION"), PendingIntent.FLAG_IMMUTABLE);
Erro ao chamar PendingIntent sdk 31
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
SOLUÇÃO ALTERAR
this.mPermissionIntent = PendingIntent.getBroadcast(this.context, 0, new Intent("com.android.example.USB_PERMISSION"), 0);
*para *
mPermissionIntent = PendingIntent.getBroadcast(this.context, 0, new Intent("com.android.example.USB_PERMISSION"), PendingIntent.FLAG_IMMUTABLE);