From 226f078aa4177970a6d3eb381f640fb5060b8848 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Mon, 14 Oct 2024 18:34:28 -0600 Subject: [PATCH 1/5] service: attach after init --- app/src/main/java/org/oxycblt/auxio/AuxioService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/oxycblt/auxio/AuxioService.kt b/app/src/main/java/org/oxycblt/auxio/AuxioService.kt index da79b8a11..126a65a8c 100644 --- a/app/src/main/java/org/oxycblt/auxio/AuxioService.kt +++ b/app/src/main/java/org/oxycblt/auxio/AuxioService.kt @@ -51,8 +51,8 @@ class AuxioService : override fun onCreate() { super.onCreate() playbackFragment = playbackFragmentFactory.create(this, this) - sessionToken = playbackFragment.attach() musicFragment = musicFragmentFactory.create(this, this, this) + sessionToken = playbackFragment.attach() musicFragment.attach() } From 389864669178f208c9ba30b6b80fd5060639634f Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Mon, 14 Oct 2024 18:35:20 -0600 Subject: [PATCH 2/5] detail: fix missing edit header in playlists --- .../java/org/oxycblt/auxio/detail/DetailViewModel.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt index 285a21d6f..4bc306a33 100644 --- a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt @@ -34,6 +34,7 @@ import org.oxycblt.auxio.detail.list.EditHeader import org.oxycblt.auxio.detail.list.SortHeader import org.oxycblt.auxio.list.BasicHeader import org.oxycblt.auxio.list.Divider +import org.oxycblt.auxio.list.Header import org.oxycblt.auxio.list.Item import org.oxycblt.auxio.list.ListSettings import org.oxycblt.auxio.list.adapter.UpdateInstructions @@ -522,12 +523,13 @@ constructor( } } - private fun refreshDetail( + private inline fun refreshDetail( detail: Detail?, parent: MutableStateFlow, list: MutableStateFlow>, instructions: MutableEvent, - replace: Int? + replace: Int?, + songHeader: (Int) -> Header = { SortHeader(it) } ) { if (detail == null) { parent.value = null @@ -540,7 +542,7 @@ constructor( when (section) { is DetailSection.PlainSection<*> -> { val header = - if (section is DetailSection.Songs) SortHeader(section.stringRes) + if (section is DetailSection.Songs) songHeader(section.stringRes) else BasicHeader(section.stringRes) newList.add(Divider(header)) newList.add(header) @@ -575,7 +577,9 @@ constructor( if (edited == null) { val playlist = detailGenerator.playlist(uid) refreshDetail( - playlist, _currentPlaylist, _playlistSongList, _playlistSongInstructions, null) + playlist, _currentPlaylist, _playlistSongList, _playlistSongInstructions, null) { + EditHeader(it) + } return } val list = mutableListOf() From caa2e02aff1729728801d16e03d074342d19220e Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Mon, 14 Oct 2024 19:34:51 -0600 Subject: [PATCH 3/5] detail: correctly reset edited playlist --- app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt index 4bc306a33..1a999ef49 100644 --- a/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/detail/DetailViewModel.kt @@ -431,6 +431,7 @@ constructor( // TODO: The user could probably press some kind of button if they were fast enough. // Think of a better way to handle this state. _editedPlaylist.value = null + refreshPlaylist(playlist.uid) } } From 9b4e9b30b2beb26693d5bda1b8e4d8b414d3dc6d Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Mon, 14 Oct 2024 19:51:52 -0600 Subject: [PATCH 4/5] service: fix release memory leaks --- .../main/java/org/oxycblt/auxio/music/service/Indexer.kt | 6 +++--- .../oxycblt/auxio/playback/service/MediaSessionHolder.kt | 2 +- .../auxio/playback/service/PlaybackServiceFragment.kt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/music/service/Indexer.kt b/app/src/main/java/org/oxycblt/auxio/music/service/Indexer.kt index 6b3dfb29f..abc9eeaaf 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/service/Indexer.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/service/Indexer.kt @@ -90,10 +90,10 @@ private constructor( fun release() { contentObserver.release() - musicSettings.registerListener(this) - musicRepository.addIndexingListener(this) - musicRepository.addUpdateListener(this) + musicRepository.unregisterWorker(this) musicRepository.removeIndexingListener(this) + musicRepository.removeUpdateListener(this) + musicSettings.unregisterListener(this) } override fun requestIndex(withCache: Boolean) { diff --git a/app/src/main/java/org/oxycblt/auxio/playback/service/MediaSessionHolder.kt b/app/src/main/java/org/oxycblt/auxio/playback/service/MediaSessionHolder.kt index b5724f6b4..dc33ca4ab 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/service/MediaSessionHolder.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/service/MediaSessionHolder.kt @@ -113,9 +113,9 @@ private constructor( */ fun release() { bitmapProvider.release() + playbackManager.removeListener(this) playbackSettings.unregisterListener(this) imageSettings.unregisterListener(this) - playbackManager.removeListener(this) mediaSession.apply { isActive = false release() diff --git a/app/src/main/java/org/oxycblt/auxio/playback/service/PlaybackServiceFragment.kt b/app/src/main/java/org/oxycblt/auxio/playback/service/PlaybackServiceFragment.kt index 04af2a40f..26ce16237 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/service/PlaybackServiceFragment.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/service/PlaybackServiceFragment.kt @@ -107,11 +107,11 @@ private constructor( fun release() { waitJob.cancel() + playbackManager.removeListener(this) + systemReceiver.release() widgetComponent.release() - context.unregisterReceiver(systemReceiver) sessionHolder.release() exoHolder.release() - playbackManager.removeListener(this) } override fun onSessionEnded() { From 4a6273e2da74780c01d7eb6c02a2254b4e74f9ff Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Mon, 14 Oct 2024 19:54:15 -0600 Subject: [PATCH 5/5] build: bump to 3.6.1 --- CHANGELOG.md | 10 ++++++++++ README.md | 4 ++-- app/build.gradle | 4 ++-- fastlane/metadata/android/en-US/changelogs/51.txt | 3 +++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/51.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 699da229b..37d5300c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.6.1 + +#### What's Fixed +- Fixed possible crash from poor service initalization +- Fixed issue where it was impossible to edit playlists +- Fixed issue where playlist would revert to older version when re-edited + +#### Dev/Meta +- Fixed service memory leaks + ## 3.6.0 #### What's New diff --git a/README.md b/README.md index 68a4139fe..b5373da18 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@

Auxio

A simple, rational music player for android.

- - Latest Version + + Latest Version Releases diff --git a/app/build.gradle b/app/build.gradle index 2cd8a66fe..5c622439b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,8 +21,8 @@ android { defaultConfig { applicationId namespace - versionName "3.6.0" - versionCode 50 + versionName "3.6.1" + versionCode 51 minSdk 24 targetSdk 34 diff --git a/fastlane/metadata/android/en-US/changelogs/51.txt b/fastlane/metadata/android/en-US/changelogs/51.txt new file mode 100644 index 000000000..131fed628 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/51.txt @@ -0,0 +1,3 @@ +Auxio 3.6.0 improves support for android auto and fixes several small regressions. +This release fixes critical issues identified in the previous version. +For more information, see https://github.com/OxygenCobalt/Auxio/releases/tag/v3.6.0. \ No newline at end of file