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

Skip to content
Commit 250a9700 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Reduce unnecessary invocation of pokeDrawLock

Now it only acquires wake lock (poke draw) for focused activity
window. Because the original purpose (commit c2932a1b) is to make
sure that ambiactive activity can draw without being suspended
for wearable devices.

Check focus instead of visibility because pokeDrawLockIfNeeded
can be called from DisplayListener which happens before the
visibility change.

On a regular phone device with AOD enabled, this can reduce the
number of invocation:
 30+ times when turning screen off.
 4 times per minute (the clock on AOD).
i.e. pokeDrawLock will never be called on a device with keyguard.

Bug: 218406154
Test: Enable AOD, turn off screen to enter AOD.
      Check the section "Wake Lock Log" of "adb shell dumpsys power".
      There is no more "ACQ Window:xxx (draw)".
      And after several minutes, the clock on AOD still shows the
      latest time (because com.android.systemui.doze.DozeUi#onTimeTick
      also acquires WakeLock).
Change-Id: I6fc7f6afec68c63124d76c4734285188ab62fc41
parent 993c5e10
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment