diff options
3 files changed, 5 insertions, 57 deletions
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java index 16bc155caadd..bd249c42031d 100644 --- a/core/java/android/view/InsetsState.java +++ b/core/java/android/view/InsetsState.java @@ -63,37 +63,6 @@ import java.util.StringJoiner; */ public class InsetsState implements Parcelable { - /** - * Internal representation of inset source types. This is different from the public API in - * {@link WindowInsets.Type} as one type from the public API might indicate multiple windows - * at the same time. - */ - @Retention(RetentionPolicy.SOURCE) - @IntDef(prefix = "ITYPE", value = { - ITYPE_CAPTION_BAR, - ITYPE_LEFT_TAPPABLE_ELEMENT, - ITYPE_TOP_TAPPABLE_ELEMENT, - ITYPE_RIGHT_TAPPABLE_ELEMENT, - ITYPE_BOTTOM_TAPPABLE_ELEMENT, - ITYPE_LEFT_GENERIC_OVERLAY, - ITYPE_TOP_GENERIC_OVERLAY, - ITYPE_RIGHT_GENERIC_OVERLAY, - ITYPE_BOTTOM_GENERIC_OVERLAY - }) - public @interface InternalInsetsType {} - - public static final int ITYPE_CAPTION_BAR = 0; - - public static final int ITYPE_LEFT_TAPPABLE_ELEMENT = 1; - public static final int ITYPE_TOP_TAPPABLE_ELEMENT = 2; - public static final int ITYPE_RIGHT_TAPPABLE_ELEMENT = 3; - public static final int ITYPE_BOTTOM_TAPPABLE_ELEMENT = 4; - - public static final int ITYPE_LEFT_GENERIC_OVERLAY = 5; - public static final int ITYPE_TOP_GENERIC_OVERLAY = 6; - public static final int ITYPE_RIGHT_GENERIC_OVERLAY = 7; - public static final int ITYPE_BOTTOM_GENERIC_OVERLAY = 8; - @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = "ISIDE", value = { ISIDE_LEFT, @@ -677,30 +646,6 @@ public class InsetsState implements Parcelable { && !WindowConfiguration.inMultiWindowMode(windowingMode); } - /** - * Converting a internal type to the public type. - * @param type internal insets type, {@code InternalInsetsType}. - * @return public insets type, {@code Type.InsetsType}. - */ - public static @Type.InsetsType int toPublicType(@InternalInsetsType int type) { - switch (type) { - case ITYPE_LEFT_GENERIC_OVERLAY: - case ITYPE_TOP_GENERIC_OVERLAY: - case ITYPE_RIGHT_GENERIC_OVERLAY: - case ITYPE_BOTTOM_GENERIC_OVERLAY: - return Type.SYSTEM_OVERLAYS; - case ITYPE_CAPTION_BAR: - return Type.CAPTION_BAR; - case ITYPE_LEFT_TAPPABLE_ELEMENT: - case ITYPE_TOP_TAPPABLE_ELEMENT: - case ITYPE_RIGHT_TAPPABLE_ELEMENT: - case ITYPE_BOTTOM_TAPPABLE_ELEMENT: - return Type.TAPPABLE_ELEMENT; - default: - throw new IllegalArgumentException("Unknown type: " + type); - } - } - public void dump(String prefix, PrintWriter pw) { final String newPrefix = prefix + " "; pw.println(prefix + "InsetsState"); diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java index 868a15d3c977..a8c9cd30b656 100644 --- a/services/core/java/com/android/server/wm/InsetsPolicy.java +++ b/services/core/java/com/android/server/wm/InsetsPolicy.java @@ -334,7 +334,11 @@ class InsetsPolicy { // remove caption insets from floating windows. // TODO(b/254128050): Remove this workaround after we find a way to update window frames // and caption insets frames simultaneously. - state.removeSource(InsetsState.ITYPE_CAPTION_BAR); + for (int i = state.sourceSize() - 1; i >= 0; i--) { + if (state.sourceAt(i).getType() == Type.captionBar()) { + state.removeSourceAt(i); + } + } } final SparseArray<WindowContainerInsetsSourceProvider> providers = diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java index 695a72e56232..7a0961d8c306 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayPolicyLayoutTests.java @@ -202,7 +202,6 @@ public class DisplayPolicyLayoutTests extends DisplayPolicyTestsBase { // Exclude comparing IME insets because currently the simulated layout only focuses on the // insets from status bar and navigation bar. realInsetsState.removeSource(InsetsSource.ID_IME); - realInsetsState.removeSource(InsetsState.ITYPE_CAPTION_BAR); assertEquals(new ToStringComparatorWrapper<>(realInsetsState), new ToStringComparatorWrapper<>(simulatedInsetsState)); |