Loading core/java/android/view/DisplayInfo.java +14 −0 Original line number Diff line number Diff line Loading @@ -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(); } } /** Loading services/core/java/com/android/server/display/DisplayInfoProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading Loading @@ -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 services/core/java/com/android/server/display/LogicalDisplay.java +7 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading
core/java/android/view/DisplayInfo.java +14 −0 Original line number Diff line number Diff line Loading @@ -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(); } } /** Loading
services/core/java/com/android/server/display/DisplayInfoProxy.java +11 −0 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading Loading @@ -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
services/core/java/com/android/server/display/LogicalDisplay.java +7 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading