diff --git a/packages/DocumentsUI/res/layout/fragment_directory.xml b/packages/DocumentsUI/res/layout/fragment_directory.xml index 0fb74e5eca346..0d336f91ee3a3 100644 --- a/packages/DocumentsUI/res/layout/fragment_directory.xml +++ b/packages/DocumentsUI/res/layout/fragment_directory.xml @@ -46,6 +46,8 @@ android:layout_height="match_parent" android:orientation="vertical" android:background="@color/window_background" + android:focusable="true" + android:focusableInTouchMode="true" android:visibility="gone"> mimeTypes) { diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/FragmentTuner.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/FragmentTuner.java index 3f51e538a2636..a9b0fd181d8bc 100644 --- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/FragmentTuner.java +++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/FragmentTuner.java @@ -249,9 +249,10 @@ public abstract class FragmentTuner { @Override void onModelLoaded(Model model, @ResultType int resultType) { - if (DEBUG) Log.d(TAG, "Handling model loaded. Has Location shcnage: " + mState.initialiLocationHasChanged()); + if (DEBUG) Log.d(TAG, "Handling model loaded. Has Location shcnage: " + mState.initialLocationHasChanged()); // When launched into empty root, open drawer. - if (model.isEmpty() && !mState.initialiLocationHasChanged()) { + if (model.isEmpty() && !mState.initialLocationHasChanged() + && resultType != DirectoryFragment.TYPE_SEARCH) { if (DEBUG) Log.d(TAG, "Showing roots drawer cuz stuffs empty."); // This noops on layouts without drawer, so no need to guard.