Check insets again for clipboard UI post-animation

In some cases (particularly copying back to the clipboard after the
clipboard EditTextActivity) there's a race condition where the keyboard
insets are still visible when we check, even though the keyboard then
disappears. To mitigate this we can recheck the window insets once the
animation finishes, and expand the view automatically if the keyboard is
no longer showing.

Bug: 358479709
Fix: 358479709
Flag: EXEMPT trivial change
Test: manual (visual change)
Change-Id: If87a4e143568f24ec70a3dc919ca3d16d32d9253
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
index 04c6fa9..b100f0e 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/ClipboardOverlayController.java
@@ -575,6 +575,10 @@
             @Override
             public void onAnimationEnd(Animator animation) {
                 super.onAnimationEnd(animation);
+                // check again after animation to see if we should still be minimized
+                if (mIsMinimized && !shouldShowMinimized(mWindow.getWindowInsets())) {
+                    animateFromMinimized();
+                }
                 if (mOnUiUpdate != null) {
                     mOnUiUpdate.run();
                 }