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

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

Merge "Wake up the device if activity can turn screen on" into main

parents 23b0528a cfc84e2c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2538,7 +2538,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {

    void wakeUp(int displayId, String reason) {
        mPowerManager.wakeUp(SystemClock.uptimeMillis(), PowerManager.WAKE_REASON_APPLICATION,
                "android.server.am:TURN_ON:" + reason, displayId);
                "android.server.wm:TURN_ON:" + reason, displayId);
    }

    /** Starts a batch of visibility updates. */
+9 −3
Original line number Diff line number Diff line
@@ -5230,10 +5230,16 @@ class Task extends TaskFragment {
            // to ensure any necessary pause logic occurs. In the case where the Activity will be
            // shown regardless of the lock screen, the call to
            // {@link ActivityTaskSupervisor#checkReadyForSleepLocked} is skipped.
            if (shouldSleepActivities()) {
                final ActivityRecord next = topRunningActivity(true /* focusableOnly */);
            if (next == null || !next.canTurnScreenOn()) {
                if (next != null && next.canTurnScreenOn()
                        && !mWmService.mPowerManager.isInteractive()) {
                    mTaskSupervisor.wakeUp(getDisplayId(), "resumeTop-turnScreenOnFlag");
                    next.setCurrentLaunchCanTurnScreenOn(false);
                } else {
                    checkReadyForSleep();
                }
            }
        } finally {
            mInResumeTopActivity = false;
        }