Refactor to inline the isNewInTaskView argument.
The local boolean variable isNewInTaskView was only used to pass a value
to the prepareOpenAnimation method. Depending on the conditional branch,
this value was always either true or false.
This change removes the temporary variable and inlines the boolean
literal directly into the method call. This is a pure refactoring that
simplifies the code and improves readability without altering behavior.
Bug: 387193964
Flag: EXEMPT PURE_REFACTOR
Test: atest WMShellUnitTests:TaskViewTransitionsTest
Test: atest WMShellUnitTests:TaskViewTransitionStartAnimationTest
Change-Id: Ic67a25d12d4288ef2d1aa9abf07bea1e3d052dab
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java
index 604b949..7f634293 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTransitions.java
@@ -835,18 +835,16 @@
startTransaction, finishTransaction, taskInfo, leash, wct);
break;
case TRANSIT_TO_FRONT:
- boolean isNewInTaskView = false;
if (wct == null) wct = new WindowContainerTransaction();
if (infoTv == null && pending != null && isTaskToTaskView(task, pending)) {
// The task is being moved into taskView, so it is still "new" from
// TaskView's perspective (e.g. task being moved into a bubble)
stillNeedsMatchingLaunch = false;
- isNewInTaskView = true;
- prepareOpenAnimation(pending.mTaskView, isNewInTaskView, startTransaction,
- finishTransaction, taskInfo, leash, wct);
+ prepareOpenAnimation(pending.mTaskView, true /* isNewInTaskView */,
+ startTransaction, finishTransaction, taskInfo, leash, wct);
} else {
- prepareOpenAnimation(infoTv, isNewInTaskView, startTransaction,
- finishTransaction, taskInfo, leash, wct);
+ prepareOpenAnimation(infoTv, false /* isNewInTaskView */,
+ startTransaction, finishTransaction, taskInfo, leash, wct);
}
break;
case TRANSIT_CHANGE: