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

Commit 4ee1f85f authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Reducing unnecessary activity pause if activity can turn on screen" into main

parents 07c812e2 fe68a895
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4453,6 +4453,12 @@
      "group": "WM_DEBUG_BACK_PREVIEW",
      "at": "com\/android\/server\/wm\/BackNavigationController.java"
    },
    "1946983717": {
      "message": "Waiting for screen on due to %s",
      "level": "VERBOSE",
      "group": "WM_DEBUG_STATES",
      "at": "com\/android\/server\/wm\/TaskFragment.java"
    },
    "1947239194": {
      "message": "Deferring rotation, still finishing previous rotation",
      "level": "VERBOSE",
+8 −4
Original line number Diff line number Diff line
@@ -926,10 +926,14 @@ class TaskFragment extends WindowContainer<WindowContainer> {
    boolean sleepIfPossible(boolean shuttingDown) {
        boolean shouldSleep = true;
        if (mResumedActivity != null) {
            if (!shuttingDown && mResumedActivity.canTurnScreenOn()) {
                ProtoLog.v(WM_DEBUG_STATES, "Waiting for screen on due to %s", mResumedActivity);
            } else {
                // Still have something resumed; can't sleep until it is paused.
                ProtoLog.v(WM_DEBUG_STATES, "Sleep needs to pause %s", mResumedActivity);
                startPausing(false /* userLeaving */, true /* uiSleeping */, null /* resuming */,
                        "sleep");
            }
            shouldSleep = false;
        } else if (mPausingActivity != null) {
            // Still waiting for something to pause; can't sleep yet.