Ignore UiObjectNotFoundException in scrollToBottom().

flingToEnd() sometimes still fails despite waitForIdle() and the
exists() check.

Fixes: 246984354
Test: manual
Change-Id: I191464f03b13358ba23b314ffb69c77aa4322288
diff --git a/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt b/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
index dd8dc6f..eaf703d 100755
--- a/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
+++ b/tests/tests/permission3/src/android/permission3/cts/BaseUsePermissionTest.kt
@@ -26,6 +26,7 @@
 import android.provider.Settings
 import android.support.test.uiautomator.By
 import android.support.test.uiautomator.BySelector
+import android.support.test.uiautomator.UiObjectNotFoundException
 import android.support.test.uiautomator.UiScrollable
 import android.support.test.uiautomator.UiSelector
 import android.text.Spanned
@@ -626,7 +627,13 @@
         }
         waitForIdle()
         if (scrollable.exists()) {
-            scrollable.flingToEnd(10)
+            try {
+                scrollable.flingToEnd(10)
+            } catch (e: UiObjectNotFoundException) {
+                // flingToEnd() sometimes still fails despite waitForIdle() and the exists() check
+                // (b/246984354).
+                e.printStackTrace()
+            }
         }
     }