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

Commit 72cbf68a authored by Philip Junker's avatar Philip Junker Committed by Android (Google) Code Review
Browse files

Merge changes Icf5ac6f7,I3bb82fa9

* changes:
  Remove mDisplayGroupIds by iterating through PowerGroups directly
  Pass PowerGroup instead of groupId where possible.
parents 2e3d6bce 5241ce01
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.power;
import static android.os.PowerManagerInternal.WAKEFULNESS_AWAKE;

import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
import android.view.Display;

/**
 * Used to store power related requests to every display in a
@@ -33,9 +34,10 @@ public class PowerGroup {

    private final DisplayPowerRequest mDisplayPowerRequest;
    private final boolean mSupportsSandman;
    private final int mGroupId;

    // True if DisplayManagerService has applied all the latest display states that were
    // requested for this group
    // True if DisplayManagerService has applied all the latest display states that were requested
    // for this group
    private boolean mReady;
    // True if this group is in the process of powering on
    private boolean mPoweringOn;
@@ -49,8 +51,9 @@ public class PowerGroup {
    private long mLastUserActivityTime;
    private long mLastUserActivityTimeNoChangeLights;

    PowerGroup(DisplayPowerRequest displayPowerRequest, int wakefulness, boolean ready,
    PowerGroup(int groupId, DisplayPowerRequest displayPowerRequest, int wakefulness, boolean ready,
            boolean supportsSandman) {
        this.mGroupId = groupId;
        this.mDisplayPowerRequest = displayPowerRequest;
        this.mWakefulness = wakefulness;
        this.mReady = ready;
@@ -58,6 +61,7 @@ public class PowerGroup {
    }

    PowerGroup() {
        this.mGroupId = Display.DEFAULT_DISPLAY_GROUP;
        this.mDisplayPowerRequest = new DisplayPowerRequest();
        this.mWakefulness = WAKEFULNESS_AWAKE;
        this.mReady = false;
@@ -72,6 +76,10 @@ public class PowerGroup {
        return mWakefulness;
    }

    int getGroupId() {
        return mGroupId;
    }

    /**
     * Sets the {@code wakefulness} value for this {@link PowerGroup}.
     *
+220 −196

File changed.

Preview size limit exceeded, changes collapsed.