Use the WS hidden flag instead of WSA for dim check

The current code uses the WSA mLastHidden flag to ensure that the WSA
animation starts at the same time as the dim. However, the flag is set
to true when the layer is being preserved which will cause the dim to
hide and then show again. Instead, use the WS mHidden flag which is set
to false when the WSA will be shown, but still remains false when the
WSA surface is getting preserved.

Change-Id: I8b2545480fad78cdba26173d28503fc7fe591d28
Fixes: 72869695
Test: Bug no longer occurs.
Test: Other dims still work properly
Test: atest WindowManagerSmokeTest
diff --git a/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
index 2284bbb..63ac4af 100644
--- a/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DisplayContentTests.java
@@ -28,6 +28,7 @@
 import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR;
 import static android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION;
 import static com.android.server.wm.WindowContainer.POSITION_TOP;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -38,7 +39,6 @@
 import android.annotation.SuppressLint;
 import android.content.res.Configuration;
 import android.graphics.Path;
-import android.graphics.Point;
 import android.graphics.Rect;
 import android.os.SystemClock;
 import android.platform.test.annotations.Presubmit;
@@ -166,6 +166,7 @@
         assertTrue(appWin.canBeImeTarget());
         WindowState imeTarget = mDisplayContent.computeImeTarget(false /* updateImeTarget */);
         assertEquals(appWin, imeTarget);
+        appWin.mHidden = false;
 
         // Verify that an child window can be an ime target.
         final WindowState childWin = createWindow(appWin,