Loading core/java/android/hardware/display/DisplayTopologyGraph.java +40 −0 Original line number Diff line number Diff line Loading @@ -19,12 +19,14 @@ package android.hardware.display; import android.annotation.FlaggedApi; import android.annotation.TestApi; import android.graphics.RectF; import android.util.IndentingPrintWriter; import android.util.SparseArray; import androidx.annotation.NonNull; import com.android.server.display.feature.flags.Flags; import java.io.StringWriter; import java.util.Arrays; import java.util.Collections; import java.util.List; Loading Loading @@ -68,6 +70,27 @@ public class DisplayTopologyGraph { return displayNodes; } /** * Print the object's state and debug information into the given stream. * @hide * @param pw The stream to dump information to. */ public void dump(IndentingPrintWriter pw) { pw.println("DisplayTopologyGraph{" + "mPrimaryDisplayId=" + mPrimaryDisplayId + '}'); pw.increaseIndent(); for (DisplayNode displayNode : mDisplayNodes) { displayNode.dump(pw); } pw.decreaseIndent(); } @Override public String toString() { StringWriter out = new StringWriter(); dump(new IndentingPrintWriter(out)); return out.toString(); } /** Node representation of a display, including its {@link AdjacentEdge} */ public static class DisplayNode { Loading Loading @@ -111,6 +134,23 @@ public class DisplayTopologyGraph { public @NonNull List<AdjacentEdge> getAdjacentEdges() { return Collections.unmodifiableList(Arrays.asList(mAdjacentEdges)); } /** * Print the object's state and debug information into the given stream. * @hide * @param pw The stream to dump information to. */ public void dump(IndentingPrintWriter pw) { pw.println("DisplayNode{" + "displayId=" + mDisplayId + ", density=" + mDensity + ", bounds=" + mBoundsInGlobalDp + '}'); if (mAdjacentEdges != null) { pw.increaseIndent(); for (AdjacentEdge edge : mAdjacentEdges) { pw.println(edge); } pw.decreaseIndent(); } } } /** Edge to adjacent display */ Loading services/core/java/com/android/server/display/DisplayManagerService.java +11 −3 Original line number Diff line number Diff line Loading @@ -689,9 +689,12 @@ public final class DisplayManagerService extends SystemService { final var backupManager = new BackupManager(mContext); Consumer<Pair<DisplayTopology, DisplayTopologyGraph>> topologyChangedCallback = update -> { DisplayTopologyGraph graph = update.second; if (mInputManagerInternal != null && graph != null) { mInputManagerInternal.setDisplayTopology(graph); if (mInputManagerInternal != null) { Slog.d(TAG, "Sending topology graph to Input Manager: " + update.second); mInputManagerInternal.setDisplayTopology(update.second); } else { Slog.w(TAG, "Not sending topology, mInputManagerInternal is null"); } deliverTopologyUpdate(update.first); }; Loading Loading @@ -843,6 +846,11 @@ public final class DisplayManagerService extends SystemService { synchronized (mSyncRoot) { mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class); mInputManagerInternal = LocalServices.getService(InputManagerInternal.class); if (mDisplayTopologyCoordinator != null) { DisplayTopologyGraph graph = mDisplayTopologyCoordinator.getTopology().getGraph(); Slog.d(TAG, "Sending topology graph to Input Manager: " + graph); mInputManagerInternal.setDisplayTopology(graph); } mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class); ActivityManager activityManager = mContext.getSystemService(ActivityManager.class); Loading Loading
core/java/android/hardware/display/DisplayTopologyGraph.java +40 −0 Original line number Diff line number Diff line Loading @@ -19,12 +19,14 @@ package android.hardware.display; import android.annotation.FlaggedApi; import android.annotation.TestApi; import android.graphics.RectF; import android.util.IndentingPrintWriter; import android.util.SparseArray; import androidx.annotation.NonNull; import com.android.server.display.feature.flags.Flags; import java.io.StringWriter; import java.util.Arrays; import java.util.Collections; import java.util.List; Loading Loading @@ -68,6 +70,27 @@ public class DisplayTopologyGraph { return displayNodes; } /** * Print the object's state and debug information into the given stream. * @hide * @param pw The stream to dump information to. */ public void dump(IndentingPrintWriter pw) { pw.println("DisplayTopologyGraph{" + "mPrimaryDisplayId=" + mPrimaryDisplayId + '}'); pw.increaseIndent(); for (DisplayNode displayNode : mDisplayNodes) { displayNode.dump(pw); } pw.decreaseIndent(); } @Override public String toString() { StringWriter out = new StringWriter(); dump(new IndentingPrintWriter(out)); return out.toString(); } /** Node representation of a display, including its {@link AdjacentEdge} */ public static class DisplayNode { Loading Loading @@ -111,6 +134,23 @@ public class DisplayTopologyGraph { public @NonNull List<AdjacentEdge> getAdjacentEdges() { return Collections.unmodifiableList(Arrays.asList(mAdjacentEdges)); } /** * Print the object's state and debug information into the given stream. * @hide * @param pw The stream to dump information to. */ public void dump(IndentingPrintWriter pw) { pw.println("DisplayNode{" + "displayId=" + mDisplayId + ", density=" + mDensity + ", bounds=" + mBoundsInGlobalDp + '}'); if (mAdjacentEdges != null) { pw.increaseIndent(); for (AdjacentEdge edge : mAdjacentEdges) { pw.println(edge); } pw.decreaseIndent(); } } } /** Edge to adjacent display */ Loading
services/core/java/com/android/server/display/DisplayManagerService.java +11 −3 Original line number Diff line number Diff line Loading @@ -689,9 +689,12 @@ public final class DisplayManagerService extends SystemService { final var backupManager = new BackupManager(mContext); Consumer<Pair<DisplayTopology, DisplayTopologyGraph>> topologyChangedCallback = update -> { DisplayTopologyGraph graph = update.second; if (mInputManagerInternal != null && graph != null) { mInputManagerInternal.setDisplayTopology(graph); if (mInputManagerInternal != null) { Slog.d(TAG, "Sending topology graph to Input Manager: " + update.second); mInputManagerInternal.setDisplayTopology(update.second); } else { Slog.w(TAG, "Not sending topology, mInputManagerInternal is null"); } deliverTopologyUpdate(update.first); }; Loading Loading @@ -843,6 +846,11 @@ public final class DisplayManagerService extends SystemService { synchronized (mSyncRoot) { mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class); mInputManagerInternal = LocalServices.getService(InputManagerInternal.class); if (mDisplayTopologyCoordinator != null) { DisplayTopologyGraph graph = mDisplayTopologyCoordinator.getTopology().getGraph(); Slog.d(TAG, "Sending topology graph to Input Manager: " + graph); mInputManagerInternal.setDisplayTopology(graph); } mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class); ActivityManager activityManager = mContext.getSystemService(ActivityManager.class); Loading