Fix WindowInsetsAnimationControllerTests when there is no MockIME

Bug: 155126599
Test: atest WindowInsetsAnimationControllerTests
Change-Id: Id461a0959fa401fd9b1f765e3b48113ae159abcd
diff --git a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationControllerTests.java b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationControllerTests.java
index c90b859..35b06ba 100644
--- a/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationControllerTests.java
+++ b/tests/framework/base/windowmanager/src/android/server/wm/WindowInsetsAnimationControllerTests.java
@@ -175,7 +175,9 @@
         // which can trigger assertion failures in VerifyingCallback otherwise.
         runOnUiThread(() -> {
             mCallbacks.clear();
-            mRootView.setWindowInsetsAnimationCallback(null);
+            if (mRootView != null) {
+                mRootView.setWindowInsetsAnimationCallback(null);
+            }
         });
 
         // Now it should be safe to reset the IME to the default one.