Loading src/com/android/documentsui/dirlist/DirectoryFragment.java +19 −0 Original line number Diff line number Diff line Loading @@ -792,6 +792,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void openDocuments(final Selection selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_OPEN); if (selected.isEmpty()) { return; } // Model must be accessed in UI thread, since underlying cursor is not threadsafe. List<DocumentInfo> docs = mModel.getDocuments(selected); if (docs.size() > 1) { Loading @@ -804,6 +808,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void showChooserForDoc(final Selection<String> selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_OPEN); if (selected.isEmpty()) { return; } assert selected.size() == 1; DocumentInfo doc = DocumentInfo.fromDirectoryCursor(mModel.getItem(selected.iterator().next())); Loading @@ -813,6 +821,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void transferDocuments( final Selection<String> selected, @Nullable DocumentStack destination, final @OpType int mode) { if (selected.isEmpty()) { return; } switch (mode) { case FileOperationService.OPERATION_COPY: Metrics.logUserAction(MetricConsts.USER_ACTION_COPY_TO); Loading Loading @@ -925,6 +937,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void renameDocuments(Selection selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_RENAME); if (selected.isEmpty()) { return; } // Batch renaming not supported // Rename option is only available in menu when 1 document selected assert selected.size() == 1; Loading Loading @@ -952,6 +968,9 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On } public void pasteIntoFolder() { if (mSelectionMgr.getSelection().isEmpty()) { return; } assert (mSelectionMgr.getSelection().size() == 1); String modelId = mSelectionMgr.getSelection().iterator().next(); Loading src/com/android/documentsui/files/ActionHandler.java +7 −2 Original line number Diff line number Diff line Loading @@ -142,6 +142,10 @@ public class ActionHandler<T extends FragmentActivity & Addons> extends Abstract @Override public void openSelectedInNewWindow() { Selection<String> selection = getStableSelection(); if (selection.isEmpty()) { return; } assert(selection.size() == 1); DocumentInfo doc = mModel.getDocument(selection.iterator().next()); assert(doc != null); Loading Loading @@ -352,8 +356,9 @@ public class ActionHandler<T extends FragmentActivity & Addons> extends Abstract Metrics.logUserAction(MetricConsts.USER_ACTION_SHARE); Selection<String> selection = getStableSelection(); assert(!selection.isEmpty()); if (selection.isEmpty()) { return; } // Model must be accessed in UI thread, since underlying cursor is not threadsafe. List<DocumentInfo> docs = mModel.loadDocuments( Loading Loading
src/com/android/documentsui/dirlist/DirectoryFragment.java +19 −0 Original line number Diff line number Diff line Loading @@ -792,6 +792,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void openDocuments(final Selection selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_OPEN); if (selected.isEmpty()) { return; } // Model must be accessed in UI thread, since underlying cursor is not threadsafe. List<DocumentInfo> docs = mModel.getDocuments(selected); if (docs.size() > 1) { Loading @@ -804,6 +808,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void showChooserForDoc(final Selection<String> selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_OPEN); if (selected.isEmpty()) { return; } assert selected.size() == 1; DocumentInfo doc = DocumentInfo.fromDirectoryCursor(mModel.getItem(selected.iterator().next())); Loading @@ -813,6 +821,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void transferDocuments( final Selection<String> selected, @Nullable DocumentStack destination, final @OpType int mode) { if (selected.isEmpty()) { return; } switch (mode) { case FileOperationService.OPERATION_COPY: Metrics.logUserAction(MetricConsts.USER_ACTION_COPY_TO); Loading Loading @@ -925,6 +937,10 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On private void renameDocuments(Selection selected) { Metrics.logUserAction(MetricConsts.USER_ACTION_RENAME); if (selected.isEmpty()) { return; } // Batch renaming not supported // Rename option is only available in menu when 1 document selected assert selected.size() == 1; Loading Loading @@ -952,6 +968,9 @@ public class DirectoryFragment extends Fragment implements SwipeRefreshLayout.On } public void pasteIntoFolder() { if (mSelectionMgr.getSelection().isEmpty()) { return; } assert (mSelectionMgr.getSelection().size() == 1); String modelId = mSelectionMgr.getSelection().iterator().next(); Loading
src/com/android/documentsui/files/ActionHandler.java +7 −2 Original line number Diff line number Diff line Loading @@ -142,6 +142,10 @@ public class ActionHandler<T extends FragmentActivity & Addons> extends Abstract @Override public void openSelectedInNewWindow() { Selection<String> selection = getStableSelection(); if (selection.isEmpty()) { return; } assert(selection.size() == 1); DocumentInfo doc = mModel.getDocument(selection.iterator().next()); assert(doc != null); Loading Loading @@ -352,8 +356,9 @@ public class ActionHandler<T extends FragmentActivity & Addons> extends Abstract Metrics.logUserAction(MetricConsts.USER_ACTION_SHARE); Selection<String> selection = getStableSelection(); assert(!selection.isEmpty()); if (selection.isEmpty()) { return; } // Model must be accessed in UI thread, since underlying cursor is not threadsafe. List<DocumentInfo> docs = mModel.loadDocuments( Loading