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

Commit 350cf6e8 authored by Chen Bai's avatar Chen Bai
Browse files

draw-wakelock: acquire only for state DOZE not DOZE_SUSPEND

- Display.isDozeState also includes DOZE_SUSPEND. In this state,
  Android shouldn't control the display; Therefore, DRAW_WAKE_LOCK
  shouldn't be acquired.

Flag: Flag: EXEMPT bugfix
Test: verify that no DRAW_WAKE_LOCK during offloading
Bug: 349886281
Change-Id: I1f96fddc37dc245efe75acc53fed474af6a5d2b8
parent 2f24c237
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2476,8 +2476,10 @@ public final class ViewRootImpl implements ViewParent,
            return;
        }
        if (!Display.isDozeState(mAttachInfo.mDisplayState)) {
            // Only need to acquire wake lock for DOZE state.
        if (mAttachInfo.mDisplayState != Display.STATE_DOZE) {
            // In DOZE_SUSPEND, Android shouldn't control the display; therefore we only poke the
            // draw wake lock when display state is DOZE. Noted that Display#isDozeState includes
            // DOZE_SUSPEND as well, so, it's not feasible here.
            return;
        }
        if (mWindowAttributes.type != WindowManager.LayoutParams.TYPE_BASE_APPLICATION) {