From 8021848b03530cbbf980e0182f9b4a7d302fed8d Mon Sep 17 00:00:00 2001 From: Coffeemakr Date: Tue, 27 Dec 2016 14:41:30 +0100 Subject: [PATCH] Remove note field completly Always use noteBuilder directly to generate a notification --- .../org/schabi/newpipe/player/BackgroundPlayer.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java index 2824647ec..0eec36b1b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BackgroundPlayer.java @@ -124,7 +124,6 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare private WifiManager.WifiLock wifiLock; private Bitmap videoThumbnail; private NoteBuilder noteBuilder; - private Notification note; public PlayerThread(String src, String title, BackgroundPlayer owner) { this.source = src; @@ -183,9 +182,8 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare filter.addAction(ACTION_REWIND); registerReceiver(broadcastReceiver, filter); - note = buildNotification(); - - startForeground(noteID, note); + initNotificationBuilder(); + startForeground(noteID, noteBuilder.build()); //currently decommissioned progressbar looping update code - works, but doesn't fit inside //Notification.MediaStyle Notification layout. @@ -264,7 +262,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare } } - private Notification buildNotification() { + private void initNotificationBuilder() { Notification note; Resources res = getApplicationContext().getResources(); @@ -304,10 +302,6 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare .setCategory(Notification.CATEGORY_TRANSPORT) //Make notification appear on lockscreen .setVisibility(Notification.VISIBILITY_PUBLIC); - - note = noteBuilder.build(); - - return note; }