1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-17 15:24:55 +00:00

Remove note field completly

Always use noteBuilder directly to generate a notification
This commit is contained in:
Coffeemakr 2016-12-27 14:41:30 +01:00
parent 5a127c26e6
commit 8021848b03

View File

@ -124,7 +124,6 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
private WifiManager.WifiLock wifiLock; private WifiManager.WifiLock wifiLock;
private Bitmap videoThumbnail; private Bitmap videoThumbnail;
private NoteBuilder noteBuilder; private NoteBuilder noteBuilder;
private Notification note;
public PlayerThread(String src, String title, BackgroundPlayer owner) { public PlayerThread(String src, String title, BackgroundPlayer owner) {
this.source = src; this.source = src;
@ -183,9 +182,8 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
filter.addAction(ACTION_REWIND); filter.addAction(ACTION_REWIND);
registerReceiver(broadcastReceiver, filter); registerReceiver(broadcastReceiver, filter);
note = buildNotification(); initNotificationBuilder();
startForeground(noteID, noteBuilder.build());
startForeground(noteID, note);
//currently decommissioned progressbar looping update code - works, but doesn't fit inside //currently decommissioned progressbar looping update code - works, but doesn't fit inside
//Notification.MediaStyle Notification layout. //Notification.MediaStyle Notification layout.
@ -264,7 +262,7 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
} }
} }
private Notification buildNotification() { private void initNotificationBuilder() {
Notification note; Notification note;
Resources res = getApplicationContext().getResources(); Resources res = getApplicationContext().getResources();
@ -304,10 +302,6 @@ public class BackgroundPlayer extends Service /*implements MediaPlayer.OnPrepare
.setCategory(Notification.CATEGORY_TRANSPORT) .setCategory(Notification.CATEGORY_TRANSPORT)
//Make notification appear on lockscreen //Make notification appear on lockscreen
.setVisibility(Notification.VISIBILITY_PUBLIC); .setVisibility(Notification.VISIBILITY_PUBLIC);
note = noteBuilder.build();
return note;
} }