Android Auto: Prevent crashing loop in case that app restarts while browsing content

This commit is contained in:
ISO-B 2024-11-18 19:47:49 +02:00
parent a08ae6f977
commit 8caa08843e

View file

@ -1042,6 +1042,12 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
result.detach()
// Prevent crashing if app is restarted while browsing
if ((parentMediaId != DOWNLOADS_ROOT && parentMediaId != AUTO_MEDIA_ROOT) && !firstLoadDone){
result.sendResult(null)
return
}
if (parentMediaId == DOWNLOADS_ROOT) { // Load downloads
val localBooks = DeviceManager.dbManager.getLocalLibraryItems("book")