Loading core/java/android/app/Presentation.java +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE; import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION; import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION; import static com.android.window.flags.Flags.enablePresentationForConnectedDisplays; import android.annotation.NonNull; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; Loading @@ -34,6 +36,8 @@ import android.view.ContextThemeWrapper; import android.view.Display; import android.view.Gravity; import android.view.Window; import android.view.WindowInsets; import android.view.WindowInsetsController; import android.view.WindowManager; import android.view.WindowManager.LayoutParams.WindowType; Loading Loading @@ -277,6 +281,11 @@ public class Presentation extends Dialog { @Override public void show() { super.show(); WindowInsetsController controller = getWindow().getInsetsController(); if (controller != null && enablePresentationForConnectedDisplays()) { controller.hide(WindowInsets.Type.systemBars()); } } /** Loading services/core/java/com/android/server/wm/DisplayContent.java +8 −2 Original line number Diff line number Diff line Loading @@ -157,6 +157,7 @@ import static com.android.server.wm.utils.DisplayInfoOverrides.copyDisplayInfoFi import static com.android.server.wm.utils.RegionUtils.forEachRectReverse; import static com.android.server.wm.utils.RegionUtils.rectListToRegion; import static com.android.window.flags.Flags.enablePersistingDensityScaleForConnectedDisplays; import static com.android.window.flags.Flags.enablePresentationForConnectedDisplays; import android.annotation.IntDef; import android.annotation.NonNull; Loading Loading @@ -3835,13 +3836,18 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp /** * Looking for the focused window on this display if the top focused display hasn't been * found yet (topFocusedDisplayId is INVALID_DISPLAY) or per-display focused was allowed. * found yet (topFocusedDisplayId is INVALID_DISPLAY), per-display focused was allowed, or * the display is presenting. The last one is needed to update system bar visibility in response * to presentation visibility because per-display focus is needed to change system bar * visibility, but the display shouldn't get global focus when a presentation gets shown. * * @param topFocusedDisplayId Id of the top focused display. * @return The focused window or null if there isn't any or no need to seek. */ WindowState findFocusedWindowIfNeeded(int topFocusedDisplayId) { return (hasOwnFocus() || topFocusedDisplayId == INVALID_DISPLAY) return (hasOwnFocus() || topFocusedDisplayId == INVALID_DISPLAY || (enablePresentationForConnectedDisplays() && mWmService.mPresentationController.isPresentationVisible(mDisplayId))) ? findFocusedWindow() : null; } Loading services/core/java/com/android/server/wm/PresentationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class PresentationController implements DisplayManager.DisplayListener { return mPresentations.contains(displayId); } private boolean isPresentationVisible(int displayId) { boolean isPresentationVisible(int displayId) { final Presentation presentation = mPresentations.get(displayId); return presentation != null && presentation.mWin.mToken.isVisibleRequested(); } Loading Loading
core/java/android/app/Presentation.java +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE; import static android.view.WindowManager.LayoutParams.TYPE_PRESENTATION; import static android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION; import static com.android.window.flags.Flags.enablePresentationForConnectedDisplays; import android.annotation.NonNull; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; Loading @@ -34,6 +36,8 @@ import android.view.ContextThemeWrapper; import android.view.Display; import android.view.Gravity; import android.view.Window; import android.view.WindowInsets; import android.view.WindowInsetsController; import android.view.WindowManager; import android.view.WindowManager.LayoutParams.WindowType; Loading Loading @@ -277,6 +281,11 @@ public class Presentation extends Dialog { @Override public void show() { super.show(); WindowInsetsController controller = getWindow().getInsetsController(); if (controller != null && enablePresentationForConnectedDisplays()) { controller.hide(WindowInsets.Type.systemBars()); } } /** Loading
services/core/java/com/android/server/wm/DisplayContent.java +8 −2 Original line number Diff line number Diff line Loading @@ -157,6 +157,7 @@ import static com.android.server.wm.utils.DisplayInfoOverrides.copyDisplayInfoFi import static com.android.server.wm.utils.RegionUtils.forEachRectReverse; import static com.android.server.wm.utils.RegionUtils.rectListToRegion; import static com.android.window.flags.Flags.enablePersistingDensityScaleForConnectedDisplays; import static com.android.window.flags.Flags.enablePresentationForConnectedDisplays; import android.annotation.IntDef; import android.annotation.NonNull; Loading Loading @@ -3835,13 +3836,18 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp /** * Looking for the focused window on this display if the top focused display hasn't been * found yet (topFocusedDisplayId is INVALID_DISPLAY) or per-display focused was allowed. * found yet (topFocusedDisplayId is INVALID_DISPLAY), per-display focused was allowed, or * the display is presenting. The last one is needed to update system bar visibility in response * to presentation visibility because per-display focus is needed to change system bar * visibility, but the display shouldn't get global focus when a presentation gets shown. * * @param topFocusedDisplayId Id of the top focused display. * @return The focused window or null if there isn't any or no need to seek. */ WindowState findFocusedWindowIfNeeded(int topFocusedDisplayId) { return (hasOwnFocus() || topFocusedDisplayId == INVALID_DISPLAY) return (hasOwnFocus() || topFocusedDisplayId == INVALID_DISPLAY || (enablePresentationForConnectedDisplays() && mWmService.mPresentationController.isPresentationVisible(mDisplayId))) ? findFocusedWindow() : null; } Loading
services/core/java/com/android/server/wm/PresentationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class PresentationController implements DisplayManager.DisplayListener { return mPresentations.contains(displayId); } private boolean isPresentationVisible(int displayId) { boolean isPresentationVisible(int displayId) { final Presentation presentation = mPresentations.get(displayId); return presentation != null && presentation.mWin.mToken.isVisibleRequested(); } Loading