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

Commit 35f003c2 authored by Danae Savvidi's avatar Danae Savvidi Committed by Android (Google) Code Review
Browse files

Merge "Add dumpsys logging for DisplayInfoProxy fields" into main

parents 0cee2e35 4c36d80d
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -969,6 +969,20 @@ public final class DisplayInfo implements Parcelable {
        public int getMask() {
            return mMask;
        }

        /** Convert bitmask to a string of group names. */
        public static String displayInfoGroupsToString(int changedGroups) {
            StringBuilder sb = new StringBuilder();
            for (DisplayInfo.DisplayInfoGroup group : DisplayInfo.DisplayInfoGroup.values()) {
                if ((changedGroups & group.getMask()) != 0) {
                    if (sb.length() > 0) {
                        sb.append(", ");
                    }
                    sb.append(group);
                }
            }
            return sb.length() == 0 ? "NONE" : sb.toString();
        }
    }

    /**
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.server.display;

import static android.view.DisplayInfo.DisplayInfoGroup.displayInfoGroupsToString;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.hardware.display.DisplayManagerGlobal;
@@ -23,6 +25,8 @@ import android.view.DisplayInfo;

import androidx.annotation.IntRange;

import java.io.PrintWriter;

/**
 * A proxy class for {@link DisplayInfo} objects.
 * This class wraps access to {@link DisplayInfo} objects by {@link LogicalDisplay} to allow
@@ -114,4 +118,11 @@ public class DisplayInfoProxy {
    public DisplayInfo.DisplayInfoChangeSource getDisplayInfoChangeSource() {
        return mDisplayInfoChangeSource;
    }

    /** Dump the state of this object for debugging purposes. */
    public void dumpLocked(PrintWriter pw) {
        pw.println("mDisplayInfoGroupsChanged="
                + displayInfoGroupsToString(mDisplayInfoGroupsChanged));
        pw.println("mDisplayInfoChangeSource=" + mDisplayInfoChangeSource);
    }
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.graphics.Rect;
import android.hardware.display.DisplayManagerInternal;
import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.IndentingPrintWriter;
import android.util.Slog;
import android.util.SparseArray;
import android.view.Display;
@@ -1296,6 +1297,12 @@ final class LogicalDisplay {
        pw.println("mLayoutLimitedRefreshRate=" + mLayoutLimitedRefreshRate);
        pw.println("mThermalRefreshRateThrottling=" + mThermalRefreshRateThrottling);
        pw.println("mPowerThrottlingDataId=" + mPowerThrottlingDataId);

        IndentingPrintWriter ipw = new IndentingPrintWriter(pw, "  ");
        ipw.println("DisplayInfoProxy (mInfo):");
        ipw.increaseIndent();
        mInfo.dumpLocked(ipw);
        ipw.decreaseIndent();
    }

    @Override