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

Commit e0e6942c authored by Ats Jenk's avatar Ats Jenk Committed by Android (Google) Code Review
Browse files

Merge changes Ib1b5e9f4,Ia72fa393 into main

* changes:
  Enable drag from app handle on foldables
  Enable app handle based on bubbles flag
parents 562c3a18 33ded4d4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ java_library {
        "**/desktopmode/*.kt",
    ],
    static_libs: [
        "WindowManager-Shell-shared-AOSP",
        "com.android.window.flags.window-aconfig-java",
        "wm_shell-shared-utils",
    ],
+4 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.wm.shell.shared.desktopmode;

import static android.hardware.display.DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED;

import static com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper.enableBubbleToFullscreen;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
@@ -270,7 +272,8 @@ public class DesktopModeStatus {
     * necessarily enabling desktop mode
     */
    public static boolean overridesShowAppHandle(@NonNull Context context) {
        return Flags.showAppHandleLargeScreens() && deviceHasLargeScreen(context);
        return (Flags.showAppHandleLargeScreens() || enableBubbleToFullscreen())
                && deviceHasLargeScreen(context);
    }

    /**
+15 −6
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;

/**
 * Animated visual indicator for Desktop Mode windowing transitions.
@@ -149,12 +151,19 @@ public class DesktopModeVisualIndicator {
        // left, and split right for the right edge. This is universal across all drag event types.
        if (inputCoordinates.x < 0) return TO_SPLIT_LEFT_INDICATOR;
        if (inputCoordinates.x > layout.width()) return TO_SPLIT_RIGHT_INDICATOR;
        IndicatorType result;
        if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()
                && !DesktopModeStatus.canEnterDesktopMode(mContext)) {
            // If desktop is not available, default to "no indicator"
            result = NO_INDICATOR;
        } else {
            // If we are in freeform, we don't want a visible indicator in the "freeform" drag zone.
            // In drags not originating on a freeform caption, we should default to a TO_DESKTOP
            // indicator.
        IndicatorType result = mDragStartState == DragStartState.FROM_FREEFORM
            result = mDragStartState == DragStartState.FROM_FREEFORM
                    ? NO_INDICATOR
                    : TO_DESKTOP_INDICATOR;
        }
        final int transitionAreaWidth = mContext.getResources().getDimensionPixelSize(
                com.android.wm.shell.R.dimen.desktop_mode_transition_region_thickness);
        // Because drags in freeform use task position for indicator calculation, we need to
+6 −1
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ import com.android.wm.shell.recents.RecentsTransitionStateListener;
import com.android.wm.shell.shared.FocusTransitionListener;
import com.android.wm.shell.shared.annotations.ShellBackgroundThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.bubbles.BubbleAnythingFlagHelper;
import com.android.wm.shell.shared.desktopmode.DesktopModeCompatPolicy;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource;
@@ -1439,13 +1440,17 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                mDragToDesktopAnimationStartBounds.set(
                        relevantDecor.mTaskInfo.configuration.windowConfiguration.getBounds());
                boolean dragFromStatusBarAllowed = false;
                final int windowingMode = relevantDecor.mTaskInfo.getWindowingMode();
                if (DesktopModeStatus.canEnterDesktopMode(mContext)) {
                    // In proto2 any full screen or multi-window task can be dragged to
                    // freeform.
                    final int windowingMode = relevantDecor.mTaskInfo.getWindowingMode();
                    dragFromStatusBarAllowed = windowingMode == WINDOWING_MODE_FULLSCREEN
                            || windowingMode == WINDOWING_MODE_MULTI_WINDOW;
                }
                if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) {
                    // TODO(b/388851898): add support for split screen (multi-window wm mode)
                    dragFromStatusBarAllowed = windowingMode == WINDOWING_MODE_FULLSCREEN;
                }
                final boolean shouldStartTransitionDrag =
                        relevantDecor.checkTouchEventInFocusedCaptionHandle(ev)
                                || DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue();
+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ class HandleMenu(
                    view = handleMenuView.rootView,
                    forciblyShownTypes = if (forceShowSystemBars) { systemBars() } else { 0 },
                    ignoreCutouts = Flags.showAppHandleLargeScreens()
                            || BubbleAnythingFlagHelper.enableBubbleToFullscreen()
                )
            } else {
                parentDecor.addWindow(
Loading