use of com.android.documentsui.model.DocumentInfo in project android_frameworks_base by DirtyUnicorns.
the class BaseActivity method reloadSearch.
private void reloadSearch(String query) {
FragmentManager fm = getFragmentManager();
RootInfo root = getCurrentRoot();
DocumentInfo cwd = getCurrentDirectory();
DirectoryFragment.reloadSearch(fm, root, cwd, query);
}
use of com.android.documentsui.model.DocumentInfo in project android_frameworks_base by DirtyUnicorns.
the class FilesActivity method refreshDirectory.
@Override
void refreshDirectory(int anim) {
final FragmentManager fm = getFragmentManager();
final RootInfo root = getCurrentRoot();
final DocumentInfo cwd = getCurrentDirectory();
assert (!mSearchManager.isSearching());
if (cwd == null) {
DirectoryFragment.showRecentsOpen(fm, anim);
} else {
// Normal boring directory
DirectoryFragment.showDirectory(fm, root, cwd, anim);
}
}
use of com.android.documentsui.model.DocumentInfo in project android_frameworks_base by DirtyUnicorns.
the class DocumentsProviderHelper method listChildren.
public List<DocumentInfo> listChildren(String documentId) throws Exception {
Uri uri = buildChildDocumentsUri(mAuthority, documentId);
List<DocumentInfo> children = new ArrayList<>();
try (Cursor cursor = mClient.query(uri, null, null, null, null, null)) {
Cursor wrapper = new RootCursorWrapper(mAuthority, "totally-fake", cursor, 100);
while (wrapper.moveToNext()) {
children.add(DocumentInfo.fromDirectoryCursor(wrapper));
}
}
return children;
}
use of com.android.documentsui.model.DocumentInfo in project android_frameworks_base by DirtyUnicorns.
the class DocumentsProviderHelper method assertFileContents.
public void assertFileContents(String parentId, String fileName, byte[] expected) throws Exception {
DocumentInfo file = findFile(parentId, fileName);
assertNotNull(file);
assertFileContents(file.derivedUri, expected);
}
use of com.android.documentsui.model.DocumentInfo in project android_frameworks_base by DirtyUnicorns.
the class AbstractCopyJobTest method runCopyDirRecursivelyTest.
public void runCopyDirRecursivelyTest() throws Exception {
Uri testDir1 = mDocs.createFolder(mSrcRoot, "dir1");
mDocs.createDocument(testDir1, "text/plain", "test1.txt");
Uri testDir2 = mDocs.createFolder(testDir1, "dir2");
mDocs.createDocument(testDir2, "text/plain", "test2.txt");
createJob(newArrayList(testDir1)).run();
mJobListener.waitForFinished();
DocumentInfo dir1Copy = mDocs.findDocument(mDestRoot.documentId, "dir1");
mDocs.assertChildCount(dir1Copy.derivedUri, 2);
mDocs.assertHasDirectory(dir1Copy.derivedUri, "dir2");
mDocs.assertHasFile(dir1Copy.derivedUri, "test1.txt");
DocumentInfo dir2Copy = mDocs.findDocument(dir1Copy.documentId, "dir2");
mDocs.assertChildCount(dir2Copy.derivedUri, 1);
mDocs.assertHasFile(dir2Copy.derivedUri, "test2.txt");
}
Aggregations