Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
On Android 14+ tapping the notification body (title/artwork area) of a MediaStyle notification does nothing - no response at all. The tap is completely ignored.
Test Results:
- Pixel 7a (Android 15): Notification body tap → No response (does nothing)
- Samsung Galaxy S10+ (Android 12): Notification body tap → Works correctly on lock screen (opens app), but does nothing on unlocked sticky notification
What Still Works:
- Play/Pause button on notification → Works correctly
- Next/Previous buttons on notification → Work correctly
- Media controls function normally
What Doesn't Work:
- Notification body tap on Pixel 7a → Completely ignored, no response
Expected Behavior
When a user taps the notification body (title/artwork area) of a MediaStyle notification, the app should:
- Open the app (bring it to foreground)
- Navigate to the appropriate screen (e.g., show alarm modal, episode details, etc.)
- This should work consistently across all Android versions (8-15) and all device manufacturers
Reference: This is the standard behavior on Android 8-13 and works on Samsung/Xiaomi devices even on Android 14+. Major apps like YouTube Music and Spotify handle this correctly.
Steps To Reproduce
- Create a .NET MAUI app using
CommunityToolkit.Maui.MediaElement version 7.0.0
- Set up media playback with a
MediaElement control
- Start playback (this creates a MediaStyle notification)
- Put the app in the background (or lock the screen)
- Tap the notification body (title or artwork area, NOT the play/pause button)
- Observed: On Pixel 7a (Android 15), the tap does nothing - no response
- Expected: App should open and navigate to the appropriate screen
Additional Test Steps:
- Try setting
SessionActivity via reflection → Notification body tap still does nothing
- Try overriding notification with null MediaSession token → Notification body tap still does nothing
- Try continuous notification override → Notification body tap still does nothing
Link to public reproduction project repository
...
Environment
- **Package**: `CommunityToolkit.Maui.MediaElement` version **7.0.0**
- **.NET Version**: .NET 10.0
- **MAUI Version**: 10.0.11
- **Platform**: Android
- **Android Version**: Android 14+ (API 34+)
- **Tested Devices**:
- **Pixel 7a (Android 15)** - ❌ Body tap does nothing
- **Samsung Galaxy S10+ (Android 12)** - ✅ Body tap works on lock screen
- **Android SDK**: 36 (Android 15)
- **Target Framework**: net10.0-android
Anything else?
Root Cause Analysis
According to Android's official documentation:
"When a MediaStyle notification is displayed with a MediaSession token, taps on the notification body are reserved for resuming the media session (i.e. they trigger MediaSession.Callback.onPlay()). The ContentIntent is ignored unless no MediaSession token is set."
The Problem:
- MediaElement 7.0.0 uses Media3 (
androidx.media3.session.MediaSession)
- Media3's
MediaSession callback is set during session creation via MediaSession.Builder.setCallback()
- MediaElement creates the
MediaSession internally in MediaManager.android.cs (line 174-177) without exposing a way to set a custom callback
- Media3's
MediaSession does not allow changing the callback after creation (it's immutable)
- The default callback's
OnPlay() method just plays/pauses - it doesn't open the app
- On Pixel 7a, even setting MediaSession token to null in MediaStyle doesn't work - the system still ignores ContentIntent
Discussion
#2975
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
On Android 14+ tapping the notification body (title/artwork area) of a MediaStyle notification does nothing - no response at all. The tap is completely ignored.
Test Results:
What Still Works:
What Doesn't Work:
Expected Behavior
When a user taps the notification body (title/artwork area) of a MediaStyle notification, the app should:
Reference: This is the standard behavior on Android 8-13 and works on Samsung/Xiaomi devices even on Android 14+. Major apps like YouTube Music and Spotify handle this correctly.
Steps To Reproduce
CommunityToolkit.Maui.MediaElementversion 7.0.0MediaElementcontrolAdditional Test Steps:
SessionActivityvia reflection → Notification body tap still does nothingLink to public reproduction project repository
...
Environment
Anything else?
Root Cause Analysis
According to Android's official documentation:
The Problem:
androidx.media3.session.MediaSession)MediaSessioncallback is set during session creation viaMediaSession.Builder.setCallback()MediaSessioninternally inMediaManager.android.cs(line 174-177) without exposing a way to set a custom callbackMediaSessiondoes not allow changing the callback after creation (it's immutable)OnPlay()method just plays/pauses - it doesn't open the appDiscussion
#2975