This repository was archived by the owner on Jul 8, 2025. It is now read-only.
-
Couldn't load subscription status.
- Fork 3.8k
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Black Player #557
Copy link
Copy link
Open
Description
uamp/mobile/src/main/java/com/example/android/uamp/playback/PlaybackManager.java
Lines 328 to 346 in f3154af
| @Override | |
| public void onCustomAction(@NonNull String action, Bundle extras) { | |
| if (CUSTOM_ACTION_THUMBS_UP.equals(action)) { | |
| LogHelper.i(TAG, "onCustomAction: favorite for current track"); | |
| MediaSessionCompat.QueueItem currentMusic = mQueueManager.getCurrentMusic(); | |
| if (currentMusic != null) { | |
| String mediaId = currentMusic.getDescription().getMediaId(); | |
| if (mediaId != null) { | |
| String musicId = MediaIDHelper.extractMusicIDFromMediaID(mediaId); | |
| mMusicProvider.setFavorite(musicId, !mMusicProvider.isFavorite(musicId)); | |
| } | |
| } | |
| // playback state needs to be updated because the "Favorite" icon on the | |
| // custom action will change to reflect the new favorite state. | |
| updatePlaybackState(null); | |
| } else { | |
| LogHelper.e(TAG, "Unsupported action: ", action); | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels