google / flutter.plugins

BSD 3-Clause "New" or "Revised" License
117 stars 55 forks source link

Fixing for Android 12 #123

Closed rguntha closed 2 years ago

rguntha commented 2 years ago
  1. Added PendingIntent.FLAG_IMMUTABLE for all the pending requests in AudiofilePlayerService.java and AudiofilePlayerPlugin.java
  2. Modified the MediaSessionCompat in the AudiofilePlayerService.onCreate method to send the FLAG_IMMUTABLE
  3. Added new MediaButtonReceiver12 class, modifying the static methods that create the PendingIntent and passing the FLAG_IMMUTABLE flag
rguntha commented 2 years ago

Dear @monkeyswarm,

I have implemented most/all of your comments. Please check.

The upgraded media library works.

I have tested on Android 12 and on Android 11.

Thanks very much Ramesh

On Mon, 1 Nov 2021 at 10:16, Daniel Iglesia @.***> wrote:

@.**** commented on this pull request.

In packages/audiofileplayer/android/src/main/java/com/google/flutter/plugins/audiofileplayer/MediaButtonReceiver12.java https://github.com/google/flutter.plugins/pull/123#discussion_r739954211 :

import java.util.List;

-public class MediaButtonReceiver12{ +public class MediaButtonReceiver12 {

Delete this file if unused

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/flutter.plugins/pull/123#pullrequestreview-793849673, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2WSBMTEIUF6SRJIYUPDYDUJYLUFANCNFSM5HCKFDNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Ramesh Guntha