Loading core/java/android/hardware/display/DisplayTopology.java +21 −3 Original line number Diff line number Diff line Loading @@ -108,7 +108,6 @@ public final class DisplayTopology implements Parcelable { public DisplayTopology() {} @VisibleForTesting public DisplayTopology(TreeNode root, int primaryDisplayId) { mRoot = root; if (mRoot != null) { Loading Loading @@ -540,6 +539,19 @@ public final class DisplayTopology implements Parcelable { } } @Override public boolean equals(Object obj) { if (!(obj instanceof DisplayTopology)) { return false; } return obj.toString().equals(toString()); } @Override public int hashCode() { return toString().hashCode(); } @Override public String toString() { StringWriter out = new StringWriter(); Loading Loading @@ -610,7 +622,7 @@ public final class DisplayTopology implements Parcelable { } @Nullable private static TreeNode findDisplay(int displayId, @Nullable TreeNode startingNode) { public static TreeNode findDisplay(int displayId, @Nullable TreeNode startingNode) { if (startingNode == null) { return null; } Loading Loading @@ -775,16 +787,22 @@ public final class DisplayTopology implements Parcelable { */ private float mOffset; private final List<TreeNode> mChildren = new ArrayList<>(); private final List<TreeNode> mChildren; @VisibleForTesting public TreeNode(int displayId, float width, float height, @Position int position, float offset) { this(displayId, width, height, position, offset, List.of()); } public TreeNode(int displayId, float width, float height, int position, float offset, List<TreeNode> children) { mDisplayId = displayId; mWidth = width; mHeight = height; mPosition = position; mOffset = offset; mChildren = new ArrayList<>(children); } public TreeNode(Parcel source) { Loading services/core/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ java_library_static { ":platform-compat-overrides", ":display-device-config", ":display-layout-config", ":display-topology", ":device-state-config", "java/com/android/server/EventLogTags.logtags", "java/com/android/server/am/EventLogTags.logtags", Loading services/core/java/com/android/server/display/DisplayTopologyStore.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.display; import android.annotation.Nullable; import android.hardware.display.DisplayTopology; /** * Allows to save and restore {@link DisplayTopology}. * See implementation: {@link DisplayTopologyXmlStore} */ interface DisplayTopologyStore { boolean saveTopology(DisplayTopology topology); @Nullable DisplayTopology restoreTopology(DisplayTopology topology); void reloadTopologies(int userId); } services/core/java/com/android/server/display/DisplayTopologyXmlStore.java 0 → 100644 +582 −0 File added.Preview size limit exceeded, changes collapsed. Show changes services/core/xsd/Android.bp +8 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,14 @@ xsd_config { gen_writer: true, } xsd_config { name: "display-topology", srcs: ["display-topology/display-topology.xsd"], api_dir: "display-topology/schema", package_name: "com.android.server.display.topology", gen_writer: true, } xsd_config { name: "display-device-config", srcs: ["display-device-config/display-device-config.xsd"], Loading Loading
core/java/android/hardware/display/DisplayTopology.java +21 −3 Original line number Diff line number Diff line Loading @@ -108,7 +108,6 @@ public final class DisplayTopology implements Parcelable { public DisplayTopology() {} @VisibleForTesting public DisplayTopology(TreeNode root, int primaryDisplayId) { mRoot = root; if (mRoot != null) { Loading Loading @@ -540,6 +539,19 @@ public final class DisplayTopology implements Parcelable { } } @Override public boolean equals(Object obj) { if (!(obj instanceof DisplayTopology)) { return false; } return obj.toString().equals(toString()); } @Override public int hashCode() { return toString().hashCode(); } @Override public String toString() { StringWriter out = new StringWriter(); Loading Loading @@ -610,7 +622,7 @@ public final class DisplayTopology implements Parcelable { } @Nullable private static TreeNode findDisplay(int displayId, @Nullable TreeNode startingNode) { public static TreeNode findDisplay(int displayId, @Nullable TreeNode startingNode) { if (startingNode == null) { return null; } Loading Loading @@ -775,16 +787,22 @@ public final class DisplayTopology implements Parcelable { */ private float mOffset; private final List<TreeNode> mChildren = new ArrayList<>(); private final List<TreeNode> mChildren; @VisibleForTesting public TreeNode(int displayId, float width, float height, @Position int position, float offset) { this(displayId, width, height, position, offset, List.of()); } public TreeNode(int displayId, float width, float height, int position, float offset, List<TreeNode> children) { mDisplayId = displayId; mWidth = width; mHeight = height; mPosition = position; mOffset = offset; mChildren = new ArrayList<>(children); } public TreeNode(Parcel source) { Loading
services/core/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ java_library_static { ":platform-compat-overrides", ":display-device-config", ":display-layout-config", ":display-topology", ":device-state-config", "java/com/android/server/EventLogTags.logtags", "java/com/android/server/am/EventLogTags.logtags", Loading
services/core/java/com/android/server/display/DisplayTopologyStore.java 0 → 100644 +33 −0 Original line number Diff line number Diff line /* * Copyright 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.display; import android.annotation.Nullable; import android.hardware.display.DisplayTopology; /** * Allows to save and restore {@link DisplayTopology}. * See implementation: {@link DisplayTopologyXmlStore} */ interface DisplayTopologyStore { boolean saveTopology(DisplayTopology topology); @Nullable DisplayTopology restoreTopology(DisplayTopology topology); void reloadTopologies(int userId); }
services/core/java/com/android/server/display/DisplayTopologyXmlStore.java 0 → 100644 +582 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
services/core/xsd/Android.bp +8 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,14 @@ xsd_config { gen_writer: true, } xsd_config { name: "display-topology", srcs: ["display-topology/display-topology.xsd"], api_dir: "display-topology/schema", package_name: "com.android.server.display.topology", gen_writer: true, } xsd_config { name: "display-device-config", srcs: ["display-device-config/display-device-config.xsd"], Loading