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

Commit a53fdbb2 authored by Tiger Huang's avatar Tiger Huang
Browse files

Remove unused WINDOW_DECOR

WINDOW_DECOR has been defined since the new insets framework of API 30,
but it is never used. This CL removes it.

This CL also removes the ViewDebug annotation of mFitInsetsTypes and
mFitInsetsSides. The string conversion can be done by
WindowInsets.Type.toString and WindowInsets.Side.toString instead. The
conversion doesn't have to be maintained at 2 places (WindowInsets and
WindowManager) anymore.

Bug: 118118435
Flag: EXEMPT clean up
Test: presubmit
Change-Id: I26dff5c9757571c765be41b69170b324d14700ab
parent 875ed5bb
Loading
Loading
Loading
Loading
+26 −11
Original line number Diff line number Diff line
@@ -1847,13 +1847,12 @@ public final class WindowInsets {
        static final int MANDATORY_SYSTEM_GESTURES = 1 << 5;
        static final int TAPPABLE_ELEMENT = 1 << 6;
        static final int DISPLAY_CUTOUT = 1 << 7;
        static final int WINDOW_DECOR = 1 << 8;
        static final int SYSTEM_OVERLAYS = 1 << 9;
        static final int SYSTEM_OVERLAYS = 1 << 8;
        @InsetsType
        static final int FIRST = STATUS_BARS;
        @InsetsType
        static final int LAST = SYSTEM_OVERLAYS;
        static final int SIZE = 10;
        static final int SIZE = 9;
        @InsetsType
        static final int DEFAULT_VISIBLE = ~IME;

@@ -1875,10 +1874,8 @@ public final class WindowInsets {
                    return 6;
                case DISPLAY_CUTOUT:
                    return 7;
                case WINDOW_DECOR:
                    return 8;
                case SYSTEM_OVERLAYS:
                    return 9;
                    return 8;
                default:
                    throw new IllegalArgumentException("type needs to be >= FIRST and <= LAST,"
                            + " type=" + type);
@@ -1890,7 +1887,7 @@ public final class WindowInsets {
        @NonNull
        @SuppressLint("UnflaggedApi") // @TestApi without associated feature.
        public static String toString(@InsetsType int types) {
            StringBuilder result = new StringBuilder();
            final StringBuilder result = new StringBuilder();
            if ((types & STATUS_BARS) != 0) {
                result.append("statusBars ");
            }
@@ -1915,9 +1912,6 @@ public final class WindowInsets {
            if ((types & DISPLAY_CUTOUT) != 0) {
                result.append("displayCutout ");
            }
            if ((types & WINDOW_DECOR) != 0) {
                result.append("windowDecor ");
            }
            if ((types & SYSTEM_OVERLAYS) != 0) {
                result.append("systemOverlays ");
            }
@@ -1941,7 +1935,6 @@ public final class WindowInsets {
                MANDATORY_SYSTEM_GESTURES,
                TAPPABLE_ELEMENT,
                DISPLAY_CUTOUT,
                WINDOW_DECOR,
                SYSTEM_OVERLAYS,
        })
        public @interface InsetsType {
@@ -2125,5 +2118,27 @@ public final class WindowInsets {
        public static int all() {
            return LEFT | TOP | RIGHT | BOTTOM;
        }

        /** @hide */
        @NonNull
        public static String toString(@InsetsSide int sides) {
            final StringBuilder result = new StringBuilder();
            if ((sides & LEFT) != 0) {
                result.append("LEFT ");
            }
            if ((sides & TOP) != 0) {
                result.append("TOP ");
            }
            if ((sides & RIGHT) != 0) {
                result.append("RIGHT ");
            }
            if ((sides & BOTTOM) != 0) {
                result.append("BOTTOM ");
            }
            if (result.length() > 0) {
                result.delete(result.length() - 1, result.length());
            }
            return result.toString();
        }
    }
}
+4 −70
Original line number Diff line number Diff line
@@ -38,18 +38,6 @@ import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE;
import static android.view.View.SYSTEM_UI_FLAG_VISIBLE;
import static android.view.WindowInsets.Side.BOTTOM;
import static android.view.WindowInsets.Side.LEFT;
import static android.view.WindowInsets.Side.RIGHT;
import static android.view.WindowInsets.Side.TOP;
import static android.view.WindowInsets.Type.CAPTION_BAR;
import static android.view.WindowInsets.Type.IME;
import static android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES;
import static android.view.WindowInsets.Type.NAVIGATION_BARS;
import static android.view.WindowInsets.Type.STATUS_BARS;
import static android.view.WindowInsets.Type.SYSTEM_GESTURES;
import static android.view.WindowInsets.Type.TAPPABLE_ELEMENT;
import static android.view.WindowInsets.Type.WINDOW_DECOR;
import static android.internal.perfetto.protos.Windowlayoutparams.WindowLayoutParamsProto.ALPHA;
import static android.internal.perfetto.protos.Windowlayoutparams.WindowLayoutParamsProto.APPEARANCE;
import static android.internal.perfetto.protos.Windowlayoutparams.WindowLayoutParamsProto.BEHAVIOR;
@@ -4805,62 +4793,8 @@ public interface WindowManager extends ViewManager {
         */
        public final InsetsFlags insetsFlags = new InsetsFlags();

        @ViewDebug.ExportedProperty(flagMapping = {
                @ViewDebug.FlagToString(
                        mask = STATUS_BARS,
                        equals = STATUS_BARS,
                        name = "STATUS_BARS"),
                @ViewDebug.FlagToString(
                        mask = NAVIGATION_BARS,
                        equals = NAVIGATION_BARS,
                        name = "NAVIGATION_BARS"),
                @ViewDebug.FlagToString(
                        mask = CAPTION_BAR,
                        equals = CAPTION_BAR,
                        name = "CAPTION_BAR"),
                @ViewDebug.FlagToString(
                        mask = IME,
                        equals = IME,
                        name = "IME"),
                @ViewDebug.FlagToString(
                        mask = SYSTEM_GESTURES,
                        equals = SYSTEM_GESTURES,
                        name = "SYSTEM_GESTURES"),
                @ViewDebug.FlagToString(
                        mask = MANDATORY_SYSTEM_GESTURES,
                        equals = MANDATORY_SYSTEM_GESTURES,
                        name = "MANDATORY_SYSTEM_GESTURES"),
                @ViewDebug.FlagToString(
                        mask = TAPPABLE_ELEMENT,
                        equals = TAPPABLE_ELEMENT,
                        name = "TAPPABLE_ELEMENT"),
                @ViewDebug.FlagToString(
                        mask = WINDOW_DECOR,
                        equals = WINDOW_DECOR,
                        name = "WINDOW_DECOR")
        })
        private @InsetsType int mFitInsetsTypes = Type.systemBars();

        @ViewDebug.ExportedProperty(flagMapping = {
                @ViewDebug.FlagToString(
                        mask = LEFT,
                        equals = LEFT,
                        name = "LEFT"),
                @ViewDebug.FlagToString(
                        mask = TOP,
                        equals = TOP,
                        name = "TOP"),
                @ViewDebug.FlagToString(
                        mask = RIGHT,
                        equals = RIGHT,
                        name = "RIGHT"),
                @ViewDebug.FlagToString(
                        mask = BOTTOM,
                        equals = BOTTOM,
                        name = "BOTTOM")
        })
        private @InsetsSide int mFitInsetsSides = Side.all();

        private boolean mFitInsetsIgnoringVisibility = false;

        /**
@@ -6094,13 +6028,13 @@ public interface WindowManager extends ViewManager {
            }
            if (mFitInsetsTypes != 0) {
                sb.append(System.lineSeparator());
                sb.append(prefix).append("  fitTypes=").append(ViewDebug.flagsToString(
                        LayoutParams.class, "mFitInsetsTypes", mFitInsetsTypes));
                sb.append(prefix).append("  fitTypes=").append(
                        WindowInsets.Type.toString(mFitInsetsTypes));
            }
            if (mFitInsetsSides != Side.all()) {
                sb.append(System.lineSeparator());
                sb.append(prefix).append("  fitSides=").append(ViewDebug.flagsToString(
                        LayoutParams.class, "mFitInsetsSides", mFitInsetsSides));
                sb.append(prefix).append("  fitSides=").append(
                        WindowInsets.Side.toString(mFitInsetsSides));
            }
            if (mFitInsetsIgnoringVisibility) {
                sb.append(System.lineSeparator());