From 65967011876af5c6775f471be92a8f16e34b2703 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 10 Aug 2017 21:41:23 -0700 Subject: [PATCH] Ensure the Activity is available before showing the update notification dialog. --- .../src/main/java/io/casey/musikcube/remote/MainActivity.kt | 2 +- .../java/io/casey/musikcube/remote/playback/SystemService.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/MainActivity.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/MainActivity.kt index 2b8aff398..eff60bd4d 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/MainActivity.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/MainActivity.kt @@ -419,7 +419,7 @@ class MainActivity : WebSocketActivityBase() { private fun runUpdateCheck() { if (!UpdateAvailableDialog.displayed) { updateCheck.run { required, version, url -> - if (required) { + if (!isPaused && required) { val suppressed = prefs.getString(Prefs.Key.UPDATE_DIALOG_SUPPRESSED_VERSION, "") if (!UpdateAvailableDialog.displayed && suppressed != version) { val tag = UpdateAvailableDialog.TAG diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/SystemService.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/SystemService.kt index bd47f8cc1..e65d450f8 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/SystemService.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/playback/SystemService.kt @@ -8,10 +8,11 @@ import android.media.AudioManager import android.os.Handler import android.os.IBinder import android.os.PowerManager +import android.support.v4.app.NotificationCompat import android.support.v4.media.MediaMetadataCompat +import android.support.v4.media.app.NotificationCompat.MediaStyle import android.support.v4.media.session.MediaSessionCompat import android.support.v4.media.session.PlaybackStateCompat -import android.support.v4.app.NotificationCompat import android.util.Log import android.view.KeyEvent import com.bumptech.glide.Glide @@ -27,7 +28,6 @@ import io.casey.musikcube.remote.util.Debouncer import io.casey.musikcube.remote.util.Strings import io.casey.musikcube.remote.websocket.Prefs import android.support.v4.app.NotificationCompat.Action as NotifAction -import android.support.v4.media.app.NotificationCompat.MediaStyle /** * a service used to interact with all of the system media-related components -- notifications,