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

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

Unhide API: WindowInsets.Type#displayCutout()

With this CL, the public developers can interact with display cutout via
insets APIs.

Bug: 118118435
Test: build
Change-Id: If5ccacddb079bc5513ccb5820ea1c371e95fe562
parent e16645a9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -55520,6 +55520,7 @@ package android.view {
  public static final class WindowInsets.Type {
    method public static int captionBar();
    method public static int displayCutout();
    method public static int ime();
    method public static int mandatorySystemGestures();
    method public static int navigationBars();
+20 −4
Original line number Diff line number Diff line
@@ -393,22 +393,38 @@ public final class DisplayCutout {
        return mSafeInsets.equals(ZERO_RECT);
    }

    /** Returns the inset from the top which avoids the display cutout in pixels. */
    /**
     * Returns the inset from the top which avoids the display cutout in pixels.
     *
     * @see WindowInsets.Type#displayCutout()
     */
    public int getSafeInsetTop() {
        return mSafeInsets.top;
    }

    /** Returns the inset from the bottom which avoids the display cutout in pixels. */
    /**
     * Returns the inset from the bottom which avoids the display cutout in pixels.
     *
     * @see WindowInsets.Type#displayCutout()
     */
    public int getSafeInsetBottom() {
        return mSafeInsets.bottom;
    }

    /** Returns the inset from the left which avoids the display cutout in pixels. */
    /**
     * Returns the inset from the left which avoids the display cutout in pixels.
     *
     * @see WindowInsets.Type#displayCutout()
     */
    public int getSafeInsetLeft() {
        return mSafeInsets.left;
    }

    /** Returns the inset from the right which avoids the display cutout in pixels. */
    /**
     * Returns the inset from the right which avoids the display cutout in pixels.
     *
     * @see WindowInsets.Type#displayCutout()
     */
    public int getSafeInsetRight() {
        return mSafeInsets.right;
    }
+7 −3
Original line number Diff line number Diff line
@@ -1370,10 +1370,14 @@ public final class WindowInsets {
        }

        /**
         * @return An insets type representing the area that avoids the display cutout.
         * Returns an insets type representing the area that used by {@link DisplayCutout}.
         *
         * @see DisplayCutout#getSafeInsetTop
         * @hide
         * <p>This is equivalent to the safe insets on {@link #getDisplayCutout()}.</p>
         *
         * @see DisplayCutout#getSafeInsetLeft()
         * @see DisplayCutout#getSafeInsetTop()
         * @see DisplayCutout#getSafeInsetRight()
         * @see DisplayCutout#getSafeInsetBottom()
         */
        public static @InsetsType int displayCutout() {
            return DISPLAY_CUTOUT;