Loading packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ abstract class BaseActivity extends Activity { public static String ACTION_OPEN_COPY_DESTINATION_STRING = "com.android.documentsui.OPEN_COPY_DESTINATION"; /** * Extra boolean flag for ACTION_OPEN_COPY_DESTINATION_STRING, which * specifies if the destination directory needs to create new directory or not. */ public static String EXTRA_DIRECTORY_COPY = "com.android.documentsui.DIRECTORY_COPY"; public abstract State getDisplayState(); public abstract RootInfo getCurrentRoot(); public abstract void onStateChanged(); Loading Loading @@ -77,6 +83,7 @@ abstract class BaseActivity extends Activity { public boolean showAdvanced = false; public boolean stackTouched = false; public boolean restored = false; public boolean directoryCopy = false; /** Current user navigation stack; empty implies recents. */ public DocumentStack stack = new DocumentStack(); Loading packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +8 −0 Original line number Diff line number Diff line Loading @@ -687,6 +687,14 @@ public class DirectoryFragment extends Fragment { Uri.EMPTY, getActivity(), DocumentsActivity.class); boolean directoryCopy = false; for (DocumentInfo info : docs) { if (Document.MIME_TYPE_DIR.equals(info.mimeType)) { directoryCopy = true; break; } } intent.putExtra(BaseActivity.EXTRA_DIRECTORY_COPY, directoryCopy); startActivityForResult(intent, REQUEST_COPY_DESTINATION); } Loading packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,10 @@ public class DocumentsActivity extends BaseActivity { } else { mState.showSize = LocalPreferences.getDisplayFileSize(this); } if (mState.action == ACTION_OPEN_COPY_DESTINATION) { mState.directoryCopy = intent.getBooleanExtra( BaseActivity.EXTRA_DIRECTORY_COPY, false); } } private class RestoreRootTask extends AsyncTask<Void, Void, RootInfo> { Loading packages/DocumentsUI/src/com/android/documentsui/RootsCache.java +3 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,9 @@ public class RootsCache { if (!state.showAdvanced && advanced) continue; // Exclude non-local devices when local only if (state.localOnly && !localOnly) continue; // Exclude downloads roots that don't support directory creation // TODO: Add flag to check the root supports directory creation or not. if (state.directoryCopy && root.isDownloads()) continue; // Only show empty roots when creating if ((state.action != State.ACTION_CREATE || state.action != State.ACTION_OPEN_TREE || Loading Loading
packages/DocumentsUI/src/com/android/documentsui/BaseActivity.java +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ abstract class BaseActivity extends Activity { public static String ACTION_OPEN_COPY_DESTINATION_STRING = "com.android.documentsui.OPEN_COPY_DESTINATION"; /** * Extra boolean flag for ACTION_OPEN_COPY_DESTINATION_STRING, which * specifies if the destination directory needs to create new directory or not. */ public static String EXTRA_DIRECTORY_COPY = "com.android.documentsui.DIRECTORY_COPY"; public abstract State getDisplayState(); public abstract RootInfo getCurrentRoot(); public abstract void onStateChanged(); Loading Loading @@ -77,6 +83,7 @@ abstract class BaseActivity extends Activity { public boolean showAdvanced = false; public boolean stackTouched = false; public boolean restored = false; public boolean directoryCopy = false; /** Current user navigation stack; empty implies recents. */ public DocumentStack stack = new DocumentStack(); Loading
packages/DocumentsUI/src/com/android/documentsui/DirectoryFragment.java +8 −0 Original line number Diff line number Diff line Loading @@ -687,6 +687,14 @@ public class DirectoryFragment extends Fragment { Uri.EMPTY, getActivity(), DocumentsActivity.class); boolean directoryCopy = false; for (DocumentInfo info : docs) { if (Document.MIME_TYPE_DIR.equals(info.mimeType)) { directoryCopy = true; break; } } intent.putExtra(BaseActivity.EXTRA_DIRECTORY_COPY, directoryCopy); startActivityForResult(intent, REQUEST_COPY_DESTINATION); } Loading
packages/DocumentsUI/src/com/android/documentsui/DocumentsActivity.java +4 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,10 @@ public class DocumentsActivity extends BaseActivity { } else { mState.showSize = LocalPreferences.getDisplayFileSize(this); } if (mState.action == ACTION_OPEN_COPY_DESTINATION) { mState.directoryCopy = intent.getBooleanExtra( BaseActivity.EXTRA_DIRECTORY_COPY, false); } } private class RestoreRootTask extends AsyncTask<Void, Void, RootInfo> { Loading
packages/DocumentsUI/src/com/android/documentsui/RootsCache.java +3 −0 Original line number Diff line number Diff line Loading @@ -367,6 +367,9 @@ public class RootsCache { if (!state.showAdvanced && advanced) continue; // Exclude non-local devices when local only if (state.localOnly && !localOnly) continue; // Exclude downloads roots that don't support directory creation // TODO: Add flag to check the root supports directory creation or not. if (state.directoryCopy && root.isDownloads()) continue; // Only show empty roots when creating if ((state.action != State.ACTION_CREATE || state.action != State.ACTION_OPEN_TREE || Loading