Merge "Disable flaky ComponentActivity test on API 30" into androidx-main
diff --git a/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityResultTest.kt b/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityResultTest.kt
index f73cf98..d977458 100644
--- a/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityResultTest.kt
+++ b/activity/activity/src/androidTest/java/androidx/activity/ComponentActivityResultTest.kt
@@ -69,6 +69,12 @@
 
     @Test
     fun registerBeforeOnCreateTest() {
+        // There is a leak in API 30 InputMethodManager that causes this test to be flaky.
+        // Once https://github.com/square/leakcanary/issues/2592 is addressed we can upgrade
+        // leak canary and remove this.
+        if (Build.VERSION.SDK_INT == Build.VERSION_CODES.R) {
+            return
+        }
         ActivityScenario.launch(RegisterBeforeOnCreateActivity::class.java).use { scenario ->
             scenario.withActivity {
                 recreate()