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

Commit 85091178 authored by Ady Abraham's avatar Ady Abraham Committed by Android (Google) Code Review
Browse files

Merge "DisplayDeviceInfo: improve logging when device changes" into main

parents ac7c725b 27a8a9a6
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -254,6 +254,11 @@ final class DisplayDeviceInfo {
     */
    public static final int DIFF_MODE_ID = 1 << 7;

    /**
     * Diff result: The frame rate override list differs.
     */
    public static final int DIFF_FRAME_RATE_OVERRIDE = 1 << 8;

    /**
     * Diff result: Catch-all for "everything changed"
     */
@@ -523,6 +528,9 @@ final class DisplayDeviceInfo {
        if (modeId != other.modeId) {
            diff |= DIFF_MODE_ID;
        }
        if (!Arrays.equals(frameRateOverrides, other.frameRateOverrides)) {
            diff |= DIFF_FRAME_RATE_OVERRIDE;
        }
        if (!Objects.equals(name, other.name)
                || !Objects.equals(uniqueId, other.uniqueId)
                || width != other.width
@@ -546,7 +554,6 @@ final class DisplayDeviceInfo {
                || !Objects.equals(deviceProductInfo, other.deviceProductInfo)
                || ownerUid != other.ownerUid
                || !Objects.equals(ownerPackageName, other.ownerPackageName)
                || !Arrays.equals(frameRateOverrides, other.frameRateOverrides)
                || !BrightnessSynchronizer.floatEquals(brightnessMinimum, other.brightnessMinimum)
                || !BrightnessSynchronizer.floatEquals(brightnessMaximum, other.brightnessMaximum)
                || !BrightnessSynchronizer.floatEquals(brightnessDefault,
+9 −4
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.internal.annotations.GuardedBy;
import com.android.server.display.DisplayManagerService.SyncRoot;
import com.android.server.display.utils.DebugUtils;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
@@ -177,18 +178,22 @@ class DisplayDeviceRepository implements DisplayAdapter.Listener {
                        "handleDisplayDeviceChanged");
            }
            int diff = device.mDebugLastLoggedDeviceInfo.diff(info);
            if (diff == DisplayDeviceInfo.DIFF_STATE) {
            if (diff == 0) {
                Slog.i(TAG, "Display device same: " + info);
            } else if (diff == DisplayDeviceInfo.DIFF_STATE) {
                Slog.i(TAG, "Display device changed state: \"" + info.name
                        + "\", " + Display.stateToString(info.state));
            } else if (diff == DisplayDeviceInfo.DIFF_ROTATION) {
                Slog.i(TAG, "Display device rotated: \"" + info.name
                        + "\", " + Surface.rotationToString(info.rotation));
            } else if (diff
                    == (DisplayDeviceInfo.DIFF_MODE_ID | DisplayDeviceInfo.DIFF_RENDER_TIMINGS)) {
            } else if ((diff &
                    (DisplayDeviceInfo.DIFF_MODE_ID | DisplayDeviceInfo.DIFF_RENDER_TIMINGS
                            | DisplayDeviceInfo.DIFF_FRAME_RATE_OVERRIDE)) != 0) {
                Slog.i(TAG, "Display device changed render timings: \"" + info.name
                        + "\", renderFrameRate=" + info.renderFrameRate
                        + ", presentationDeadlineNanos=" + info.presentationDeadlineNanos
                        + ", appVsyncOffsetNanos=" + info.appVsyncOffsetNanos);
                        + ", appVsyncOffsetNanos=" + info.appVsyncOffsetNanos
                        + ", frameRateOverrides=" + Arrays.toString(info.frameRateOverrides));
            } else if (diff == DisplayDeviceInfo.DIFF_COMMITTED_STATE) {
                if (DEBUG) {
                    Slog.i(TAG, "Display device changed committed state: \"" + info.name