From 892b4a15f66ef79c5dfbd4f11d76c0a77779eeb3 Mon Sep 17 00:00:00 2001 From: thefalsedev <74975183+thefalsedev@users.noreply.github.com> Date: Tue, 7 Sep 2021 00:04:05 +0200 Subject: [PATCH] Change player progress bar update from 500 ms to 1 s Just like in the issue 7062, https://github.com/TeamNewPipe/NewPipe/issues/7062, this doesn't affect UI as it updates every one second anyway, but reduces very heavy android widget progress bar high cpu usage. With every 500s there is 6% cpu usage and with 1s only 4%. However further changes will have to be made to disable updating of player progress bar when screen is off to further reduce power consumption. With this, total power savings would be 20% in mAh consumption. --- app/src/main/java/org/schabi/newpipe/player/Player.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index dd5468f69..4319f9775 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -238,7 +238,7 @@ public final class Player implements //////////////////////////////////////////////////////////////////////////*/ public static final int PLAY_PREV_ACTIVATION_LIMIT_MILLIS = 5000; // 5 seconds - public static final int PROGRESS_LOOP_INTERVAL_MILLIS = 500; // 500 millis + public static final int PROGRESS_LOOP_INTERVAL_MILLIS = 1000; // 1 second public static final int DEFAULT_CONTROLS_DURATION = 300; // 300 millis public static final int DEFAULT_CONTROLS_HIDE_TIME = 2000; // 2 Seconds public static final int DPAD_CONTROLS_HIDE_TIME = 7000; // 7 Seconds