diff options
author | 2025-01-06 16:23:51 -0800 | |
---|---|---|
committer | 2025-01-06 16:23:51 -0800 | |
commit | 479fdca8cd9182fc48c1c9f97ff25ff4f12fcabb (patch) | |
tree | b0e64a60dac7f072d2ce2e27192ef07405348b6a | |
parent | e736086b6d95b68168e1ddccac2032eb3c7c5e1a (diff) | |
parent | fa50a345db3c4a22a5b6dafcb84b3153dc2fd634 (diff) |
Merge changes Idb61d47c,I626ee944 into main
* changes:
Replace assertThat(v).isNotNull with assertNotNull
Fix the format of argument name comments
13 files changed, 110 insertions, 118 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopImmersiveController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopImmersiveController.kt index 536dc2a58534..a4620d5a4dfe 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopImmersiveController.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopImmersiveController.kt @@ -339,7 +339,7 @@ class DesktopImmersiveController( .setWindowCrop(leash, endBounds.width(), endBounds.height()) .apply() onTaskResizeAnimationListener?.onAnimationEnd(taskId) - finishCallback.onTransitionFinished(null /* wct */) + finishCallback.onTransitionFinished(/* wct= */ null) } ) addUpdateListener { animation -> diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt index ceef69969d9a..e8f9a789bb98 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeEventLogger.kt @@ -306,7 +306,7 @@ class DesktopModeEventLogger { fun logTaskInfoStateInit() { logTaskUpdate( FrameworkStatsLog.DESKTOP_MODE_SESSION_TASK_UPDATE__TASK_EVENT__TASK_INIT_STATSD, - /* session_id */ 0, + sessionId = 0, TaskUpdate( visibleTaskCount = 0, instanceId = 0, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java index cd37113666bb..32ee319a053b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeVisualIndicator.java @@ -274,7 +274,7 @@ public class DesktopModeVisualIndicator { lp.inputFeatures |= INPUT_FEATURE_NO_INPUT_CHANNEL; final WindowlessWindowManager windowManager = new WindowlessWindowManager( mTaskInfo.configuration, mLeash, - null /* hostInputToken */); + /* hostInputToken= */ null); mViewHost = new SurfaceControlViewHost(mContext, mDisplayController.getDisplay(mTaskInfo.displayId), windowManager, "DesktopModeVisualIndicator"); @@ -338,7 +338,7 @@ public class DesktopModeVisualIndicator { if (mCurrentType == NO_INDICATOR) { fadeInIndicator(newType); } else if (newType == NO_INDICATOR) { - fadeOutIndicator(null /* finishCallback */); + fadeOutIndicator(/* finishCallback= */ null); } else { final VisualIndicatorAnimator animator = VisualIndicatorAnimator.animateIndicatorType( mView, mDisplayController.getDisplayLayout(mTaskInfo.displayId), mCurrentType, diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt index d180ea7b79ff..ee817b34b24a 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt @@ -762,7 +762,7 @@ class DesktopTasksController( return } val wct = WindowContainerTransaction() - wct.reorder(taskInfo.token, true /* onTop */, true /* includingParents */) + wct.reorder(taskInfo.token, /* onTop= */ true, /* includingParents= */ true) startLaunchTransition( transitionType = TRANSIT_TO_FRONT, wct = wct, @@ -884,7 +884,7 @@ class DesktopTasksController( } else if (Flags.enableMoveToNextDisplayShortcut()) { applyFreeformDisplayChange(wct, task, displayId) } - wct.reparent(task.token, displayAreaInfo.token, true /* onTop */) + wct.reparent(task.token, displayAreaInfo.token, /* onTop= */ true) if (Flags.enableDisplayFocusInShellTransitions()) { // Bring the destination display to top with includingParents=true, so that the // destination display gains the display focus, which makes the top task in the display @@ -896,7 +896,7 @@ class DesktopTasksController( performDesktopExitCleanupIfNeeded(task.taskId, task.displayId, wct) } - transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */) + transitions.startTransition(TRANSIT_CHANGE, wct, /* handler= */ null) } /** @@ -1672,7 +1672,7 @@ class DesktopTasksController( requestedTaskId, splitPosition, options.toBundle(), - null, /* hideTaskToken */ + /* hideTaskToken= */ null, ) } } @@ -1709,8 +1709,8 @@ class DesktopTasksController( fillIn, splitPosition, options.toBundle(), - null /* hideTaskToken */, - true /* forceLaunchNewTask */, + /* hideTaskToken= */ null, + /* forceLaunchNewTask= */ true, splitIndex, ) } @@ -1961,7 +1961,7 @@ class DesktopTasksController( wct.setBounds(taskInfo.token, initialBounds) } wct.setWindowingMode(taskInfo.token, targetWindowingMode) - wct.reorder(taskInfo.token, true /* onTop */) + wct.reorder(taskInfo.token, /* onTop= */ true) if (useDesktopOverrideDensity()) { wct.setDensityDpi(taskInfo.token, DESKTOP_DENSITY_OVERRIDE) } @@ -2796,7 +2796,7 @@ class DesktopTasksController( controller, "visibleTaskCount", { controller -> result[0] = controller.visibleTaskCount(displayId) }, - true, /* blocking */ + /* blocking= */ true, ) return result[0] } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksLimiter.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksLimiter.kt index 0330a5f0c4e7..c2dd4d28305b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksLimiter.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksLimiter.kt @@ -234,7 +234,7 @@ class DesktopTasksLimiter( // If it's a running task, reorder it to back. taskIdToMinimize ?.let { shellTaskOrganizer.getRunningTaskInfo(it) } - ?.let { wct.reorder(it.token, false /* onTop */) } + ?.let { wct.reorder(it.token, /* onTop= */ false) } return taskIdToMinimize } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandler.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandler.kt index 72c064248988..1380a9ca164f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandler.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandler.kt @@ -131,7 +131,7 @@ sealed class DragToDesktopTransitionHandler( val pendingIntent = PendingIntent.getActivityAsUser( context.createContextAsUser(taskUser, /* flags= */ 0), - 0 /* requestCode */, + /* requestCode= */ 0, launchHomeIntent, FLAG_MUTABLE or FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT or FILL_IN_COMPONENT, options.toBundle(), @@ -234,7 +234,7 @@ sealed class DragToDesktopTransitionHandler( val wct = WindowContainerTransaction() restoreWindowOrder(wct, state) state.startTransitionFinishTransaction?.apply() - state.startTransitionFinishCb?.onTransitionFinished(null /* wct */) + state.startTransitionFinishCb?.onTransitionFinished(/* wct= */ null) requestSplitFromScaledTask(splitPosition, wct) clearState() } else { @@ -440,7 +440,7 @@ sealed class DragToDesktopTransitionHandler( val wct = WindowContainerTransaction() restoreWindowOrder(wct) state.startTransitionFinishTransaction?.apply() - state.startTransitionFinishCb?.onTransitionFinished(null /* wct */) + state.startTransitionFinishCb?.onTransitionFinished(/* wct= */ null) requestSplitSelect(wct, taskInfo, splitPosition) } return true @@ -492,7 +492,7 @@ sealed class DragToDesktopTransitionHandler( finishTransaction = startTransactionFinishT, ) // Call finishCallback to merge animation before startTransitionFinishCb is called - finishCallback.onTransitionFinished(null /* wct */) + finishCallback.onTransitionFinished(/* wct= */ null) animateEndDragToDesktop(startTransaction = t, startTransitionFinishCb) } else if (isCancelTransition) { info.changes.forEach { change -> @@ -500,8 +500,8 @@ sealed class DragToDesktopTransitionHandler( startTransactionFinishT.show(change.leash) } t.apply() - finishCallback.onTransitionFinished(null /* wct */) - startTransitionFinishCb.onTransitionFinished(null /* wct */) + finishCallback.onTransitionFinished(/* wct= */ null) + startTransitionFinishCb.onTransitionFinished(/* wct= */ null) clearState() } } @@ -653,7 +653,7 @@ sealed class DragToDesktopTransitionHandler( interactionJankMonitor.cancel(CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_HOLD) } else if (state.cancelTransitionToken == transition) { state.draggedTaskChange?.leash?.let { state.startTransitionFinishTransaction?.show(it) } - state.startTransitionFinishCb?.onTransitionFinished(null /* wct */) + state.startTransitionFinishCb?.onTransitionFinished(/* wct= */ null) clearState() } else { // This transition being aborted is neither the start, nor the cancel transition, so @@ -741,19 +741,19 @@ sealed class DragToDesktopTransitionHandler( // TODO(b/322852244): investigate why even though these "other" tasks are // reordered in front of home and behind the translucent dragged task, its // surface is not visible on screen. - wct.reorder(wc, true /* toTop */) + wct.reorder(wc, /* onTop= */ true) } val wc = state.draggedTaskChange?.container ?: error("Dragged task should be non-null before cancelling") // Then the dragged task a the very top. - wct.reorder(wc, true /* toTop */) + wct.reorder(wc, /* onTop= */ true) } is TransitionState.FromSplit -> { val wc = state.splitRootChange?.container ?: error("Split root should be non-null before cancelling") - wct.reorder(wc, true /* toTop */) + wct.reorder(wc, /* onTop= */ true) } } val homeWc = diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/CloseDesktopTaskTransitionHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/CloseDesktopTaskTransitionHandlerTest.kt index db00f41f723b..04f9ada8a9d7 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/CloseDesktopTaskTransitionHandlerTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/CloseDesktopTaskTransitionHandlerTest.kt @@ -142,7 +142,7 @@ class CloseDesktopTaskTransitionHandlerTest : ShellTestCase() { changeMode: Int = WindowManager.TRANSIT_CLOSE, task: RunningTaskInfo, ): TransitionInfo = - TransitionInfo(type, 0 /* flags */).apply { + TransitionInfo(type, /* flags= */ 0).apply { addChange( TransitionInfo.Change(mock(), closingTaskLeash).apply { mode = changeMode diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopBackNavigationTransitionHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopBackNavigationTransitionHandlerTest.kt index d14c6402982d..c705f5a5ac87 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopBackNavigationTransitionHandlerTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopBackNavigationTransitionHandlerTest.kt @@ -153,7 +153,7 @@ class DesktopBackNavigationTransitionHandlerTest : ShellTestCase() { changeMode: Int = WindowManager.TRANSIT_TO_BACK, task: RunningTaskInfo, ): TransitionInfo = - TransitionInfo(type, 0 /* flags */).apply { + TransitionInfo(type, /* flags= */ 0).apply { addChange( TransitionInfo.Change(mock(), closingTaskLeash).apply { mode = changeMode diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandlerTest.kt index 3cf84d92a625..372e47ce6a17 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandlerTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopMixedTransitionHandlerTest.kt @@ -777,7 +777,7 @@ class DesktopMixedTransitionHandlerTest : ShellTestCase() { task: RunningTaskInfo, withWallpaper: Boolean = false, ): TransitionInfo = - TransitionInfo(WindowManager.TRANSIT_CLOSE, 0 /* flags */).apply { + TransitionInfo(WindowManager.TRANSIT_CLOSE, /* flags= */ 0).apply { addChange( TransitionInfo.Change(mock(), closingTaskLeash).apply { mode = changeMode diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt index e032616e7d43..da27c08920dc 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt @@ -1267,7 +1267,7 @@ class DesktopTasksControllerTest : ShellTestCase() { // Set task as systemUI package val systemUIPackageName = context.resources.getString(com.android.internal.R.string.config_systemUi) - val baseComponent = ComponentName(systemUIPackageName, /* class */ "") + val baseComponent = ComponentName(systemUIPackageName, /* cls= */ "") val task = setUpFullscreenTask().apply { baseActivity = baseComponent @@ -1284,7 +1284,7 @@ class DesktopTasksControllerTest : ShellTestCase() { // Set task as systemUI package val systemUIPackageName = context.resources.getString(com.android.internal.R.string.config_systemUi) - val baseComponent = ComponentName(systemUIPackageName, /* class */ "") + val baseComponent = ComponentName(systemUIPackageName, /* cls= */ "") val task = setUpFullscreenTask().apply { baseActivity = baseComponent @@ -1757,12 +1757,12 @@ class DesktopTasksControllerTest : ShellTestCase() { controller.moveToNextDisplay(task.taskId) - with(getLatestWct(type = TRANSIT_CHANGE)) { - val wallpaperChange = - hierarchyOps.find { op -> op.container == wallpaperToken.asBinder() } - assertThat(wallpaperChange).isNotNull() - assertThat(wallpaperChange!!.type).isEqualTo(HIERARCHY_OP_TYPE_REMOVE_TASK) - } + val wallpaperChange = + getLatestWct(type = TRANSIT_CHANGE).hierarchyOps.find { op -> + op.container == wallpaperToken.asBinder() + } + assertNotNull(wallpaperChange) + assertThat(wallpaperChange.type).isEqualTo(HIERARCHY_OP_TYPE_REMOVE_TASK) } @Test @@ -1792,15 +1792,13 @@ class DesktopTasksControllerTest : ShellTestCase() { controller.moveToNextDisplay(task.taskId) - with(getLatestWct(type = TRANSIT_CHANGE)) { - val taskChange = changes[task.token.asBinder()] - assertThat(taskChange).isNotNull() - // To preserve DP size, pixel size is changed to 320x240. The ratio of the left margin - // to the right margin and the ratio of the top margin to bottom margin are also - // preserved. - assertThat(taskChange!!.configuration.windowConfiguration.bounds) - .isEqualTo(Rect(240, 160, 560, 400)) - } + val taskChange = getLatestWct(type = TRANSIT_CHANGE).changes[task.token.asBinder()] + assertNotNull(taskChange) + // To preserve DP size, pixel size is changed to 320x240. The ratio of the left margin + // to the right margin and the ratio of the top margin to bottom margin are also + // preserved. + assertThat(taskChange.configuration.windowConfiguration.bounds) + .isEqualTo(Rect(240, 160, 560, 400)) } @Test @@ -1831,12 +1829,10 @@ class DesktopTasksControllerTest : ShellTestCase() { controller.moveToNextDisplay(task.taskId) - with(getLatestWct(type = TRANSIT_CHANGE)) { - val taskChange = changes[task.token.asBinder()] - assertThat(taskChange).isNotNull() - assertThat(taskChange!!.configuration.windowConfiguration.bounds) - .isEqualTo(Rect(960, 480, 1280, 720)) - } + val taskChange = getLatestWct(type = TRANSIT_CHANGE).changes[task.token.asBinder()] + assertNotNull(taskChange) + assertThat(taskChange.configuration.windowConfiguration.bounds) + .isEqualTo(Rect(960, 480, 1280, 720)) } @Test @@ -1864,13 +1860,11 @@ class DesktopTasksControllerTest : ShellTestCase() { controller.moveToNextDisplay(task.taskId) - with(getLatestWct(type = TRANSIT_CHANGE)) { - val taskChange = changes[task.token.asBinder()] - assertThat(taskChange).isNotNull() - // DP size is preserved. The window is centered in the destination display. - assertThat(taskChange!!.configuration.windowConfiguration.bounds) - .isEqualTo(Rect(320, 120, 960, 600)) - } + val taskChange = getLatestWct(type = TRANSIT_CHANGE).changes[task.token.asBinder()] + assertNotNull(taskChange) + // DP size is preserved. The window is centered in the destination display. + assertThat(taskChange.configuration.windowConfiguration.bounds) + .isEqualTo(Rect(320, 120, 960, 600)) } @Test @@ -1903,14 +1897,12 @@ class DesktopTasksControllerTest : ShellTestCase() { controller.moveToNextDisplay(task.taskId) - with(getLatestWct(type = TRANSIT_CHANGE)) { - val taskChange = changes[task.token.asBinder()] - assertThat(taskChange).isNotNull() - assertThat(taskChange!!.configuration.windowConfiguration.bounds.left).isAtLeast(0) - assertThat(taskChange.configuration.windowConfiguration.bounds.top).isAtLeast(0) - assertThat(taskChange.configuration.windowConfiguration.bounds.right).isAtMost(640) - assertThat(taskChange.configuration.windowConfiguration.bounds.bottom).isAtMost(480) - } + val taskChange = getLatestWct(type = TRANSIT_CHANGE).changes[task.token.asBinder()] + assertNotNull(taskChange) + assertThat(taskChange.configuration.windowConfiguration.bounds.left).isAtLeast(0) + assertThat(taskChange.configuration.windowConfiguration.bounds.top).isAtLeast(0) + assertThat(taskChange.configuration.windowConfiguration.bounds.right).isAtMost(640) + assertThat(taskChange.configuration.windowConfiguration.bounds.bottom).isAtMost(480) } @Test @@ -2722,7 +2714,7 @@ class DesktopTasksControllerTest : ShellTestCase() { // Set task as systemUI package val systemUIPackageName = context.resources.getString(com.android.internal.R.string.config_systemUi) - val baseComponent = ComponentName(systemUIPackageName, /* class */ "") + val baseComponent = ComponentName(systemUIPackageName, /* cls= */ "") val task = setUpFreeformTask().apply { baseActivity = baseComponent @@ -2743,7 +2735,7 @@ class DesktopTasksControllerTest : ShellTestCase() { // Set task as systemUI package val systemUIPackageName = context.resources.getString(com.android.internal.R.string.config_systemUi) - val baseComponent = ComponentName(systemUIPackageName, /* class */ "") + val baseComponent = ComponentName(systemUIPackageName, /* cls= */ "") val task = setUpFullscreenTask().apply { baseActivity = baseComponent @@ -3376,11 +3368,11 @@ class DesktopTasksControllerTest : ShellTestCase() { spyController.onDragPositioningEnd( task, mockSurface, - Point(100, -100), /* position */ - PointF(200f, -200f), /* inputCoordinate */ - Rect(100, -100, 500, 1000), /* currentDragBounds */ - Rect(0, 50, 2000, 2000), /* validDragArea */ - Rect() /* dragStartBounds */, + position = Point(100, -100), + inputCoordinate = PointF(200f, -200f), + currentDragBounds = Rect(100, -100, 500, 1000), + validDragArea = Rect(0, 50, 2000, 2000), + dragStartBounds = Rect(), motionEvent, desktopWindowDecoration, ) @@ -3415,11 +3407,11 @@ class DesktopTasksControllerTest : ShellTestCase() { spyController.onDragPositioningEnd( task, mockSurface, - Point(100, 200), /* position */ - PointF(200f, 300f), /* inputCoordinate */ - currentDragBounds, /* currentDragBounds */ - Rect(0, 50, 2000, 2000) /* validDragArea */, - Rect() /* dragStartBounds */, + position = Point(100, 200), + inputCoordinate = PointF(200f, 300f), + currentDragBounds = currentDragBounds, + validDragArea = Rect(0, 50, 2000, 2000), + dragStartBounds = Rect(), motionEvent, desktopWindowDecoration, ) @@ -3459,11 +3451,11 @@ class DesktopTasksControllerTest : ShellTestCase() { spyController.onDragPositioningEnd( task, mockSurface, - Point(100, 50), /* position */ - PointF(200f, 300f), /* inputCoordinate */ - Rect(100, 50, 500, 1000), /* currentDragBounds */ - Rect(0, 50, 2000, 2000) /* validDragArea */, - Rect() /* dragStartBounds */, + position = Point(100, 50), + inputCoordinate = PointF(200f, 300f), + currentDragBounds = Rect(100, 50, 500, 1000), + validDragArea = Rect(0, 50, 2000, 2000), + dragStartBounds = Rect(), motionEvent, desktopWindowDecoration, ) @@ -3498,11 +3490,11 @@ class DesktopTasksControllerTest : ShellTestCase() { spyController.onDragPositioningEnd( task, mockSurface, - Point(100, 50), /* position */ - PointF(200f, 300f), /* inputCoordinate */ + position = Point(100, 50), + inputCoordinate = PointF(200f, 300f), currentDragBounds, - Rect(0, 50, 2000, 2000) /* validDragArea */, - Rect() /* dragStartBounds */, + validDragArea = Rect(0, 50, 2000, 2000), + dragStartBounds = Rect(), motionEvent, desktopWindowDecoration, ) @@ -3555,11 +3547,11 @@ class DesktopTasksControllerTest : ShellTestCase() { spyController.onDragPositioningEnd( task, mockSurface, - Point(100, 50), /* position */ - PointF(200f, 300f), /* inputCoordinate */ - currentDragBounds, /* currentDragBounds */ - Rect(0, 50, 2000, 2000) /* validDragArea */, - Rect() /* dragStartBounds */, + position = Point(100, 50), + inputCoordinate = PointF(200f, 300f), + currentDragBounds = currentDragBounds, + validDragArea = Rect(0, 50, 2000, 2000), + dragStartBounds = Rect(), motionEvent, desktopWindowDecoration, ) @@ -5053,7 +5045,7 @@ class DesktopTasksControllerTest : ShellTestCase() { task: RunningTaskInfo?, @WindowManager.TransitionType type: Int = TRANSIT_OPEN, ): TransitionRequestInfo { - return TransitionRequestInfo(type, task, null /* remoteTransition */) + return TransitionRequestInfo(type, task, /* remoteTransition= */ null) } private companion object { diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksLimiterTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksLimiterTest.kt index 52602f22fd4b..c8214b3838e2 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksLimiterTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksLimiterTest.kt @@ -193,10 +193,10 @@ class DesktopTasksLimiterTest : ShellTestCase() { desktopTasksLimiter .getTransitionObserver() .onTransitionReady( - Binder() /* transition */, + /* transition= */ Binder(), TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isFalse() @@ -217,10 +217,10 @@ class DesktopTasksLimiterTest : ShellTestCase() { desktopTasksLimiter .getTransitionObserver() .onTransitionReady( - taskTransition /* transition */, + /* transition= */ taskTransition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isFalse() @@ -242,8 +242,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfoBuilder(TRANSIT_OPEN).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isFalse() @@ -265,8 +265,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfoBuilder(TRANSIT_OPEN).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isTrue() @@ -287,8 +287,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isTrue() @@ -316,8 +316,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfo(TRANSIT_OPEN, TransitionInfo.FLAG_NONE).apply { addChange(change) }, - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isTrue() @@ -344,8 +344,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( newTransition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) assertThat(desktopTaskRepo.isMinimizedTask(taskId = task.taskId)).isTrue() @@ -552,8 +552,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) desktopTasksLimiter.getTransitionObserver().onTransitionStarting(transition) @@ -584,8 +584,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( transition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) desktopTasksLimiter.getTransitionObserver().onTransitionStarting(transition) @@ -617,8 +617,8 @@ class DesktopTasksLimiterTest : ShellTestCase() { .onTransitionReady( mergedTransition, TransitionInfoBuilder(TRANSIT_OPEN).addChange(TRANSIT_TO_BACK, task).build(), - StubTransaction() /* startTransaction */, - StubTransaction(), /* finishTransaction */ + /* startTransaction= */ StubTransaction(), + /* finishTransaction= */ StubTransaction(), ) desktopTasksLimiter.getTransitionObserver().onTransitionStarting(mergedTransition) diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt index d491d445458d..3cc30cb491b3 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt @@ -305,7 +305,7 @@ class DesktopTasksTransitionObserverTest { type: Int = TRANSIT_TO_BACK, withWallpaper: Boolean = false, ): TransitionInfo { - return TransitionInfo(type, 0 /* flags */).apply { + return TransitionInfo(type, /* flags= */ 0).apply { addChange( Change(mock(), mock()).apply { mode = type @@ -331,7 +331,7 @@ class DesktopTasksTransitionObserverTest { task: RunningTaskInfo?, type: Int = TRANSIT_OPEN, ): TransitionInfo { - return TransitionInfo(TRANSIT_OPEN, 0 /* flags */).apply { + return TransitionInfo(TRANSIT_OPEN, /* flags= */ 0).apply { addChange( Change(mock(), mock()).apply { mode = TRANSIT_OPEN @@ -344,7 +344,7 @@ class DesktopTasksTransitionObserverTest { } private fun createCloseTransition(task: RunningTaskInfo?): TransitionInfo { - return TransitionInfo(TRANSIT_CLOSE, 0 /* flags */).apply { + return TransitionInfo(TRANSIT_CLOSE, /* flags= */ 0).apply { addChange( Change(mock(), mock()).apply { mode = TRANSIT_CLOSE @@ -357,7 +357,7 @@ class DesktopTasksTransitionObserverTest { } private fun createToBackTransition(task: RunningTaskInfo?): TransitionInfo { - return TransitionInfo(TRANSIT_TO_BACK, 0 /* flags */).apply { + return TransitionInfo(TRANSIT_TO_BACK, /* flags= */ 0).apply { addChange( Change(mock(), mock()).apply { mode = TRANSIT_TO_BACK diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandlerTest.kt index 2216d5452ce5..341df0299a97 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandlerTest.kt +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DragToDesktopTransitionHandlerTest.kt @@ -677,7 +677,7 @@ class DragToDesktopTransitionHandlerTest : ShellTestCase() { } private fun createTransitionInfo(type: Int, draggedTask: RunningTaskInfo): TransitionInfo { - return TransitionInfo(type, 0 /* flags */).apply { + return TransitionInfo(type, /* flags= */ 0).apply { addChange( // Home. TransitionInfo.Change(mock(), homeTaskLeash).apply { parent = null |