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
This commit is contained in:
Lucas Dupin
2018-06-26 15:09:08 -07:00
parent 0c40911ee6
commit a11298be5d
2 changed files with 2 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;