1
0
Fork 0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2025-10-04 18:29:26 +02:00

Reduce power consumption

Only schedule the chek for new streams if the user enaled the check. Cancel the worker when the user disables the notifications.
This commit is contained in:
TobiGr 2021-12-10 23:52:28 +01:00
parent 779d3dce6f
commit 19fd7bc37e
4 changed files with 60 additions and 13 deletions

View file

@ -165,8 +165,9 @@ public class MainActivity extends AppCompatActivity {
}
openMiniPlayerUponPlayerStarted();
// schedule worker for checking for new streams and creating corresponding notifications
NotificationWorker.schedule(this);
// Schedule worker for checking for new streams and creating corresponding notifications
// if this is enabled by the user.
NotificationWorker.initialize(this);
}
@Override