DO NOT MERGE Ensure minimized state is false when dock is gone on exists change

Whenever registerDockedStackListener runs, it will unminimize the docked
stack even if it was not supposed to. The previous change that caused
this was the test ag/1718898,
ActivityManagerDockedStackTests#testFinishDockActivityWhileMinimized
where an activity runs finish() while minimized would remove the
divider but not update the minimized mode. This change will only set the
minimized mode to false if the divider is invisible allowing
registerDockedStackListener to not unminimize.

Fixes: 62460975
Fixes: 63381251
Test: go/wm-smoke
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
CtsServicesHostTestCases
android.server.cts.ActivityManagerDockedStackTests#
testFinishDockActivityWhileMinimized
Change-Id: I2baaac9ce50b8ed792356cbaeeedef6bddc271d3
(cherry picked from commit bc527a3a26a48afd04e8ad10893a38996177bc53)
diff --git a/services/core/java/com/android/server/wm/DockedStackDividerController.java b/services/core/java/com/android/server/wm/DockedStackDividerController.java
index 2d7fc68..6b51455 100644
--- a/services/core/java/com/android/server/wm/DockedStackDividerController.java
+++ b/services/core/java/com/android/server/wm/DockedStackDividerController.java
@@ -427,8 +427,9 @@
                 inputMethodManagerInternal.hideCurrentInputMethod();
                 mImeHideRequested = true;
             }
+            return;
         }
-        setMinimizedDockedStack(false, false /* animate */);
+        setMinimizedDockedStack(false /* minimizedDock */, false /* animate */);
     }
 
     /**