From 9513088d5941f8ea38ae7abd8ea819c0db1aa506 Mon Sep 17 00:00:00 2001 From: ashrafzadeh Date: Wed, 5 Sep 2018 12:13:40 +0430 Subject: [PATCH] change notification importance to low --- .../main/java/dm/audiostreamer/AudioStreamingManager.java | 1 + .../main/java/dm/audiostreamer/AudioStreamingService.java | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingManager.java b/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingManager.java index 939991b..a5df7f7 100644 --- a/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingManager.java +++ b/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingManager.java @@ -330,6 +330,7 @@ public void cleanupPlayer(Context context, boolean notify, boolean stopService) public void cleanupPlayer(boolean notify, boolean stopService) { handlePauseRequest(); audioPlayback.stop(true); + if (stopService) { Intent intent = new Intent(context, AudioStreamingService.class); context.stopService(intent); diff --git a/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingService.java b/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingService.java index 67ab5af..9c24a1b 100644 --- a/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingService.java +++ b/dmaudiostreamer/src/main/java/dm/audiostreamer/AudioStreamingService.java @@ -177,7 +177,7 @@ public void run() { } Bitmap albumArt = null; - + Notification notification = null; private void createNotification(MediaMetaData mSongDetail) { try { String songName = mSongDetail.getMediaTitle(); @@ -192,11 +192,11 @@ private void createNotification(MediaMetaData mSongDetail) { } - Notification notification = null; + CharSequence name = getString(R.string.app_name); boolean androidOPlus = false; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { - int importance = android.app.NotificationManager.IMPORTANCE_HIGH; + int importance = android.app.NotificationManager.IMPORTANCE_LOW; NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, importance); android.app.NotificationManager mNotificationManager = (android.app.NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);