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

Commit 62792028 authored by Todd Lee's avatar Todd Lee
Browse files

Ensure that floating windows on Wear can be non-fullscreen

By default wear uses fullscreen UI experiences, and certainly
by virtue of the default themes on Wear even floating windows
are generally accompanied with fullscreen however it should be
*possible* to override this and allow developers to create a
non-fullscreen experience if explicitly directed via theming.

This is evident in expectations around CtsWindowManagerDeviceAnimation
tests.

Bug: b/338534521
Test: atest CtsWindowManagerDeviceAnimations:MoveAnimationTests
      atest CtsWindowManagerDeviceAnimations:BlurTests

Flag: NONE not required - localized to floating window
      specifically on Wear.
Change-Id: I9c8ab92f68fc0ca651f56d630b3dc8086c6ce314
parent dc6e3c33
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2513,9 +2513,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        }

        mIsFloating = a.getBoolean(R.styleable.Window_windowIsFloating, false);

        // For floating windows that are *allowed* to fill the screen (like Wear) content
        // should still be wrapped if they're not explicitly requested as fullscreen.
        final boolean isFloatingAndFullscreen = mIsFloating
                && mAllowFloatingWindowsFillScreen
                && a.getBoolean(R.styleable.Window_windowFullscreen, false);

        int flagsToUpdate = (FLAG_LAYOUT_IN_SCREEN|FLAG_LAYOUT_INSET_DECOR)
                & (~getForcedWindowFlags());
        if (mIsFloating && !mAllowFloatingWindowsFillScreen) {
        if (mIsFloating && !isFloatingAndFullscreen) {
            setLayout(WRAP_CONTENT, WRAP_CONTENT);
            setFlags(0, flagsToUpdate);
        } else {