summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steve McKay <smckay@google.com> 2016-05-06 12:07:54 -0700
committer Steve McKay <smckay@google.com> 2016-05-06 12:27:49 -0700
commit99544dd0f42988fc17a49fcb39ac6971b57cd25d (patch)
treed29283b6bdb89e3ab28fff8f0547181a764e49c9
parentf8892359b0ae07031160a71cf3f7e3a86604c2b1 (diff)
Don't persist selection after restore.
Bug: 28469988 Change-Id: I1fec774d8ebdec13b33262d7fe8e17fccd84b657
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
index 2db8fad714a9..5e7a229fda9d 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/dirlist/DirectoryFragment.java
@@ -170,6 +170,7 @@ public class DirectoryFragment extends Fragment
private RootInfo mRoot;
private DocumentInfo mDocument;
private String mQuery = null;
+ // Save selection found during creation so it can be restored during directory loading.
private Selection mSelection = null;
private boolean mSearchMode = false;
private @Nullable ActionMode mActionMode;
@@ -698,7 +699,7 @@ public class DirectoryFragment extends Fragment
public final boolean onBackPressed() {
if (mSelectionManager.hasSelection()) {
- if (DEBUG) Log.d(TAG, "Clearing selection on back pressed.");
+ if (DEBUG) Log.d(TAG, "Clearing selection on selection manager.");
mSelectionManager.clearSelection();
return true;
}
@@ -1817,6 +1818,7 @@ public class DirectoryFragment extends Fragment
if (mSelection != null) {
mSelectionManager.setItemsSelected(mSelection.toList(), true);
+ mSelection.clear();
}
// Restore any previous instance state