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

Commit 2b995c7a authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge changes from topic "touch-event-tests" into main

* changes:
  Remove `forceReinflation` parameter
  Revert^2: Add DesktopModeTouchEventListener tests
parents f000fb68 737ac1cb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ import com.android.wm.shell.windowdecor.WindowDecorViewModel;
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer;
import com.android.wm.shell.windowdecor.common.AppHandleAndHeaderVisibilityHelper;
import com.android.wm.shell.windowdecor.common.WindowDecorTaskResourceLoader;
import com.android.wm.shell.windowdecor.common.WindowDecorTaskResourceLoaderImpl;
import com.android.wm.shell.windowdecor.common.viewhost.DefaultWindowDecorViewHostSupplier;
import com.android.wm.shell.windowdecor.common.viewhost.PooledWindowDecorViewHostSupplier;
import com.android.wm.shell.windowdecor.common.viewhost.WindowDecorViewHost;
@@ -1339,8 +1340,9 @@ public abstract class WMShellModule {
            @ShellBackgroundThread MainCoroutineDispatcher bgDispatcher,
            @NonNull ShellCommandHandler shellCommandHandler,
            @NonNull UserProfileContexts userProfileContexts) {
        return new WindowDecorTaskResourceLoader(context, shellInit, shellController, mainHandler,
                mainScope, mainDispatcher, bgDispatcher, shellCommandHandler, userProfileContexts);
        return new WindowDecorTaskResourceLoaderImpl(context, shellInit, shellController,
                mainHandler, mainScope, mainDispatcher, bgDispatcher, shellCommandHandler,
                userProfileContexts);
    }

    @WMSingleton
+801 −0

File added.

Preview size limit exceeded, changes collapsed.

+15 −753

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter;
/**
 * Utility class to handle task operations performed on a window decoration.
 */
class TaskOperations {
public class TaskOperations {
    private static final String TAG = "TaskOperations";

    private final FreeformTaskTransitionStarter mTransitionStarter;
+17 −2
Original line number Diff line number Diff line
@@ -43,10 +43,12 @@ import android.window.DesktopExperienceFlags
import android.window.TaskConstants
import android.window.WindowContainerTransaction
import com.android.app.tracing.traceSection
import com.android.internal.protolog.ProtoLog
import com.android.wm.shell.ShellTaskOrganizer
import com.android.wm.shell.common.BoxShadowHelper
import com.android.wm.shell.common.DisplayController
import com.android.wm.shell.common.DisplayController.OnDisplaysChangedListener
import com.android.wm.shell.protolog.ShellProtoLogGroup
import com.android.wm.shell.shared.annotations.ShellMainThread
import com.android.wm.shell.transition.Transitions
import com.android.wm.shell.windowdecor.caption.CaptionController
@@ -166,6 +168,7 @@ abstract class WindowDecoration2<T>(
            traceTag = Trace.TRACE_TAG_WINDOW_MANAGER,
            name = "WindowDecoration2#relayout",
        ) {
            logD("relayout(task=%d) startT=%d finishT=%d", taskInfo.taskId, startT.id, finishT.id)
            taskInfo = params.runningTaskInfo
            hasGlobalFocus = params.hasGlobalFocus
            exclusionRegion.set(params.displayExclusionRegion)
@@ -189,6 +192,7 @@ abstract class WindowDecoration2<T>(
                if (params.setTaskVisibilityPositionAndCrop) {
                    finishT.hide(taskSurface)
                }
                logD("relayout(task=%d) invisible task, skipping", taskInfo.taskId)
                return null
            }

@@ -196,7 +200,10 @@ abstract class WindowDecoration2<T>(

            // If display has not yet appeared, return. Relayout will run again once display is
            // registered
            display ?: return null
            if (display == null) {
                logD("relayout(task=%d) null display, skipping", taskInfo.taskId)
                return null
            }

            val taskBounds = taskInfo.getConfiguration().windowConfiguration.bounds
            val taskWidth = taskBounds.width()
@@ -249,7 +256,11 @@ abstract class WindowDecoration2<T>(
                )
            }

            val controller = getOrCreateCaptionController(params.captionType) ?: return null
            val controller = getOrCreateCaptionController(params.captionType)
            if (controller == null) {
                logD("relayout(task=%d) null caption controller, skipping", taskInfo.taskId)
                return null
            }
            val captionResult =
                controller.relayout(
                    params = params,
@@ -432,6 +443,10 @@ abstract class WindowDecoration2<T>(
        startT.setWindowCrop(containerSurface, taskWidth, taskHeight).show(containerSurface)
    }

    private fun logD(msg: String, vararg arguments: Any?) {
        ProtoLog.d(ShellProtoLogGroup.WM_SHELL_WINDOW_DECORATION, "%s: $msg", TAG, *arguments)
    }

    private fun releaseViewsIfNeeded(params: RelayoutParams, wct: WindowContainerTransaction) =
        traceSection(
            traceTag = Trace.TRACE_TAG_WINDOW_MANAGER,
Loading