fix CTS android.appsecurity.cts.DocumentsTest#testCreateWebLink on screen landscape

Uses the list view mode in DocumentsUI instead of grid mode to do CTS android.appsecurity.cts.DocumentsTest. Enforce set the list view mode in findDocument().
Because findDocument() can't find valid object to click in landscape mode.

Test: run cts --module CtsAppSecurityHostTestCases -t android.appsecurity.cts.DocumentsTest#testCreateWebLink
      run cts --module CtsAppSecurityHostTestCases -t android.appsecurity.cts.DocumentsTest

Change-Id: I3e8bb089137e0b5f42bc06a4d143f95ba0238557
diff --git a/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/DocumentsClientTest.java b/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/DocumentsClientTest.java
index e85e167..5032ad3 100644
--- a/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/DocumentsClientTest.java
+++ b/hostsidetests/appsecurity/test-apps/DocumentClient/src/com/android/cts/documentclient/DocumentsClientTest.java
@@ -101,6 +101,15 @@
         assertTrue("First list item",
                 new UiObject(docList.childSelector(new UiSelector())).waitForExists(TIMEOUT));
 
+        try {
+            //Enfornce to set the list mode
+            //Because UiScrollable can't reach the real bottom (when WEB_LINKABLE_FILE item) in grid mode when screen landscape mode
+            new UiObject(new UiSelector().resourceId("com.android.documentsui:id/option_menu_list")).click();
+            mDevice.waitForIdle();
+        }catch (UiObjectNotFoundException e){
+            //do nothing, already be in list mode.
+        }
+
         // Now scroll around to find our item
         new UiScrollable(docList).scrollIntoView(new UiSelector().text(label));
         return new UiObject(docList.childSelector(new UiSelector().text(label)));