feat(player): notification favorite via MediaControl.custom (6c)
Adds a heart action to the media notification implemented as a custom control + customAction handler — NOT setRating, which is broken upstream (audio_service #376: onSetRating never fires from a notification tap) and previously blanked the Pixel Watch. - res/drawable/ic_stat_favorite{,_border}.xml: white 24dp vector hearts - audio_handler: favorite MediaControl.custom in _broadcastState (icon/label toggle by LikeBridge state; kept out of androidCompactActionIndices so compact/lock + Wear transport are unchanged); customAction override (Future<dynamic>, matches base) toggles the like then re-broadcasts; refreshFavoriteControl() - player_provider: cascade refreshFavoriteControl into the likedIds listener so liking from TrackRow/kebab/SSE flips the notification heart Reliable on phone notification + lock screen; Wear/Auto display of a non-transport custom action is platform-dependent (not a bug). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -62,7 +62,9 @@ class PlayerActions {
|
||||
// kebab menu, or another logged-in device propagating via SSE.
|
||||
_ref.listen<AsyncValue<LikedIds>>(likedIdsProvider, (_, next) {
|
||||
if (next.value == null) return;
|
||||
_ref.read(audioHandlerProvider).refreshCurrentRating();
|
||||
_ref.read(audioHandlerProvider)
|
||||
..refreshCurrentRating()
|
||||
..refreshFavoriteControl();
|
||||
});
|
||||
}
|
||||
final Ref _ref;
|
||||
|
||||
Reference in New Issue
Block a user