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

Commit 8216eb22 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Added PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME window flag

Allows us to differentiate between child windows that always want to be
laid-out in the parent frame regardless of multi-windowing mode
(PopupWindows) and those that don't (SurfaceViews).

Bug: 26255254
Change-Id: Icbc245a24f9a38698444196846ddb25016ef7e2a
parent 79f268d9
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1182,6 +1182,13 @@ public interface WindowManager extends ViewManager {
         */
        public static final int PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH = 0x00008000;

        /**
         * Flag to indicate that this child window should always be laid-out in the parent
         * frame regardless of the current windowing mode configuration.
         * @hide
         */
        public static final int PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME = 0x00010000;

        /**
         * Control flags that are private to the platform.
         * @hide
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.widget;

import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;

import com.android.internal.R;
@@ -1313,7 +1314,8 @@ public class PopupWindow {
            p.width = mLastWidth = mWidth;
        }

        p.privateFlags = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;
        p.privateFlags = PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH
                | PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;

        // Used for debugging.
        p.setTitle("PopupWindow:" + Integer.toHexString(hashCode()));
+3 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
import static android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW;
import static android.view.WindowManager.LayoutParams.MATCH_PARENT;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_COMPATIBLE_WINDOW;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPLACE_ON_RELAUNCH;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE;
@@ -606,7 +607,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        final boolean fullscreenTask = task == null || task.isFullscreen();
        final boolean freeformWorkspace = task != null && task.inFreeformWorkspace();

        if (fullscreenTask || isChildWindow()) {
        if (fullscreenTask || (isChildWindow()
                && (mAttrs.privateFlags & PRIVATE_FLAG_LAYOUT_CHILD_WINDOW_IN_PARENT_FRAME) != 0)) {
            // We use the parent frame as the containing frame for fullscreen and child windows
            mContainingFrame.set(pf);
            mDisplayFrame.set(df);