Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a11298be authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Decrease delay to improve battery life

Arbitrary delays were introduced a while ago to deal with device
specific issues but these delays ended up affecting battery life
significantly. Although removing them completely isn't possible,
they can be reduced to more conservative values.

Test: cover prox. sensor multiple times with multiple durations
Fixes: 110902271
Change-Id: I2731fc7a5414f796e96a6c97959c395b10c32faa
parent 0c40911e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -113,9 +113,7 @@ public class DozeUi implements DozeMachine.Part {
                    // The display buffers will be empty and need to be filled.
                    mHost.dozeTimeTick();
                    // The first frame may arrive when the display isn't ready yet.
                    mHandler.postDelayed(mWakeLock.wrap(mHost::dozeTimeTick), 100);
                    // The the delayed frame may arrive when the display isn't ready yet either.
                    mHandler.postDelayed(mWakeLock.wrap(mHost::dozeTimeTick), 1000);
                    mHandler.postDelayed(mWakeLock.wrap(mHost::dozeTimeTick), 500);
                }
                scheduleTimeTick();
                break;
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.os.Handler;
 */
public class DelayedWakeLock implements WakeLock {

    private static final long RELEASE_DELAY_MS = 140;
    private static final long RELEASE_DELAY_MS = 100;

    private final Handler mHandler;
    private final WakeLock mInner;