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

Commit ddecd74c authored by Andrii Kulian's avatar Andrii Kulian Committed by Android (Google) Code Review
Browse files

Merge changes from topic "wm_decor_status"

* changes:
  Notify the WMS when the display content is ready.
  Read system decor support status from WM
parents ff6fd9b1 643bf13f
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -2732,10 +2732,6 @@ package android.view {
    field public static final int CALLBACK_ANIMATION = 1; // 0x1
  }

  public final class Display {
    method public boolean supportsSystemDecorations();
  }

  public class FocusFinder {
    method public static void sort(android.view.View[], int, int, android.view.ViewGroup, boolean);
  }
@@ -2805,6 +2801,7 @@ package android.view {
    method public default void setShouldShowIme(int, boolean);
    method public default void setShouldShowSystemDecors(int, boolean);
    method public default void setShouldShowWithInsecureKeyguard(int, boolean);
    method public default boolean shouldShowSystemDecors(int);
  }

  public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable {
+0 −14
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE;
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.app.KeyguardManager;
import android.content.res.CompatibilityInfo;
@@ -231,7 +230,6 @@ public final class Display {
     * bar, navigation bar, home activity or IME.
     * </p>
     *
     * @see #supportsSystemDecorations
     * @hide
     */
    // TODO (b/114338689): Remove the flag and use IWindowManager#setShouldShowSystemDecors
@@ -906,18 +904,6 @@ public final class Display {
        return mDisplayInfo.removeMode;
    }

    /**
     * Returns whether this display should support showing system decorations.
     *
     * @see #FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS
     * @hide
     */
    @TestApi
    // TODO (b/114338689): Remove the method and use IWindowManager#shouldShowSystemDecors
    public boolean supportsSystemDecorations() {
        return (mDisplayInfo.flags & FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS) != 0;
    }

    /**
     * Returns the display's HDR capabilities.
     *
+16 −0
Original line number Diff line number Diff line
@@ -481,12 +481,28 @@ public interface WindowManager extends ViewManager {
     *
     * @param displayId The id of the display.
     * @param shouldShow Indicates that the display should show system decors.
     * @see #shouldShowSystemDecors(int)
     * @hide
     */
    @TestApi
    default void setShouldShowSystemDecors(int displayId, boolean shouldShow) {
    }

    /**
     * Checks if the display supports showing system decors.
     * <p>
     * System decors include status bar, navigation bar, launcher.
     * </p>
     *
     * @param displayId The id of the display.
     * @see #setShouldShowSystemDecors(int, boolean)
     * @hide
     */
    @TestApi
    default boolean shouldShowSystemDecors(int displayId) {
        return false;
    }

    /**
     * Sets that the display should show IME.
     *
+9 −0
Original line number Diff line number Diff line
@@ -176,6 +176,15 @@ public final class WindowManagerImpl implements WindowManager {
        }
    }

    @Override
    public boolean shouldShowSystemDecors(int displayId) {
        try {
            return WindowManagerGlobal.getWindowManagerService().shouldShowSystemDecors(displayId);
        } catch (RemoteException e) {
        }
        return false;
    }

    @Override
    public void setShouldShowIme(int displayId, boolean shouldShow) {
        try {
+1 −3
Original line number Diff line number Diff line
@@ -110,9 +110,7 @@ public class NavigationBarController implements DisplayListener, Callbacks {
     * @param display the display to add navigation bar on.
     */
    private void createNavigationBar(Display display) {
        if (display == null
                || (display.getDisplayId() != DEFAULT_DISPLAY
                        && !display.supportsSystemDecorations())) {
        if (display == null) {
            return;
        }

Loading