diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java
index d7cb490ed0cb8c7e5b51dd30bac057da1eecf684..4aed7c449750dc77380dcbc6d0ddb49723c99779 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldAnimationController.java
@@ -16,6 +16,8 @@
 
 package com.android.wm.shell.unfold;
 
+import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
+
 import android.annotation.NonNull;
 import android.app.ActivityManager.RunningTaskInfo;
 import android.app.TaskInfo;
@@ -28,11 +30,11 @@ import com.android.wm.shell.sysui.ShellInit;
 import com.android.wm.shell.unfold.ShellUnfoldProgressProvider.UnfoldListener;
 import com.android.wm.shell.unfold.animation.UnfoldTaskAnimator;
 
+import dagger.Lazy;
+
 import java.util.List;
 import java.util.Optional;
 
-import dagger.Lazy;
-
 /**
  * Manages fold/unfold animations of tasks on foldable devices.
  * When folding or unfolding a foldable device we play animations that
@@ -228,7 +230,8 @@ public class UnfoldAnimationController implements UnfoldListener {
     }
 
     private void maybeResetTask(UnfoldTaskAnimator animator, TaskInfo taskInfo) {
-        if (!mIsInStageChange) {
+        // TODO(b/311084698): the windowing mode check is added here as a work around.
+        if (!mIsInStageChange || taskInfo.getWindowingMode() == WINDOWING_MODE_PINNED) {
             // No need to resetTask if there is no ongoing state change.
             return;
         }