Loading core/java/android/view/WindowManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ import static android.view.WindowLayoutParamsProto.WINDOW_ANIMATIONS; import static android.view.WindowLayoutParamsProto.X; import static android.view.WindowLayoutParamsProto.Y; import static com.android.server.display.feature.flags.Flags.FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT; import android.Manifest.permission; import android.annotation.CallbackExecutor; import android.annotation.FlaggedApi; Loading Loading @@ -1872,6 +1874,19 @@ public interface WindowManager extends ViewManager { return false; } /** * Indicates that the display is eligible for the desktop mode from WindowManager's perspective. * * @param displayId The id of the display. * @return {@code true} if the display is eligible for the desktop mode from WindowManager's * perspective. * @hide */ @FlaggedApi(FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT) default boolean isEligibleForDesktopMode(int displayId) { return false; } /** * Sets the policy for how the display should show IME. * Loading core/java/android/view/WindowManagerImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,16 @@ public class WindowManagerImpl implements WindowManager { return false; } @Override public boolean isEligibleForDesktopMode(int displayId) { try { return WindowManagerGlobal.getWindowManagerService() .isEligibleForDesktopMode(displayId); } catch (RemoteException e) { } return false; } @Override public void setDisplayImePolicy(int displayId, @DisplayImePolicy int imePolicy) { try { Loading libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ public class DesktopModeStatus { || display.getType() == Display.TYPE_OVERLAY) && enableDisplayContentModeManagement()) { final WindowManager wm = context.getSystemService(WindowManager.class); return wm != null && wm.shouldShowSystemDecors(display.getDisplayId()); return wm != null && wm.isEligibleForDesktopMode(display.getDisplayId()); } return false; Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayController.java +8 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,14 @@ public class DisplayController { return mDisplayManager.getDisplay(displayId); } /** * Returns true if the display with the given displayId is part of the topology. */ public boolean isDisplayInTopology(int displayId) { return mDisplayTopology != null && mDisplayTopology.findDisplay(displayId, mDisplayTopology.getRoot()) != null; } /** * Gets the DisplayLayout associated with a display. */ Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.windowdecor.common import android.app.ActivityManager import android.app.WindowConfiguration import android.content.Context import android.view.Display import android.view.WindowManager import android.window.DesktopExperienceFlags.ENABLE_BUG_FIXES_FOR_SECONDARY_DISPLAY import com.android.wm.shell.common.DisplayController Loading Loading @@ -99,6 +100,11 @@ class AppHandleAndHeaderVisibilityHelper ( val display = displayController.getDisplay(displayId) if (display == null) return false if (display.type != Display.TYPE_INTERNAL && !displayController.isDisplayInTopology(displayId)) { return false } if (DesktopModeStatus.isDesktopModeSupportedOnDisplay(context, display)) { return true } Loading Loading
core/java/android/view/WindowManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,8 @@ import static android.view.WindowLayoutParamsProto.WINDOW_ANIMATIONS; import static android.view.WindowLayoutParamsProto.X; import static android.view.WindowLayoutParamsProto.Y; import static com.android.server.display.feature.flags.Flags.FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT; import android.Manifest.permission; import android.annotation.CallbackExecutor; import android.annotation.FlaggedApi; Loading Loading @@ -1872,6 +1874,19 @@ public interface WindowManager extends ViewManager { return false; } /** * Indicates that the display is eligible for the desktop mode from WindowManager's perspective. * * @param displayId The id of the display. * @return {@code true} if the display is eligible for the desktop mode from WindowManager's * perspective. * @hide */ @FlaggedApi(FLAG_ENABLE_DISPLAY_CONTENT_MODE_MANAGEMENT) default boolean isEligibleForDesktopMode(int displayId) { return false; } /** * Sets the policy for how the display should show IME. * Loading
core/java/android/view/WindowManagerImpl.java +10 −0 Original line number Diff line number Diff line Loading @@ -338,6 +338,16 @@ public class WindowManagerImpl implements WindowManager { return false; } @Override public boolean isEligibleForDesktopMode(int displayId) { try { return WindowManagerGlobal.getWindowManagerService() .isEligibleForDesktopMode(displayId); } catch (RemoteException e) { } return false; } @Override public void setDisplayImePolicy(int displayId, @DisplayImePolicy int imePolicy) { try { Loading
libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/desktopmode/DesktopModeStatus.java +1 −1 Original line number Diff line number Diff line Loading @@ -290,7 +290,7 @@ public class DesktopModeStatus { || display.getType() == Display.TYPE_OVERLAY) && enableDisplayContentModeManagement()) { final WindowManager wm = context.getSystemService(WindowManager.class); return wm != null && wm.shouldShowSystemDecors(display.getDisplayId()); return wm != null && wm.isEligibleForDesktopMode(display.getDisplayId()); } return false; Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayController.java +8 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,14 @@ public class DisplayController { return mDisplayManager.getDisplay(displayId); } /** * Returns true if the display with the given displayId is part of the topology. */ public boolean isDisplayInTopology(int displayId) { return mDisplayTopology != null && mDisplayTopology.findDisplay(displayId, mDisplayTopology.getRoot()) != null; } /** * Gets the DisplayLayout associated with a display. */ Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/common/AppHandleAndHeaderVisibilityHelper.kt +6 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.wm.shell.windowdecor.common import android.app.ActivityManager import android.app.WindowConfiguration import android.content.Context import android.view.Display import android.view.WindowManager import android.window.DesktopExperienceFlags.ENABLE_BUG_FIXES_FOR_SECONDARY_DISPLAY import com.android.wm.shell.common.DisplayController Loading Loading @@ -99,6 +100,11 @@ class AppHandleAndHeaderVisibilityHelper ( val display = displayController.getDisplay(displayId) if (display == null) return false if (display.type != Display.TYPE_INTERNAL && !displayController.isDisplayInTopology(displayId)) { return false } if (DesktopModeStatus.isDesktopModeSupportedOnDisplay(context, display)) { return true } Loading