Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +2 −3 Original line number Diff line number Diff line Loading @@ -946,8 +946,7 @@ public abstract class WMShellModule { FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler WindowDecorTaskResourceLoader taskResourceLoader ) { if (!DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.empty(); Loading @@ -963,7 +962,7 @@ public abstract class WMShellModule { desktopTasksLimiter, appHandleEducationController, appToWebEducationController, windowDecorCaptionHandleRepository, activityOrientationChangeHandler, focusTransitionObserver, desktopModeEventLogger, desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler)); taskResourceLoader)); } @WMSingleton Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl +2 −4 Original line number Diff line number Diff line Loading @@ -17,10 +17,9 @@ package com.android.wm.shell.recents; import android.graphics.Rect; import android.os.Bundle; import android.view.RemoteAnimationTarget; import android.window.TaskSnapshot; import android.window.TransitionInfo; import android.os.Bundle; import com.android.wm.shell.recents.IRecentsAnimationController; Loading Loading @@ -58,8 +57,7 @@ oneway interface IRecentsAnimationRunner { */ void onAnimationStart(in IRecentsAnimationController controller, in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras, in TransitionInfo info) = 2; in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras) = 2; /** * Called when the task of an activity that has been started while the recents animation Loading libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -587,8 +587,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mListener.onAnimationStart(this, apps.toArray(new RemoteAnimationTarget[apps.size()]), new RemoteAnimationTarget[0], new Rect(0, 0, 0, 0), new Rect(), new Bundle(), null); new Rect(0, 0, 0, 0), new Rect(), new Bundle()); for (int i = 0; i < mStateListeners.size(); i++) { mStateListeners.get(i).onTransitionStateChanged(TRANSITION_STATE_ANIMATING); } Loading Loading @@ -819,7 +818,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mListener.onAnimationStart(this, apps.toArray(new RemoteAnimationTarget[apps.size()]), wallpapers.toArray(new RemoteAnimationTarget[wallpapers.size()]), new Rect(0, 0, 0, 0), new Rect(), b, info); new Rect(0, 0, 0, 0), new Rect(), b); for (int i = 0; i < mStateListeners.size(); i++) { mStateListeners.get(i).onTransitionStateChanged(TRANSITION_STATE_ANIMATING); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +3 −48 Original line number Diff line number Diff line Loading @@ -126,8 +126,6 @@ import com.android.wm.shell.desktopmode.common.ToggleTaskSizeUtilsKt; import com.android.wm.shell.desktopmode.education.AppHandleEducationController; import com.android.wm.shell.desktopmode.education.AppToWebEducationController; import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; import com.android.wm.shell.recents.RecentsTransitionHandler; 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; Loading Loading @@ -159,10 +157,8 @@ import kotlinx.coroutines.MainCoroutineDispatcher; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; /** Loading Loading @@ -251,7 +247,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, private final DesktopModeEventLogger mDesktopModeEventLogger; private final DesktopModeUiEventLogger mDesktopModeUiEventLogger; private final WindowDecorTaskResourceLoader mTaskResourceLoader; private final RecentsTransitionHandler mRecentsTransitionHandler; public DesktopModeWindowDecorViewModel( Context context, Loading Loading @@ -287,8 +282,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler) { WindowDecorTaskResourceLoader taskResourceLoader) { this( context, shellExecutor, Loading Loading @@ -329,8 +323,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, focusTransitionObserver, desktopModeEventLogger, desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler); taskResourceLoader); } @VisibleForTesting Loading Loading @@ -374,8 +367,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler) { WindowDecorTaskResourceLoader taskResourceLoader) { mContext = context; mMainExecutor = shellExecutor; mMainHandler = mainHandler; Loading Loading @@ -444,7 +436,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mDesktopModeEventLogger = desktopModeEventLogger; mDesktopModeUiEventLogger = desktopModeUiEventLogger; mTaskResourceLoader = taskResourceLoader; mRecentsTransitionHandler = recentsTransitionHandler; shellInit.addInitCallback(this::onInit, this); } Loading @@ -459,10 +450,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, new DesktopModeOnTaskResizeAnimationListener()); mDesktopTasksController.setOnTaskRepositionAnimationListener( new DesktopModeOnTaskRepositionAnimationListener()); if (Flags.enableDesktopRecentsTransitionsCornersBugfix()) { mRecentsTransitionHandler.addTransitionStateListener( new DesktopModeRecentsTransitionStateListener()); } mDisplayController.addDisplayChangingController(mOnDisplayChangingListener); try { mWindowManager.registerSystemGestureExclusionListener(mGestureExclusionListener, Loading Loading @@ -1872,38 +1859,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } } private class DesktopModeRecentsTransitionStateListener implements RecentsTransitionStateListener { final Set<Integer> mAnimatingTaskIds = new HashSet<>(); @Override public void onTransitionStateChanged(int state) { switch (state) { case RecentsTransitionStateListener.TRANSITION_STATE_REQUESTED: for (int n = 0; n < mWindowDecorByTaskId.size(); n++) { int taskId = mWindowDecorByTaskId.keyAt(n); mAnimatingTaskIds.add(taskId); setIsRecentsTransitionRunningForTask(taskId, true); } return; case RecentsTransitionStateListener.TRANSITION_STATE_NOT_RUNNING: // No Recents transition running - clean up window decorations for (int taskId : mAnimatingTaskIds) { setIsRecentsTransitionRunningForTask(taskId, false); } mAnimatingTaskIds.clear(); return; default: } } private void setIsRecentsTransitionRunningForTask(int taskId, boolean isRecentsRunning) { final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(taskId); if (decoration == null) return; decoration.setIsRecentsTransitionRunning(isRecentsRunning); } } private class DragEventListenerImpl implements DragPositioningCallbackUtility.DragEventListener { @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +6 −25 Original line number Diff line number Diff line Loading @@ -204,7 +204,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final MultiInstanceHelper mMultiInstanceHelper; private final WindowDecorCaptionHandleRepository mWindowDecorCaptionHandleRepository; private final DesktopUserRepositories mDesktopUserRepositories; private boolean mIsRecentsTransitionRunning = false; private Runnable mLoadAppInfoRunnable; private Runnable mSetAppInfoRunnable; Loading Loading @@ -499,7 +498,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin applyStartTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, inFullImmersive, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, displayExclusionRegion, mIsRecentsTransitionRunning); displayExclusionRegion); final WindowDecorLinearLayout oldRootView = mResult.mRootView; final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; Loading Loading @@ -870,8 +869,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin boolean inFullImmersiveMode, @NonNull InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean shouldIgnoreCornerRadius) { @NonNull Region displayExclusionRegion) { final int captionLayoutId = getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode()); final boolean isAppHeader = captionLayoutId == R.layout.desktop_mode_app_header; Loading Loading @@ -1008,19 +1006,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mWindowDecorConfig = windowDecorConfig; if (DesktopModeStatus.useRoundedCorners()) { relayoutParams.mCornerRadius = shouldIgnoreCornerRadius ? INVALID_CORNER_RADIUS : getCornerRadius(context, relayoutParams.mLayoutResId); relayoutParams.mCornerRadius = taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM ? loadDimensionPixelSize(context.getResources(), R.dimen.desktop_windowing_freeform_rounded_corner_radius) : INVALID_CORNER_RADIUS; } } private static int getCornerRadius(@NonNull Context context, int layoutResId) { if (layoutResId == R.layout.desktop_mode_app_header) { return loadDimensionPixelSize(context.getResources(), R.dimen.desktop_windowing_freeform_rounded_corner_radius); } return INVALID_CORNER_RADIUS; } /** * If task has focused window decor, return the caption id of the fullscreen caption size * resource. Otherwise, return ID_NULL and caption width be set to task width. Loading Loading @@ -1747,17 +1739,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin /* maximizeHoverEnabled= */ canOpenMaximizeMenu(animatingTaskResizeOrReposition))); } /** * Declares whether a Recents transition is currently active. * * <p> When a Recents transition is active we allow that transition to take ownership of the * corner radius of its task surfaces, so each window decoration should stop updating the corner * radius of its task surface during that time. */ void setIsRecentsTransitionRunning(boolean isRecentsTransitionRunning) { mIsRecentsTransitionRunning = isRecentsTransitionRunning; } /** * Called when there is a {@link MotionEvent#ACTION_HOVER_EXIT} on the maximize window button. */ Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +2 −3 Original line number Diff line number Diff line Loading @@ -946,8 +946,7 @@ public abstract class WMShellModule { FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler WindowDecorTaskResourceLoader taskResourceLoader ) { if (!DesktopModeStatus.canEnterDesktopModeOrShowAppHandle(context)) { return Optional.empty(); Loading @@ -963,7 +962,7 @@ public abstract class WMShellModule { desktopTasksLimiter, appHandleEducationController, appToWebEducationController, windowDecorCaptionHandleRepository, activityOrientationChangeHandler, focusTransitionObserver, desktopModeEventLogger, desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler)); taskResourceLoader)); } @WMSingleton Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/IRecentsAnimationRunner.aidl +2 −4 Original line number Diff line number Diff line Loading @@ -17,10 +17,9 @@ package com.android.wm.shell.recents; import android.graphics.Rect; import android.os.Bundle; import android.view.RemoteAnimationTarget; import android.window.TaskSnapshot; import android.window.TransitionInfo; import android.os.Bundle; import com.android.wm.shell.recents.IRecentsAnimationController; Loading Loading @@ -58,8 +57,7 @@ oneway interface IRecentsAnimationRunner { */ void onAnimationStart(in IRecentsAnimationController controller, in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers, in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras, in TransitionInfo info) = 2; in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras) = 2; /** * Called when the task of an activity that has been started while the recents animation Loading
libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java +2 −3 Original line number Diff line number Diff line Loading @@ -587,8 +587,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mListener.onAnimationStart(this, apps.toArray(new RemoteAnimationTarget[apps.size()]), new RemoteAnimationTarget[0], new Rect(0, 0, 0, 0), new Rect(), new Bundle(), null); new Rect(0, 0, 0, 0), new Rect(), new Bundle()); for (int i = 0; i < mStateListeners.size(); i++) { mStateListeners.get(i).onTransitionStateChanged(TRANSITION_STATE_ANIMATING); } Loading Loading @@ -819,7 +818,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler, mListener.onAnimationStart(this, apps.toArray(new RemoteAnimationTarget[apps.size()]), wallpapers.toArray(new RemoteAnimationTarget[wallpapers.size()]), new Rect(0, 0, 0, 0), new Rect(), b, info); new Rect(0, 0, 0, 0), new Rect(), b); for (int i = 0; i < mStateListeners.size(); i++) { mStateListeners.get(i).onTransitionStateChanged(TRANSITION_STATE_ANIMATING); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +3 −48 Original line number Diff line number Diff line Loading @@ -126,8 +126,6 @@ import com.android.wm.shell.desktopmode.common.ToggleTaskSizeUtilsKt; import com.android.wm.shell.desktopmode.education.AppHandleEducationController; import com.android.wm.shell.desktopmode.education.AppToWebEducationController; import com.android.wm.shell.freeform.FreeformTaskTransitionStarter; import com.android.wm.shell.recents.RecentsTransitionHandler; 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; Loading Loading @@ -159,10 +157,8 @@ import kotlinx.coroutines.MainCoroutineDispatcher; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; import java.util.function.Supplier; /** Loading Loading @@ -251,7 +247,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, private final DesktopModeEventLogger mDesktopModeEventLogger; private final DesktopModeUiEventLogger mDesktopModeUiEventLogger; private final WindowDecorTaskResourceLoader mTaskResourceLoader; private final RecentsTransitionHandler mRecentsTransitionHandler; public DesktopModeWindowDecorViewModel( Context context, Loading Loading @@ -287,8 +282,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler) { WindowDecorTaskResourceLoader taskResourceLoader) { this( context, shellExecutor, Loading Loading @@ -329,8 +323,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, focusTransitionObserver, desktopModeEventLogger, desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler); taskResourceLoader); } @VisibleForTesting Loading Loading @@ -374,8 +367,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, FocusTransitionObserver focusTransitionObserver, DesktopModeEventLogger desktopModeEventLogger, DesktopModeUiEventLogger desktopModeUiEventLogger, WindowDecorTaskResourceLoader taskResourceLoader, RecentsTransitionHandler recentsTransitionHandler) { WindowDecorTaskResourceLoader taskResourceLoader) { mContext = context; mMainExecutor = shellExecutor; mMainHandler = mainHandler; Loading Loading @@ -444,7 +436,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mDesktopModeEventLogger = desktopModeEventLogger; mDesktopModeUiEventLogger = desktopModeUiEventLogger; mTaskResourceLoader = taskResourceLoader; mRecentsTransitionHandler = recentsTransitionHandler; shellInit.addInitCallback(this::onInit, this); } Loading @@ -459,10 +450,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, new DesktopModeOnTaskResizeAnimationListener()); mDesktopTasksController.setOnTaskRepositionAnimationListener( new DesktopModeOnTaskRepositionAnimationListener()); if (Flags.enableDesktopRecentsTransitionsCornersBugfix()) { mRecentsTransitionHandler.addTransitionStateListener( new DesktopModeRecentsTransitionStateListener()); } mDisplayController.addDisplayChangingController(mOnDisplayChangingListener); try { mWindowManager.registerSystemGestureExclusionListener(mGestureExclusionListener, Loading Loading @@ -1872,38 +1859,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } } private class DesktopModeRecentsTransitionStateListener implements RecentsTransitionStateListener { final Set<Integer> mAnimatingTaskIds = new HashSet<>(); @Override public void onTransitionStateChanged(int state) { switch (state) { case RecentsTransitionStateListener.TRANSITION_STATE_REQUESTED: for (int n = 0; n < mWindowDecorByTaskId.size(); n++) { int taskId = mWindowDecorByTaskId.keyAt(n); mAnimatingTaskIds.add(taskId); setIsRecentsTransitionRunningForTask(taskId, true); } return; case RecentsTransitionStateListener.TRANSITION_STATE_NOT_RUNNING: // No Recents transition running - clean up window decorations for (int taskId : mAnimatingTaskIds) { setIsRecentsTransitionRunningForTask(taskId, false); } mAnimatingTaskIds.clear(); return; default: } } private void setIsRecentsTransitionRunningForTask(int taskId, boolean isRecentsRunning) { final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(taskId); if (decoration == null) return; decoration.setIsRecentsTransitionRunning(isRecentsRunning); } } private class DragEventListenerImpl implements DragPositioningCallbackUtility.DragEventListener { @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java +6 −25 Original line number Diff line number Diff line Loading @@ -204,7 +204,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin private final MultiInstanceHelper mMultiInstanceHelper; private final WindowDecorCaptionHandleRepository mWindowDecorCaptionHandleRepository; private final DesktopUserRepositories mDesktopUserRepositories; private boolean mIsRecentsTransitionRunning = false; private Runnable mLoadAppInfoRunnable; private Runnable mSetAppInfoRunnable; Loading Loading @@ -499,7 +498,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin applyStartTransactionOnDraw, shouldSetTaskVisibilityPositionAndCrop, mIsStatusBarVisible, mIsKeyguardVisibleAndOccluded, inFullImmersive, mDisplayController.getInsetsState(taskInfo.displayId), hasGlobalFocus, displayExclusionRegion, mIsRecentsTransitionRunning); displayExclusionRegion); final WindowDecorLinearLayout oldRootView = mResult.mRootView; final SurfaceControl oldDecorationSurface = mDecorationContainerSurface; Loading Loading @@ -870,8 +869,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin boolean inFullImmersiveMode, @NonNull InsetsState displayInsetsState, boolean hasGlobalFocus, @NonNull Region displayExclusionRegion, boolean shouldIgnoreCornerRadius) { @NonNull Region displayExclusionRegion) { final int captionLayoutId = getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode()); final boolean isAppHeader = captionLayoutId == R.layout.desktop_mode_app_header; Loading Loading @@ -1008,19 +1006,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin relayoutParams.mWindowDecorConfig = windowDecorConfig; if (DesktopModeStatus.useRoundedCorners()) { relayoutParams.mCornerRadius = shouldIgnoreCornerRadius ? INVALID_CORNER_RADIUS : getCornerRadius(context, relayoutParams.mLayoutResId); relayoutParams.mCornerRadius = taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM ? loadDimensionPixelSize(context.getResources(), R.dimen.desktop_windowing_freeform_rounded_corner_radius) : INVALID_CORNER_RADIUS; } } private static int getCornerRadius(@NonNull Context context, int layoutResId) { if (layoutResId == R.layout.desktop_mode_app_header) { return loadDimensionPixelSize(context.getResources(), R.dimen.desktop_windowing_freeform_rounded_corner_radius); } return INVALID_CORNER_RADIUS; } /** * If task has focused window decor, return the caption id of the fullscreen caption size * resource. Otherwise, return ID_NULL and caption width be set to task width. Loading Loading @@ -1747,17 +1739,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin /* maximizeHoverEnabled= */ canOpenMaximizeMenu(animatingTaskResizeOrReposition))); } /** * Declares whether a Recents transition is currently active. * * <p> When a Recents transition is active we allow that transition to take ownership of the * corner radius of its task surfaces, so each window decoration should stop updating the corner * radius of its task surface during that time. */ void setIsRecentsTransitionRunning(boolean isRecentsTransitionRunning) { mIsRecentsTransitionRunning = isRecentsTransitionRunning; } /** * Called when there is a {@link MotionEvent#ACTION_HOVER_EXIT} on the maximize window button. */ Loading