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
Loading
Please register or sign in to comment